Your IP : 216.73.217.68


Current Path : /home/w/u/e/wuectly/www/03cbe/
Upload File :
Current File : /home/w/u/e/wuectly/www/03cbe/renderer.tar

megamenurender.php000060400000005606152455625460010274 0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  Document
 *
 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

use Joomla\CMS\Document\DocumentRenderer;

defined('JPATH_PLATFORM') or die;

/**
 * JDocument Megamenu renderer
 */
class JDocumentRendererMegamenuRender extends DocumentRenderer
{
	/**
	 * Render megamenu block, then push the output into megamenu renderer to display
	 *
	 * @param   string  $position  The position of the modules to render
	 * @param   array   $params    Associative array of values
	 * @param   string  $content   Module content
	 *
	 * @return  string  The output of the script
	 *
	 * @since   11.1
	 */
	public function render($info = null, $params = array(), $content = null)
	{
		T3::import('menu/megamenu');

		$t3app = T3::getApp();

		//we will check from params
		$menutype      = empty($params['menutype']) ? (empty($params['name']) ? $t3app->getParam('mm_type', 'mainmenu') : $params['name']) : $params['menutype'];
		$currentconfig = json_decode($t3app->getParam('mm_config', ''), true);

		//force to array
		if (!is_array($currentconfig)) {
			$currentconfig = (array)$currentconfig;
		}

		//get user access levels
		$viewLevels = JFactory::getUser()->getAuthorisedViewLevels();
		$mmkey = $menutype;
		$mmconfig = array();
		if (!empty($currentconfig)) {
			//find best fit configuration based on view level
			$vlevels = array_merge($viewLevels);
			if (is_array($vlevels) && in_array(3, $vlevels)) { //we assume, if a user is special, they should be registered also
				$vlevels[] = 2;
			}
			$vlevels = array_unique($vlevels);
			rsort($vlevels);
			if (!is_array($vlevels)) $vlevels = array();
			$vlevels[] = ''; // extend a blank, default key

			// check if available configuration for language override
			$langcode = JFactory::getDocument()->language;
			$shortlangcode = substr($langcode, 0, 2);
			$types = array($menutype . '-' . $langcode, $menutype . '-' . $shortlangcode, $menutype);

			foreach ($types as $type) {
				foreach ($vlevels as $vlevel) {
					$key  = $type . ($vlevel !== '' ? '-' . $vlevel : '');
					if(isset($currentconfig[$key])) {
						$mmkey    = $key;
						$menutype = $type;
						break 2;
					}
				}
			}
			if (isset($currentconfig[$mmkey])) {
				$mmconfig = $currentconfig[$mmkey];
				if(!is_array($mmconfig)){
					$mmconfig = array();
				}
			}
		}

		JFactory::getApplication()->triggerEvent('onT3Megamenu', array(&$menutype, &$mmconfig, &$viewLevels));

		$mmconfig['access'] = $viewLevels;
		$menu = new T3MenuMegamenu ($menutype, $mmconfig, $t3app->_tpl->params);

		$buffer = $menu->render(true);

		if (isset($params['return_result']) && $params['return_result']) {
			return $buffer;
		} else {
			$t3app->setBuffer($buffer, 'megamenu', empty($params['name']) ? null : $params['name'], null);
			return '';
		}
	}
}
pageclass.php000060400000004223152455625460007232 0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  Document
 *
 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

use Joomla\CMS\Document\DocumentRenderer;

defined('JPATH_PLATFORM') or die;

/**
 * JDocument Bodyclass renderer
 *
 * @package     Joomla.Platform
 * @subpackage  Document
 * @since       11.1
 */
class JDocumentRendererPageClass extends DocumentRenderer
{
	/**
	 * Render body class of current page
	 *
	 * @param   string  $position  The position of the modules to render
	 * @param   array   $params    Associative array of values
	 * @param   string  $content   Module content
	 *
	 * @return  string  The output of the script
	 *
	 * @since   11.1
	 */
	public function render($info, $params = array(), $content = null)
	{
		$input = JFactory::getApplication()->input;
		$t3tpl = T3::getApp();
		$pageclass = array();
		if($input->getCmd('option', '')){
			$pageclass[] = $input->getCmd('option', '');
		}
		if($input->getCmd('view', '')){
			$pageclass[] = 'view-' . $input->getCmd('view', '');
		}
		if($input->getCmd('layout', '')){
			$pageclass[] = 'layout-' . $input->getCmd('layout', '');
		}
		if($input->getCmd('task', '')){
			$pageclass[] = 'task-' . $input->getCmd('task', '');
		}
		if($input->getCmd('Itemid', '')){
			$pageclass[] = 'itemid-' . $input->getCmd('Itemid', '');
		}

		$menu = JFactory::getApplication()->getMenu();
		if($menu){
			$active = $menu->getActive();
			$default = $menu->getDefault();

			if ($active) {
				if($default && $active->id == $default->id){
					$pageclass[] = 'home';
				}

				if ($active->getParams() && $active->getParams()->get('pageclass_sfx')) {
					$pageclass[] = $active->getParams()->get('pageclass_sfx');
				}
			}
		}

		$pageclass[] = 'j'.str_replace('.', '', (number_format((float)JVERSION, 1, '.', '')));
		if(version_compare(JVERSION,'4','ge')){
			$pageclass[] = 'j40';
		}

		$pageclass = array_unique(array_merge($pageclass, $t3tpl->getPageclass()));

		JFactory::getApplication()->triggerEvent('onT3BodyClass', array(&$pageclass));

		return implode(' ', $pageclass);
	}

}
megamenu.php000060400000001637152455625460007074 0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  Document
 *
 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die;

