Пример #1
0
 /**
  * Define Hook Bundles
  */
 protected function setupHookBundles()
 {
     $bundle = new Zikula_HookManager_ProviderBundle($this->name, self::PROVIDER_UIAREANAME, 'ui_hooks', $this->__('BBSmile - Show smilies'));
     // form_edit hook is used to add smiley selector and other code to new object form (validate and process hooks unneeded)
     $bundle->addServiceHandler('form_edit', 'BBSmile_HookHandlers', 'uiEdit', 'bbsmile.smilies');
     $this->registerHookProviderBundle($bundle);
     $bundle = new Zikula_HookManager_ProviderBundle($this->name, self::PROVIDER_FILTERAREANAME, 'filter_hooks', $this->__('BBSmile - Transform Smilies'));
     // filter hook is used to transform the altered text in the hooked object to display the smilies
     $bundle->addServiceHandler('filter', 'BBSmile_HookHandlers', 'uifilter', 'bbsmile.transform');
     $this->registerHookProviderBundle($bundle);
 }
Пример #2
0
 protected function setupHookBundles()
 {
     // Register hooks
     $bundle = new Zikula_HookManager_SubscriberBundle($this->name, 'subscriber.ephemerides.ui_hooks.items', 'ui_hooks', $this->__('Ephemerides Items Hooks'));
     $bundle->addEvent('display_view', 'ephemerides.ui_hooks.items.display_view');
     $bundle->addEvent('form_edit', 'ephemerides.ui_hooks.items.form_edit');
     $this->registerHookSubscriberBundle($bundle);
     $bundle = new Zikula_HookManager_ProviderBundle($this->name, 'provider.ephemerides.ui_hooks.ephemeride', 'ui_hooks', $this->__('Ephemerides Item'));
     $bundle->addServiceHandler('display_view', 'Ephemerides_HookHandlers', 'uiView', 'ephemerides.ephemeride');
     $this->registerHookProviderBundle($bundle);
 }
Пример #3
0
 protected function setupHookBundles()
 {
     $bundle = new Zikula_HookManager_ProviderBundle($this->name, 'provider.ezcomments.ui_hooks.comments', 'ui_hooks', $this->__('EZComments Comment Hooks'));
     $bundle->addServiceHandler('display_view', 'EZComments_HookHandlers', 'uiView', 'ezcomments.hooks.comments');
     $bundle->addServiceHandler('process_edit', 'EZComments_HookHandlers', 'processEdit', 'ezcomments.hooks.comments');
     $bundle->addServiceHandler('process_delete', 'EZComments_HookHandlers', 'processDelete', 'ezcomments.hooks.comments');
     $this->registerHookProviderBundle($bundle);
     $bundle = new Zikula_HookManager_SubscriberBundle($this->name, 'subscriber.ezcomments.ui_hooks.comments', 'ui_hooks', $this->__('EZComments Comment Hooks'));
     $bundle->addEvent('display_view', 'ezcomments.ui_hooks.comments.display_view');
     $bundle->addEvent('form_edit', 'ezcomments.ui_hooks.comments.form_edit');
     $bundle->addEvent('form_delete', 'ezcomments.ui_hooks.comments.form_delete');
     $bundle->addEvent('validate_edit', 'ezcomments.ui_hooks.comments.validate_edit');
     $bundle->addEvent('validate_delete', 'ezcomments.ui_hooks.comments.validate_delete');
     $bundle->addEvent('process_edit', 'ezcomments.ui_hooks.comments.process_edit');
     $bundle->addEvent('process_delete', 'ezcomments.ui_hooks.comments.process_delete');
     $this->registerHookSubscriberBundle($bundle);
     $bundle = new Zikula_HookManager_SubscriberBundle($this->name, 'subscriber.ezcomments.filter_hooks.comments', 'filter_hooks', $this->__('EZComment Comments Filter'));
     $bundle->addEvent('filter', 'ezcomments.filter_hooks.comments.filter');
     $this->registerHookSubscriberBundle($bundle);
 }
Пример #4
0
 private function createProviderUIHook($name, $title)
 {
     $bundle = new \Zikula_HookManager_ProviderBundle($this->name, "provider.cmfcmfmediamodule.ui_hooks.{$name}", "ui_hooks", $this->__f("Media Module - %s", [$title]));
     $class = "Cmfcmf\\Module\\MediaModule\\HookHandler\\" . ucfirst($name) . "HookHandler";
     $service = "cmfcmf_media_module.hook_handler.{$name}";
     $bundle->addServiceHandler("display_view", $class, "uiView", $service);
     $bundle->addServiceHandler("form_edit", $class, "uiEdit", $service);
     $bundle->addServiceHandler("validate_edit", $class, "validateEdit", $service);
     $bundle->addServiceHandler("process_edit", $class, "processEdit", $service);
     $bundle->addServiceHandler("process_delete", $class, "processDelete", $service);
     $this->registerHookProviderBundle($bundle);
 }
Пример #5
0
 protected function setupHookBundles()
 {
     $bundle = new Zikula_HookManager_ProviderBundle($this->name, self::PROVIDER_UIAREANAME, 'ui_hooks', __('WYSIWYG Editor'));
     $bundle->addServiceHandler('form_edit', 'Scribite_HookHandlers', 'uiEdit', 'scribite.editor');
     $this->registerHookProviderBundle($bundle);
 }
Пример #6
0
 /**
  * Unregister a provider bundle with persistence.
  *
  * @param Zikula_HookManager_ProviderBundle $bundle
  */
 public function unregisterProviderBundle(Zikula_HookManager_ProviderBundle $bundle)
 {
     $this->storage->unregisterProviderByArea($bundle->getArea());
     $this->reload();
 }
Пример #7
0
 /**
  * Register a hook subscriber bundle.
  *
  * @param Zikula_HookManager_ProviderBundle $bundle HookProviderBundle.
  *
  * @return Zikula_AbstractVersion
  */
 public function registerHookProviderBundle(Zikula_HookManager_ProviderBundle $bundle)
 {
     if (array_key_exists($bundle->getArea(), $this->hookProviderBundles)) {
         throw new InvalidArgumentException(sprintf('Area %s is already registered', $bundle->getArea()));
     }
     $this->hookProviderBundles[$bundle->getArea()] = $bundle;
     return $this;
 }