/** * Change status * * @param string $what field to change * @param integer $id ID of the item to change * @param integer $value value to set (0 = off, 1 = on) * @return void */ public function set($what, $id, $value = 0) { $msg = null; $mod = new Widget_model(); $id_user = $mod->get_var($id, 'widgets', 'id_user'); if ($id_user != $_SESSION['xuid']) { $msg = AdminUtils::set_msg(false, '', $this->dict->get_word('_NOT_PERMITTED', 'msg')); } if (is_null($msg)) { $qs = X4Route_core::get_query_string(); // do action $mod = new Widget_model(); $result = $mod->update($id, array($what => $value)); // set message $this->dict->get_words(); $msg = AdmUtils_helper::set_msg($result); // set update if ($result[1]) { $msg->update[] = array('element' => $qs['div'], 'url' => urldecode($qs['url']), 'title' => null); } } $this->response($msg); }