function render() { switch (@$_GET["type"]) { case 'Content': $this->type = 'Content'; break; case 'Default': default: $this->type = 'Default'; } if (@$_GET['a'] == "edit" && !empty($_GET['cat_id'])) { $edit_cat = new Category(); $edit_cat->category_id = $_GET['cat_id']; $edit_cat->load(); $this->edit_title = $edit_cat->name; $this->edit_desc = $edit_cat->description; $this->cat_id = $edit_cat->category_id; $this->type = $edit_cat->type; $parent_id = $edit_cat->find_parent($edit_cat->category_id); $this->parent_id = $parent_id ? $parent_id : 0; if ($this->parent_id) { $edit_cat->category_id = $this->parent_id; $edit_cat->load(); $this->parent_name = $edit_cat->name; } else { $this->parent_name = ''; } } $this->categories = Category::build_all_category_list('', '', '', $this->type); $category = Category::build_root_list(NULL, $this->type); if (is_array($category)) { foreach ($category as $catg) { $this->get_childs($catg); } } $this->inner_HTML = $this->generate_inner_html(); $content = parent::render(); return $content; }