Пример #1
1
 function display($tpl = null)
 {
     $this->canDo = JSolrIndexHelper::getActions();
     $this->modules = JModuleHelper::getModules('jsolrindex');
     $this->addToolbar();
     parent::display($tpl);
 }
Пример #2
0
 function parseXmenu($temp)
 {
     while (($ini = strpos($temp, "{xm ")) !== false) {
         $fin = strpos($temp, "}", $ini);
         $parms = substr($temp, $ini + 4, $fin - $ini - 4);
         list($position, $width, $height) = explode(',', $parms);
         if (!empty($position)) {
             settype($width, 'integer');
             settype($height, 'integer');
             $width = $width == 0 ? '' : 'width:' . $width . 'px;';
             $height = $height == 0 ? '' : 'height:' . $height . 'px;';
             $modules = JModuleHelper::getModules($position);
             $attribs = array('style' => 'xhtml');
             $positionhtml = "<div class=\"xmenu_position {$position}\" style=\"{$width} {$height}\">";
             foreach ($modules as $module) {
                 $positionhtml .= JModuleHelper::renderModule($module, $attribs);
             }
             $positionhtml .= "</div>";
         } else {
             $positionhtml = '';
         }
         $temp = substr_replace($temp, $positionhtml, $ini, $fin - $ini + 1);
     }
     // Do double lines
     $temp = str_replace('{xm}', '<span class=\'xmenu\'>', $temp);
     $temp = str_replace('{/xm}', '</span>', $temp);
     return $temp;
 }
Пример #3
0
function jdocIncludeModules($position)
{
    $modules = JModuleHelper::getModules($position);
    foreach ($modules as $module) {
        echo JModuleHelper::renderModule($module);
    }
}
Пример #4
0
 /**
  * Execute and display a template script.
  *
  * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
  *
  * @return  mixed  A string if successful, otherwise a Error object.
  */
 public function display($tpl = null)
 {
     // Set toolbar items for the page
     JToolbarHelper::title(JText::_('COM_CPANEL'), 'home-2 cpanel');
     JToolbarHelper::help('screen.cpanel');
     $input = JFactory::getApplication()->input;
     /*
      * Set the template - this will display cpanel.php
      * from the selected admin template.
      */
     $input->set('tmpl', 'cpanel');
     // Display the cpanel modules
     $this->modules = JModuleHelper::getModules('cpanel');
     // Load the RAD layer and count the number of post-installation messages
     if (!defined('FOF_INCLUDED')) {
         require_once JPATH_LIBRARIES . '/fof/include.php';
     }
     try {
         $messages_model = FOFModel::getTmpInstance('Messages', 'PostinstallModel')->eid(700);
         $messages = $messages_model->getItemList();
     } catch (RuntimeException $e) {
         $messages = array();
         // Still render the error message from the Exception object
         JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
     }
     $this->postinstall_message_count = count($messages);
     parent::display($tpl);
 }
