public function run() { $this->message_center->register_hooks(); $this->activation_manager->register_hooks(); add_action('plugins_loaded', array(&$this, 'load_textdomain'), 3); add_action('plugins_loaded', array(&$this, 'load_settings'), 5); add_action('plugins_loaded', array(&$this, 'load_addons'), 10); add_action('init', array(&$this, 'load_scripts'), 7); add_action('init', array(&$this, 'load_styles'), 8); add_action('init', array(&$this, 'load_defaults'), 9); if (is_admin()) { add_action('admin_notices', array(&$this, 'print_admin_notices')); add_action('init', array(&$this, 'load_defaults'), 9); add_action('permalink_structure_changed', array(&$this, 'check_permalinks_enabled')); add_action('cuar/core/activation/run-deferred-action?action_id=check-template-files', array(&$this, 'check_templates')); add_action('cuar/core/activation/run-deferred-action?action_id=check-permalink-settings', array(&$this, 'check_permalinks_enabled')); } else { add_action('plugins_loaded', array(&$this, 'load_theme_functions'), 7); } }
/** * Called when the plugin is activated. You should not do much work here. Instead, this is a place to * queue deferred actions that will be executed on next page refresh. */ public function on_activate() { // Reset all warnings, they should all be started new CUAR_MessageCenter::reset_warnings(); // Schedule checking for updating/setting up the plugin CUAR_PluginActivationManager::schedule_deferred_action('check-plugin-version', 10); // Schedule a check of the template files CUAR_PluginActivationManager::schedule_deferred_action('check-template-files', 20); // Schedule flushing all rewrite rules CUAR_PluginActivationManager::schedule_deferred_action('flush-rewrite-rules', 20); // Schedule a check of the permalinks setting in WordPress CUAR_PluginActivationManager::schedule_deferred_action('check-permalink-settings', 40); }
/** * @param CUAR_PluginActivationDelegate $delegate */ public static function set_delegate($delegate) { self::$DELEGATE = $delegate; }
include_once CUAR_INCLUDES_DIR . '/core-addons/capabilities/capabilities-addon.class.php'; include_once CUAR_INCLUDES_DIR . '/core-addons/customer-pages/customer-pages-addon.class.php'; include_once CUAR_INCLUDES_DIR . '/core-addons/status/status-addon.class.php'; include_once CUAR_INCLUDES_DIR . '/core-addons/user-profile/user-profile-addon.class.php'; include_once CUAR_INCLUDES_DIR . '/core-addons/shortcodes/shortcodes-addon.class.php'; // Core content types include_once CUAR_INCLUDES_DIR . '/core-addons/private-page/private-page-addon.class.php'; include_once CUAR_INCLUDES_DIR . '/core-addons/private-file/private-file-addon.class.php'; // Core pages include_once CUAR_INCLUDES_DIR . '/core-addons/customer-home/customer-home-addon.class.php'; include_once CUAR_INCLUDES_DIR . '/core-addons/customer-dashboard/customer-dashboard-addon.class.php'; include_once CUAR_INCLUDES_DIR . '/core-addons/customer-account-home/customer-account-home-addon.class.php'; include_once CUAR_INCLUDES_DIR . '/core-addons/customer-account-edit/customer-account-edit-addon.class.php'; include_once CUAR_INCLUDES_DIR . '/core-addons/customer-account/customer-account-addon.class.php'; include_once CUAR_INCLUDES_DIR . '/core-addons/customer-logout/customer-logout-addon.class.php'; include_once CUAR_INCLUDES_DIR . '/core-addons/customer-private-files-home/customer-private-files-home-addon.class.php'; include_once CUAR_INCLUDES_DIR . '/core-addons/customer-private-files/customer-private-files-addon.class.php'; include_once CUAR_INCLUDES_DIR . '/core-addons/customer-private-pages-home/customer-private-pages-home-addon.class.php'; include_once CUAR_INCLUDES_DIR . '/core-addons/customer-private-pages/customer-private-pages-addon.class.php'; // Template functions include_once CUAR_INCLUDES_DIR . '/functions/functions-general.php'; include_once CUAR_INCLUDES_DIR . '/functions/functions-private-content.php'; include_once CUAR_INCLUDES_DIR . '/functions/functions-private-files.php'; // Some hooks for activation, deactivation, ... CUAR_PluginActivationManager::set_delegate(new CUAR_PluginActivation()); register_activation_hook(__FILE__, array('CUAR_PluginActivationManager', 'on_activate')); register_deactivation_hook(__FILE__, array('CUAR_PluginActivationManager', 'on_deactivate')); // Start the plugin! global $cuar_plugin; $cuar_plugin = new CUAR_Plugin(); $cuar_plugin->run();
public function redo_activation_checks() { CUAR_PluginActivationManager::on_activate(); }