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


PHP KunenaRoute::search方法代码示例

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


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

示例1: build

 protected static function build()
 {
     KUNENA_PROFILER ? KunenaProfiler::instance()->start('function ' . __CLASS__ . '::' . __FUNCTION__ . '()') : null;
     if (self::$search === false) {
         $user = KunenaUserHelper::getMyself();
         $language = JFactory::getDocument()->getLanguage();
         $cache = self::getCache();
         // FIXME: enable caching after fixing the issues
         self::$search = false;
         //unserialize($cache->get('search', "com_kunena.route.{$language}.{$user->userid}"));
         if (self::$search === false) {
             self::$search['home'] = array();
             foreach (self::$menu as $item) {
                 // Joomla! 1.5:
                 if (!is_object($item) || isset($item->published) && $item->published < 1) {
                     continue;
                 }
                 // Do not add menu items for other languages
                 if (isset($item->language) && $item->language != '*' && strtolower($item->language) != strtolower($language)) {
                     continue;
                 }
                 if ($item->type == 'alias' && !empty($item->query['Itemid']) && !empty(self::$menu[$item->query['Itemid']])) {
                     // Follow links
                     $item = self::$menu[$item->query['Itemid']];
                 } elseif ($item->type == 'component' && $item->component == 'com_kunena' && isset($item->query['view'])) {
                     // Save Kunena menu items so that we can make fast searches
                     $home = self::getHome($item);
                     self::$search[$item->query['view']][$home ? $home->id : 0][$item->id] = $item->id;
                 }
             }
             // FIXME: enable caching after fixing the issues
             //$cache->store(serialize(self::$search), 'search', "com_kunena.route.{$language}.{$user->userid}");
         }
     }
     KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function ' . __CLASS__ . '::' . __FUNCTION__ . '()') : null;
 }
开发者ID:proyectoseb,项目名称:University,代码行数:36,代码来源:route.php

示例2: build

	protected static function build()
	{
		KUNENA_PROFILER ? KunenaProfiler::instance()->start('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;

		if (self::$search === false)
		{
			$user = KunenaUserHelper::getMyself();
			$language = strtolower(JFactory::getDocument()->getLanguage());
			self::$search = false;

			if (KunenaConfig::getInstance()->get('cache_mid'))
			{
				// FIXME: Experimental caching.
				$cache = self::getCache();
				self::$search = unserialize($cache->get('search', "com_kunena.route.v1.{$language}.{$user->userid}"));
			}

			if (self::$search === false)
			{
				self::$search['home'] = array();
				foreach (self::$menu as $item)
				{
					// Skip menu items that aren't pointing to Kunena or are using wrong language.
					if (($item->component != 'com_kunena' && $item->type != 'alias')
						|| ($item->language  != '*' && strtolower($item->language) != $language))
					{
						continue;
					}

					// Follow links.
					if ($item->type == 'alias')
					{
						if (empty($item->query['Itemid']) || empty(self::$menu[$item->query['Itemid']]))
						{
							continue;
						}

						$item = self::$menu[$item->query['Itemid']];
						if ($item->component != 'com_kunena' || ($item->language  != '*' && strtolower($item->language) != $language))
						{
							continue;
						}
					}

					// Ignore legacy menu items without view in it.
					if (!isset($item->query['view']))
					{
						continue;
					}

					// Save Kunena menu items so that we can make fast searches
					$home = self::getHome($item);
					self::$search[$item->query['view']][$home ? $home->id : 0][$item->id] = $item->id;
				}

				if (isset($cache))
				{
					$cache->store(serialize(self::$search), 'search', "com_kunena.route.v1.{$language}.{$user->userid}");
				}
			}
		}
		KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
	}
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:63,代码来源:route.php

示例3: build

	protected static function build() {
		KUNENA_PROFILER ? KunenaProfiler::instance()->start('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
		if (self::$search === false) {
			$cache = JFactory::getCache('_system', 'output');
			self::$search = unserialize($cache->get('search', 'com_kunena.route'));
			if (self::$search === false) {
				self::$search['home'] = array();
				foreach ( self::$menu as $item ) {
					if (! is_object ( $item ))
						continue;
					$home = self::getHome($item);
					// Follow links
					if ($item->type == 'menulink' && !empty($item->query['Itemid']) && !empty(self::$menu[$item->query['Itemid']])) {
						$item = self::$menu[$item->query['Itemid']];
					}
					// Save Kunena menu items so that we can make fast searches
					if ($item->type == 'component' && $item->component == 'com_kunena' && isset($item->query['view'])) {
						self::$search[$item->query['view']][$home ? $home->id : 0][$item->id] = $item->id;
					}
				}
				$cache->store(serialize(self::$search), 'search', 'com_kunena.route');
			}
		}
		KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
	}
开发者ID:rich20,项目名称:Kunena,代码行数:25,代码来源:route.php


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