• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP MenusHelper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getInput

 /**
  * Method to get the field input markup.
  *
  * @return	string	The field input markup.
  * @since	1.6
  */
 protected function getInput()
 {
     // Initialise variables.
     $html = array();
     $recordId = (int) $this->form->getValue('id');
     $size = ($v = $this->element['size']) ? ' size="' . $v . '"' : '';
     $class = ($v = $this->element['class']) ? ' class="' . $v . '"' : 'class="text_area"';
     // Get a reverse lookup of the base link URL to Title
     $model = JModel::getInstance('menutypes', 'menusModel');
     $rlu = $model->getReverseLookup();
     switch ($this->value) {
         case 'url':
             $value = JText::_('COM_MENUS_TYPE_EXTERNAL_URL');
             break;
         case 'alias':
             $value = JText::_('COM_MENUS_TYPE_ALIAS');
             break;
         case 'separator':
             $value = JText::_('COM_MENUS_TYPE_SEPARATOR');
             break;
         default:
             $link = $this->form->getValue('link');
             // Clean the link back to the option, view and layout
             $value = JText::_(JArrayHelper::getValue($rlu, MenusHelper::getLinkKey($link)));
             break;
     }
     // Load the javascript and css
     JHtml::_('behavior.framework');
     JHtml::_('behavior.modal');
     $html[] = '<input type="text" readonly="readonly" disabled="disabled" value="' . $value . '"' . $size . $class . ' />';
     $html[] = '<input type="button" value="' . JText::_('JSELECT') . '" onclick="SqueezeBox.fromElement(this, {handler:\'iframe\', size: {x: 600, y: 450}, url:\'' . JRoute::_('index.php?option=com_menus&view=menutypes&tmpl=component&recordId=' . $recordId) . '\'})" />';
     $html[] = '<input type="hidden" name="' . $this->name . '" value="' . htmlspecialchars($this->value, ENT_COMPAT, 'UTF-8') . '" />';
     return implode("\n", $html);
 }
开发者ID:laiello,项目名称:senluonirvana,代码行数:40,代码来源:menutype.php