Пример #5
0
 /**
  * Change format of HTML when render modules using base in joomla
  *
  * @return  void
  */
 public function renderModules()
 {
     $renderer = $this->_document->loadRenderer('module');
     $positions = $this->_template->getTemplatePositions();
     if ($positions != null) {
         /** if template using joomla modules load **/
         foreach ($positions as $position) {
             if ($this->_document->countModules($position->name)) {
                 $buffer = JSNHtmlHelper::openTag('div', array('class' => "jsn-element-container_inner"));
                 $buffer .= JSNHtmlHelper::openTag('div', array('class' => "jsn-position", 'id' => $position->name . '-jsnposition'));
                 foreach (JModuleHelper::getModules($position->name) as $mod) {
                     $buffer .= JSNHtmlHelper::openTag('div', array('class' => "poweradmin-module-item", 'id' => $mod->id . '-jsnposition-published', 'title' => $mod->title, 'showtitle' => $mod->showtitle)) . JSNHtmlHelper::openTag('div', array('id' => $mod->id . '-content', 'class' => 'jsnpw-module-content')) . $renderer->render($mod, $position->params) . JSNHtmlHelper::closeTag('div') . JSNHtmlHelper::closeTag('div');
                 }
                 $buffer .= JSNHtmlHelper::closeTag('div');
                 $buffer .= JSNHtmlHelper::closeTag('div');
                 $this->_document->setBuffer($buffer, 'modules', $position->name);
             }
         }
     } else {
         /** if template not set load positions in index.php file **/
         $positions = $this->_template->loadXMLPositions();
         foreach ($positions as $position) {
             if ($this->_document->countModules($position->name)) {
                 $buffer = JSNHtmlHelper::openTag('div', array('class' => "jsn-element-container_inner"));
                 $buffer .= JSNHtmlHelper::openTag('div', array('class' => "jsn-position", 'id' => $position->name . '-jsnposition'));
                 foreach (JModuleHelper::getModules($position) as $mod) {
                     $buffer .= JSNHtmlHelper::openTag('div', array('class' => "poweradmin-module-item", 'id' => $mod->id . '-jsnposition-published', 'title' => $mod->title, 'showtitle' => $mod->showtitle)) . JSNHtmlHelper::openTag('div', array('id' => "moduleid-' . {$mod->id} . '-content")) . $renderer->render($mod, $position->params) . JSNHtmlHelper::closeTag('div') . JSNHtmlHelper::closeTag('div');
                 }
                 $buffer .= JSNHtmlHelper::closeTag('div');
                 $buffer .= JSNHtmlHelper::closeTag('div');
                 $this->_document->setBuffer($buffer, 'modules', $position->name);
             }
         }
     }
 }
Пример #6
0
function bc_loadBanner()
{
    $pos = mosGetParam($_REQUEST, 'pos', '');
    $style = mosGetParam($_REQUEST, 'st', 0);
    $no_html = mosGetParam($_REQUEST, 'no_html', 0);
    $format = mosGetParam($_REQUEST, 'format', null);
    //raw
    $tmpl = mosGetParam($_REQUEST, 'tmpl', null);
    //component
    $dynamic = mosGetParam($_REQUEST, 'dyn', 0);
    if (!$pos) {
        return;
    }
    if ($dynamic) {
        //set no caching in browser, this is for dynamic reloading of banner
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
        header("Cache-Control: no-store, no-cache, must-revalidate");
        header("Pragma: no-cache");
    }
    if ($format == "raw") {
        //show RAW output, what are 1.5 parameters for render function torender raw output?
        echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">" . "\n<html xmlns=\"http://www.w3.org/1999/xhtml\">" . "\n<head>" . "\n<title></title>" . "\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />" . "\n<meta name=\"robots\" content=\"noindex, nofollow\" />" . "\n</head>" . "\n<body>\n";
    }
    // Include the syndicate functions only once
    jimport('joomla.application.module.helper');
    $modules =& JModuleHelper::getModules($pos);
    $total = count($modules);
    for ($i = 0; $i < $total; $i++) {
        JModuleHelper::renderModule($modules[$i]);
    }
    if ($format == "raw") {
        echo "\n</body>\n</html>";
    }
}
Пример #7
0
 function load($position)
 {
     // init vars
     $modules = JModuleHelper::getModules($position);
     // set params, force no style
     $params['style'] = 'none';
     // get modules content
     foreach ($modules as $index => $module) {
         // set module params
         $module->parameter = new JRegistry($module->params);
         // set parameter show all children for accordion menu
         if ($module->module == 'mod_menu') {
             if (strpos($module->parameter->get('class_sfx', ''), 'accordion') !== false) {
                 if ($module->parameter->get('showAllChildren') == 0) {
                     $module->parameter->set('showAllChildren', 1);
                     $module->showAllChildren = 0;
                 } else {
                     $module->showAllChildren = 1;
                 }
                 $module->params = $module->parameter->toString();
             }
         }
         $modules[$index]->content = $this->_renderer->render($module, $params);
     }
     return $modules;
 }
