/** * Inject a style handler for includes. * * @param IIncludes $iStyleInclude */ public function __construct(IIncludes $iStyleInclude = null) { if ($iStyleInclude) { $this->styleInclude = $iStyleInclude; } else { $this->styleInclude = Container::instance()->fetch('CLMVC\\Interfaces\\IStyleInclude'); } $this->styleInclude->init(); Hook::register('stylesheets-register', array($this, 'registerIncludes')); }
public function init() { Hook::register('init', [$this, 'routeQuery'], 1); Hook::register('init', [$this, 'renderText'], 99999); add_filter('do_parse_request', [$this, 'disableParseRequest'], 9999999, 3); Filter::register('posts_request', [$this, 'disablePostQuery'], 9999999); Filter::register('pre_handle_404', [$this, 'disable404handling']); Hook::register('rendering-render', function ($controllerName, $action) { global $clmvc_template; $clmvc_template = [$controllerName, $action]; }); Hook::register('init', [$this, 'templateRendering'], 9999); Filter::register('document_title_parts', [$this, 'setTitle']); Filter::register('wp_title', [$this, 'setTitle']); add_filter('pre_get_document_title', [$this, 'override404']); }
public function init() { if (Security::isAdmin()) { Filter::register('set_plugin_has_updates', array($this, 'siteTransientUpdatePlugins')); Hook::register('set_plugin_has_updates', array($this, 'transientUpdatePlugins')); if (isset($_GET['plugin']) && $_GET['plugin'] == $this->application->getName()) { Hook::register('install_plugins_pre_plugin-information', array($this, 'versionInformation')); } $this->application->onInitUpdate(); $oldVersion = AoiSoraSettings::getApplicationVersion($this->application->getName()); if ($this->application->installed() && version_compare($oldVersion, $this->version, '<')) { AoiSoraSettings::addApplication($this->application->getName(), $this->application->getInstallDirectory(), $this->version); $this->application->update(); } if ($this->update_site && isset($_REQUEST['action']) && 'upgrade-plugin' == $_REQUEST['action'] && isset($_REQUEST['plugin']) && urldecode($_REQUEST['plugin']) == $this->application->getInstallName()) { Filter::register('http_request_args', array($this, 'addUpdateUrl'), 10); } } }