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


PHP JApplication::getMenu方法代码示例

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


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

示例1: _findItemId

 protected static function _findItemId($needles)
 {
     // Prepare the reverse lookup array.
     if (self::$lookup === null) {
         self::$lookup = array();
         $component =& JComponentHelper::getComponent('com_xmap');
         $menus =& JApplication::getMenu('site', array());
         $items = $menus->getItems('component_id', $component->id);
         foreach ($items as &$item) {
             if (isset($item->query) && isset($item->query['view'])) {
                 $view = $item->query['view'];
                 if (!isset(self::$lookup[$view])) {
                     self::$lookup[$view] = array();
                 }
                 if (isset($item->query['id'])) {
                     self::$lookup[$view][$item->query['id']] = $item->id;
                 }
             }
         }
     }
     $match = null;
     foreach ($needles as $view => $id) {
         if (isset(self::$lookup[$view])) {
             if (isset(self::$lookup[$view][$id])) {
                 return self::$lookup[$view][$id];
             }
         }
     }
     return null;
 }
开发者ID:educakanchay,项目名称:educared,代码行数:30,代码来源:router.php

示例2: getItemid

 function getItemid($poll_id)
 {
     $component = JComponentHelper::getComponent('com_mijopolls');
     $menus = JApplication::getMenu('site', array());
     if (MijopollsHelper::is15()) {
         $items = $menus->getItems('componentid', $component->id);
     } else {
         $items = $menus->getItems('component_id', $component->id);
     }
     $match = false;
     $item_id = '';
     if (isset($items)) {
         foreach ($items as $item) {
             if (@$item->query['view'] == 'poll' && @$item->query['id'] == $poll_id) {
                 $itemid = $item->id;
                 $match = true;
                 break;
             }
         }
     }
     if ($match) {
         $item_id = '&Itemid=' . $itemid;
     }
     return $item_id;
 }
开发者ID:jasonrgd,项目名称:Digital-Publishing-Platform-Joomla,代码行数:25,代码来源:helper.php

示例3: getExistmenu

 function getExistmenu()
 {
     $component =& JComponentHelper::getComponent('com_hotelguide');
     $menus =& JApplication::getMenu('site', array());
     $items = $menus->getItems('componentid', $component->id);
     if (count($items) > 0) {
         return true;
     }
     return false;
 }
开发者ID:raulrotundo,项目名称:jpmoser_guide,代码行数:10,代码来源:hotelguide.php

示例4: _findItem

 function _findItem($needles)
 {
     $component =& JComponentHelper::getComponent('com_k2');
     $menus =& JApplication::getMenu('site', array());
     $items = $menus->getItems('componentid', $component->id);
     $match = null;
     foreach ($needles as $needle => $id) {
         if (count($items)) {
             foreach ($items as $item) {
                 if ($needle == 'user') {
                     if (@$item->query['task'] == $needle && @$item->query['id'] == $id) {
                         $match = $item;
                         break;
                     }
                 } else {
                     if ($needle == 'tag') {
                         if (@$item->query['task'] == $needle && @$item->query['tag'] == $id) {
                             $match = $item;
                             break;
                         }
                     } else {
                         if (@$item->query['view'] == $needle && @$item->query['id'] == $id) {
                             $match = $item;
                             break;
                         }
                         $menuparams = new JParameter($item->params);
                         $catids = $menuparams->get('categories');
                         if (is_array($catids)) {
                             foreach ($catids as $catid) {
                                 if (@$item->query['view'] == $needle && @(int) $catid == $id) {
                                     $match = $item;
                                     break;
                                 }
                             }
                         }
                         /*else{
                         
                         							if ( (@$item->query['view'] == $needle) && (!isset($item->query['task'])) && (@$item->query['view'] == 'itemlist') ) {
                         								$match = $item;
                         							}
                         
                         						}*/
                     }
                 }
             }
         }
         if (isset($match)) {
             break;
         }
     }
     return $match;
 }
开发者ID:rlee1962,项目名称:diylegalcenter,代码行数:52,代码来源:route.php

示例5: getObjectLink

 function getObjectLink($id)
 {
     $link = 'index.php?option=com_blog&view=comments&pid=' . $id;
     require_once JPATH_SITE . DS . 'includes' . DS . 'application.php';
     $component = JComponentHelper::getComponent('com_blog');
     $menus = JApplication::getMenu('site');
     $items = $menus->getItems('componentid', $component->id);
     if (count($items)) {
         $link .= "&Itemid=" . $items[0]->id;
     }
     $link = JRoute::_($link);
     return $link;
 }
开发者ID:DanyCan,项目名称:wisten.github.io,代码行数:13,代码来源:com_blog.plugin.php