function Joom_ShowMenu_HTML()
{
    $database =& JFactory::getDBO();
    $document =& JFactory::getDocument();
    $config = Joom_GetConfig();
    jimport('joomla.html.pane');
    $document->addStyleDeclaration('
.joom_cpanel img {
  padding:21px 0px !important;
}');
    $database->setQuery("SELECT id\n      FROM #__components\n      WHERE link = 'option=" . _JOOM_OPTION . "' AND parent=''");
    $id = $database->loadResult();
    $database->setQuery("SELECT *\n      FROM #__components\n      WHERE parent='" . $id . "' ORDER BY id ASC");
    $rows = $database->loadObjectList();
    ?>
<table border="0" cellpadding="10" style="margin-right:auto; margin-left:auto;" class="adminform">
  <tbody>
    <tr>
      <td width="55%" valign="top">
        <div id="cpanel" class="joom_cpanel">
<?php 
    foreach ($rows as $row) {
        Joom_QuickIconButton($row->admin_menu_link, $row->admin_menu_img, $row->name);
    }
    ?>
        </div>
      </td>
      <td width="45%" valign="top">
<?php 
    $modules =& JModuleHelper::getModules('joom_cpanel');
    // TODO: allowAllClose should default true in J!1.6, so remove the array when it does.
    $pane =& JPane::getInstance('sliders', array('allowAllClose' => true));
    echo $pane->startPane("content-pane");
    if ($config->jg_checkupdate) {
        Joom_ShowDatedExtensions($pane);
    }
    foreach ($modules as $module) {
        echo $pane->startPanel($module->title, 'cpanel-panel-' . $module->name);
        echo JModuleHelper::renderModule($module);
        echo $pane->endPanel();
    }
    echo $pane->endPane();
    if ($config->jg_checkupdate) {
        if (!count(Joom_CheckUpdate())) {
            ?>
  <div style=" weight:100%; text-align:center; color:#008000; font-weight:bold;">
    <?php 
            echo JText::_('JGA_SYSTEM_UPTODATE');
            ?>
  </div>
<?php 
        }
    }
    ?>
      </td>
    </tr>
  </tbody>
</table>
<?php 
}
Пример #9
0
 public static function parseJdocTags($data)
 {
     $replace = array();
     $matches = array();
     if (preg_match_all('#<jdoc:include\\ type="([^"]+)" (.*)\\/>#iU', $data, $matches)) {
         $matches[0] = array_reverse($matches[0]);
         $matches[1] = array_reverse($matches[1]);
         $matches[2] = array_reverse($matches[2]);
         $count = count($matches[1]);
         for ($i = 0; $i < $count; $i++) {
             $attribs = JUtility::parseAttributes($matches[2][$i]);
             $type = $matches[1][$i];
             if ($type != 'modules') {
                 continue;
             }
             $name = isset($attribs['name']) ? $attribs['name'] : null;
             if (empty($name)) {
                 continue;
             }
             unset($attribs['name']);
             jimport('joomla.application.module.helper');
             $modules = JModuleHelper::getModules($name);
             $moduleHtml = null;
             if (!empty($modules)) {
                 foreach ($modules as $module) {
                     $moduleHtml .= JModuleHelper::renderModule($module, $attribs);
                 }
             }
             $data = str_replace($matches[0][$i], $moduleHtml, $data);
         }
     }
     return $data;
 }
Пример #10
0
 /**
  * Renders multiple modules script and returns the results as a string
  *
  * @param string 	$name		The position of the modules to render
  * @param array 	$params		Associative array of values
  * @return string	The output of the script
  */
 public function render($position, array $params = array(), $content = null)
 {
     $renderer = KFactory::get('lib.koowa.document.html.renderer.module');
     $contents = '';
     foreach (JModuleHelper::getModules($position) as $mod) {
         $contents .= $renderer->render($mod, $params, $content);
     }
     return $contents;
 }
Пример #11
0
 /**
  * Renders multiple modules script and returns the results as a string
  *
  * @access public
  * @param string 	$name		The position of the modules to render
  * @param array 	$params		Associative array of values
  * @return string	The output of the script
  */
 function render($position, $params = array(), $content = null)
 {
     $renderer =& $this->_doc->loadRenderer('module');
     $contents = '';
     foreach (JModuleHelper::getModules($position) as $mod) {
         $contents .= $renderer->render($mod, $params, $content);
     }
     return $contents;
 }
Пример #12
0
 public static function loadModules($position, $style = 'raw')
 {
     jimport('joomla.application.module.helper');
     $modules = JModuleHelper::getModules($position);
     $params = array('style' => $style);
     foreach ($modules as $module) {
         echo JModuleHelper::renderModule($module, $params);
     }
 }
Пример #13
0
function modChrome_canvastabs($module, $params, $attribs)
{
    $area = isset($attribs['id']) ? (int) $attribs['id'] : '1';
    $area = 'area-' . $area;
    static $modulecount;
    static $modules;
    if ($modulecount < 1) {
        $modulecount = count(JModuleHelper::getModules($attribs['name']));
        $modules = array();
    }
    if ($modulecount == 1) {
        $temp = new stdClass();
        $temp->content = $module->content;
        $temp->title = $module->title;
        $temp->params = $module->params;
        $temp->id = $module->id;
        $modules[] = $temp;
        // list of moduletitles
        echo '<ul class="nav nav-tabs" id="tab' . $temp->id . '">';
        foreach ($modules as $rendermodule) {
            //prepare the module title
            if (strpos($rendermodule->title, '::') !== false) {
                $moduleTitle = explode('::', $rendermodule->title);
                $moduleTitle = "<span>" . $moduleTitle[0] . "</span>" . $moduleTitle[1];
            } else {
                $moduleTitle = $rendermodule->title;
            }
            echo '<li><a data-toggle="tab" href="#module-' . $rendermodule->id . '" >' . $moduleTitle . '</a></li>';
        }
        echo '</ul>';
        echo '<div class="tab-content">';
        $counter = 0;
        // modulecontent
        foreach ($modules as $rendermodule) {
            $counter++;
            echo '<div class="tab-pane  fade in" id="module-' . $rendermodule->id . '">';
            echo $rendermodule->content;
            echo '</div>';
        }
        echo '</div>';
        echo '<script type="text/javascript">';
        echo 'jQuery(document).ready(function(){';
        echo 'jQuery("#tab' . $temp->id . ' a:first").tab("show")';
        echo '});';
        echo '</script>';
        $modulecount--;
    } else {
        $temp = new stdClass();
        $temp->content = $module->content;
        $temp->params = $module->params;
        $temp->title = $module->title;
        $temp->id = $module->id;
        $modules[] = $temp;
        $modulecount--;
    }
}
Пример #14
0
 /**
  * Renders multiple modules
  *
  * Returns the results as an string using the __onString magic method.
  * Doing so allows you to use this method directly in an foreach()
  *
  * String example:
  *	<pre>
  *		<?= @ninja('module.render', 'left') ?>
  *	</pre>
  *
  * Array example:
  *	<pre>
  *		<?= @$helper('tabs.startpane', 'tabs', array('display' => 0)) ?>
  * 		<? foreach (@$helper('module.render', 'left') as $title => $content) : ?>
  * 			<?= @$helper('tabs.startpanel', @text($title)) ?>
  *				<?= $content ?>
  *			<?= @$helper('tabs.endpanel') ?>
  *		<? endforeach ?>
  *		<?= @$helper('tabs.endpane') ?>
  * </pre>
  *
  * @param	string			$position	The position of the modules to render
  * @param	array			$params		Associative array of values
  * @return	KObjectArray	$this		Allows you to either echo the result as a string
  *										or iterate over each module
  */
 public function render($position, $params = array(), $content = null)
 {
     // We need to clear the array in order to use this more than once
     $this->_data = array();
     foreach (JModuleHelper::getModules($position) as $module) {
         $this->_data[$module->title] = $this->renderer->render($module, $params, $content);
     }
     return $this->_data;
     //	    $renderer->render($mod, $params, $content);
 }
Пример #15
0
 public function getInput()
 {
     $document = JFactory::getDocument();
     $position = (string) $this->element['position'];
     jimport('joomla.application.module.helper');
     $module = JModuleHelper::getModules('');
     echo '<pre>';
     var_dump($module);
     echo '</pre>';
 }
Пример #16
0
 public static function loadposition($position, $style = -2)
 {
     $document = JFactory::getDocument();
     $renderer = $document->loadRenderer('module');
     $params = array('style' => $style);
     $contents = '';
     foreach (JModuleHelper::getModules($position) as $mod) {
         $contents .= $renderer->render($mod, $params);
     }
     return $contents;
 }
Пример #17
0
 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;
 }
