Source for file helper.php

Documentation is available at helper.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Site
  4.  * @subpackage  mod_breadcrumbs
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * Helper for mod_breadcrumbs
  14.  *
  15.  * @package     Joomla.Site
  16.  * @subpackage  mod_breadcrumbs
  17.  * @since       1.5
  18.  */
  19. {
  20.     public static function getList(&$params)
  21.     {
  22.         // Get the PathWay object from the application
  23.         $app        JFactory::getApplication();
  24.         $pathway    $app->getPathway();
  25.         $items        $pathway->getPathWay();
  26.  
  27.         $count count($items);
  28.  
  29.         // Don't use $items here as it references JPathway properties directly
  30.         $crumbs    array();
  31.         for ($i 0$i $count$i ++)
  32.         {
  33.             $crumbs[$inew stdClass;
  34.             $crumbs[$i]->name stripslashes(htmlspecialchars($items[$i]->nameENT_COMPAT'UTF-8'));
  35.             $crumbs[$i]->link JRoute::_($items[$i]->link);
  36.         }
  37.  
  38.         if ($params->get('showHome'1))
  39.         {
  40.             $item new stdClass;
  41.             $item->name htmlspecialchars($params->get('homeText'JText::_('MOD_BREADCRUMBS_HOME')));
  42.             $item->link JRoute::_('index.php?Itemid=' $app->getMenu()->getDefault()->id);
  43.             array_unshift($crumbs$item);
  44.         }
  45.  
  46.         return $crumbs;
  47.     }
  48.  
  49.     /**
  50.      * Set the breadcrumbs separator for the breadcrumbs display.
  51.      *
  52.      * @param   string    $custom    Custom xhtml complient string to separate the
  53.      *  items of the breadcrumbs
  54.      * @return  string    Separator string
  55.      * @since   1.5
  56.      */
  57.     public static function setSeparator($custom null)
  58.     {
  59.         $lang JFactory::getLanguage();
  60.  
  61.         // If a custom separator has not been provided we try to load a template
  62.         // specific one first, and if that is not present we load the default separator
  63.         if ($custom == null)
  64.         {
  65.             if ($lang->isRTL())
  66.             {
  67.                 $_separator JHtml::_('image''system/arrow_rtl.png'nullnulltrue);
  68.             }
  69.             else
  70.             {
  71.                 $_separator JHtml::_('image''system/arrow.png'nullnulltrue);
  72.             }
  73.         }
  74.         else
  75.         {
  76.             $_separator htmlspecialchars($custom);
  77.         }
  78.  
  79.         return $_separator;
  80.     }
  81. }

Documentation generated on Tue, 19 Nov 2013 15:04:17 +0100 by phpDocumentor 1.4.3