/** * Class constructor. * Calls the implementated method 'startUp' if it exists. This is done at plugins loading time. * Prepares admin menus by seting an action for the implemented method '_adminMenus' if it exists. * * @param string $file The main file to run the component. * @return aocComponent The component object. */ final function __construct($file) { parent::__construct('component', '', $file); $this->slug = ak_get_object($this->PID)->getSlug(); // Activating and deactivating hooks. add_action('ak_activate_' . $this->ID, array($this, 'activate')); add_action('ak_deactivate_' . $this->ID, array($this, 'componentDeactivate')); add_action('ak_' . $this->PID . '_components_init', array($this, 'init')); add_action('ak_' . $this->PID . '_widgets_init', array($this, 'widgetsInit')); }
/** * Class constructor. * Calls the implementated method 'startUp' if it exists. This is done at plugins loading time. * Prepares admin menus by seting an action for the implemented method '_adminMenus' if it exists. * * @param string $mod_file Full main plugin's filename (absolute to root). * @param string $ID Plugin short name (known as plugin ID). * @return spostsPlugin|false The plugin object or false if not compatible. */ public function __construct($mod_file, $ID = '') { parent::__construct('plugin', $ID, $mod_file); if ($this->isCompatible()) { // Activation and deactivation hooks. register_activation_hook($this->mod_file, array($this, 'activate')); register_deactivation_hook($this->mod_file, array($this, 'deactivate')); add_action('plugins_loaded', array($this, 'init')); } }
/** * Class constructor. * Calls the implementated method 'startUp' if it exists. This is done at theme's loading time. * Prepares admin menus by setting an action for the implemented method '_adminMenus' if it exists. * * @uses do_action() Calls the 'ak_theme_loaded' action hook. * @param string $ID Theme internal short name (known as theme ID). * @return akTheme */ public function __construct($ID = '') { parent::__construct('theme', $ID); if ($this->installing) { $this->install(); } if (function_exists('register_sidebars')) { $this->themeSideBars(); } $this->configureTheme(); do_action('ak_theme_loaded'); }