/** * Инициализация управления категориями * @return null */ public function init() { $admin_file = globals::g('admin_file'); lang::o()->get('admin/cats'); $act = $_GET['act']; $type = $_GET['type']; if (!$type || !$this->cats->change_type($type)) { $type = 'content'; } tpl::o()->assign('oldadmin_file', $admin_file); $admin_file .= '&type=' . $type; globals::s('admin_file', $admin_file); tpl::o()->assign('admin_file', $admin_file); tpl::o()->assign('cat_type', $type); switch ($act) { case "add": case "edit": try { $this->add((int) $_GET['id'], $act == "add"); } catch (EngineException $e) { $e->defaultCatch(true); } break; case "save": $this->save($type, $_POST); break; default: $this->show(); break; } }