예제 #1
0
 /**
  * Register Edit dictionary word form data
  *
  * @access	private
  * @param   object 	$obj word object
  * @param   array 	$_post _POST array
  * @return  void
  */
 private function editing($obj, $_post)
 {
     $msg = null;
     // check permission
     $msg = AdmUtils_helper::chk_priv_level($_SESSION['xuid'], 'dictionary', $_post['id'], 2);
     if (is_null($msg)) {
         // handle _post
         $post = array('xval' => nl2br(trim($_post['xval'])));
         // update
         $dict = new Dictionary_model();
         $result = $dict->update($_post['id'], $post);
         // set message
         $msg = AdmUtils_helper::set_msg($result);
         // set what update
         if ($result[1]) {
             APC && apc_delete(SITE . 'dict' . $obj->area . $obj->lang . $obj->what);
             $msg->update[] = array('element' => 'tdown', 'url' => BASE_URL . 'dictionary/keys/' . $obj->lang . '/' . $obj->area . '/' . $obj->what, 'title' => null);
         }
     }
     $this->response($msg);
 }