theme_name = $theme_name; $this->template = $template; } public function url($path) { return url::base() . "themes/{$this->theme_name}/$path"; } public function item() { return $this->template->item; } public function display($page_name, $view_class="View") { return new $view_class($page_name); } public function pager() { $this->pagination = new Pagination(); $this->pagination->initialize( array('query_string' => 'page', 'total_items' => $this->template->item->children_count(), 'items_per_page' => $this->template->page_size, 'style' => 'classic')); return $this->pagination->render(); } public function module($module_name) { $module = module::get($module_name); return $module->loaded ? $module : null; } public function in_place_edit() { return new View("in_place_edit.html"); } }