当前位置: 首页>>代码示例>>PHP>>正文


PHP MenusHelper::getMenuTypes方法代码示例

本文整理汇总了PHP中MenusHelper::getMenuTypes方法的典型用法代码示例。如果您正苦于以下问题:PHP MenusHelper::getMenuTypes方法的具体用法?PHP MenusHelper::getMenuTypes怎么用?PHP MenusHelper::getMenuTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MenusHelper的用法示例。


在下文中一共展示了MenusHelper::getMenuTypes方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getMenus

 /**
  * Return list of menus.
  *
  * @return array
  * @throws \RuntimeException
  */
 public function getMenus()
 {
     static $items;
     if ($items === null) {
         require_once JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php';
         $items = (array) \MenusHelper::getMenuTypes();
     }
     return $items;
 }
开发者ID:nmsde,项目名称:gantry5,代码行数:15,代码来源:Menu.php

示例2: fetchElement

 public function fetchElement($name, $value, &$node, $control_name)
 {
     require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_menus' . DS . 'helpers' . DS . 'menus.php';
     $menuTypes = MenusHelper::getMenuTypes();
     foreach ($menuTypes as $menutype) {
         $options[] = JHtml::_('select.option', $menutype, $menutype);
     }
     array_unshift($options, JHtml::_('select.option', '', JText::_('JOPTION_SELECT_MENU')));
     return JHtml::_('select.genericlist', $options, $control_name . '[' . $name . ']', array('id' => $control_name . $name, 'list.attr' => 'class="inputbox"', 'list.select' => $value));
 }
开发者ID:ramdesh,项目名称:joomla-platform,代码行数:10,代码来源:menu.php

示例3: fetchElement

 /**
  * Fetch a calendar element
  *
  * @param   string  $name          Element name
  * @param   string  $value         Element value
  * @param   object  &$node         XMLElement node object containing the settings for the element
  * @param   string  $control_name  Control name
  * @return  string
  */
 public function fetchElement($name, $value, &$node, $control_name)
 {
     require_once PATH_CORE . '/components/com_menus/admin/helpers/menus.php';
     $menuTypes = \MenusHelper::getMenuTypes();
     foreach ($menuTypes as $menutype) {
         $options[] = Builder\Select::option($menutype, $menutype);
     }
     array_unshift($options, Builder\Select::option(\App::get('language')->txt('JOPTION_SELECT_MENU')));
     return Builder\Select::genericlist($options, $control_name . '[' . $name . ']', array('id' => $control_name . $name, 'list.attr' => 'class="inputbox"', 'list.select' => $value));
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:19,代码来源:Menu.php

示例4: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     $db =& JFactory::getDBO();
     require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_menus' . DS . 'helpers' . DS . 'helper.php';
     $menuTypes = MenusHelper::getMenuTypes();
     foreach ($menuTypes as $menutype) {
         $options[] = JHTML::_('select.option', $menutype, $menutype);
     }
     array_unshift($options, JHTML::_('select.option', '', '- ' . JText::_('Select Menu') . ' -'));
     return JHTML::_('select.genericlist', $options, '' . $control_name . '[' . $name . ']', 'class="inputbox"', 'value', 'text', $value, $control_name . $name);
 }
开发者ID:jicheng17,项目名称:comanova,代码行数:11,代码来源:menu.php

示例5: fetchElement

 /**
  * Fetch a html for a list of menus
  *
  * @param   string       $name          Element name
  * @param   string       $value         Element value
  * @param   JXMLElement  &$node         JXMLElement node object containing the settings for the element
  * @param   string       $control_name  Control name
  *
  * @return  string
  *
  * @deprecated    12.1  Use JFormFieldMenu::getOptions instead
  * @since   11.1
  */
 public function fetchElement($name, $value, &$node, $control_name)
 {
     // Deprecation warning.
     JLog::add('JElementMenu::fetchElement() is deprecated.', JLog::WARNING, 'deprecated');
     require_once JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php';
     $menuTypes = MenusHelper::getMenuTypes();
     foreach ($menuTypes as $menutype) {
         $options[] = JHtml::_('select.option', $menutype, $menutype);
     }
     array_unshift($options, JHtml::_('select.option', '', JText::_('JOPTION_SELECT_MENU')));
     return JHtml::_('select.genericlist', $options, $control_name . '[' . $name . ']', array('id' => $control_name . $name, 'list.attr' => 'class="inputbox"', 'list.select' => $value));
 }
开发者ID:acculitx,项目名称:fleetmatrixsite,代码行数:25,代码来源:menu.php

示例6: universalfetchElement

 function universalfetchElement($name, $value, &$node)
 {
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php';
     } else {
         require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_menus' . DS . 'helpers' . DS . 'helper.php';
     }
     $menuTypes = MenusHelper::getMenuTypes();
     foreach ($menuTypes as $menutype) {
         $node->addChild('option', array('value' => $menutype))->setData(ucfirst($menutype));
     }
     return parent::universalfetchElement($name, $value, $node);
 }
开发者ID:pguilford,项目名称:vcomcc,代码行数:13,代码来源:offlajnmenu.php

示例7: fetchElement

 function fetchElement()
 {
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         require_once JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php';
     } else {
         require_once JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_menus' . DIRECTORY_SEPARATOR . 'helpers' . DIRECTORY_SEPARATOR . 'helper.php';
     }
     $options = MenusHelper::getMenuTypes();
     for ($i = 0; $i < count($options); $i++) {
         $this->_xml->addChild('option', htmlspecialchars(ucfirst($options[$i])))->addAttribute('value', $options[$i]);
     }
     $this->_value = $this->_form->get($this->_name, $this->_default);
     $html = parent::fetchElement();
     return $html;
 }
