コード例 #1
0
 /**
  * Class constructor. Initializes class attributes and invokes the constructor of parent class WP_List_Table
  **/
 public function __construct($version)
 {
     $this->load_dependencies();
     $this->version = $version;
     $this->db = WPFEPP_DB_Table::get_instance();
     global $status, $page;
     parent::__construct(array('singular' => 'form', 'plural' => 'forms', 'ajax' => false, 'screen' => $_REQUEST['page']));
 }
コード例 #2
0
ファイル: class-wpfepp-tab.php プロジェクト: poweronio/mbsite
 /**
  * Class constructor. Initializes all the class variables.
  *
  * @var string $version Plugin version.
  * @var string $slug Tab slug.
  * @var string $name Tab name.
  **/
 public function __construct($version, $slug, $name)
 {
     $this->load_dependencies();
     $this->version = $version;
     $this->slug = $slug;
     $this->name = $name;
     $this->renderer = WPFEPP_Field_Renderer::get_instance();
     $this->validator = WPFEPP_Field_Validator::get_instance();
     $this->db = WPFEPP_DB_Table::get_instance();
 }
コード例 #3
0
 /**
  * Class constructor. Includes essential files and initializes the class attributes.
  **/
 public function __construct($version)
 {
     $this->load_dependencies();
     $this->version = $version;
     $this->page = 'wpfepp_form_manager';
     $this->db = WPFEPP_DB_Table::get_instance();
     $this->tabs = new WPFEPP_Tab_Collection();
     $fields_tab = new WPFEPP_Tab_Form_Fields($this->version, 'fields', __('Fields', 'wpfepp-plugin'), $this);
     $settings_tab = new WPFEPP_Tab_Form_Settings($this->version, 'settings', __('Settings', 'wpfepp-plugin'), $this);
     $emails_tab = new WPFEPP_Tab_Form_Emails($this->version, 'emails', __('Emails', 'wpfepp-plugin'), $this);
     $this->tabs->add($fields_tab);
     $this->tabs->add($settings_tab);
     $this->tabs->add($emails_tab);
 }
コード例 #4
0
 /**
  * Fetches the form data from the database table and initializes all the class attributes.
  * 
  * @param int $form_id The row ID of this form from the database table.
  **/
 public function __construct($version, $form_id = -1)
 {
     $this->load_dependencies();
     $this->version = $version;
     if ($form_id < 0) {
         $this->valid = false;
         return;
     }
     require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-wpfepp-db-table.php';
     $this->id = $form_id;
     $this->db = WPFEPP_DB_Table::get_instance();
     $row = $this->db->get($form_id);
     $this->captcha = new WPFEPP_Captcha($this->version);
     if ($row) {
         $this->valid = true;
     } else {
         $this->valid = false;
     }
     if ($this->valid) {
         $this->name = $row['name'];
         $this->description = $row['description'];
         $this->post_type = $row['post_type'];
         $this->fields = $row['fields'];
         $this->settings = $row['settings'];
         $this->emails = $row['emails'];
         //Necessary because we need to check if the post type is public before showing any links to the end user.
         $this->post_type_obj = get_post_type_object($this->post_type);
     }
 }
コード例 #5
0
 /**
  * The function that will run on uninstallation of the plugin to remove data.
  **/
 public static function rollback()
 {
     $data_settings = get_option('wpfepp_data_settings');
     if ($data_settings && $data_settings['delete_on_uninstall']) {
         $db_instance = WPFEPP_DB_Table::get_instance();
         $db_instance->remove_table();
         $db_instance->delete_post_meta(WPFEPP_CopyScape::$meta_key);
         delete_option('wpfepp_media_settings');
         delete_option('wpfepp_post_list_settings');
         delete_option('wpfepp_data_settings');
         delete_option('wpfepp_errors');
         delete_option('wpfepp_email_settings');
         delete_option('wpfepp_copyscape_settings');
         delete_option('wpfepp_recaptcha_settings');
         delete_option('wpfepp_version');
         delete_option('wpfepp_db_table_version');
         delete_option('wpfepp_nag_dismissed');
     }
 }