function update($id, $data = array()) { $this_item = $this->get_one($id); check_allowed_category($this_item['category_id'], LZ_RESPONSE == 'text'); if ($data['category_id']) { check_allowed_category($data['category_id'], LZ_RESPONSE == 'text'); } return parent::update($id, $data); }
function update($id, $data = array()) { check_allowed_category($id, END_RESPONSE == 'text'); if (!$data['update_time']) { $data['update_time'] = time(); } if (isset($data['url'])) { $data['url'] = $this->unique_url($data['url'], $id); } $re = parent::update($id, $data); if ($re && $data['url'] && defined('MAKE_HTML') && MAKE_HTML) { end_mkdir(END_ROOT . $data['url']); } return $re; }
function update($id, $data) { global $cache; check_allowed_category($id, LZ_RESPONSE == 'text'); if ($data['status'] == 2) { include_once LZ_BASEPATH . 'model/item.php'; $item = new LZ_Item(); if (!$item->exists(array('status' => 3, 'category_id' => $id))) { $data['item_id'] = $item->add(array('category_id' => $id, 'status' => 3, 'publish_time' => time())); } else { $this_item = $item->get_one(array('status' => 3, 'category_id' => $id)); $data['item_id'] = $this_item['item_id']; } } $re = parent::update($id, $data); $cache->clear_uri('#admin/category'); return $re; }