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


PHP KunenaRoute::normalize方法代码示例

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


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

示例1: addBreadcrumb

 /**
  * Add path to breadcrumbs.
  * @param $text
  * @param $uri
  * @param $ignore
  *
  * @return $this
  */
 public function addBreadcrumb($text, $uri, $ignore = true)
 {
     if ($ignore) {
         $active = KunenaRoute::$active;
         $view = isset($active->query['view']) ? $active->query['view'] : '';
         $layout = isset($active->query['layout']) ? $active->query['layout'] : 'default';
         if ($active && $active->component == 'com_kunena' && strtolower("{$view}/{$layout}") == strtolower($this->_name)) {
             return $this;
         }
     }
     $this->breadcrumb->addItem($text, KunenaRoute::normalize($uri));
     return $this;
 }
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:21,代码来源:page.php

示例2: displayBreadcrumb

	function displayBreadcrumb($tpl = null) {
		$catid = JRequest::getInt ( 'catid', 0 );
		$id = JRequest::getInt ( 'id', 0 );
		$view = JRequest::getWord ( 'view', 'default' );
		$layout = JRequest::getWord ( 'layout', 'default' );

		$app = JFactory::getApplication();
		$pathway = $app->getPathway();
		$active = JFactory::getApplication()->getMenu ()->getActive ();

		if (empty($this->pathway)) {
			if ($catid) {
				$parents = KunenaForumCategoryHelper::getParents($catid);
				$parents[$catid] = KunenaForumCategoryHelper::get($catid);

				// Remove categories from pathway if menu item contains/excludes them
				if (!empty($active->query['catid']) && isset($parents[$active->query['catid']])) {
					$curcatid = $active->query['catid'];
					while (($item = array_shift($parents)) !== null) {
						if ($item->id == $curcatid) break;
					}
				}
				foreach ( $parents as $parent ) {
					$pathway->addItem($this->escape( $parent->name ), KunenaRoute::normalize("index.php?option=com_kunena&view=category&catid={$parent->id}"));
				}
			}
			if ($id) {
				$topic = KunenaForumTopicHelper::get($id);
				$pathway->addItem($this->escape( $topic->subject ), KunenaRoute::normalize("index.php?option=com_kunena&view=category&catid={$catid}&id={$topic->id}"));
			}
			if ($view == 'topic') {
				$active_layout = (!empty($active->query['view']) && $active->query['view'] == 'topic' && !empty($active->query['layout'])) ? $active->query['layout'] : '';
				switch ($layout) {
					case 'create':
						if ($active_layout != 'create') $pathway->addItem($this->escape( JText::_('COM_KUNENA_BUTTON_NEW_TOPIC'), KunenaRoute::normalize() ));
						break;
					case 'reply':
						if ($active_layout != 'reply') $pathway->addItem($this->escape( JText::_('COM_KUNENA_BUTTON_REPLY_TOPIC'), KunenaRoute::normalize() ));
						break;
					case 'edit':
						if ($active_layout != 'edit') $pathway->addItem($this->escape( JText::_('COM_KUNENA_BUTTON_EDIT'), KunenaRoute::normalize() ));
						break;
				}
			}
		}
		$this->pathway = array();
		foreach ($pathway->getPathway() as $pitem) {
			$item = new StdClass();
			$item->name = $this->escape($pitem->name);
			$item->link = KunenaRoute::_($pitem->link);
			if ($item->link) $this->pathway[] = $item;
		}

		$result = $this->loadTemplate($tpl);
		if (JError::isError($result)) {
			return $result;
		}
		echo $result;
	}
开发者ID:rich20,项目名称:Kunena,代码行数:59,代码来源:view.html.php

