Beispiel #1
0
 /**
  * We're not able to set the __construct() method to private because we're extending the GFAddon class, so
  * we fake it. When called using `new GravityView_Settings`, it will return get_instance() instead. We pass
  * 'get_instance' as a test string.
  *
  * @see get_instance()
  *
  * @param string $prevent_multiple_instances
  */
 public function __construct($prevent_multiple_instances = '')
 {
     if ($prevent_multiple_instances === 'get_instance') {
         return parent::__construct();
     }
     return self::get_instance();
 }
Beispiel #2
0
 public function __construct()
 {
     parent::__construct();
     add_action('gform_after_submission', array($this, 'after_submission'), 10, 2);
     add_filter('gform_export_field_value', array($this, 'display_entries_field_value'), 10, 3);
     add_action('gform_polls_cron', array($this, 'wp_cron_task'));
 }
 /**
  * Constructor
  */
 public function __construct()
 {
     $this->_path = self::addon_local_path();
     $this->plugin_path = plugin_dir_path(dirname(dirname(__FILE__)));
     parent::__construct();
     $this->init();
 }
Beispiel #4
0
 function __construct()
 {
     $this->set_settings_on_activation();
     $this->_version = KWS_GF_Salesforce::version;
     parent::__construct();
     $plugins = $this->get_addon_setting('salesforce_integration');
     // If plugins are set, load'em up.
     if ($plugins !== NULL) {
         // Load the API plugin
         if ($plugins === 'api' || is_array($plugins) && !empty($plugins['api'])) {
             if (false === $this->is_incompatible_with_api() && !class_exists('GFSalesforce')) {
                 require_once KWS_GF_Salesforce::$plugin_dir_path . 'inc/salesforce-api.php';
             }
         }
         // Load the Web-to-Lead plugin - if the only plugin active or one of two
         if ($plugins === 'web2lead' || is_array($plugins) && !empty($plugins['web2lead'])) {
             if (!class_exists('KWSGFWebToLeadAddon') && KWS_GF_Salesforce::supports_addon_api()) {
                 require_once KWS_GF_Salesforce::$plugin_dir_path . 'inc/web-to-lead.php';
                 new KWSGFWebToLeadAddon();
             }
         }
     }
     // Add Daddy Analytics whether using Web-to-Lead or API
     if (!class_exists('KWSGFDaddyAnalyticsAddon') && KWS_GF_Salesforce::supports_addon_api()) {
         require_once KWS_GF_Salesforce::$plugin_dir_path . 'inc/daddy_analytics.addon.php';
         new KWSGFDaddyAnalyticsAddon();
     }
 }
Beispiel #5
0
 public function __construct()
 {
     if (defined('DOING_CRON') && DOING_CRON) {
         add_action('gravityforms_results_cron_' . $this->_slug, array($this, 'results_cron'), 10, 3);
         return;
     }
     parent::__construct();
 }
 /**
  * Class constructor for setting up the add-on.
  *
  * @access private
  * @since 1.0.0
  * @see GFAddOn
  */
 public function __construct()
 {
     $this->_title = __('Gravity Forms Iframe Add-On', 'gravity-forms-iframe');
     $this->_short_title = __('Iframe', 'gravity-forms-iframe');
     $this->_version = '1.0.0';
     $this->_slug = 'gfiframe';
     $this->_path = 'gravity-forms-iframe/gravity-forms-iframe.php';
     $this->_full_path = dirname(dirname(__FILE__)) . '/gravity-forms-iframe.php';
     parent::__construct();
 }
Beispiel #7
0
 /**
  * Class constructor for setting up the add-on.
  *
  * @since 2.0.0
  * @see GFAddOn
  *
  * @param GravityFormsIframe_Plugin $plugin Main plugin instance.
  */
 public function __construct($plugin)
 {
     $this->plugin = $plugin;
     $this->_title = esc_html__('Gravity Forms Iframe Add-On', 'gravity-forms-iframe');
     $this->_short_title = esc_html__('Iframe', 'gravity-forms-iframe');
     $this->_version = '2.0.1';
     $this->_slug = 'gfiframe';
     $this->_path = $this->plugin->get_basename();
     $this->_full_path = $this->plugin->get_file();
     parent::__construct();
 }
 public function __construct()
 {
     parent::__construct();
     $this->plugin_settings = $this->get_plugin_settings();
     $this->user = isset($this->plugin_settings['solve_user']) ? $this->plugin_settings['solve_user'] : false;
     $this->token = isset($this->plugin_settings['solve_token']) ? $this->plugin_settings['solve_token'] : false;
     $this->email_to = isset($this->plugin_settings['email_to']) ? $this->plugin_settings['email_to'] : false;
     $this->email_from = isset($this->plugin_settings['email_from']) ? $this->plugin_settings['email_from'] : false;
     $this->email_cc = isset($this->plugin_settings['email_cc']) ? $this->plugin_settings['email_cc'] : false;
     $this->email_bcc = isset($this->plugin_settings['email_bcc']) ? $this->plugin_settings['email_bcc'] : false;
     $this->email_headers = array();
     /**
      * Set wp_mail headers
      */
     if ($this->email_from) {
         $this->email_headers[] = sprintf('From: %s', $this->email_from);
     }
     if ($this->email_cc) {
         $this->email_headers[] = sprintf('Cc: %s', $this->email_cc);
     }
     if ($this->email_bcc) {
         $this->email_headers[] = sprintf('Bcc: %s', $this->email_bcc);
     }
     if (!$this->user && !$this->token) {
         throw new Exception(sprintf('Solve user and token are required! <a href="%s">Update your Solve credentials</a>.', $this->get_plugin_settings_url()));
     } else {
         if (!$this->user) {
             throw new Exception(sprintf('Solve user is required! <a href="%s">Update your Solve credentials</a>.', $this->get_plugin_settings_url()));
         } else {
             if (!$this->token) {
                 throw new Exception(sprintf('Solve token is required! <a href="%s">Update your Solve credentials</a>.', $this->get_plugin_settings_url()));
             }
         }
     }
     $this->solveService = new Solve360Service($this->user, $this->token);
     if (!$this->solveService) {
         throw new Exception('Invalid Solve Credentials, failed to intitiate Solve gateway.');
     }
     add_action('gform_field_advanced_settings', array($this, 'gform_field_advanced_settings'), 10, 2);
     add_action('gform_editor_js', array($this, 'editor_script'));
     add_action('gform_tooltips', array($this, 'form_tooltips'));
 }
 public function __construct()
 {
     parent::__construct();
     // add our CSS class to forms with section tabs enabled
     add_filter('gform_pre_render', array($this, 'gform_pre_render'), 10, 3);
 }
 public function __construct()
 {
     add_action('init', array($this, 'maybe_handle_settings_submission'), 1);
     parent::__construct();
 }