/** * Initialize plugin. */ public function __construct() { require_once 'classes/Helpers/DataHelper.php'; // profiler has to be loaded manually require_once 'classes/SimpleProfiler.php'; $this->profiler = new WSAL_SimpleProfiler(); require_once 'classes/Models/ActiveRecord.php'; require_once 'classes/Models/Query.php'; require_once 'classes/Models/OccurrenceQuery.php'; require_once 'classes/Models/Option.php'; // load autoloader and register base paths require_once 'classes/Autoloader.php'; $this->autoloader = new WSAL_Autoloader($this); $this->autoloader->Register(self::PLG_CLS_PRFX, $this->GetBaseDir() . 'classes' . DIRECTORY_SEPARATOR); // load dependencies $this->views = new WSAL_ViewManager($this); $this->alerts = new WSAL_AlertManager($this); $this->sensors = new WSAL_SensorManager($this); $this->settings = new WSAL_Settings($this); $this->constants = new WSAL_ConstantManager($this); $this->licensing = new WSAL_LicenseManager($this); $this->widgets = new WSAL_WidgetManager($this); // listen for installation event register_activation_hook(__FILE__, array($this, 'Install')); // listen for init event add_action('init', array($this, 'Init')); // listen for cleanup event add_action('wsal_cleanup', array($this, 'CleanUp')); // render wsal header add_action('admin_enqueue_scripts', array($this, 'RenderHeader')); // render wsal footer add_action('admin_footer', array($this, 'RenderFooter')); // handle admin Disable Custom Field add_action('wp_ajax_AjaxDisableCustomField', array($this, 'AjaxDisableCustomField')); }
/** * Initialize plugin. */ public function __construct() { // profiler has to be loaded manually require_once 'classes/SimpleProfiler.php'; $this->profiler = new WSAL_SimpleProfiler(); // load autoloader and register base paths require_once 'classes/Autoloader.php'; $this->autoloader = new WSAL_Autoloader($this); $this->autoloader->Register(self::PLG_CLS_PRFX, $this->GetBaseDir() . 'classes' . DIRECTORY_SEPARATOR); // load dependencies $this->views = new WSAL_ViewManager($this); $this->alerts = new WSAL_AlertManager($this); $this->sensors = new WSAL_SensorManager($this); $this->settings = new WSAL_Settings($this); $this->constants = new WSAL_ConstantManager($this); $this->licensing = new WSAL_LicenseManager($this); $this->widgets = new WSAL_WidgetManager($this); // listen for installation event register_activation_hook(__FILE__, array($this, 'Install')); // listen for cleanup event add_action('wsal_cleanup', array($this, 'CleanUp')); // render wsal header add_action('admin_enqueue_scripts', array($this, 'RenderHeader')); // render wsal footer add_action('admin_footer', array($this, 'RenderFooter')); // hide plugin if ($this->settings->IsIncognito()) { add_action('admin_head', array($this, 'HidePlugin')); } }