示例3: _buildDataObject

 /**
  * Create and return the pagination data object.
  *
  * @return	object	Pagination data object.
  * @since	Joomla 1.6
  */
 public function _buildDataObject()
 {
     // Initialise variables.
     $data = new stdClass();
     // Build the additional URL parameters string.
     $uri = KunenaRoute::normalize($this->_uri, true);
     if (!$uri) {
         $uri = JUri::getInstance();
     }
     $uri->delVar('start');
     $uri->delVar('limitstart');
     $uri->delVar('limit');
     if (!empty($this->_additionalUrlParams)) {
         foreach ($this->_additionalUrlParams as $key => $value) {
             $uri->setVar($key, $value);
         }
     }
     $data->pages = array();
     $range = range($this->get('pages.start'), $this->get('pages.stop'));
     $range[] = 1;
     $range[] = $this->get('pages.total');
     sort($range);
     foreach ($range as $i) {
         $offset = ($i - 1) * $this->limit;
         $data->pages[$i] = new JPaginationObject($i, $this->prefix);
         if ($i != $this->get('pages.current') || $this->_viewall) {
             $uri->setVar($this->prefix . 'limitstart', $offset);
             $data->pages[$i]->base = $offset;
             $data->pages[$i]->link = KunenaRoute::_($uri);
         }
     }
     return $data;
 }
开发者ID:laiello,项目名称:senluonirvana,代码行数:39,代码来源:pagination.php

示例4: getPaginationObject

 function getPaginationObject($maxpages)
 {
     $pagination = new KunenaPagination($this->total, $this->state->get('list.start'), $this->state->get('list.limit'));
     $pagination->setDisplayedPages($maxpages);
     $uri = KunenaRoute::normalize(null, true);
     if ($uri) {
         $uri->delVar('mesid');
         $pagination->setUri($uri);
     }
     return $pagination;
 }
开发者ID:Jougito,项目名称:DynWeb,代码行数:11,代码来源:view.html.php

示例5: getPagination

 function getPagination($maxpages)
 {
     $uri = KunenaRoute::normalize(null, true);
     if ($uri) {
         $uri->delVar('mesid');
     }
     $pagination = new KunenaHtmlPagination($this->total, $this->state->get('list.start'), $this->state->get('list.limit'));
     $pagination->setDisplay($maxpages, $uri);
     return $pagination->getPagesLinks();
 }
开发者ID:laiello,项目名称:senluonirvana,代码行数:10,代码来源:view.html.php

示例6: defined

<?php
/**
 * Kunena Component
 * @package     Kunena.Template.Crypsis
 * @subpackage  Pages.Announcement
 *
 * @copyright   (C) 2008 - 2016 Kunena Team. All rights reserved.
 * @license     http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link        https://www.kunena.org
 **/
defined('_JEXEC') or die;

$content = $this->execute('Announcement/Edit');

$this->addBreadcrumb(
	JText::_('COM_KUNENA_ANN_ANNOUNCEMENTS'),
	'index.php?option=com_kunena&view=announcement&layout=list'
);
$this->addBreadcrumb(
	JText::_('COM_KUNENA_EDIT'),
	KunenaRoute::normalize()
);

echo $content;
开发者ID:BillVGN,项目名称:PortalPRP,代码行数:24,代码来源:default.php

示例7: defined

<?php

/**
 * Kunena Component
 * @package     Kunena.Template.Crypsis
 * @subpackage  Pages.Announcement
 *
 * @copyright   (C) 2008 - 2015 Kunena Team. All rights reserved.
 * @license     http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link        http://www.kunena.org
 **/
defined('_JEXEC') or die;
$this->addBreadcrumb(JText::_('COM_KUNENA_ANN_ANNOUNCEMENTS'), KunenaRoute::normalize("index.php?option=com_kunena&view=announcement&layout=list"));
echo $this->subRequest('Announcement/List');
?>

<div class="clearfix"></div>

开发者ID:anawu2006,项目名称:PeerLearning,代码行数:17,代码来源:default.php

示例8: defined

<?php

/**
 * Kunena Component
 * @package     Kunena.Template.Crypsis
 * @subpackage  Pages.Announcement
 *
 * @copyright   (C) 2008 - 2015 Kunena Team. All rights reserved.
 * @license     http://www.gnu.org/copyleft/gpl.html GNU/GPL
 * @link        http://www.kunena.org
 **/
