function menuData($pos, $parentID = '0') { $CI =& get_instance(); $menu = getTerms('menu_' . $pos . "_" . getThemeActive(), $parentID, 'order_term ASC'); if (!empty($menu)) { return $menu; } else { return null; } }
function editlink() { $title = $this->input->post('title'); $url = $this->input->post('url'); $menu = $this->input->post('menu'); $pos = $this->input->post('pos'); $parent = $this->input->post('parent'); $slug = stringCreateSlug($title); $jsondata = json_encode(array('create' => dateNow(TRUE), 'relasi' => 'link', 'value' => $url)); //updateTerms($menu,'menu_'.$pos,$title,$slug."_menu","",$parent,$jsondata); $tipe = "menu_" . $pos . "_" . getThemeActive(); $catSlug = dbField('terms', 'term_id', $menu, 'slug'); updateTerms($menu, $tipe, $title, $catSlug, "", $parent, $jsondata); echo json_encode('ok'); }