getExtension( 'l10n' ), '_' ), func_get_args() ); } /** * Bootstrap ARV Plugin * * return void */ protected function __construct() { # Plugin base parent::__construct( __FILE__, new Config\Plugin() ); } /** * put your comment there... * */ public function _initializePluggableHooks() { ////////////////////////////////////#$ do_action( Hooks::ACTION_PLUGIN_LOADED, $this ); ////////////////////////////////////#$ ////////////////////////////////////#$ if ( $this->bindingHooks ) { do_action( Hooks::ACTION_PLUGIN_BINDING_HOOKS, $this ); } ////////////////////////////////////#$ } /** * put your comment there... * */ public function _localize() { if (!$this->getExtension('l10n')) { // Load localization extension $this->setExtension( 'l10n', Localization::localize(basename(dirname(__FILE__)), $this) ); } } /** * put your comment there... * */ protected function bootStrap() { # Wordpress backward compatibility CompatibleWordpress::loadCompatibilityLayers( $GLOBALS[ 'wp_version' ] ); # Installer if ( ! \WCFE\Installer\Installer::run( ) ) { // Could not install !!!! return; } # System Plugins \WCFE\SysPlugins\Plugins::load()->runPlugins(); # Localization add_action('plugins_loaded', array($this, '_localize')); # MVC components # Only admin side is used in this Plugin if ( is_admin() ) { # Editor Module $this->editorModule = new Services\EditorModule( $this ); $this->editorModule->start(); # Profile module $this->profilesModule = new Services\ProfilesModule( $this ); # System filters module $this->sysFiltersModule = new Services\SysFiltersModule( $this ); $this->sysFiltersModule->start(); # Profiles is totally relying on AJAX # editor Ajax should be here too however I will do that # in the subsequence releases if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { $this->profilesModule->start(); } $this->bindingHooks = true; } # Start using hooks at this point so that WCFE Extensions can get involved add_action( 'plugins_loaded', array( $this, '_initializePluggableHooks' ) ); } /** * put your comment there... * */ public function & getEditorModule() { return $this->editorModule; } /** * put your comment there... * */ public function & getProfilesModule() { return $this->profilesModule; } /** * put your comment there... * */ public function & getSysFiltersModule() { return $this->sysFiltersModule; } /** * put your comment there... * */ public static function & me() { return self::$instance; } /** * put your comment there... * */ protected function onCreateServiceFront() { $this->_localize(); } /** * Run ARV Plugin if not alreayd running * * This methos is to construct a new ARV\Plugin instance if not already * instantiated. * * @return PLugin */ public static function plug() { # Create if not yet created if ( ! self::$instance ) { # Get Instance self::$instance = new Plugin(); # Load self::$instance->bootStrap(); } # Return instance return self::$instance; } } # Run The Plugin Plugin::plug();