defined('_JEXEC') or die;
$content = $this->execute('Announcement/Edit');
$this->addBreadcrumb(JText::_('COM_KUNENA_ANN_ANNOUNCEMENTS'), 'index.php?option=com_kunena&view=announcement&layout=list');
$this->addBreadcrumb(JText::_('COM_KUNENA_EDIT'), KunenaRoute::normalize());
echo $content;
开发者ID:giabmf11,项目名称:Kunena-Forum,代码行数:16,代码来源:default.php

示例9: displayBreadcrumb

 function displayBreadcrumb($tpl = null)
 {
     if ($this->offline) {
         return;
     }
     $catid = JRequest::getInt('catid', 0);
     $id = JRequest::getInt('id', 0);
     $view = JRequest::getWord('view', 'default');
     $layout = JRequest::getWord('layout', 'default');
     $this->breadcrumb = $pathway = $this->app->getPathway();
     $active = $this->app->getMenu()->getActive();
     if (empty($this->pathway)) {
         KunenaFactory::loadLanguage('com_kunena.sys', 'admin');
         if ($catid) {
             $parents = KunenaForumCategoryHelper::getParents($catid);
             $parents[$catid] = KunenaForumCategoryHelper::get($catid);
             // Remove categories from pathway if menu item contains/excludes them
             if (!empty($active->query['catid']) && isset($parents[$active->query['catid']])) {
                 $curcatid = $active->query['catid'];
                 while (($item = array_shift($parents)) !== null) {
                     if ($item->id == $curcatid) {
                         break;
                     }
                 }
             }
             foreach ($parents as $parent) {
                 $pathway->addItem($this->escape($parent->name), KunenaRoute::normalize("index.php?option=com_kunena&view=category&catid={$parent->id}"));
             }
         }
         if ($view == 'announcement') {
             $pathway->addItem(JText::_('COM_KUNENA_ANN_ANNOUNCEMENTS'), KunenaRoute::normalize("index.php?option=com_kunena&view=announcement&layout=list"));
         } elseif ($id) {
             $topic = KunenaForumTopicHelper::get($id);
             $pathway->addItem($this->escape($topic->subject), KunenaRoute::normalize("index.php?option=com_kunena&view=category&catid={$catid}&id={$topic->id}"));
         }
         if ($view == 'topic') {
             $active_layout = !empty($active->query['view']) && $active->query['view'] == 'topic' && !empty($active->query['layout']) ? $active->query['layout'] : '';
             switch ($layout) {
                 case 'create':
                     if ($active_layout != 'create') {
                         $pathway->addItem($this->escape(JText::_('COM_KUNENA_MENU_TOPIC_CREATE'), KunenaRoute::normalize()));
                     }
                     break;
                 case 'reply':
                     if ($active_layout != 'reply') {
                         $pathway->addItem($this->escape(JText::_('COM_KUNENA_MENU_TOPIC_REPLY'), KunenaRoute::normalize()));
                     }
                     break;
                 case 'edit':
                     if ($active_layout != 'edit') {
                         $pathway->addItem($this->escape(JText::_('COM_KUNENA_MENU_TOPIC_EDIT'), KunenaRoute::normalize()));
                     }
                     break;
             }
         }
     }
     $this->pathway = array();
     foreach ($pathway->getPathway() as $pitem) {
         $item = new StdClass();
         $item->name = $this->escape($pitem->name);
         $item->link = KunenaRoute::_($pitem->link);
         if ($item->link) {
             $this->pathway[] = $item;
         }
     }
     $result = $this->loadTemplateFile($tpl, array('pathway' => $this->pathway));
     if (JError::isError($result)) {
         return $result;
     }
     echo $result;
 }
开发者ID:r-ahmadi,项目名称:Kunena-Forum,代码行数:71,代码来源:view.html.php


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