public function index() { if ($this->registry["ui"]["admin"]) { $this->view->setTitle("Шаблоны"); $template = new Model_Template(); $list = $template->getTemplates(); if (isset($this->args[1])) { if ($this->args[1] == "add") { if (isset($_POST["submit"])) { $template->addTemplate($_POST); $this->view->refresh(array("timer" => "1", "url" => "objects/")); } else { $this->view->objects_templateadd(); } } elseif ($this->args[1] == "edit") { if (isset($this->args[2])) { if (isset($_POST["submit"])) { $template->editTemplate($this->args[2], $_POST); $this->view->refresh(array("timer" => "1", "url" => "objects/")); } else { $param = $template->getTemplate($this->args[2]); $this->view->objects_templateedit(array("post" => $param)); } } } elseif ($this->args[1] == "list") { $this->view->objects_templatelist(array("id" => $this->args[2])); } } else { $this->view->objects_templates(array("list" => $list)); } } $this->view->showPage(); }
public function index() { $this->view->setLeftContent($this->view->render("left_kb", array())); $advinfo = new Model_Ai(); $tpl = new Model_Template(); if (isset($this->get["history"])) { $this->view->setTitle("История"); $tasks = $this->registry["logs"]->getHistory("info", $this->get["history"]); foreach ($tasks as $task) { if ($task["param"][0]["key"]) { $this->view->history(array("obj" => $task)); } } } elseif (isset($_GET["tag"])) { $this->view->setTitle("Тег: " . htmlspecialchars($_GET["tag"])); $ai = $advinfo->getAIFromTag($_GET["tag"]); $this->view->setMainContent("<b>Тег:</b> " . htmlspecialchars($_GET["tag"])); foreach ($ai as $part) { $aiinfo = $advinfo->getaiinfo(); /* if ($ainfo = json_decode($part["val"], true)) { $part["val"] = null; foreach($ainfo as $key=>$val) { $part["val"] .= "<b>" . $key . "</b>: " . $val . "<br />"; } } */ $this->view->ai(array("ai" => $part, "info" => $aiinfo)); } } elseif (isset($this->args[1]) and $this->args[1] == "add") { $this->view->setTitle("Добавить информацию"); $this->view->kb_add(); } else { $this->view->setTitle("Теги"); $templates = $tpl->getTemplates(); $id = count($templates); $templates[$id]["id"] = 0; $templates[$id]["name"] = "Заметки"; $list = $advinfo->getAi(); for ($i = 0; $i < count($list); $i++) { if ($list[$i]["oid"] == "0") { $list[$i]["name"] = "Заметки"; } } $sortlist = array(); foreach ($templates as $template) { foreach ($list as $kb) { if ($kb["name"] == $template["name"]) { $sortlist[$template["name"]][] = $kb["tag"]; } } } $this->print_array($sortlist); $this->view->kb_tree(array("list" => $this->tree)); } $this->view->showPage(); }
public function index() { $this->view->setTitle("Просмотр"); $this->view->setLeftContent($this->view->render("left_objects", array())); $template = new Model_Template(); $list = $template->getTemplates(); $this->object->links = "/list"; $this->view->objects_find(array("list" => $this->templates, "templates" => $this->templates)); $this->view->showPage(); }
public function index() { if ($this->registry["ui"]["admin"]) { $this->view->setTitle("Управление объектами"); $template = new Model_Template(); $list = $template->getTemplates(); $this->view->objects_admin(array("list" => $list)); $this->view->showPage(); } }
public function index() { if ($this->registry["ui"]["admin"]) { $this->view->setTitle("Шаблоны"); $this->view->setLeftContent($this->view->render("left_objects", array())); $template = new Model_Template(); $list = $template->getTemplates(); $datatypes = $template->getDataTypes(); if (isset($this->args[1])) { if ($this->args[1] == "add") { if (isset($_POST["submit"])) { $template->addTemplate($_POST); $this->view->refresh(array("timer" => "1", "url" => "objects/admin/")); } else { $this->view->objects_templateadd(array("datatypes" => $datatypes)); } } elseif ($this->args[1] == "edit") { if (isset($this->args[2])) { if (isset($_POST["submit"])) { $template->editTemplate($this->args[2], $_POST); $this->view->refresh(array("timer" => "1", "url" => "objects/admin/")); } else { $param = $template->getTemplate($this->args[2]); $this->view->objects_templateedit(array("post" => $param, "datatypes" => $datatypes)); } } } elseif ($this->args[1] == "editview") { $param = $template->getTemplateView($this->args[2]); $this->view->objects_templateeditview(array("tid" => $this->args[2], "post" => $param, "datatypes" => $datatypes)); } elseif ($this->args[1] == "list") { $this->view->objects_templatelist(array("id" => $this->args[2])); } } else { $this->view->objects_templates(array("list" => $list)); } } $this->view->showPage(); }
public function index() { $this->view->setTitle("Просмотр"); $template = new Model_Template(); $list = $template->getTemplates(); $this->object->links = "/list"; $data = $this->object->getObjsTree(); $res_tree = null; foreach ($data as $part) { if (!isset($part["id"])) { if (isset($part["tname"])) { $template = "[" . $part["tname"] . "]"; $sub = $part["type_id"]; if (!isset($res_tree[$template][$sub][0])) { $res_tree[$template][$sub][0] = null; } } } } $this->print_array($res_tree); $this->view->objects_find(array("list" => $this->find, "tree" => $this->tree, "templates" => $this->templates)); $this->view->showPage(); }