Example #1
0
 /**
  * Displays a submenu if there is one and if hidemainmenu is not set
  *
  * @param $selected
  * @return unknown_type
  */
 public function displaySubmenu($selected = '')
 {
     if (!JRequest::getInt('hidemainmenu') && empty($this->hidemenu)) {
         jimport('joomla.html.toolbar');
         require_once JPATH_ADMINISTRATOR . '/includes/toolbar.php';
         $view = strtolower(JRequest::getVar('view'));
         $menu = DSCMenu::getInstance();
     }
 }
Example #2
0
 /**
  * Displays a layout file with room for a left menu bar
  * @param $tpl
  * @return unknown_type
  */
 public function displayWithLeftMenu($tpl = null, $menuname)
 {
     // TODO This is an ugly, quick hack - fix it
     echo "<table width='100%'>";
     echo "<tr>";
     echo "<td style='width: 180px; padding-right: 5px; vertical-align: top;' >";
     DSC::load('DSCMenu', 'library.menu');
     if ($menu = DSCMenu::getInstance($menuname)) {
         $menu->display('leftmenu', $menu);
     }
     $modules = JModuleHelper::getModules($this->_name . "_left");
     $document = JFactory::getDocument();
     $renderer = $document->loadRenderer('module');
     $attribs = array();
     $attribs['style'] = 'xhtml';
     foreach ($modules as $mod) {
         echo $renderer->render($mod, $attribs);
     }
     echo "</td>";
     echo "<td style='vertical-align: top;' >";
     parent::display($tpl);
     echo "</td>";
     echo "</tr>";
     echo "</table>";
 }
Example #3
0
 public static function treerecurse($id, $indent, $list, &$children, $maxlevel = 9999, $level = 0, $type = 1, $pre = null, $spacer = null)
 {
     if ($children[$id] && $level <= $maxlevel) {
         foreach ($children[$id] as $v) {
             $id = $v->id;
             if ($type == 1) {
                 if (is_null($pre)) {
                     $pre = '<sup>|_</sup>&#160;';
                 }
                 if (is_null($spacer)) {
                     $spacer = '.&#160;&#160;&#160;&#160;&#160;&#160;';
                 }
             } else {
                 if (is_null($pre)) {
                     $pre = '- ';
                 }
                 if (is_null($spacer)) {
                     $spacer = '&#160;&#160;';
                 }
             }
             if ($v->parent_id == 0) {
                 $txt = $v->title;
             } else {
                 $txt = $pre . $v->title;
             }
             $pt = $v->parent_id;
             $list[$id] = $v;
             $list[$id]->treename = "{$indent}{$txt}";
             $list[$id]->children = count($children[$id]);
             $list = DSCMenu::treerecurse($id, $indent . $spacer, $list, $children, $maxlevel, $level + 1, $type, $pre, $spacer);
         }
     }
     return $list;
 }