Пример #18
0
    public function renderCompanion($name, $args, $width, $alt = false)
    {
        $doc = Wright::getInstance();
        if ($doc->browser->isMobile() && !$doc->browser->isTablet()) {
            $hiddenmodule = $doc->params->get('hiddenmodule', array());
            $modules = JModuleHelper::getModules($name);
            if (count($modules) > 0 && count($hiddenmodule) > 0) {
                foreach ($modules as $module) {
                    if (in_array($module->id, $hiddenmodule)) {
                        $module->position = 'hiddenmodule';
                    }
                }
            }
        }
        if ($name == 'menu') {
            return '
				<nav id="' . $name . ($alt ? '_alt' : '_primary') . '" class="clearfix">
					<div class="navbar ' . $args['menuWrapClass'] . '">
						<div class="navbar-inner">
				            <a class="btn btn-navbar collapsed" data-toggle="collapse" data-target="#nav-' . $name . '">
					            <span class="icon-bar"></span>
					            <span class="icon-bar"></span>
					            <span class="icon-bar"></span>
				            </a>
				            <div class="nav-collapse" id="nav-' . $name . '">
								 <jdoc:include type="modules" name="' . $name . '" style="raw" />
							</div>
						</div>
					</div>
				</nav>
			';
        } elseif ($name == 'toolbar') {
            return '
				<nav id="' . $name . ($alt ? '_alt' : '_primary') . '" class="clearfix">
		            <a class="btn btn-navbar collapsed" data-toggle="collapse" data-target="#nav-' . $name . '">
			            <span class="icon-bar"></span>
			            <span class="icon-bar"></span>
			            <span class="icon-bar"></span>
		            </a>
		            <div class="nav-collapse" id="nav-' . $name . '">
						 <jdoc:include type="modules" name="' . $name . '" style="raw" />
					</div>
				</nav>
			';
        } else {
            if ($doc->document->params->get('logowidth') !== '12' && $doc->countModules($name)) {
                return '<div id="' . $name . ($alt ? '_alt' : '_primary') . '" class="clearfix">
							<jdoc:include type="modules" name="' . $name . '" style="' . $args['style'] . '" />
						</div>';
            }
        }
        return '';
    }
