Files
handbrake-cluster-webui/HandBrakeCluster/Page.class.php
Ben Roberts 23a5590131 Job details page shows the job id, fixed bug
Job details page now shows the id number for the current job, reading it
from the URL using the RequestParser
Fixed a bug where if no query string was provided (index.php was
accessed directly) then a blank pagename was used (instead of 'home') and an
exception was thrown.
2010-03-17 02:49:57 +00:00

42 lines
930 B
PHP

<?php
class HandBrakeCluster_Page {
private $smarty;
private $request;
private $page;
public function __construct(Smarty $smarty, HandBrakeCluster_RequestParser $request) {
$this->smarty = $smarty;
$this->request = $request;
$this->page = $request->page();
}
public function page() {
return $this->page;
}
public function template_filename() {
$template_filename = $this->page . '.tpl';
if (!$this->smarty->template_exists($template_filename)) {
$template_filename = 'home.tpl';
}
return $template_filename;
}
public function evaluate() {
$code_filename = 'pages/' . $this->page . '.php';
if (!file_exists($code_filename)) {
throw new Exception("Template code file does not exist: '$code_filename'");
}
eval("include '$code_filename';");
}
};
?>