PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/mod_breadcrumbs/helper.php

https://github.com/joebushi/joomla
PHP | 66 lines | 40 code | 7 blank | 19 comment | 6 complexity | 8848de2adcea59015a98feea041a3423 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. <?php
  2. /**
  3. * @version $Id$
  4. * @package Joomla.Site
  5. * @subpackage mod_breadcrumbs
  6. * @copyright Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE.txt
  8. */
  9. // no direct access
  10. defined('_JEXEC') or die;
  11. class modBreadCrumbsHelper
  12. {
  13. function getList(&$params)
  14. {
  15. // Get the PathWay object from the application
  16. $app = &JFactory::getApplication();
  17. $pathway = &$app->getPathway();
  18. $items = $pathway->getPathWay();
  19. $count = count($items);
  20. for ($i = 0; $i < $count; $i ++)
  21. {
  22. $items[$i]->name = stripslashes(htmlspecialchars($items[$i]->name));
  23. $items[$i]->link = JRoute::_($items[$i]->link);
  24. }
  25. if ($params->get('showHome', 1))
  26. {
  27. $item = new stdClass();
  28. $item->name = $params->get('homeText', JText::_('Home'));
  29. $item->link = JURI::base();
  30. array_unshift($items, $item);
  31. }
  32. return $items;
  33. }
  34. /**
  35. * Set the breadcrumbs separator for the breadcrumbs display.
  36. *
  37. * @param string $custom Custom xhtml complient string to separate the
  38. * items of the breadcrumbs
  39. * @return string Separator string
  40. * @since 1.5
  41. */
  42. function setSeparator($custom = null)
  43. {
  44. $lang = &JFactory::getLanguage();
  45. // If a custom separator has not been provided we try to load a template
  46. // specific one first, and if that is not present we load the default separator
  47. if ($custom == null) {
  48. if ($lang->isRTL()){
  49. $_separator = JHtml::_('image', 'system/arrow_rtl.png', NULL, NULL, true);
  50. }
  51. else{
  52. $_separator = JHtml::_('image', 'system/arrow.png', NULL, NULL, true);
  53. }
  54. } else {
  55. $_separator = $custom;
  56. }
  57. return $_separator;
  58. }
  59. }