Esempio n. 1
0
 /**
  * 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;
 }
Esempio n. 2
0
	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;
	}
Esempio n. 3
0
 /**
  * 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;
 }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
 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();
 }
Esempio n. 6
0
<?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;
Esempio n. 7
0
<?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>

Esempio n. 8
0
<?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;
$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>

Esempio n. 9
0
<?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;
Esempio n. 10
0
 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;
 }