Esempio n. 1
0
 function render(&$params, $callback)
 {
     switch ($params->get('menu_style', 'list')) {
         case 'list_flat':
             // Include the legacy library file
             require_once dirname(__FILE__) . DS . 'legacy.php';
             mosShowHFMenu($params, 1);
             break;
         case 'horiz_flat':
             // Include the legacy library file
             require_once dirname(__FILE__) . DS . 'legacy.php';
             mosShowHFMenu($params, 0);
             break;
         case 'vert_indent':
             // Include the legacy library file
             require_once dirname(__FILE__) . DS . 'legacy.php';
             mosShowVIMenu($params);
             break;
         default:
             // Include the new menu class
             $xml = modMainMenuHelper::getXML($params->get('menutype'), $params, $callback);
             if ($xml) {
                 $class = $params->get('class_sfx');
                 $xml->addAttribute('class', 'menu' . $class);
                 if ($tagId = $params->get('tag_id')) {
                     $xml->addAttribute('id', $tagId);
                 }
                 $result = JFilterOutput::ampReplace($xml->toString((bool) $params->get('show_whitespace')));
                 $result = str_replace(array('<ul/>', '<ul />'), '', $result);
                 echo $result;
             }
             break;
     }
 }
Esempio n. 2
0
            }
        }
    }
}
$params->def('menutype', 'mainmenu');
$params->def('class_sfx', '');
$params->def('menu_images', 0);
$params->def('menu_images_align', 0);
$params->def('expand_menu', 0);
$params->def('activate_parent', 0);
$params->def('indent_image', 0);
$params->def('indent_image1', 'indent1.png');
$params->def('indent_image2', 'indent2.png');
$params->def('indent_image3', 'indent3.png');
$params->def('indent_image4', 'indent4.png');
$params->def('indent_image5', 'indent5.png');
$params->def('indent_image6', 'indent.png');
$params->def('spacer', '');
$params->def('end_spacer', '');
$params->def('full_active_id', 0);
switch ($params->get('menu_style', 'vert_indent')) {
    case 'list_flat':
        mosShowHFMenu($params, 1);
        break;
    case 'horiz_flat':
        mosShowHFMenu($params, 0);
        break;
    default:
        mosShowVIMenu($params);
        break;
}