Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:entwickler:hooks [2026/08/26 21:03] – created kainhoferen:entwickler:hooks [2026/08/26 22:33] (current) kainhofer
Line 2: Line 2:
  
  
-For the full list of hooks, see the Hooks Catalogue. +For the full list of hooks, see the [[.:hooks:catalogue|Hooks Catalogue]]
  
 Note: The underlying plugin system that lets Admidio extend easily with third party plugins is not yet implemented. The hooks functionality described here, however, also works with manually added extensions in the admidio code tree. Note: The underlying plugin system that lets Admidio extend easily with third party plugins is not yet implemented. The hooks functionality described here, however, also works with manually added extensions in the admidio code tree.
Line 10: Line 10:
 Admidio's hooks are a generic extension mechanism to allow plugins to react to core events or even  Admidio's hooks are a generic extension mechanism to allow plugins to react to core events or even 
 modify core Admidio behavior without patching core files or subclassing core classes: modify core Admidio behavior without patching core files or subclassing core classes:
-  * You register a callback function for any of the documented hookd +  * You register a callback function for any of the documented hooks 
-  * At several strategic spots in the code, Admidio core dispatches a named hoo, at that point+  * At several strategic spots in the code, Admidio core dispatches a named hook
   * Core calls all registered callback functions for the particular named hook.   * Core calls all registered callback functions for the particular named hook.
  
Line 146: Line 146:
     }     }
     // reject an email outside the association's domain     // reject an email outside the association's domain
-    if ($userData->getValue('usd_usf_id') === $emailFieldId && !str_ends_with($value, '@example.org')) {+    if ($userData->getValue('usf_name_intern') === 'EMAIL' && !str_ends_with($value, '@example.org')) {
         throw new Exception('Only @example.org addresses are allowed.');         throw new Exception('Only @example.org addresses are allowed.');
     }     }
Line 202: Line 202:
 Hooks::addAction('page_before_render', function (PagePresenter $page) { Hooks::addAction('page_before_render', function (PagePresenter $page) {
     if ($page->getHtmlID() === 'adm_preferences') {     if ($page->getHtmlID() === 'adm_preferences') {
-        $page->addJavascript('msgBox("Discuss all changes with the webmaster first.");', true);+        $page->addJavascript('alert("Discuss all changes with the webmaster first.");', true);
     }     }
 }); });
  • en/entwickler/hooks.1787771029.txt.gz
  • Last modified: 2026/08/26 21:03
  • by kainhofer