本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
示例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>
示例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;
示例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;
}