/** * generate the title for the page * * @param string title Existing title (i.e. generated by modules) * @return string Title for the page * @author Elias Müller **/ protected function generateTitle($title = '') { switch ($this->s->action) { case 'list': $title = 'Tische'; break; } return parent::generateTitle($title); }
/** * generate the title for the page * * @param string title Existing title (i.e. generated by modules) * @return string Title for the page * @author Elias Müller **/ protected function generateTitle($title = '') { switch ($this->s->action) { case 'list': $title = 'Benutzer'; break; case 'logout': $title = 'Anmeldung'; break; } return parent::generateTitle($title); }
/** * generate the title for the page * * @param string title Existing title (i.e. generated by modules) * @return string Title for the page * @author Elias Müller **/ protected function generateTitle($title = '') { switch ($this->s->action) { case 'play': $title = 'Spielen'; break; case 'tables': $title = 'Tische'; break; case 'spots': $title = 'Spots'; break; case 'archive': $title = 'Spielarchiv'; break; } return parent::generateTitle($title); }
/** * Build the requestet HTML file */ protected function buildSite($content = '', $clean = false) { if ($this->s->post['call'] == 'ajax') { if (empty(Error::$messages)) { echo $content; } else { foreach (Error::$messages as $type => $texts) { $err = ''; foreach ($texts as $message) { $err .= '<p>' . $message . '</p>'; } $errors .= '<div class="' . $type . '">' . $err . '</div>'; } echo $errors; } } else { $tpl = new Template(); if ($this->s->auth()) { $title = $this->generateTitle(); $m = $this->generateNav(); $b = $this->generateToolbar(); } else { // user is not logged in, so display login form $tpl->assign('path', $this->s->action == 'logout' ? '' : $this->s->getPath()); $tpl->assign('username', $this->s->post['username']); $tpl->assign('password', $this->s->post['password']); $content = $tpl->fetch('login.html'); $title = BackendController::generateTitle('Anmeldung'); } $tpl->assign('title', $title); // $title should be string $tpl->assign('nav', $m['main']); // $nav should be array of links/titles/attributes $tpl->assign('subnav', $m['sub']); // $subnav dito $tpl->assign('path', $this->s->getPath()); $tpl->assign('user', $this->s->user); $tpl->assign('clean', $clean); $tpl->assign('messages', Error::$messages); $tpl->assign('buttons', $b); // buttons for right toolbar $tpl->assign('content', $content); // $content should be a single string $tpl->display('!.html'); } }