public function registerEvents() { if (!Ajde_Event::has($this, 'afterCrudSave', 'postCrudSave')) { Ajde_Event::register($this, 'beforeCrudSave', 'preCrudSave'); Ajde_Event::register($this, 'afterCrudSave', 'postCrudSave'); } }
protected function addTimeoutWarning() { // Add timeout warning to layout if ($this->getLoggedInUser() !== false) { Ajde_Event::register('Ajde_Layout', 'beforeGetContents', 'requireTimeoutWarning'); } }
public function registerEvents() { if (!Ajde_Event::has($this, 'afterCrudLoaded', 'parseForCrud')) { Ajde_Event::register($this, 'afterCrudLoaded', 'parseForCrud'); Ajde_Event::register($this, 'beforeCrudSave', 'prepareCrudSave'); } }
public function __bootstrap() { Ajde_Event::register('Ajde_Core_Route', 'onAfterLangSet', [$this, 'setHomepage']); Ajde_Event::register('Ajde_Core_Route', 'onAfterRouteSet', [$this, 'detectNodeSlug']); Ajde_Event::register('Ajde_Core_Route', 'onAfterRouteSet', [$this, 'detectShopSlug']); return true; }
public function __construct() { /* * We add the resources before the template is included, otherwise the * layout resources never make it into the <head> section. */ Ajde_Event::register('Ajde_Template', 'beforeGetContents', array($this, 'autoAddResources')); parent::__construct(); }
public function __construct() { /* * We add the resources before the template is included, otherwise the * layout resources never make it into the <head> section. */ Ajde_Event::register('Ajde_Template', 'beforeGetContents', [$this, 'autoAddResources']); Ajde_Event::register('Ajde_Application', 'onAfterDocumentRendered', [$this, 'setupExternalPageCache']); parent::__construct(); }
public function __bootstrap() { \Nabble\SemaltBlocker\Blocker::protect(); Ajde_Event::register('TransactionModel', 'onPaid', [$this, 'onTransactionPaid']); Ajde_Event::register('TransactionModel', 'onCreate', [$this, 'onTransactionCreated']); if (UserModel::isTester() || UserModel::isAdmin()) { $providers = config('shop.transaction.providers'); $providers[] = 'test'; Config::set('shop.transaction.providers', $providers); } return true; }
public static function register($controller) { // Extend Ajde_Controller if (!Ajde_Event::has('Ajde_Controller', 'call', 'Ajde_Collection::extendController')) { Ajde_Event::register('Ajde_Controller', 'call', 'Ajde_Collection::extendController'); } // Extend autoloader if ($controller instanceof Ajde_Controller) { Ajde_Core_Autoloader::addDir(MODULE_DIR . $controller->getModule() . '/model/'); } elseif ($controller === '*') { self::registerAll(); } else { Ajde_Core_Autoloader::addDir(MODULE_DIR . $controller . '/model/'); } }
public function __construct() { Ajde_Event::register($this, 'afterCrudLoaded', [$this, 'parseForCrud']); parent::__construct(); }
public static function registerDocumentProcessor($format, $registerOn = 'layout') { $documentProcessors = Config::get('documentProcessors'); if (is_array($documentProcessors) && isset($documentProcessors[$format])) { foreach ($documentProcessors[$format] as $processor) { $processorClass = 'Ajde_Document_Processor_' . ucfirst($format) . '_' . $processor; if (!Ajde_Core_Autoloader::exists($processorClass)) { // TODO: throw new Ajde_Exception('Processor ' . $processorClass . ' not found', 90022); } if ($registerOn == 'layout') { Ajde_Event::register('Ajde_Layout', 'beforeGetContents', $processorClass . '::preProcess'); Ajde_Event::register('Ajde_Layout', 'afterGetContents', $processorClass . '::postProcess'); } elseif ($registerOn == 'compressor') { Ajde_Event::register('Ajde_Resource_Local_Compressor', 'beforeCompress', $processorClass . '::preCompress'); Ajde_Event::register('Ajde_Resource_Local_Compressor', 'afterCompress', $processorClass . '::postCompress'); } else { // TODO: throw new Ajde_Exception('Document processor must be registered on either \'layout\' or \'compressor\''); } } } }