/** * Add page to breadcrumb queue * * @uses $_[SESSION] * @uses session_id() * @uses Wakka::GetConfigValue() * @uses Config::$num_breadcrumb_nodes * @uses Config::$enable_breadcrumbs */ function AddBreadcrumb($page) { if (0 != $this->GetConfigValue('enable_breadcrumbs')) { if (isset($_SESSION['breadcrumbs'])) { $q = new SplQueue(); $q->unserialize($_SESSION['breadcrumbs']); if ($page != $q->top()) { while ($q->count() >= $this->GetConfigValue('num_breadcrumb_nodes')) { $q->dequeue(); } $q->enqueue($page); $_SESSION['breadcrumbs'] = $q->serialize(); } } else { if (isset($_SESSION['user'])) { $q = new SplQueue(); $q->enqueue($page); $_SESSION['breadcrumbs'] = $q->serialize(); } } } }