Пример #19
0
 public function onAfterDispatch()
 {
     if (JFactory::getApplication()->isAdmin()) {
         return true;
     }
     $input = JFactory::getApplication()->input;
     $extension = $input->get('option', '', 'cmd');
     $view = $input->get('view', '', 'cmd');
     $categories = $input->get('categories', array(), 'array');
     $category_id = count($categories) == 1 ? array_shift($categories) : null;
     if ($extension !== 'com_ksenmart') {
         return true;
     }
     if (JFactory::getDocument()->getType() !== 'html' || $input->get('tmpl', '', 'cmd') === 'ksenmart') {
         return true;
     }
     $doc = JFactory::getDocument();
     $renderer = $doc->loadRenderer('module');
     $modules = $this->params->get('modules', new stdClass());
     foreach ($modules as $position => $mods) {
         $attribs = array('name' => $position);
         $buf = $doc->getBuffer('modules', $position, $attribs);
         foreach (JModuleHelper::getModules($position) as $mod) {
             foreach ($mods as $mod_id => $mod_params) {
                 $registry = new JRegistry();
                 $mod_params = $registry->loadObject($mod_params);
                 $categories = $mod_params->get('categories', array());
                 $pages = $mod_params->get('pages', array());
                 if ($mod->id == $mod_id) {
                     if ($view == 'catalog' && !empty($category_id)) {
                         if (in_array(-1, $categories) || !in_array($category_id, $categories) && !in_array(0, $categories)) {
                             $moduleHtml = $renderer->render($mod, $attribs, null);
                             $buf = str_replace($moduleHtml, '', $buf);
                         }
                     } else {
                         $page_id = 0;
                         foreach ($this->pages as $key => $page) {
                             if ($page == $view) {
                                 $page_id = $key;
                             }
                         }
                         if (in_array(-1, $pages) || !in_array($page_id, $pages) && !in_array(0, $pages)) {
                             $moduleHtml = $renderer->render($mod, $attribs, null);
                             $buf = str_replace($moduleHtml, '', $buf);
                         }
                     }
                 }
             }
         }
         $doc->setBuffer($buf, 'modules', $position);
     }
     return true;
 }
