示例#1
0
 /**
  * Uninstalling template
  *
  * @access	private
  * @param   array 	$_post _POST array
  * @return  void
  */
 private function uninstalling($_post)
 {
     $msg = null;
     // check permission
     $msg = AdmUtils_helper::chk_priv_level($_SESSION['xuid'], 'templates', $_post['id'], 4);
     if (is_null($msg)) {
         // do action
         $mod = new Template_model();
         $result = $mod->uninstall($_post['id']);
         if (is_array($result)) {
             // set error
             $msg = AdmUtils_helper::set_msg(false, '', $this->dict->get_word('_template_not_uninstalled'));
         } else {
             // set message
             $msg = AdmUtils_helper::set_msg($result);
             if ($result) {
                 // clear useless permissions
                 $perm = new Permission_model();
                 $perm->deleting_by_what('templates', $_post['id']);
                 $theme = $mod->get_var($_post['id_theme'], 'themes', 'name');
                 $msg->update[] = array('element' => 'tdown', 'url' => BASE_URL . 'templates/index/' . $_post['id_theme'] . '/' . $theme, 'title' => null);
             }
         }
     }
     $this->response($msg);
 }