Exemple #1
0
 /**
  * Constructor.
  *
  * @since 1.0
  *
  * @access public
  * @param GuiForm_Plugin $plugin The instance of the plugin.
  */
 public function __construct(GuiForm_Plugin $plugin)
 {
     parent::__construct($plugin);
     $this->_addAction('admin_menu', 'menu');
     $this->_addFilter('plugin_action_links', 'actionLink', 10, 2);
     $this->_addFilter('plugin_row_meta', 'pluginLinks', 10, 2);
 }
Exemple #2
0
 /**
  * Constructor.
  *
  * @since 1.0
  *
  * @access public
  * @param GuiForm_Plugin $plugin The instance of the plugin.
  */
 public function __construct()
 {
     parent::__construct(GuiForm_Plugin::instance());
     $screen = get_current_screen();
     $id = isset($_REQUEST['form']) ? esc_sql($_REQUEST['form']) : get_user_meta(get_current_user_id(), 'guiform_form_selected', true);
     $this->_pageScreen = $screen->id == GuiForm_Plugin::NAME . '_page_guiform-entry_view' ? $screen->id : $screen->id . '_' . $_REQUEST['form'];
     $this->settings = array('GuiForm_Render_Forms_Notification', 'GuiForm_Render_Forms_Confirmation', 'GuiForm_Render_Forms_Attachment', 'GuiForm_Render_Forms_Settings');
     if (has_filter('guiform_navigation_menu')) {
         $this->settings = apply_filters('guiform_navigation_menu', $this->settings);
     }
 }
Exemple #3
0
 /**
  * Constructor.
  *
  * @since 1.0
  * @uses add_filter() To add "do_shortcode" hook for "widget_text" and "term_description" filters.
  *
  * @access public
  * @param GuiForm_Plugin $plugin The instance of the plugin.
  */
 public function __construct()
 {
     parent::__construct(GuiForm_Plugin::instance());
     session_start();
     if (isset($_REQUEST['mv-code'])) {
         self::_activateMail();
     }
     self::_accessControl();
     $this->_addAction('generate_rewrite_rules', 'rewriteRules');
     $this->_addAction('parse_request', 'parseRequest');
     $this->_addFilter('query_vars', 'filterQueryVars');
     $this->_addShortcode('GuiForm', 'renderShortCode');
     $this->_addFilter('widget_text', 'doShortCode');
     $this->_addAction('wp_footer', 'inlineScripts', 9999);
 }
Exemple #4
0
 /**
  * Constructor.
  *
  * @since 1.0
  *
  * @access public
  * @param GuiForm_Plugin $plugin The instance of the plugin.
  */
 public function __construct(GuiForm_Plugin $plugin)
 {
     parent::__construct($plugin);
     $this->_addAction('init', 'autoUpdate');
     $this->_addFilter('cron_schedules', 'cronSchedule');
     $this->_addAction('activate_' . GuiForm_Plugin::NAME . '/index.php', 'activatePlugin');
     $this->_addAction('activate_' . GuiForm_Plugin::NAME . '/index.php', 'flushRewrite');
     $this->_addAction('upgrader_process_complete', 'activatePlugin', 10, 0);
     $this->_addAction('deactivate_' . GuiForm_Plugin::NAME . '/index.php', 'deactivatePlugin');
     $this->_addAction('plugins_loaded', 'loadTextDomain');
     $this->_addAction('admin_init', 'flushRewrite');
     $this->_addAction('media_buttons', 'add_media_button');
     $this->_addAction('wp_ajax_guiform_media_button', 'ajax_media_button');
     $this->_addAction('guiform_update_cron', 'cronUpdate');
     $this->_addFilter('http_request_host_is_external', 'externalHost');
     if (!wp_next_scheduled('guiform_update_cron')) {
         wp_schedule_event(time(), 'daily', 'guiform_update_cron');
     }
 }
