[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tep-commits
Subject:    [TEP-COMMIT] CVS: catalog/catalog/includes/classes breadcrumb.php,NONE,1.1
From:       Harald Ponce de Leon <hpdl () users ! sourceforge ! net>
Date:       2002-07-21 23:39:00
[Download RAW message or body]

Update of /cvsroot/tep/catalog/catalog/includes/classes
In directory usw-pr-cvs1:/tmp/cvs-serv17953/includes/classes

Added Files:
	breadcrumb.php 
Log Message:
replaced the $location parsing logic with a new flexible 'breadcrumb' object

--- NEW FILE: breadcrumb.php ---
<?php
/*
  $Id: breadcrumb.php,v 1.1 2002/07/21 23:38:58 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2002 osCommerce

  Released under the GNU General Public License
*/

  class breadcrumb {
    var $trail;

    function breadcrumb() {
      $this->reset();
    }

    function reset() {
      $this->trail = array();
    }

    function add($title, $link = '') {
      $this->trail[] = array('title' => $title, 'link' => $link);
    }

    function trail($separator = ' - ') {
      $trail_string = '';
      $trail_size = sizeof($this->trail);

      for ($i=0; $i<$trail_size; $i++) {
        if (tep_not_null($this->trail[$i]['link'])) {
          $trail_string .= '<a href="' . $this->trail[$i]['link'] . '" \
class="headerNavigation">' . $this->trail[$i]['title'] . '</a>';  } else {
          $trail_string .= $this->trail[$i]['title'];
        }

        if (($i+1) < $trail_size) $trail_string .= $separator;
      }

      return $trail_string;
    }
  }
?>



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Tep-commits mailing list
Tep-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tep-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic