<?php
/*
This file is part of POOF.
POOF is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
POOF is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with POOF; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
require_once(dirname(__FILE__) . "/Bread_Crumb.class.php");
/**
* A Bread Crumb Navigation Class.
* @package poof
* @subpackage Bread_Crumb
* @author Brian Takita <hide@address.com>
* @version 0.4
* @since Version 0.3.0
**/
class mod_Bread_Crumb {
/**
* @var Bread_Crumb The Bread Crumb object.
*/
var $mod_bread_crumb;
/**
* @var string The template variable name that the Bread Crumb will be placed in.
*/
var $mod_bread_crumb_var;
/**
* Initialises the Bread_Crumb module in the Page class.
* @param string $bread_crumb_var The template variable name that the Bread Crumb will be placed in.
* @see $mod_bread_crumb_var
*/
function mod_Bread_Crumb($bread_crumb_var = "Bread_Crumb") {
$this->mod_bread_crumb_var = $bread_crumb_var;
$this->mod_bread_crumb = new Bread_Crumb();
}
/**
* Set a bread crumb representing the Page class on the website.
*
* @param string $title The title of the Bread Crumb.
* @param string $url The url of the Bread Crumb.
*/
function set_bread_crumb($title, $url) {
$this->mod_bread_crumb->add($title, $this->get_url($url));
}
/**
* This function will be prepended to the rest of the parse method. To place it into the Page class use:
* <code>function parse() {
* mod_Bread_Crumb::parse();
* Page::parse();
* }</code>
*/
function parse() {
$this->set_global_var($this->mod_bread_crumb_var, $this->mod_bread_crumb->parse());
}
}
?>