コード例 #1
0
ファイル: Forms.php プロジェクト: nanookYs/orientreizen
 function process_bulk_action()
 {
     global $wpdb;
     if (!isset($_POST['action']) && count($_POST['wp_list_text_link']) == 0) {
         return;
     }
     switch ($this->current_action()) {
         case 'delete-permanently':
             if (sizeof($_POST['wp_list_text_link']) > 0) {
                 foreach ($_POST['wp_list_text_link'] as $id) {
                     $table = $wpdb->guiform_form . $id;
                     $wpdb->delete($wpdb->guiform, array('id' => $id), array('%d'));
                     $wpdb->delete($wpdb->guiform_options, array('name' => $id, 'type' => 'notification'), array('%s', '%s'));
                     $wpdb->delete($wpdb->guiform_options, array('name' => $id, 'type' => 'confirmation'), array('%s', '%s'));
                     $wpdb->delete($wpdb->guiform_options, array('name' => $id, 'type' => 'smtp'), array('%s', '%s'));
                     $wpdb->query("DROP TABLE IF EXISTS {$table}");
                     $tpl_path = GUIFORM_ABSPATH . DIRECTORY_SEPARATOR . "template";
                     $source = $tpl_path . DIRECTORY_SEPARATOR . $id;
                     GuiForm_Render_Settings_General::deleteDirectory($source);
                 }
                 $this->_message = true;
             }
             break;
     }
 }
コード例 #2
0
ファイル: Ajax.php プロジェクト: nanookYs/orientreizen
 /**
  * Delete form and entry from GuiForm manager page.
  *
  * @since 1.0
  * @access public
  */
 public function quickDelete()
 {
     global $wpdb;
     $type = esc_sql($_POST['type']);
     if ($type == 'forms') {
         if (has_action($this->_filter . 'delete_form')) {
             do_action($this->_filter . 'delete_form', $this->_id);
         }
         $wpdb->delete($wpdb->guiform, array('id' => $this->_id), array('%d'));
         $table = $wpdb->guiform_form . $this->_id;
         $wpdb->query("DROP TABLE IF EXISTS {$table}");
         $wpdb->delete($wpdb->guiform_options, array('name' => $this->_id, 'type' => 'notification'), array('%s', '%s'));
         $wpdb->delete($wpdb->guiform_options, array('name' => $this->_id, 'type' => 'confirmation'), array('%s', '%s'));
         $wpdb->delete($wpdb->guiform_options, array('name' => $this->_id, 'type' => 'smtp'), array('%s', '%s'));
         $tpl_path = GUIFORM_ABSPATH . DIRECTORY_SEPARATOR . "template";
         $source = $tpl_path . DIRECTORY_SEPARATOR . $this->_id;
         GuiForm_Render_Settings_General::deleteDirectory($source);
     } else {
         $wpdb->delete($wpdb->guiform_options, array('id' => $this->_id), array('%d'));
     }
     $this->_checkError();
     if (!empty($this->_errorType)) {
         echo $this->_errorMessage;
     }
     die;
 }
コード例 #3
0
ファイル: Setup.php プロジェクト: nanookYs/orientreizen
 public function zipExtract($zipFile)
 {
     if (class_exists('ZipArchive')) {
         $zip = new ZipArchive();
         $extractPath = ABSPATH . 'temp';
         if ($zip->open($zipFile) != "true") {
             exit;
         }
         /* Extract Zip File */
         $zip->extractTo($extractPath);
         $zip->close();
         GuiForm_Render_Settings_General::deleteDirectory($extractPath . '/' . GuiForm_Plugin::NAME);
     }
 }