function modify($id = NULL) { check_admin(); $data = NULL; if ($id) { $pro = $this->pro->load_item(intval($id)); if (!$pro) { info_page(_text('system_error_id')); } if ($pro['u2_uid'] != _sess('u2_uid') && !is_admin()) { info_page(_text('system_limit_rights')); } $data['pro'] = $pro; $data['added'] = null; $data['cates'] = load_cates(); $meta_field = $this->pro->load_meta_field($data['pro']['u2_cate']); if ($meta_field) { foreach ($meta_field as $m) { $temp['key'] = $m['u2_en_name']; $temp['value'] = $data['pro'][$m['u2_en_name']]; $temp['name'] = $m['u2_cn_name']; $data['added'][] = $temp; } } } else { info_page(_text('system_error_id')); } $this->view('modify', $data); }
function cates($action = NULL) { $this->check_admin(); if ($action == 'save') { $this->admin->cate_do_action(v('do_action'), v('cate_id'), v('cate_name')); } $data['cates'] = load_cates(); $this->view('cates', $data); }