示例6: getObjectLink

 function getObjectLink($id)
 {
     require_once JPATH_ROOT . DS . 'components' . DS . 'com_communitypolls' . DS . 'router.php';
     $query = 'SELECT a.id,' . ' CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug' . ' FROM #__jcp_polls AS a' . ' WHERE a.id = ' . $id;
     $db = JFactory::getDBO();
     $db->setQuery($query);
     $row = $db->loadObject();
     $menu = JApplication::getMenu('site');
     $mnuitems = $menu->getItems('link', 'index.php?option=com_communitypolls&controller=polls');
     $itemid = isset($mnuitems[0]) ? '&Itemid=' . $mnuitems[0]->id : '';
     $link = JRoute::_('index.php?option=com_communitypolls&controller=polls&task=viewpoll&id=' . $row->slug . $itemid);
     return $link;
 }
开发者ID:sergy444,项目名称:joomla,代码行数:13,代码来源:com_communitypolls.plugin.php

示例7: getName

 function getName()
 {
     $component =& JComponentHelper::getComponent('com_easybook');
     $menus =& JApplication::getMenu('site', array());
     $items = $menus->getItems('componentid', $component->id);
     $match = null;
     foreach ($items as $item) {
         if (@$item->query['view'] == 'easybook') {
             $match = $item->name;
             break;
         }
     }
     return $match;
 }
开发者ID:hrishikesh-kumar,项目名称:NBSNIP,代码行数:14,代码来源:menu.php

示例8: getObjectLink

 function getObjectLink($id)
 {
     $db = JFactory::getDBO();
     $db->setQuery('SELECT alias FROM #__categories WHERE section = "com_weblinks" and id = ' . $id);
     $alias = $db->loadResult();
     $link = 'index.php?option=com_weblinks&view=category&id=' . $id . ':' . $alias;
     require_once JPATH_SITE . DS . 'includes' . DS . 'application.php';
     $component = JComponentHelper::getComponent('com_weblinks');
     $menus = JApplication::getMenu('site');
     $items = $menus->getItems('componentid', $component->id);
     if (count($items)) {
         $link .= "&Itemid=" . $items[0]->id;
     }
     $link = JRoute::_($link);
     return $link;
 }
开发者ID:DanyCan,项目名称:wisten.github.io,代码行数:16,代码来源:com_weblinks.plugin.php

示例9: _findItem

 protected static function _findItem($needles)
 {
     $component = JComponentHelper::getComponent('com_ars');
     $menus = JApplication::getMenu('site');
     $items = $menus->getItems('componentid', $component->id);
     $user = JFactory::getUser();
     $access = (int) $user->get('aid');
     foreach ($items as $item) {
         if ($item->published == 1 && $item->access <= $access) {
             if (isset($item->query) && isset($item->query['view'])) {
                 if ($item->query['view'] == 'release') {
                     $params = $item->params instanceof JRegistry ? $item->params : $menus->getParams($item->id);
                     if ($params->get('relid', 0) == $needles['release_id']) {
                         return $item->id;
                     }
                 }
             }
         }
     }
     foreach ($items as $item) {
         if ($item->published == 1 && $item->access <= $access) {
             if (isset($item->query) && isset($item->query['view'])) {
                 if ($item->query['view'] == 'category') {
                     $params = $item->params instanceof JRegistry ? $item->params : $menus->getParams($item->id);
                     print_r($params);
                     if ($params->get('catid', 0) == $needles['category_id']) {
                         return $item->id;
                     }
                 }
             }
         }
     }
     foreach ($items as $item) {
         if ($item->published == 1 && $item->access <= $access) {
             if (isset($item->query) && isset($item->query['view'])) {
                 if ($item->query['view'] == 'browse') {
                     return $item->id;
                 }
             }
         }
     }
     $active = $menus->getActive();
     if ($active) {
         return $active->id;
     }
     return false;
 }
开发者ID:sergy444,项目名称:joomla,代码行数:47,代码来源:com_ars.plugin.php

示例10: _findItem

	private static function _findItem()
	{
		$component =& JComponentHelper::getComponent('com_helpdesk');

		$menus	= &JApplication::getMenu('site', array());
		$items	= $menus->getItems('componentid', $component->id);
		$match = null;

		foreach($items as $item) {
			if ((@$item->query['view'] == 'helpdesk')) {
				$match = $item->id;
				break;
			}
		}
		
		return $match;
	}
开发者ID:realityking,项目名称:com_rw_helpdesk,代码行数:17,代码来源:route.php

