_type = $type; $this->_title = $title; $this->_parents = $parents; $this->_url = ($url) ? $url : $_SERVER['REQUEST_URI']; } function isParent(&$crumb) { return in_array($crumb->getType(), $this->_parents); } // For template compatibility function get($key) { $method = 'get' . camelize($key); $ret = ''; if (method_exists($this, $method)) { $ret = $this->$method(); } return $ret; } function getTitle() { return $this->_title; } function getType() { return $this->_type; } function getUrl() { return $this->_url; } } class k4RootCrumb extends k4Crumb { function k4RootCrumb() { parent::k4Crumb('index', "Forum Index", array(), k4_url('/')); } function isParent(&$crumb) { return FALSE; } } class k4BreadCrumbs { var $_crumbs = array(); function add(&$crumb) { for ($i = count($this->_crumbs) - 1; $i >= 0; $i--) { if ($crumb->isParent($this->_crumbs[$i])) { break; } array_pop($this->_crumbs); } $this->_crumbs[] = &$crumb; } function &getIterator() { $it = &new FAArrayIterator($this->_crumbs); return $it; } } ?>