Пример #20
0
 function display($tpl = null)
 {
     // Initialise variables
     JModelLegacy::addIncludePath(JPATH_COMPONENT . '/models');
     $model = JModelLegacy::getInstance('Categories', 'DJMediaToolsModel', array('ignore_request' => true));
     $model->setState('category.id', JRequest::getVar('cid', 0, '', 'int'));
     $id = JRequest::getVar('id', 0, '', 'int');
     $params = $model->getParams();
     $category = $model->getItem();
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseWarning(500, implode("\n", $errors));
         return false;
     }
     if ($category === false) {
         JError::raiseError(404, JText::_('COM_DJMEDIATOOLS_ERROR_CATEGORY_NOT_FOUND'));
         return false;
     }
     // get gallery slides and layout
     $helper = DJMediatoolsLayoutHelper::getInstance('slideshow');
     $params->def('category', $category->id . ':' . $category->alias);
     $params->def('source', $category->source);
     $params = $helper->getParams($params);
     $this->slides = $helper->getSlides($params);
     foreach ($this->slides as $key => $slide) {
         if ($id == (int) $slide->id) {
             $this->current = $key;
             break;
         }
     }
     if (is_null($this->current)) {
         JError::raiseError(404, JText::_('COM_DJMEDIATOOLS_ERROR_ITEM_NOT_FOUND'));
         return false;
     }
     //Escape strings for HTML output
     $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
     $this->assignRef('params', $params);
     $this->assignRef('album', $category);
     // render modules
     //		$document	= JFactory::getDocument();
     $renderer = $this->document->loadRenderer('module');
     $position = 'djmt-item-desc';
     $modules = JModuleHelper::getModules($position);
     $mparams = array('style' => 'xhtml');
     ob_start();
     foreach ($modules as $module) {
         echo $renderer->render($module, $mparams);
     }
     $this->modules[$position] = ob_get_clean();
     $this->_prepareDocument();
     parent::display($tpl);
 }
Пример #21
0
 protected function _load($position, $style = 'none')
 {
     $document =& JFactory::getDocument();
     $renderer = $document->loadRenderer('module');
     $modules = JModuleHelper::getModules($position);
     $params = array('style' => $style);
     ob_start();
     foreach ($modules as $module) {
         echo $renderer->render($module, $params);
     }
     $output = ob_get_clean();
     return $output;
 }
Пример #22
0
 public function display($tpl = null)
 {
     // Set toolbar items for the page
     JToolBarHelper::title(JText::_('COM_CPANEL'), 'cpanel.png');
     JToolBarHelper::help('screen.cpanel');
     /*
      * Set the template - this will display cpanel.php
      * from the selected admin template.
      */
     JRequest::setVar('tmpl', 'cpanel');
     // Display the cpanel modules
     $this->modules = JModuleHelper::getModules('cpanel');
     parent::display($tpl);
 }
Пример #23
0
    function display($positionStub, $layout = 'standard', $chrome = 'standard', $pattern = null) {
        global $jft;

        $output = '';
        $positions = $jft->getPositions();
        $position_renders = array();
        $position_sizers = array();

        foreach ($positions as $positionName => $positionValues) {
            if ($positionStub == $positionName) {
                $letters = 'a';
                foreach ($positionValues as $key => $value) {
                    $posName = $positionName . '-' . $letters . '';
                    $gridSize = $value;
                    $contents = '';
                    $modules = JModuleHelper::getModules($posName);
                    if (!empty($modules) && count($modules) > 0) {
                        $contents .= '<jdoc:include type="modules" name="' . $posName . '" style="' . $chrome . '" />' . "\n";
                    }
                    $position_renders[$posName] = $contents;
                    $position_sizers[$posName] = $gridSize;
                    $letters++;
                }
            }
        }

        $position_renders = array_filter($position_renders, create_function('$o', 'return !empty($o);'));

        $end = end(array_keys($position_renders)); //ultimo modulo da posi��o
        $start = reset(array_keys($position_renders)); //primeiro modulo da posi�ao

        /* adicionando classes extras */
        foreach ($position_renders as $position => $posValue) {
            $contents = "";
            $contents = $posValue;
            $gridSize = $position_sizers[$position];

            $extraClass = '';
            if ($position == $start)
                $extraClass = "first";
            if ($position == $end)
                $extraClass = "last";
            if ($position == $start && $position == $end)
                $extraClass = "first last";

            $extraClass = 'grid_' . $gridSize . ' ' . $extraClass;
            $output .= HumrumModuleRender::render(array('moduleName' => $position, 'contents' => $contents, 'gridSize' => $gridSize, 'extraClass' => $extraClass));
        }
        return $output;
    }
 function mosLoadAdminModules($position = 'left', $style = 0)
 {
     jimport('joomla.html.pane');
     $modules =& JModuleHelper::getModules($position);
     $pane =& JPane::getInstance('sliders');
     echo $pane->startPane("content-pane");
     foreach ($modules as $module) {
         $title = $module->title;
         echo $pane->startPanel($title, "{$position}-panel");
         echo JModuleHelper::renderModule($module);
         echo $pane->endPanel();
     }
     echo $pane->endPane();
 }
