name."_".$page[0].'.html') && $TeKe->plugin->is_test_constructor()) { $this->setTemplate($this->name."_".$page[0]); } else { $this->setTemplate("page_not_found"); } } public function setNavigation() { global $TeKe; if (!$TeKe->plugin->is_test_constructor()) { return ""; } $this->navigation []= array('title'=>_('Items'), 'url'=>"items/view", 'current'=>$this->is_current_page($this->page[0], "view")); //if ($TeKe->is_admin()) { $context = $TeKe->plugin->context; if ($TeKe->plugin->context) { $actions = $TeKe->plugin->context->getActions(); $current_context = "add"; if (isset($this->page[2])) { $current_context = $this->page[2]; } foreach ($actions as $action => $item) { $url = "items/{$context->getType()}/".$this->page[1]."/".$action; if ($action == "add") { $url = "items/{$context->getType()}/".$action; } $this->navigation []= array( 'title'=>$item["title"], 'disabled'=>$item["disabled"], 'url'=>$url, 'current'=>$this->is_current_page($current_context, $action) ); } } else { $this->navigation []= array('title'=>_('Add New'), 'url'=>"items/add", 'current'=>$this->is_current_page($this->page[0], "add")); $this->navigation []= array('title'=>_('Import'), 'url'=>"items/import", 'current'=>$this->is_current_page($this->page[0], "import")); } //} } } ?>