*
*/
class Pages_Controller extends Template_Controller {
public $template = 'pages/base'; //defaults to template but you can set your own view file
public $auto_render = TRUE; //defaults to true, renders the template after the controller method is done
public function __construct()
{
parent::__construct(); //necessary
}
/**
* Generate lightbox markup
*
* @param array $images
*/
private function lightbox($images){
$output = '';
foreach ($images as $i){
$output .= '';
}
return $output;
}
public function index()
{
$this->template->title = 'Maemo5 application for car enthusiasts and speed freaks';
$this->template->header = 'Home';
$this->template->content = '
SpeedFreak is a free application for your mobile that allows you to measure your car\'s performance such as acceleration and top speed. In order to make it even
more interesting you can compete against others on our leaderboards to see who\'s car packs the most punch!
SpeedFreak is developed by group of enthusiastic programmers with passion for speed and OpenSource. If you want to get involved by contributing code, ideas, bug reports, translation and more just click on
community link!
';
$this->template->sidebar_title = 'SpeedFreak for Nokia N900';
$this->template->sidebar_content ='
Download SpeedFreak for Nokia N900.
'; } public function leaderboards($category='') { //@todo: Fix this hack. OMG what a horrible hack. That's what I get for coding at 4am =) $categories = array('acceleration-0-20' => 'Acceleration from 0 to 20 km/h', 'acceleration-0-40' => 'Acceleration from 0 to 40 km/h', 'acceleration-0-100'=> 'Acceleration from 0 to 100 km/h'); if (!array_key_exists($category,$categories)) $category='acceleration-0-100'; $this->template->title = $categories[$category]; $results = new Result_Model(); if ($rows=$results->get_results($category,10)){ $output = ''; foreach ($rows as $r){ $output .= 'Nick | Record (seconds) | Date |
Download SpeedFreak for Nokia N900.
'; } }