Exemple #5
0
 /**
  * Constructor.
  *
  * @since 1.0
  *
  * @access public
  * @param GuiForm_Plugin $plugin The instance of the plugin.
  */
 public function __construct(GuiForm_Plugin $plugin)
 {
     parent::__construct($plugin);
     header('HTTP/1.1 200 OK');
     //session_destroy();
     $nonce = $_REQUEST['nonce'];
     $action = $_REQUEST['action'];
     if (!wp_verify_nonce($nonce, 'guiform_nonce')) {
         $this->_sendResponse(array('status' => 'error', 'message' => "<span>Security check!</span>"));
     }
     $this->_id = esc_sql($_REQUEST['id']);
     $this->_filter = 'guiform_filter_' . $this->_id . '_';
     $this->_hookAction = 'guiform_action_' . $this->_id . '_';
     //Front-end action
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_SAVE_ENTRY, 'saveEntry', true, true);
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_XHR_UPLOAD, 'xhrUpload', true, true);
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_FILE_UNLINK, 'fileUnlink', true, true);
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_VALIDATE_DISTINCT, 'distinctEntry', true, true);
     //Admin action
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_SAVE_FORM, 'saveForm');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_SAVE_FORM_INIT, 'saveFormInit');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_FORM_PREVIEW, 'formPreview');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_MARK_UNREAD, 'markUnread');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_TRASH_ENTRY, 'trashEntry');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_DELETE_ENTRY, 'deleteEntry');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_RESTORE_ENTRY, 'restoreEntry');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_QUICK_EDIT_MAIL, 'mailEdit');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_QUICK_SAVE_MAIL, 'mailSave');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_MAIL_TEST, 'mailTest');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_MAIL_ACTIVATE, 'mailActivate');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_QUICK_EDIT_OPTIONS, 'optionsEdit');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_QUICK_SAVE_OPTIONS, 'optionsSave');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_QUICK_DELETE, 'quickDelete');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_QUICK_DUPLICATE, 'quickDuplicate');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_DISPLAY_ENTRY, 'displayEntry');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_DISPLAY_ENTRY_SAVE, 'displayEntrySave');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_NOTIFICATION_STATUS, 'notificationStatus');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_EXPORT_ENTRY_FIELDS, 'exportEntryFields');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_ACTIVATE_LICENSE, 'activateLicense');
     $this->_addAjaxAction(GuiForm_Plugin::ACTION_DEACTIVATE_LICENSE, 'deactivateLicense');
 }
Exemple #6
0
 /**
  * Constructor.
  *
  * @since 1.0
  *
  * @access public
  * @param GuiForm_Plugin $plugin The instance of the plugin.
  */
 public function __construct(GuiForm_Plugin $plugin)
 {
     parent::__construct($plugin);
     header('HTTP/1.1 200 OK');
     header("Expires: 0");
     header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
     header("Cache-Control: no-cache, must-revalidate");
     header("Pragma: no-cache");
     $nonce = isset($_REQUEST['guiform_nonce']) ? $_REQUEST['guiform_nonce'] : $_REQUEST['nonce'];
     if (isset($_POST['guiform_save_entry'])) {
         $_POST['action'] = 'guiform-save-entry';
     }
     if (!wp_verify_nonce($nonce, 'guiform_nonce')) {
         $this->_sendResponse(array('status' => 'error', 'message' => __("Security check: Invalid token!", GuiForm_Plugin::NAME)));
     }
     $this->_id = esc_sql($_REQUEST['id']);
     $this->_hookFilter = 'guiform_filter_' . $this->_id . '_';
     $this->_hookAction = 'guiform_action_' . $this->_id . '_';
     $this->_addAdminAction(GuiForm_Plugin::ACTION_EXPORT_ENTRY_CSV, 'exportEntryCsv');
     $this->_addAdminAction(GuiForm_Plugin::ACTION_EXPORT_ENTRY_SQL, 'exportEntrySql');
     $this->_addAdminAction(GuiForm_Plugin::ACTION_EXPORT_FORM_SQL, 'exportFormSql');
     $this->_addAdminAction(GuiForm_Plugin::ACTION_EXPORT_FORM_PHP, 'exportFormPhp');
     $this->_addAdminAction(GuiForm_Plugin::ACTION_IMPORT_FORM_PHP, 'importFormPhp');
     $this->_addAdminAction(GuiForm_Plugin::ACTION_SAVE_FORM, 'saveForm');
     $this->_addAdminAction(GuiForm_Plugin::ACTION_DOWNLOAD_FILE, 'downloadFile');
     if ($_POST['action'] == GuiForm_Plugin::ACTION_SAVE_FORM) {
         //Fix for 404 error not found.
         $this->saveForm();
     }
 }
Exemple #7
0
 /**
  * Constructor.
  *
  * @since 1.0.3
  *
  * @access public
  * @param GuiForm_Plugin $plugin The instance of the plugin.
  */
 public function __construct(GuiForm_Plugin $plugin)
 {
     parent::__construct($plugin);
 }
Exemple #8
0
 /**
  * Constructor.
  *
  * @since 1.0
  *
  * @access public
  * @param GuiForm_Plugin $plugin The instance of the plugin.
  */
 public function __construct(GuiForm_Plugin $plugin)
 {
     parent::__construct($plugin);
     global $guiform;
 }