Exemplo n.º 1
0
 /**
  * Register Edit file form data
  *
  * @access	private
  * @param   array 	$_post _POST array
  * @return  void
  */
 private function editing($_post)
 {
     $msg = null;
     // check permission
     $msg = AdmUtils_helper::chk_priv_level($_SESSION['xuid'], 'files', $_post['id'], 2);
     if (is_null($msg)) {
         // handle _post
         $post = array('category' => X4Utils_helper::unspace($_post['category']), 'subcategory' => X4Utils_helper::unspace($_post['subcategory']), 'alt' => $_post['alt']);
         // do action
         $mod = new File_model();
         $result = $mod->update($_post['id'], $post);
         // set message
         $msg = AdmUtils_helper::set_msg($result);
         // set what update
         if ($result[1]) {
             $msg->update[] = array('element' => 'topic', 'url' => BASE_URL . 'files/index/' . $_post['id_area'] . '/' . $post['category'] . '/' . $post['subcategory'], 'title' => null);
         }
     }
     $this->response($msg);
 }