Ejemplo n.º 1
0
 public function addActionsAndFilters()
 {
     // Admin notices
     add_action('admin_notices', array(&$this, 'addAdminNotices'));
     // Add the Admin Config page for this plugin
     // Add Config page as a top-level menu item on the Admin page
     add_action('admin_menu', array(&$this, 'createAdminMenu'));
     // Add Database Options page
     add_action('admin_menu', array(&$this, 'addSettingsSubMenuPage'));
     // Hook into Contact Form 7 when a form post is made to save the data to the DB
     if ($this->getOption('IntegrateWithCF7', 'true') == 'true') {
         require_once 'CFDBIntegrationContactForm7.php';
         $integration = new CFDBIntegrationContactForm7($this);
         $integration->registerHooks();
     }
     // Hook into Fast Secure Contact Form
     if ($this->getOption('IntegrateWithFSCF', 'true') == 'true') {
         require_once 'CFDBIntegrationFSCF.php';
         $integration = new CFDBIntegrationFSCF($this);
         $integration->registerHooks();
     }
     // Hook into JetPack Contact Form
     if ($this->getOption('IntegrateWithJetPackContactForm', 'true') == 'true') {
         require_once 'CFDBIntegrationJetPack.php';
         $integration = new CFDBIntegrationJetPack($this);
         $integration->registerHooks();
     }
     // Hook into Gravity Forms
     if ($this->getOption('IntegrateWithGravityForms', 'true') == 'true') {
         require_once 'CFDBIntegrationGravityForms.php';
         $integration = new CFDBIntegrationGravityForms($this);
         $integration->registerHooks();
     }
     // Hook to work with WR ContactForms
     if ($this->getOption('IntegrateWithWrContactForms', 'true') == 'true') {
         require_once 'CFDBIntegrationWRContactForm.php';
         $integration = new CFDBIntegrationWRContactForm($this);
         $integration->registerHooks();
     }
     // Hook to work with Quform
     if ($this->getOption('IntegrateWithQuform', 'true') == 'true') {
         require_once 'CFDBIntegrationQuform.php';
         $integration = new CFDBIntegrationQuform($this);
         $integration->registerHooks();
     }
     // Hook to work with Ninja Forms
     if ($this->getOption('IntegrateWithNinjaForms', 'true') == 'true') {
         require_once 'CFDBIntegrationNinjaForms.php';
         $integration = new CFDBIntegrationNinjaForms($this);
         $integration->registerHooks();
     }
     // Hook to work with Caldera Forms Forms
     if ($this->getOption('IntegrateWithCalderaForms', 'true') == 'true') {
         require_once 'CFDBIntegrationCalderaForms.php';
         $integration = new CFDBIntegrationCalderaForms($this);
         $integration->registerHooks();
     }
     // Enfold theme forms
     if ($this->getOption('IntegrateWithEnfoldThemForms', 'true') == 'true') {
         require_once 'CFDBIntegrationEnfoldTheme.php';
         $enfold = new CFDBIntegrationEnfoldTheme($this);
         $enfold->registerHooks();
     }
     // Have our own hook to receive form submissions independent of other plugins
     add_action('cfdb_submit', array(&$this, 'saveFormData'));
     // Register Export URL
     add_action('wp_ajax_nopriv_cfdb-export', array(&$this, 'ajaxExport'));
     add_action('wp_ajax_cfdb-export', array(&$this, 'ajaxExport'));
     // Register Get File URL
     add_action('wp_ajax_nopriv_cfdb-file', array(&$this, 'ajaxFile'));
     add_action('wp_ajax_cfdb-file', array(&$this, 'ajaxFile'));
     // Register Get Form Fields URL
     add_action('wp_ajax_nopriv_cfdb-getFormFields', array(&$this, 'ajaxGetFormFields'));
     add_action('wp_ajax_cfdb-getFormFields', array(&$this, 'ajaxGetFormFields'));
     // Register Validate submit_time value (used in short code builder page)
     add_action('wp_ajax_nopriv_cfdb-validate-submit_time', array(&$this, 'ajaxValidateSubmitTime'));
     add_action('wp_ajax_cfdb-validate-submit_time', array(&$this, 'ajaxValidateSubmitTime'));
     // Login via Ajax instead of login form
     add_action('wp_ajax_nopriv_cfdb-login', array(&$this, 'ajaxLogin'));
     add_action('wp_ajax_cfdb-login', array(&$this, 'ajaxLogin'));
     // Shortcode to add a table to a page
     $sc = new CFDBShortcodeTable();
     $sc->register(array('cf7db-table', 'cfdb-table'));
     // cf7db-table is deprecated
     // Shortcode to add a DataTable
     $sc = new CFDBShortcodeDataTable();
     $sc->register('cfdb-datatable');
     // Shortcode to add a JSON to a page
     $sc = new CFDBShortcodeJson();
     $sc->register('cfdb-json');
     // Shortcode to add a value (just text) to a page
     $sc = new CFDBShortcodeValue();
     $sc->register('cfdb-value');
     // Shortcode to add entry count to a page
     $sc = new CFDBShortcodeCount();
     $sc->register('cfdb-count');
     // Shortcode to add values wrapped in user-defined html
     $sc = new CFDBShortcodeHtml();
     $sc->register('cfdb-html');
     // Shortcode to generate Export URLs
     $sc = new CFDBShortcodeExportUrl();
     $sc->register('cfdb-export-link');
     // Shortcode to save data from non-CF7/FSCF forms
     $sc = new CFDBShortCodeSavePostData();
     $sc->register('cfdb-save-form-post');
     // Shortcode to save data Form Maker submissions
     $sc = new CFDBShortCodeSaveFormMakerSubmission();
     $sc->register('cfdb-save-form-maker-post');
 }
 public function test_getUrlWithoutSchemeHostAndPort_3()
 {
     $caldera = new CFDBIntegrationCalderaForms(null);
     $this->assertEquals('/wp-content/uploads/2015/05/Screen-Shot.png', $caldera->getUrlWithoutSchemeHostAndPort('https://www.mysite.com:8080/wp-content/uploads/2015/05/Screen-Shot.png'));
 }