public function form() { $view = new Template('search/search'); $view->load_data('servers', Navigation::$servers); $view->load_data('backend', $this->app->site_url('search/results/')); $view->render(); }
public function form($post = array()) { $view = new Template('search/search'); $view->load_data('servers', Navigation::$servers); if (!empty($post)) { $view->load_data('players', $post['player']); $view->load_data('connective', $post['connective']); } $view->render(); }
public static function pagination($page, $count, $baseurl) { $buttons = array(); if ($page > 1) { $pages[] = $page - 1; } $show = 4; $max = ceil($count / Game::$pagesize); $first = floor($page - $show / 2); $first = $first < 1 ? 1 : $first; $last = ceil($page + $show / 2); $last = $last > $max ? $max : $last; $pag = new Template('pagination'); $pag->load_data(array('baseurl' => $baseurl, 'current' => $page, 'max' => $max, 'pages' => range($first, $last))); return $pag->render(true); }
protected function output() { switch ($this->outputmode) { case self::OUTPUTMODE_TEMPLATE: header("Content-type: text/html"); $view = new Template('master'); $view->load_data(array('title' => $this->config->get('title'), 'description' => $this->config->get('description'), 'content' => $this->app_output, 'navigation' => $this->navi->render())); $view->render(); break; case self::OUTPUTMODE_JSON: header("Content-type: application/json"); echo $this->app_output; break; case self::OUTPUTMODE_CSS: header("Content-type: text/css"); echo $this->app_output; break; case self::OUTPUTMODE_JAVASCRIPT: header("Content-type: application/javascript"); echo $this->app_output; break; case self::OUTPUTMODE_RSS: header("Content-type: application/rss+xml"); echo $this->app_output; break; case self::OUTPUTMODE_PLAIN: header("Content-type: text/plain"); case self::OUTPUTMODE_NORMAL: echo $this->app_output; break; default: throw new Exception("Unknown output mode ({$this->outputmode})"); echo $this->app_output; break; } }