/modules/mod_breadcrumbs/helper.php
PHP | 66 lines | 40 code | 7 blank | 19 comment | 6 complexity | 8848de2adcea59015a98feea041a3423 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
- <?php
- /**
- * @version $Id$
- * @package Joomla.Site
- * @subpackage mod_breadcrumbs
- * @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE.txt
- */
- // no direct access
- defined('_JEXEC') or die;
- class modBreadCrumbsHelper
- {
- function getList(&$params)
- {
- // Get the PathWay object from the application
- $app = &JFactory::getApplication();
- $pathway = &$app->getPathway();
- $items = $pathway->getPathWay();
- $count = count($items);
- for ($i = 0; $i < $count; $i ++)
- {
- $items[$i]->name = stripslashes(htmlspecialchars($items[$i]->name));
- $items[$i]->link = JRoute::_($items[$i]->link);
- }
- if ($params->get('showHome', 1))
- {
- $item = new stdClass();
- $item->name = $params->get('homeText', JText::_('Home'));
- $item->link = JURI::base();
- array_unshift($items, $item);
- }
- return $items;
- }
- /**
- * Set the breadcrumbs separator for the breadcrumbs display.
- *
- * @param string $custom Custom xhtml complient string to separate the
- * items of the breadcrumbs
- * @return string Separator string
- * @since 1.5
- */
- function setSeparator($custom = null)
- {
- $lang = &JFactory::getLanguage();
- // If a custom separator has not been provided we try to load a template
- // specific one first, and if that is not present we load the default separator
- if ($custom == null) {
- if ($lang->isRTL()){
- $_separator = JHtml::_('image', 'system/arrow_rtl.png', NULL, NULL, true);
- }
- else{
- $_separator = JHtml::_('image', 'system/arrow.png', NULL, NULL, true);
- }
- } else {
- $_separator = $custom;
- }
- return $_separator;
- }
- }