Пример #1
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();
     }
 }
Пример #2
0
 function __construct()
 {
     self::$file = __FILE__;
     self::$plugin_dir_path = plugin_dir_path(__FILE__);
     add_action('plugins_loaded', array(&$this, 'load_files'), 100);
     add_action('init', array(&$this, 'init'));
     add_action('admin_notices', array(&$this, 'addon_compatibility'));
     add_action('admin_enqueue_scripts', array(&$this, 'load_admin_scripts'));
     add_filter('plugin_action_links', array(&$this, 'plugin_action_links'), 10, 2);
 }