コード例 #1
0
 /**
  * Delete dictionary word
  *
  * @access	private
  * @param   object 	$obj Word object
  * @return  void
  */
 private function deleting($obj)
 {
     $msg = null;
     // check permission
     $msg = AdmUtils_helper::chk_priv_level($_SESSION['xuid'], 'dictionary', $obj->id, 4);
     if (is_null($msg)) {
         // do action
         $dict = new Dictionary_model();
         $result = $dict->delete($obj->id);
         // set message
         $msg = AdmUtils_helper::set_msg($result);
         // clear useless permissions
         if ($result[1]) {
             $perm = new Permission_model();
             $perm->deleting_by_what('dictionary', $obj->id);
             // set what update
             $msg->update[] = array('element' => 'tdown', 'url' => BASE_URL . 'dictionary/keys/' . $obj->lang . '/' . $obj->area . '/' . $obj->what, 'title' => null);
         }
     }
     $this->response($msg);
 }