开发者ID:01J,项目名称:bealtine,代码行数:15,代码来源:joomlamenu.php

示例8: fetchElement

 function fetchElement($name, $value, &$node, $control_name)
 {
     $class = $node->attributes('class') ? 'class="' . $node->attributes('class') . '"' : 'class="inputbox"';
     $db =& JFactory::getDBO();
     require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_menus' . DS . 'helpers' . DS . 'helper.php';
     $menuTypes = MenusHelper::getMenuTypes();
     if (null == $value || !isset($value) || !in_array($value, $menuTypes)) {
         $value = $menuTypes[0];
     }
     foreach ($menuTypes as $menutype) {
         $options[] = JHTML::_('select.option', $menutype, $menutype);
     }
     array_unshift($options, JHTML::_('select.option', '', '- ' . JText::_('Select Menu') . ' -'));
     include_once 'selectbox.php';
     $selectbox = new JElementSelectBox();
     return $selectbox->fetchElement($name, $value, $node, $control_name, $options);
 }
开发者ID:janssit,项目名称:www.casaiberico.be,代码行数:17,代码来源:menus.php

示例9: _getOptions

 /**
  * Method to get a list of options for a list input.
  *
  * @return	array		An array of JHtml options.
  */
 protected function _getOptions()
 {
     require_once realpath(JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php');
     $menuTypes = MenusHelper::getMenuTypes();
     // Prepare return value
     $options = array();
     // Add basic option
     // TODO: would be better to put this basic option in the xml file ?
     $options[] = JHtml::_('select.option', '', JText::_('JOption_Select_Menu'));
     // Iterate over menus
     foreach ($menuTypes as $menutype) {
         $options[] = JHtml::_('select.option', $menutype, $menutype);
     }
     // Merge any additional options in the XML definition.
     $options = array_merge(parent::_getOptions(), $options);
     return $options;
 }
开发者ID:joebushi,项目名称:joomla,代码行数:22,代码来源:menu.php

示例10: moveForm

 function moveForm($tpl = null)
 {
     global $mainframe;
     $this->_layout = 'move';
     /*
      * Set toolbar items for the page
      */
     JToolBarHelper::title(JText::_('Menu Items') . ': <small><small>[ ' . JText::_('Move') . ' ]</small></small>');
     JToolBarHelper::custom('doMove', 'move.png', 'move_f2.png', 'Move', false);
     JToolBarHelper::cancel('cancelItem');
     JToolBarHelper::help('screen.menus');
     $document =& JFactory::getDocument();
     $document->setTitle(JText::_('Move Menu Items'));
     $menutype = $mainframe->getUserStateFromRequest('com_menus.menutype', 'menutype', 'mainmenu', 'menutype');
     // Build the menutypes select list
     $menuTypes = MenusHelper::getMenuTypes();
     foreach ($menuTypes as $menuType) {
         $menu[] = JHTML::_('select.option', $menuType, $menuType);
     }
     $MenuList = JHTML::_('select.genericlist', $menu, 'menu', 'class="inputbox" size="10"', 'value', 'text', null);
     $items =& $this->get('ItemsFromRequest');
     $this->assignRef('menutype', $menutype);
     $this->assignRef('items', $items);
     $this->assignRef('menutypes', $menuTypes);
     $this->assignRef('MenuList', $MenuList);
     parent::display($tpl);
 }
开发者ID:Isabella570,项目名称:Hotel-Management-Selena-,代码行数:27,代码来源:view.php

示例11: moveForm

 function moveForm($tpl = null)
 {
     global $mainframe;
     $this->_layout = 'move';
     /*
      * Set toolbar items for the page
      */
     JToolBarHelper::title(JText::_('Move') . ' ' . JText::_('Menu Items'));
     JToolBarHelper::custom('doMove', 'move.png', 'move_f2.png', 'Move', false);
     JToolBarHelper::cancel('cancelItem');
     JSubMenuHelper::addEntry(JText::_('Items'), 'index.php?option=com_menus&task=view', true);
     JSubMenuHelper::addEntry(JText::_('Menus'), 'index.php?option=com_menus');
     if (JFactory::getUser()->authorize('com_trash', 'manage')) {
         JSubMenuHelper::addEntry(JText::_('Trash'), 'index.php?option=com_trash&task=viewMenu');
     }
     $document =& JFactory::getDocument();
     $document->setTitle(JText::_('Move Menu Items'));
     $menutype = $mainframe->getUserStateFromRequest('com_menus.menutype', 'menutype', 'mainmenu', 'menutype');
     // Build the menutypes select list
     $menuTypes = MenusHelper::getMenuTypes();
     foreach ($menuTypes as $menuType) {
         $menu[] = JHTML::_('select.option', $menuType, $menuType);
     }
     $MenuList = JHTML::_('select.genericlist', $menu, 'menu', 'class="inputbox" size="10"', 'value', 'text', null);
     $items =& $this->get('ItemsFromRequest');
     $this->assignRef('menutype', $menutype);
     $this->assignRef('items', $items);
     $this->assignRef('menutypes', $menuTypes);
     $this->assignRef('MenuList', $MenuList);
     parent::display($tpl);
 }
开发者ID:JSWebdesign,项目名称:intranet-platform,代码行数:31,代码来源:view.php


注:本文中的MenusHelper::getMenuTypes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。