| Server IP : 180.180.241.3 / Your IP : 216.73.216.216 Web Server : Microsoft-IIS/7.5 System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586 User : IUSR ( 0) PHP Version : 5.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/AppServ/www/news/administrator/components/com_simple_review/addons/widgets/ |
Upload File : |
<?php
/**
* $Id: base.php 315 2010-11-13 07:54:05Z rowan $
*
* Copyright (C) 2005-2009 Rowan Youngson
*
* This file is part of Simple Review.
*
* Simple Review is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* Simple Review is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with Simple Review. If not, see <http://www.gnu.org/licenses/>.
*/
// ensure this file is being included by a parent file
defined('_VALID_MOS')||defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' );
class Widget_Base extends Addon_Base_Frontend
{
var $_haveIncludedTemplate = false;
var $widgetType = null;
var $canAttachToModules = null;
var $templateName = '';
function Widget_Base(&$addonManager, &$widgetName, &$templateName, $initialise)
{
$this->addonType =_SR_ADDON_TYPE_WIDGET;
$this->templateName = $templateName;
parent::Addon_Base_Frontend($addonManager, $widgetName, $initialise);
}
function SetTemplateName($templateName)
{
$this->templateName = $templateName;
}
}
class WidgetTemplateDisplayManager
{
var $_widgets;
function WidgetTemplateDisplayManager()
{
$this->_widgets = array();
}
function AddWidget(&$widget)
{
$key = strtolower($widget->addonName);
$this->_widgets["$key"] = $widget;
}
function Display($widgetName)
{
$content = '';
$widgetName = strtolower($widgetName);
if(array_key_exists($widgetName, $this->_widgets))
{
$widget =& $this->_widgets["$widgetName"];
ob_start();
$widget->Display();
$content = ob_get_contents();
ob_end_clean();
}
else
{
$content = "<!-- the widget '$widgetName' does not exist or is not enabled.-->";
}
return $content;
}
}
?>