示例11: _findItem

 protected static function _findItem($product_id, $category_id)
 {
     $component = JComponentHelper::getComponent('com_redshop');
     $menus = JApplication::getMenu('site');
     $field = JCOMMENTS_JVERSION == '1.5' ? 'componentid' : 'component_id';
     $items = $menus->getItems($field, $component->id);
     $user = JFactory::getUser();
     $access = (int) $user->get('aid');
     $count = count($items);
     if ($count == 1) {
         return $items[0]->id;
     } else {
         if ($count > 1) {
             foreach ($items as $item) {
                 if ($item->access <= $access) {
                     if (isset($item->query) && isset($item->query['view'])) {
                         if ($item->query['view'] == 'category' && isset($item->query['cid'])) {
                             if ($item->query['cid'] = $category_id) {
                                 return $item->id;
                             }
                         }
                     }
                 }
             }
             $db = JFactory::getDBO();
             $db->setQuery('SELECT category_id FROM #__redshop_product_category_xref WHERE product_id = ' . $product_id);
             $categories = $db->loadResultArray();
             foreach ($items as $item) {
                 if ($item->access <= $access) {
                     if (isset($item->query) && isset($item->query['view'])) {
                         if ($item->query['view'] == 'category' && isset($item->query['cid'])) {
                             if (in_array($item->query['cid'], $categories)) {
                                 return $item->id;
                             }
                         }
                     }
                 }
             }
         }
     }
     $active = $menus->getActive();
     if ($active) {
         return $active->id;
     }
     return false;
 }
开发者ID:ForAEdesWeb,项目名称:AEW2,代码行数:46,代码来源:com_redshop.plugin.php

示例12: _findItem

 protected static function _findItem($needles)
 {
     $component = JComponentHelper::getComponent('com_docman');
     $menus = JApplication::getMenu('site');
     $items = $menus->getItems('componentid', $component->id);
     $user = JFactory::getUser();
     $access = (int) $user->get('aid');
     foreach ($needles as $needle => $id) {
         if (is_array($items)) {
             foreach ($items as $item) {
                 if ($item->published == 1 && $item->access <= $access) {
                     return $item;
                 }
             }
         }
     }
     return false;
 }
开发者ID:DanyCan,项目名称:wisten.github.io,代码行数:18,代码来源:com_docman.plugin.php

示例13: _findItem

 function _findItem($needles)
 {
     $component =& JComponentHelper::getComponent('com_content');
     $menus =& JApplication::getMenu('site', array());
     $items = $menus->getItems('componentid', $component->id);
     $match = null;
     foreach ($needles as $needle => $id) {
         foreach ($items as $item) {
             if (@$item->query['view'] == $needle && @$item->query['id'] == $id) {
                 $match = $item;
                 break;
             }
         }
         if (isset($match)) {
             break;
         }
     }
     return $match;
 }
开发者ID:Fellah,项目名称:govnobaki,代码行数:19,代码来源:route.php

示例14: getObjectInfo

 function getObjectInfo($id, $language = null)
 {
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select('a.id, a.title, a.alias, a.created_by');
     $query->from('#__jcp_polls AS a');
     $query->where('a.id = ' . (int) $id);
     $db->setQuery($query);
     $row = $db->loadObject();
     $info = new JCommentsObjectInfo();
     if (!empty($row)) {
         $row->slug = $row->alias ? $row->id . ':' . $row->alias : $row->id;
         $items = JApplication::getMenu('site')->getItems('link', 'index.php?option=com_communitypolls&controller=polls');
         $itemid = isset($items[0]) ? '&amp;Itemid=' . $items[0]->id : '';
         $info->title = $row->title;
         $info->userid = $row->created_by;
         $info->link = JRoute::_('index.php?option=com_communitypolls&amp;controller=polls&amp;task=viewpoll&amp;id=' . $row->slug . $itemid);
     }
     return $info;
 }
开发者ID:ForAEdesWeb,项目名称:AEW2,代码行数:20,代码来源:com_communitypolls.plugin.php

示例15: fetchElementOLD

 function fetchElementOLD($name, $value, &$node, $control_name)
 {
     $options = array();
     $menu =& JApplication::getMenu('site', $options);
     $items = $menu->getMenu();
     $items2 = $menu->getItems("component", "com_joomleague");
     JArrayHelper::sortObjects($items2, "menutype");
     foreach ($items2 as &$item) {
         $item->title = $item->name . " (" . $item->menutype . " - " . $item->component . ")";
         unset($item);
     }
     JArrayHelper::sortObjects($items, "menutype");
     foreach ($items as &$item) {
         if ($item->component != "com_joomleague") {
             $item->title = $item->name . " (" . $item->menutype . " - " . $item->component . ")";
             $items2[] = $item;
             unset($item);
         }
     }
     return JHTML::_('select.genericlist', $items2, '' . $control_name . '[' . $name . ']', '', 'id', 'title', $value, $control_name . $name);
 }
开发者ID:santas156,项目名称:joomleague-2-komplettpaket,代码行数:21,代码来源:jlmlitemid.php


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