/** * Get the select box of categories * * @param bool|string parent type. Can be 'article', 'page', etc. * @param bool|string parent ID. * */ public function get_select($parent = FALSE, $id_parent = FALSE) { // Get data formed to feed the category select box $categories = $this->category_model->get_categories_select(); // Get the current categories for the element $current_categories = FALSE; if ($parent && $id_parent) { $current_categories = $this->category_model->get_joined_items_keys('category', $parent, $id_parent); } // Outputs the categories form dropdown $this->template['categories'] = form_dropdown('categories[]', $categories, $current_categories, 'class="select w100p" multiple="multiple"'); $this->output('category/select'); // $this->xhr_output(form_dropdown('categories[]', $categories, $current_categories, 'class="select w100p" multiple="multiple"')); }