/** * Configure the linkbar * * @param string $vName The name of the active view * * @return void */ public static function addSubmenu($vName) { if (JFactory::getApplication()->input->getCmd('tmpl', null) == null) { // Get 5 most-recent sliders $objJSNEasySliderSliders = new JSNEasySliderSliders(); $sliders = $objJSNEasySliderSliders->getSlidersWithoutState(5); JSNMenuHelper::addEntry('sliders', 'JSN_MENU_SLIDERS', '', $vName == 'sliders', 'administrator/components/com_easyslider/assets/images/icons-16/icon-items.png', 'sub-menu'); JSNMenuHelper::addEntry('configuration', 'JSN_MENU_CONFIGURATION_AND_MAINTENANCE', '', $vName == 'maintenance' or $vName == 'configuration', 'administrator/components/com_easyslider/assets/images/icons-16/icon-configuration.png', 'sub-menu'); JSNMenuHelper::addEntry('about', 'JSN_MENU_ABOUT', 'index.php?option=com_easyslider&view=about', $vName == 'about', 'administrator/components/com_easyslider/assets/images/icons-16/icon-about.png', 'sub-menu'); // Declare 2nd-level menu sliders for 'sliders' entry JSNMenuHelper::addEntry('slider-new', JText::_('JSN_EASYSLIDER_CREATE_NEW_SLIDER', true), 'index.php?option=com_easyslider&view=slider&layout=edit', false, '', 'sub-menu.sliders'); JSNMenuHelper::addSeparator('sub-menu.sliders'); if ($sliders) { JSNMenuHelper::addEntry('recent-sliders', JText::_('JSN_EASYSLIDER_RECENT_SLIDERS', true), '', false, '', 'sub-menu.sliders'); foreach ($sliders as $slider) { JSNMenuHelper::addEntry('slider-' . $slider->slider_id, $slider->slider_title, 'index.php?option=com_easyslider&view=slider&layout=edit&slider_id=' . $slider->slider_id, false, '', 'sub-menu.sliders.recent-sliders'); } } JSNMenuHelper::addEntry('all-sliders', JText::_('JSN_EASYSLIDER_ALL_SLIDERS', true), 'index.php?option=com_easyslider&view=sliders', false, '', 'sub-menu.sliders'); // Declare 2nd-level menu sliders for 'configuration' entry JSNMenuHelper::addEntry('global-params', JText::_('JSN_EASYSLIDER_ALL_GLOBAL_PARAMETERS', true), 'index.php?option=com_easyslider&view=configuration&s=configuration&g=configs', false, '', 'sub-menu.configuration'); JSNMenuHelper::addEntry('messages', JText::_('JSN_EASYSLIDER_ALL_GLOBAL_MESSAGES', true), 'index.php?option=com_easyslider&view=configuration&s=configuration&g=msgs', false, '', 'sub-menu.configuration'); JSNMenuHelper::addEntry('languages', JText::_('JSN_EASYSLIDER_ALL_GLOBAL_LANGUAGES', true), 'index.php?option=com_easyslider&view=configuration&s=configuration&g=langs', false, '', 'sub-menu.configuration'); JSNMenuHelper::addEntry('update', JText::_('JSN_EASYSLIDER_ALL_GLOBAL_PRODUCT_UPDATE', true), 'index.php?option=com_easyslider&view=configuration&s=configuration&g=update', false, '', 'sub-menu.configuration'); JSNMenuHelper::addEntry('maintenance', JText::_('JSN_EASYSLIDER_ALL_GLOBAL_PRODUCT_MAINTENANCE', true), '', false, '', 'sub-menu.configuration'); // Declare 3rd-level menu sliders for 'maintenance' entry JSNMenuHelper::addEntry('data', JText::_('JSN_EASYSLIDER_ALL_GLOBAL_PRODUCT_DATA', true), 'index.php?option=com_easyslider&view=configuration&s=maintenance&g=data', false, '', 'sub-menu.configuration.maintenance'); JSNMenuHelper::addEntry('permissions', JText::_('JSN_EASYSLIDER_ALL_GLOBAL_PERMISSIONS', true), 'index.php?option=com_easyslider&view=configuration&s=maintenance&g=permissions', false, '', 'sub-menu.configuration.maintenance'); // Render the sub-menu JSNMenuHelper::render('sub-menu'); } }
public static function addSubmenu($vName) { // Declare 1st-level menu items JSNMenuHelper::addEntry('launchpad', 'JSN_IMAGESHOW_MENU_LAUNCHPAD', 'index.php?option=com_imageshow', $vName == '' or $vName == 'cpanel', 'administrator/components/com_imageshow/assets/images/icons-16/icon-off.png', 'sub-menu'); if (self::getAccesses('showlist')) { JSNMenuHelper::addEntry('showlists', 'JSN_MENU_SHOWLISTS', 'index.php?option=com_imageshow&view=showlist', $vName == 'showlists', 'administrator/components/com_imageshow/assets/images/icons-16/icon-file.png', 'sub-menu'); } if (self::getAccesses('showcase')) { JSNMenuHelper::addEntry('showcases', 'JSN_MENU_SHOWCASES', 'index.php?option=com_imageshow&view=showcase', $vName == 'showcases', 'administrator/components/com_imageshow/assets/images/icons-16/icon-monitor.png', 'sub-menu'); } if (self::getAccesses('configuration')) { JSNMenuHelper::addEntry('configuration', 'JSN_MENU_CONFIGURATION_AND_MAINTENANCE', 'index.php?option=com_imageshow&view=configuration', $vName == 'configuration' || $vName == 'maintenance', 'administrator/components/com_imageshow/assets/images/icons-16/icon-cog.png', 'sub-menu'); } JSNMenuHelper::addEntry('about', 'JSN_MENU_ABOUT', 'index.php?option=com_imageshow&view=about', $vName == 'about', 'administrator/components/com_imageshow/assets/images/icons-16/icon-star.png', 'sub-menu'); // Declare 2nd-level menu items for 'items' entry JSNMenuHelper::addEntry('all-showlists', JText::_('JSN_IMAGESHOW_SUB_MENU_ALL_SHOWLISTS', true), 'index.php?option=com_imageshow&view=showlist', false, '', 'sub-menu.showlists'); JSNMenuHelper::addEntry('all-showcases', JText::_('JSN_IMAGESHOW_SUB_MENU_ALL_SHOWCASES', true), 'index.php?option=com_imageshow&view=showcase', false, '', 'sub-menu.showcases'); $objJSNShowlist = new JSNISShowlist(); $objJSNShowcase = new JSNISShowcase(); $showlist = $objJSNShowlist->getLastestShowlist(5); $showcase = $objJSNShowcase->getLastestShowcase(5); if ($showlist) { JSNMenuHelper::addEntry('recent-showlist', JText::_('JSN_IMAGESHOW_SUB_MENU_RECENT_SHOWLISTS', true), '', false, '', 'sub-menu.showlists'); foreach ($showlist as $item) { JSNMenuHelper::addEntry('showlist-' . $item->item_id, $item->item_title, 'index.php?option=com_imageshow&controller=showlist&task=edit&cid[]=' . $item->item_id, false, '', 'sub-menu.showlists.recent-showlist'); } } if ($showcase) { JSNMenuHelper::addEntry('recent-showcase', JText::_('JSN_IMAGESHOW_SUB_MENU_RECENT_SHOWCASES', true), '', false, '', 'sub-menu.showcases'); foreach ($showcase as $item) { JSNMenuHelper::addEntry('showcase-' . $item->item_id, $item->item_title, 'index.php?option=com_imageshow&controller=showcase&task=edit&cid[]=' . $item->item_id, false, '', 'sub-menu.showcases.recent-showcase'); } } JSNMenuHelper::addSeparator('sub-menu.showlists'); JSNMenuHelper::addSeparator('sub-menu.showcases'); JSNMenuHelper::addEntry('showlist-new', JText::_('JSN_IMAGESHOW_SUB_MENU_CREATE_NEW_SHOWLIST', true), 'index.php?option=com_imageshow&controller=showlist&task=add', false, '', 'sub-menu.showlists'); JSNMenuHelper::addEntry('showcase-new', JText::_('JSN_IMAGESHOW_SUB_MENU_CREATE_NEW_SHOWCASE', true), 'index.php?option=com_imageshow&controller=showcase&task=add', false, '', 'sub-menu.showcases'); // Render the sub-menu if (JFactory::getApplication()->input->getCmd('tmpl', '') == '') { JSNMenuHelper::render('sub-menu'); } }
/** * Setup menu add new form button. * * @return void */ public static function buttonAddNewForm() { // Create a toolbar button that drop-down a sub-menu when clicked JSNMenuHelper::addEntry('toolbar-new-form', JText::_('JTOOLBAR_NEW'), '', false, 'jsn-icon16 jsn-icon-plus', 'toolbar'); // Declare 1st-level menu items JSNMenuHelper::addEntry('blank-form', 'JSN_UNIFORM_BLANK_FORM', 'index.php?option=com_uniform&view=form&layout=edit', false, '', 'toolbar-new-form'); JSNMenuHelper::addSeparator('toolbar-new-form'); JSNMenuHelper::addEntry('contact-form', 'JSN_UNIFORM_CONTACT_US_FORM', 'index.php?option=com_uniform&view=form&layout=edit&form=Contact Us', false, '', 'toolbar-new-form'); JSNMenuHelper::addEntry('feedback-form', 'JSN_UNIFORM_CUSTOMER_FEEDBACK_FORM', 'index.php?option=com_uniform&view=form&layout=edit&form=Customer Feedback', false, '', 'toolbar-new-form'); JSNMenuHelper::addEntry('application-form', 'JSN_UNIFORM_JOB_APPLICATION_FORM', 'index.php?option=com_uniform&view=form&layout=edit&form=Job Application', false, '', 'toolbar-new-form'); JSNMenuHelper::addEntry('register-form', 'JSN_UNIFORM_EVENT_REGISTRATION', 'index.php?option=com_uniform&view=form&layout=edit&form=Event Registration', false, '', 'toolbar-new-form'); JSNMenuHelper::addEntry('voting-form', 'JSN_UNIFORM_VOTING_FORM', 'index.php?option=com_uniform&view=form&layout=edit&form=Voting Form', false, '', 'toolbar-new-form'); JSNMenuHelper::addEntry('Survey-form', 'Survey Product/Service Satisfaction', 'index.php?option=com_uniform&view=form&layout=edit&form=Survey Product/Service Satisfaction', false, '', 'toolbar-new-form'); }
/** * Add toolbar button. * * @return void */ public static function addToolbarMenu() { // Get 5 most-recent items $items = self::getProfiles(5); // Create a toolbar button that drop-down a sub-menu when clicked JSNMenuHelper::addEntry('toolbar-menu', 'Menu', '', false, 'jsn-icon16 jsn-icon-menu', 'toolbar'); // Declare 1st-level menu items JSNMenuHelper::addEntry('profiles', 'JSN_MOBILIZE_SUB_MENU_MOBILIZATION_TEXT', '', false, 'administrator/components/com_mobilize/assets/images/icons-16/icon-mobilize.png', 'toolbar-menu'); JSNMenuHelper::addEntry('configuration', 'JSN_MOBILIZE_SUB_MENU_CONFIGURARTION_TEXT', 'index.php?option=com_mobilize&view=configuration', false, 'administrator/components/com_mobilize/assets/images/icons-16/icon-cog.png', 'toolbar-menu'); JSNMenuHelper::addEntry('about', 'JSN_MOBILIZE_SUB_MENU_HELP_TEXT', 'index.php?option=com_mobilize&view=about', false, 'administrator/components/com_mobilize/assets/images/icons-16/icon-about.png', 'toolbar-menu'); // Declare 2nd-level menu items for 'items' entry JSNMenuHelper::addEntry('all-profiles', 'All Profiles', 'index.php?option=com_mobilize&view=profiles', false, '', 'toolbar-menu.profiles'); if ($items) { JSNMenuHelper::addEntry('recent-profiles', 'Recent Profiles', '', false, '', 'toolbar-menu.profiles'); foreach ($items as $item) { JSNMenuHelper::addEntry('item-' . $item->profile_id, $item->profile_title, 'index.php?option=com_mobilize&view=profile&task=profile.edit&layout=edit&profile_id=' . $item->profile_id, false, '', 'toolbar-menu.profiles.recent-profiles'); } } JSNMenuHelper::addSeparator('toolbar-menu.profiles'); JSNMenuHelper::addEntry('item-new', 'Create New Profile', 'index.php?option=com_mobilize&view=profile&layout=edit', false, '', 'toolbar-menu.profiles'); }