Пример #25
0
 function renderModules($position, $attribs = array())
 {
     jimport('joomla.application.module.helper');
     $modules = JModuleHelper::getModules($position);
     $modulehtml = '';
     foreach ($modules as $module) {
         $params = new JParameter($module->params);
         $moduleClassSuffix = $params->get('moduleclass_sfx', '');
         $modulehtml .= '<div class="moduletable' . $moduleClassSuffix . '">';
         $modulehtml .= JModuleHelper::renderModule($module, $attribs);
         $modulehtml .= '</div>';
     }
     echo $modulehtml;
 }
 public function load($position)
 {
     // init vars
     $modules = JModuleHelper::getModules($position);
     // set params, force no style
     $params['style'] = 'none';
     // get modules content
     foreach ($modules as $module) {
         $module->parameter = new JParameter($module->params);
         $module->menu = $module->module == 'mod_mainmenu';
         $module->content = $this->_renderer->render($module, $params);
     }
     return $modules;
 }
Пример #27
0
 /**
  * Control panel
  */
 function display()
 {
     global $mainframe;
     $modules =& JModuleHelper::getModules('cpanel');
     $pane =& JPane::getInstance('sliders');
     echo $pane->startPane("content-pane");
     foreach ($modules as $module) {
         $title = $module->title;
         echo $pane->startPanel($title, 'cpanel-panel-' . $module->name);
         echo JModuleHelper::renderModule($module);
         echo $pane->endPanel();
     }
     echo $pane->endPane();
 }
Пример #28
0
 /**
  * Control panel
  */
 function display()
 {
     global $mainframe;
     $modules =& JModuleHelper::getModules('cpanel');
     // TODO: allowAllClose should default true in J!1.6, so remove the array when it does.
     $pane =& JPane::getInstance('sliders', array('allowAllClose' => true));
     echo $pane->startPane("content-pane");
     foreach ($modules as $module) {
         $title = $module->title;
         echo $pane->startPanel($title, 'cpanel-panel-' . $module->name);
         echo JModuleHelper::renderModule($module);
         echo $pane->endPanel();
     }
     echo $pane->endPane();
 }
Пример #29
0
 public function display($tpl = null)
 {
     // Set toolbar items for the page
     JToolbarHelper::title(JText::_('COM_CPANEL'), 'cpanel.png');
     JToolbarHelper::help('screen.cpanel');
     $input = JFactory::getApplication()->input;
     /*
      * Set the template - this will display cpanel.php
      * from the selected admin template.
      */
     $input->set('tmpl', 'cpanel');
     // Display the cpanel modules
     $this->modules = JModuleHelper::getModules('cpanel');
     parent::display($tpl);
 }
Пример #30
0
 /**
  * Renders multiple modules script and returns the results as a string
  *
  * @access public
  * @param string 	$name		The position of the modules to render
  * @param array 	$params		Associative array of values
  * @return string	The output of the script
  */
 function render($position, $params = array(), $content = null)
 {
     $renderer =& $this->_doc->loadRenderer('module');
     $contents = '';
     $count = 0;
     foreach (JModuleHelper::getModules($position) as $mod) {
         $contents .= $renderer->render($mod, $params, $content);
         $count++;
         //Check if we reached the max count and break the loop
         if (isset($params['max-count']) && $params['max-count'] == $count) {
             break;
         }
     }
     return $contents;
 }