[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 breadcrumb.php

Zen Cart 源代码 breadcrumb.php




下载文件

文件名: breadcrumb.php
文件类型: PHP文件
文件大小: 2.41 KiB
MD5: 081cb58170740f8dcfdc4a37ee0f66c7

breadcrumb.php - 关闭高亮
  1. <?php
  2. /**
  3.  * breadcrumb Class.
  4.  *
  5.  * @package classes
  6.  * @copyright Copyright 2003-2006 Zen Cart Development Team
  7.  * @copyright Portions Copyright 2003 osCommerce
  8.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  9.  * @version $Id: breadcrumb.php 3147 2006-03-10 00:43:57Z drbyte $
  10.  */
  11. if (!defined('IS_ADMIN_FLAG')) {
  12.   die('Illegal Access');
  13. }
  14.  
  15. /**
  16.  * The following switch simply checks to see if the setting is already defined, and if not, sets it to true
  17.  * If you desire to have the older behaviour of having all product and category items in the breadcrumb be shown as links
  18.  * then you should add a define() for this item in the extra_datafiles folder and set it to 'false' instead of 'true':
  19.  */
  20. if (!defined('DISABLE_BREADCRUMB_LINKS_ON_LAST_ITEM')) define('DISABLE_BREADCRUMB_LINKS_ON_LAST_ITEM','true');
  21.  
  22. /**
  23.  * breadcrumb Class.
  24.  * Class to handle page breadcrumbs
  25.  *
  26.  * @package classes
  27.  */
  28. class breadcrumb extends base {
  29.   var $_trail;
  30.  
  31.   function breadcrumb() {
  32.     $this->reset();
  33.   }
  34.  
  35.   function reset() {
  36.     $this->_trail = array();
  37.   }
  38.  
  39.   function add($title, $link = '') {
  40.     $this->_trail[] = array('title' => $title, 'link' => $link);
  41.   }
  42.  
  43.   function trail($separator = '&nbsp;&nbsp;') {
  44.     $trail_string = '';
  45.  
  46.     for ($i=0, $n=sizeof($this->_trail); $i<$n; $i++) {
  47. //    echo 'breadcrumb ' . $i . ' of ' . $n . ': ' . $this->_trail[$i]['title'] . '<br />';
  48.       $skip_link = false;
  49.           if ($i==($n-1) && DISABLE_BREADCRUMB_LINKS_ON_LAST_ITEM =='true') {
  50.         $skip_link = true;
  51.       }
  52.       if (isset($this->_trail[$i]['link']) && zen_not_null($this->_trail[$i]['link']) && !$skip_link ) {
  53.         // this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
  54.         if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
  55.           $trail_string .= '  <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . $this->_trail[$i]['title'] . '</a>';
  56.         } else {
  57.           $trail_string .= '  <a href="' . $this->_trail[$i]['link'] . '">' . $this->_trail[$i]['title'] . '</a>';
  58.         }
  59.       } else {
  60.         $trail_string .= $this->_trail[$i]['title'];
  61.       }
  62.  
  63.       if (($i+1) < $n) $trail_string .= $separator;
  64.       $trail_string .= "\n";
  65.     }
  66.  
  67.     return $trail_string;
  68.   }
  69.  
  70.   function last() {
  71.     $trail_size = sizeof($this->_trail);
  72.     return $this->_trail[$trail_size-1]['title'];
  73.   }
  74. }
  75. ?>


cron