/**
 * JDocument Megamenu renderer - this is a placeholder for menumenurender
 */
T3::import('renderer/megamenurender');

class JDocumentRendererMegamenu extends JDocumentRendererMegamenuRender
{
	/**
	 * Render megamenu block
	 *
	 * @param   string  $position  The position of the modules to render
	 * @param   array   $params    Associative array of values
	 * @param   string  $content   Module content
	 *
	 * @return  string  The output of the script
	 *
	 * @since   11.1
	 */
	public function render($info = null, $params = array(), $content = null)
	{
		$params['return_result'] = true;
		return parent::render($info, $params, $content);
	}
}
t3ajax.php000060400000006437152455625460006473 0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  Document
 *
 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

defined('JPATH_PLATFORM') or die;

/**
 * JDocument Modules renderer
 *
 * @package     Joomla.Platform
 * @subpackage  Document
 * @since       11.1
 */
class JDocumentRendererT3Ajax extends JDocumentRenderer
{
	/**
	 * Renders multiple modules script and returns the results as a string
	 *
	 * @param   string  $position  The position of the modules to render
	 * @param   array   $params    Associative array of values
	 * @param   string  $content   Module content
	 *
	 * @return  string  The output of the script
	 *
	 * @since   11.1
	 */
	public function render($info, $params = array(), $content = null)
	{
		$input = JFactory::getApplication()->input;
		$task = $input->getCmd('t3ajax', 'position');
		$format = $input->getCmd('f', 'html');

		if($task == 'position'){
			if($format == 'html'){
				return $this->htmlPosition($info, $params, $content);
			} else if($format == 'json'){
				return $this->jsonPosition($info, $params, $content);
			}
		} else if($task == 'module'){
			if($format == 'html'){
				return $this->htmlModule($info, $params, $content);
			} else if($format == 'json'){
				return $this->jsonModule($info, $params, $content);
			}
		}

		return null;
	}

	protected function htmlPosition($info, $params = array(), $content = null)
	{		
		$renderer = $this->_doc->loadRenderer('module');
		
		$input = JFactory::getApplication()->input;
		$position = $input->getCmd('p');

		$buffer = '';

		foreach (JModuleHelper::getModules($position) as $mod)
		{
			$buffer .= $renderer->render($mod, $params, $content);
		}

		return $buffer;
	}

	protected function jsonPosition($info, $params = array(), $content = null)
	{		
		$result = array();
		
		$result['markup'] = $this->htmlPosition($info, $params = array(), $content = null);
		
		$result['stylesheets'] = $this->_doc->_styleSheets;
		$result['styles'] = $this->_doc->_style;

		$result['scripts'] = $this->_doc->_scripts;
		$result['scriptinlines'] = $this->_doc->_script;

		return json_encode($result);
	}

	protected function htmlModule($info, $params = array(), $content = null)
	{		
		$input = JFactory::getApplication()->input;
		$mid = $input->getInt('m');

		$db = JFactory::getDbo();
		$query = $db->getQuery(true);
		$query->select('m.id, m.title, m.module, m.position, m.content, m.showtitle, m.params');
		$query->from('#__modules AS m');
		$query->where('m.id = '. $mid);
		$query->where('m.published = 1');
		$db->setQuery($query);
		$module = $db->loadObject();
		
		$buffer = '';
		//check in case the module is unpublish or deleted
		if($module && $module->id){
			$buffer = JModuleHelper::renderModule($module, array('style'=> $input->getCmd('style', 'T3Xhtml')));
		}

		return $buffer;
	}

	protected function jsonModule($info, $params = array(), $content = null)
	{		
		$result = array();
		
		$result['markup'] = $this->htmlModule($info, $params = array(), $content = null);
		
		$result['stylesheets'] = $this->_doc->_styleSheets;
		$result['styles'] = $this->_doc->_style;

		$result['scripts'] = $this->_doc->_scripts;
		$result['scriptinlines'] = $this->_doc->_script;

		return json_encode($result);
	}
}
t3bootstrap.php000060400000002355152455625460007560 0ustar00<?php
/**
 * @package     Joomla.Platform
 * @subpackage  Document
 *
 * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE
 */

use Joomla\CMS\Document\DocumentRenderer;

defined('JPATH_PLATFORM') or die;

/**
 * JDocument Megamenu renderer
 */
class JDocumentRendererT3Bootstrap extends DocumentRenderer
{
	/**
	 * Render megamenu block
	 *
	 * @param   string  $position  The position of the modules to render
	 * @param   array   $params    Associative array of values
	 * @param   string  $content   Module content
	 *
	 * @return  string  The output of the script
	 *
	 * @since   11.1
	 */
	public function render($info = null, $params = array(), $content = null)
	{
		T3::import('menu/t3bootstrap');

		// import the renderer
		$t3app    = T3::getApp();
		$menutype = empty($params['menutype']) ? $t3app->getParam('mm_type', 'mainmenu') : $params['menutype'];
		if(version_compare(JVERSION, '3','lt')){
			JDispatcher::getInstance()->trigger('onT3BSMenu', array(&$menutype));
		}else{
			JFactory::getApplication()->triggerEvent('onT3BSMenu', array(&$menutype));
		}
		$menu = new T3Bootstrap($menutype);
		
		return $menu->render(true);
	}
}