Location: PHPKode > projects > toKernel > tokernel.1.0.6/tokernel.framework/addons/test/modules/breadcrumbs.module.php
<?php

 /**
  * Breadcrumbs module
  */

/* Restrict direct access to this file */
defined('TK_EXEC') or die('Restricted area.');

 class breadcrumbs_module extends module {

 private $bc = array();
 
 public function __construct($attr, $id_addon, $config, $log, $language) {
	parent::__construct($attr, $id_addon, $config, $log, $language);
 }

 public function add($label, $url = NULL) {
	$this->bc[$label] = $url;
 }
 
 public function remove($label) {
	if(isset($this->bc[$label])) {
		unset($this->bc[$label]);
		return true;
	} else {
		return false;
	}
 }
 
 public function run() {
	
	$buffer = '';
	
	foreach($this->bc as $label => $url) {
		
		if($url != '') {
			$buffer .= '<a href="'.$url.'">' . $label . '</a>';
		} else {
			$buffer .= $label;
		}
		
	}
	
	return $buffer;
	
 }

}
?>
Return current item: toKernel