示例2: display

 /**
  * Method to display a view.
  *
  * @param	boolean			If true, the view output will be cached
  * @param	array			An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return	JController		This object to support chaining.
  * @since	1.5
  */
 public function display($cachable = false, $urlparams = false)
 {
     require_once JPATH_COMPONENT . '/helpers/menus.php';
     // Load the submenu.
     MenusHelper::addSubmenu(JRequest::getCmd('view'));
     $view = JRequest::getCmd('view', 'menus');
     $layout = JRequest::getCmd('layout', 'default');
     $id = JRequest::getInt('id');
     // Check for edit form.
     if ($view == 'menu' && $layout == 'edit' && !$this->checkEditId('com_menus.edit.menu', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_menus&view=menus', false));
         return false;
     } elseif ($view == 'item' && $layout == 'edit' && !$this->checkEditId('com_menus.edit.item', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_menus&view=items', false));
         return false;
     }
     parent::display();
     return $this;
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:34,代码来源:controller.php


示例3: getTypeOptions

 /**
  * Method to get the available menu item type options.
  *
  * @return	array	Array of groups with menu item types.
  * @since	1.6
  */
 public function getTypeOptions()
 {
     // Initialise variables.
     $lang = Lang::getRoot();
     $list = array();
     // Get the list of components.
     $db = App::get('db');
     $query = $db->getQuery(true);
     $query->select('name, element AS ' . $db->qn('option'));
     $query->from('#__extensions');
     $query->where('type = ' . $db->q('component'));
     $query->where('enabled = 1');
     $query->order('name ASC');
     $db->setQuery($query);
     $components = $db->loadObjectList();
     foreach ($components as $component) {
         if ($options = $this->getTypeOptionsByComponent($component->option)) {
             $list[$component->name] = $options;
             // Create the reverse lookup for link-to-name.
             foreach ($options as $option) {
                 if (isset($option->request)) {
                     $this->rlu[MenusHelper::getLinkKey($option->request)] = $option->get('title');
                     if (isset($option->request['option'])) {
                         $lang->load($option->request['option'] . '.sys', PATH_APP, null, false, true) || $lang->load($option->request['option'] . '.sys', PATH_CORE . '/components/' . $option->request['option'] . '/admin', null, false, true);
                     }
                 }
             }
         }
     }
     return $list;
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:37,代码来源:menutypes.php


示例4: getTypeOptions

 /**
  * Method to get the available menu item type options.
  *
  * @return	array	Array of groups with menu item types.
  * @since	1.6
  */
 public function getTypeOptions()
 {
     jimport('joomla.filesystem.file');
     // Initialise variables.
     $lang = JFactory::getLanguage();
     $list = array();
     // Get the list of components.
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select('name, element AS ' . $db->qn('option'));
     $query->from('#__extensions');
     $query->where('type = ' . $db->q('component'));
     $query->where('enabled = 1');
     $query->order('name ASC');
     $db->setQuery($query);
     $components = $db->loadObjectList();
     foreach ($components as $component) {
         if ($options = $this->getTypeOptionsByComponent($component->option)) {
             $list[$component->name] = $options;
             // Create the reverse lookup for link-to-name.
             foreach ($options as $option) {
                 if (isset($option->request)) {
                     $this->rlu[MenusHelper::getLinkKey($option->request)] = $option->get('title');
                     if (isset($option->request['option'])) {
                         $lang->load($option->request['option'] . '.sys', JPATH_ADMINISTRATOR, null, false, false) || $lang->load($option->request['option'] . '.sys', JPATH_ADMINISTRATOR . '/components/' . $option->request['option'], null, false, false) || $lang->load($option->request['option'] . '.sys', JPATH_ADMINISTRATOR, $lang->getDefault(), false, false) || $lang->load($option->request['option'] . '.sys', JPATH_ADMINISTRATOR . '/components/' . $option->request['option'], $lang->getDefault(), false, false);
                     }
                 }
             }
         }
     }
     return $list;
 }
开发者ID:acculitx,项目名称:fleetmatrixsite,代码行数:38,代码来源:menutypes.php


示例5: association

 /**
  * Generate the markup to display the item associations
  *
  * @param   int  $itemid  The menu item id
  *
  * @return  string
  *
  * @since   3.0
  *
  * @throws Exception If there is an error on the query
  */
 public static function association($itemid)
 {
     // Defaults
     $html = '';
     // Get the associations
     if ($associations = MenusHelper::getAssociations($itemid)) {
         // Get the associated menu items
         $db = JFactory::getDbo();
         $query = $db->getQuery(true)->select('m.id, m.title')->select('l.sef as lang_sef')->select('mt.title as menu_title')->from('#__menu as m')->join('LEFT', '#__menu_types as mt ON mt.menutype=m.menutype')->where('m.id IN (' . implode(',', array_values($associations)) . ')')->join('LEFT', '#__languages as l ON m.language=l.lang_code')->select('l.image')->select('l.title as language_title');
         $db->setQuery($query);
         try {
             $items = $db->loadObjectList('id');
         } catch (runtimeException $e) {
             throw new Exception($e->getMessage(), 500);
         }
         // Construct html
         if ($items) {
             foreach ($items as &$item) {
                 $text = strtoupper($item->lang_sef);
                 $url = JRoute::_('index.php?option=com_menus&task=item.edit&id=' . (int) $item->id);
                 $tooltipParts = array(JHtml::_('image', 'mod_languages/' . $item->image . '.gif', $item->language_title, array('title' => $item->language_title), true), $item->title, '(' . $item->menu_title . ')');
                 $class = 'hasTooltip label label-association label-' . $item->lang_sef;
                 $item->link = JHtml::_('tooltip', implode(' ', $tooltipParts), null, null, $text, $url, null, $class);
             }
         }
         $html = JLayoutHelper::render('joomla.content.associations', $items);
     }
     return $html;
 }
开发者ID:adjaika,项目名称:J3Base,代码行数:40,代码来源:menus.php


示例6: association

 /**
  * @param	int $itemid	The menu item id
  */
 static function association($itemid)
 {
     // Get the associations
     $associations = MenusHelper::getAssociations($itemid);
     // Get the associated menu items
     $db = JFactory::getDbo();
     $query = $db->getQuery(true);
     $query->select('m.*');
     $query->select('mt.title as menu_title');
     $query->from('#__menu as m');
     $query->leftJoin('#__menu_types as mt ON mt.menutype=m.menutype');
     $query->where('m.id IN (' . implode(',', array_values($associations)) . ')');
     $query->leftJoin('#__languages as l ON m.language=l.lang_code');
     $query->select('l.image');
     $query->select('l.title as language_title');
     $db->setQuery($query);
     $items = $db->loadObjectList('id');
     // Check for a database error.
     if ($error = $db->getErrorMsg()) {
         JError::raiseWarning(500, $error);
         return false;
     }
     // Construct html
     $text = array();
     foreach ($associations as $tag => $associated) {
         if ($associated != $itemid) {
             $text[] = JText::sprintf('COM_MENUS_TIP_ASSOCIATED_LANGUAGE', JHtml::_('image', 'mod_languages/' . $items[$associated]->image . '.gif', $items[$associated]->language_title, array('title' => $items[$associated]->language_title), true), $items[$associated]->title, $items[$associated]->menu_title);
         }
     }
     return JHtml::_('tooltip', implode('<br />', $text), JText::_('COM_MENUS_TIP_ASSOCIATION'), 'menu/icon-16-links.png');
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:34,代码来源:menus.php


示例7: getGroups

 /**
  * Method to get the field option groups.
  *
  * @return  array  The field option objects as a nested array in groups.
  */
 protected function getGroups()
 {
     // Initialize variables.
     $groups = array();
     // Initialize some field attributes.
     $menuType = (string) $this->element['menu_type'];
     $published = $this->element['published'] ? explode(',', (string) $this->element['published']) : array();
     $disable = $this->element['disable'] ? explode(',', (string) $this->element['disable']) : array();
     $language = $this->element['language'] ? explode(',', (string) $this->element['language']) : array();
     // Get the menu items.
     $items = \MenusHelper::getMenuLinks($menuType, 0, 0, $published, $language);
     // Build group for a specific menu type.
     if ($menuType) {
         // Initialize the group.
         $groups[$menuType] = array();
         // Build the options array.
         foreach ($items as $link) {
             $groups[$menuType][] = Dropdown::option($link->value, $link->text, 'value', 'text', in_array($link->type, $disable));
         }
     } else {
         // Build the groups arrays.
         foreach ($items as $menu) {
             // Initialize the group.
             $groups[$menu->menutype] = array();
             // Build the options array.
             foreach ($menu->links as $link) {
                 $groups[$menu->menutype][] = Dropdown::option($link->value, $link->text, 'value', 'text', in_array($link->type, $disable));
             }
         }
     }
     // Merge any additional groups in the XML definition.
     $groups = array_merge(parent::getGroups(), $groups);
     return $groups;
 }
开发者ID:kevinwojo,项目名称:framework,代码行数:39,代码来源:MenuItem.php


示例8: addToolbar

 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $canDo = MenusHelper::getActions($this->state->get('filter.parent_id'));
     JToolBarHelper::title(JText::_($isNew ? 'COM_MENUS_VIEW_NEW_MENU_TITLE' : 'COM_MENUS_VIEW_EDIT_MENU_TITLE'), 'menu.png');
     // If a new item, can save the item.  Allow users with edit permissions to apply changes to prevent returning to grid.
     if ($isNew && $canDo->get('core.create')) {
         if ($canDo->get('core.edit')) {
             JToolBarHelper::apply('menu.apply');
         }
         JToolBarHelper::save('menu.save');
     }
     // If user can edit, can save the item.
     if (!$isNew && $canDo->get('core.edit')) {
         JToolBarHelper::apply('menu.apply');
         JToolBarHelper::save('menu.save');
     }
     // If the user can create new items, allow them to see Save & New
     if ($canDo->get('core.create')) {
         JToolBarHelper::save2new('menu.save2new');
     }
     if ($isNew) {
         JToolBarHelper::cancel('menu.cancel');
     } else {
         JToolBarHelper::cancel('menu.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_MENUS_MENU_MANAGER_EDIT');
 }
开发者ID:christianesperar,项目名称:joomla-example,代码行数:36,代码来源:view.html.php


示例9: addToolbar

 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
     $canDo = MenusHelper::getActions($this->state->get('filter.parent_id'));
     JToolBarHelper::title(JText::_($isNew ? 'COM_MENUS_VIEW_NEW_ITEM_TITLE' : 'COM_MENUS_VIEW_EDIT_ITEM_TITLE'), 'menu-add');
     // If a new item, can save the item.  Allow users with edit permissions to apply changes to prevent returning to grid.
     if ($isNew && $canDo->get('core.create')) {
         if ($canDo->get('core.edit')) {
             JToolBarHelper::apply('adminitem.apply');
         }
         JToolBarHelper::save('adminitem.save');
     }
     // If not checked out, can save the item.
     if (!$isNew && !$checkedOut && $canDo->get('core.edit')) {
         JToolBarHelper::apply('adminitem.apply');
         JToolBarHelper::save('adminitem.save');
     }
     // If the user can create new items, allow them to see Save & New
     if ($canDo->get('core.create')) {
         JToolBarHelper::save2new('adminitem.save2new');
     }
     // If an existing item, can save to a copy only if we have create rights.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::save2copy('adminitem.save2copy');
     }
     if ($isNew) {
         JToolBarHelper::cancel('adminitem.cancel');
     } else {
         JToolBarHelper::cancel('adminitem.cancel', 'JTOOLBAR_CLOSE');
     }
 }
开发者ID:rdeutz,项目名称:square-one-cms,代码行数:39,代码来源:view.html.php


示例10: _getGroups

 /**
  * Method to get a list of options for a list input.
  *
  * @return	array		An array of JHtml options.
  */
 protected function _getGroups()
 {
     // Get the attributes
     $menuType = (string) $this->_element->attributes()->menu_type;
     $published = (string) $this->_element->attributes()->published ? explode(',', (string) $this->_element->attributes()->published) : array();
     $disable = (string) $this->_element->attributes()->disable ? explode(',', (string) $this->_element->attributes()->disable) : array();
     // Get the com_menus helper
     require_once realpath(JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php');
     // Get the items
     $items = MenusHelper::getMenuLinks($menuType, 0, 0, $published);
     // Prepare return value
     $groups = array();
     // If a menu type was set
     if ($menuType) {
         $groups[$menuType] = array();
         // Loop over links
         foreach ($items as $link) {
             // Generate an option disabling it if it's the case
             $groups[$menuType][] = JHtml::_('select.option', $link->value, $link->text, 'value', 'text', in_array($link->type, $disable));
         }
     } else {
         // Loop over types
         foreach ($items as $menu) {
             $groups[$menu->menutype] = array();
             // Loop over links
             foreach ($menu->links as $link) {
                 // Generate an option disabling it if it's the case
                 $groups[$menu->menutype][] = JHtml::_('select.option', $link->value, $link->text, 'value', 'text', in_array($link->type, $disable));
             }
         }
     }
     // Merge any additional options in the XML definition.
     $groups = array_merge(parent::_getGroups(), $groups);
     return $groups;
 }
开发者ID:joebushi,项目名称:joomla,代码行数:40,代码来源:menuitem.php


示例11: links

 public function links()
 {
     if (!CakePlugin::loaded('Menus')) {
         CakePlugin::load('Menus');
     }
     App::uses('View', 'View');
     App::uses('AppHelper', 'View/Helper');
     App::uses('MenusHelper', 'Menus.View/Helper');
     $Menus = new MenusHelper(new View());
     $Link = ClassRegistry::init('Menus.Link');
     $links = $Link->find('all', array('fields' => array('id', 'title', 'link')));
     $count = 0;
     foreach ($links as $link) {
         if (!strstr($link['Link']['link'], 'controller:')) {
             continue;
         }
         if (strstr($link['Link']['link'], 'plugin:')) {
             continue;
         }
         $url = $Menus->linkStringToArray($link['Link']['link']);
         if (isset($this->_controllerMap[$url['controller']])) {
             $url['plugin'] = $this->_controllerMap[$url['controller']];
             $linkString = $Menus->urlToLinkString($url);
             $Link->id = $link['Link']['id'];
             $this->out(__('Updating Link %s', $Link->id));
             $this->warn(__('- %s', $link['Link']['link']));
             $this->success(__('+ %s', $linkString), 2);
             $Link->saveField('link', $linkString, false);
             $count++;
         }
     }
     $this->out(__('Links updated: %d rows', $count));
 }
开发者ID:laiello,项目名称:plankonindia,代码行数:33,代码来源:UpgradeTask.php


示例12: association

 /**
  * Generate the markup to display the item associations
  *
  * @param   int  $itemid  The menu item id
  *
  * @return  string
  *
  * @since   3.0
  *
  * @throws Exception If there is an error on the query
  */
 public static function association($itemid)
 {
     // Defaults
     $html = '';
     // Get the associations
     if ($associations = MenusHelper::getAssociations($itemid)) {
         // Get the associated menu items
         $db = JFactory::getDbo();
         $query = $db->getQuery(true)->select('m.id, m.title')->select('l.sef as lang_sef, l.lang_code')->select('mt.title as menu_title')->from('#__menu as m')->join('LEFT', '#__menu_types as mt ON mt.menutype=m.menutype')->where('m.id IN (' . implode(',', array_values($associations)) . ')')->join('LEFT', '#__languages as l ON m.language=l.lang_code')->select('l.image')->select('l.title as language_title');
         $db->setQuery($query);
         try {
             $items = $db->loadObjectList('id');
         } catch (runtimeException $e) {
             throw new Exception($e->getMessage(), 500);
         }
         // Construct html
         if ($items) {
             foreach ($items as &$item) {
                 $text = strtoupper($item->lang_sef);
                 $url = JRoute::_('index.php?option=com_menus&task=item.edit&id=' . (int) $item->id);
                 $tooltip = $item->title . '<br />' . JText::sprintf('COM_MENUS_MENU_SPRINTF', $item->menu_title);
                 $classes = 'hasPopover label label-association label-' . $item->lang_sef;
                 $item->link = '<a href="' . $url . '" title="' . $item->language_title . '" class="' . $classes . '" data-content="' . $tooltip . '" data-placement="top">' . $text . '</a>';
             }
         }
         JHtml::_('bootstrap.popover');
         $html = JLayoutHelper::render('joomla.content.associations', $items);
     }
     return $html;
 }
开发者ID:eshiol,项目名称:joomla-cms,代码行数:41,代码来源:menus.php


示例13: 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:BeastModeON,项目名称:gantry5,代码行数:15,代码来源:Menu.php


示例14: getList

 public static function getList(&$params)
 {
     $user = JFactory::getUser();
     $lang = JFactory::getLanguage();
     $app = JFactory::getApplication();
     $menu = $app->getMenu();
     // Get menu home items
     $homes = array();
     foreach ($menu->getMenu() as $item) {
         if ($item->home) {
             $homes[$item->language] = $item;
         }
     }
     // Load associations
     $assoc = isset($app->menu_associations) ? $app->menu_associations : 0;
     if ($assoc) {
         $active = $menu->getActive();
         if ($active) {
             $associations = MenusHelper::getAssociations($active->id);
         }
     }
     $levels = $user->getAuthorisedViewLevels();
     $languages = JLanguageHelper::getLanguages();
     // Filter allowed languages
     foreach ($languages as $i => &$language) {
         // Do not display language without frontend UI
         if (!JLanguage::exists($language->lang_code)) {
             unset($languages[$i]);
         } elseif (!isset($homes[$language->lang_code])) {
             unset($languages[$i]);
         } elseif (isset($language->access) && $language->access && !in_array($language->access, $levels)) {
             unset($languages[$i]);
         } else {
             $language->active = $language->lang_code == $lang->getTag();
             if ($app->getLanguageFilter()) {
                 if (isset($associations[$language->lang_code]) && $menu->getItem($associations[$language->lang_code])) {
                     $itemid = $associations[$language->lang_code];
                     if ($app->getCfg('sef') == '1') {
                         $language->link = JRoute::_('index.php?lang=' . $language->sef . '&Itemid=' . $itemid);
                     } else {
                         $language->link = 'index.php?lang=' . $language->sef . '&amp;Itemid=' . $itemid;
                     }
                 } else {
                     if ($app->getCfg('sef') == '1') {
                         $itemid = isset($homes[$language->lang_code]) ? $homes[$language->lang_code]->id : $homes['*']->id;
                         $language->link = JRoute::_('index.php?lang=' . $language->sef . '&Itemid=' . $itemid);
                     } else {
                         $language->link = 'index.php?lang=' . $language->sef;
                     }
                 }
             } else {
                 $language->link = JRoute::_('&Itemid=' . $homes['*']->id);
             }
         }
     }
     return $languages;
 }
开发者ID:jimyb3,项目名称:mathematicalteachingsite,代码行数:57,代码来源:helper.php


示例15: getInput

 protected function getInput()
 {
     $size = (int) $this->def('size');
     $multiple = $this->def('multiple', 1);
     require_once JPATH_ADMINISTRATOR . '/components/com_menus/helpers/menus.php';
     $options = MenusHelper::getMenuLinks();
     require_once JPATH_PLUGINS . '/system/nnframework/helpers/html.php';
     return nnHtml::selectlist($options, $this->name, $this->value, $this->id, $size, $multiple);
 }
开发者ID:sillysachin,项目名称:teamtogether,代码行数:9,代码来源:menuitems.php


示例16: 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


示例17: 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


示例18: 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


示例19: 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


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Merchant类代码示例发布时间:2022-05-23
下一篇:
PHP Menu_helper类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap