]> git.mxchange.org Git - friendica.git/blob - doc/Addons.md
89c3c3d99ac65ecdece6221a0af514a73817ac4f
[friendica.git] / doc / Addons.md
1 Friendica Addon development
2 ==============
3
4 * [Home](help)
5
6 Please see the sample addon 'randplace' for a working example of using some of these features.
7 Addons work by intercepting event hooks - which must be registered.
8 Modules work by intercepting specific page requests (by URL path).
9
10 ## Naming
11
12 Addon names are used in file paths and functions names, and as such:
13 - Can't contain spaces or punctuation.
14 - Can't start with a number.
15
16 ## Metadata
17
18 You can provide human-readable information about your addon in the first multi-line comment of your addon file.
19
20 Here's the structure:
21
22 ```php
23 /**
24  * Name: {Human-readable name}
25  * Description: {Short description}
26  * Version: 1.0
27  * Author: {Author1 Name}
28  * Author: {Author2 Name} <{Author profile link}>
29  * Maintainer: {Maintainer1 Name}
30  * Maintainer: {Maintainer2 Name} <{Maintainer profile link}>
31  * Status: {Unsupported|Arbitrary status}
32  */
33 ```
34
35 You can also provide a longer documentation in a `README` or `README.md` file.
36 The latter will be converted from Markdown to HTML in the addon detail page.
37
38 ## Install/Uninstall
39
40 If your addon uses hooks, they have to be registered in a `<addon>_install()` function.
41 This function also allows to perform arbitrary actions your addon needs to function properly.
42
43 Uninstalling an addon automatically unregisters any hook it registered, but if you need to provide specific uninstallation steps, you can add them in a `<addon>_uninstall()` function.
44
45 The install and uninstall functions will be called (i.e. re-installed) if the addon changes after installation.
46 Therefore your uninstall should not destroy data and install should consider that data may already exist.
47 Future extensions may provide for "setup" amd "remove".
48
49 ## PHP addon hooks
50
51 Register your addon hooks during installation.
52
53     \Friendica\Core\Hook::register($hookname, $file, $function);
54
55 `$hookname` is a string and corresponds to a known Friendica PHP hook.
56
57 `$file` is a pathname relative to the top-level Friendica directory.
58 This *should* be 'addon/*addon_name*/*addon_name*.php' in most cases and can be shortened to `__FILE__`.
59
60 `$function` is a string and is the name of the function which will be executed when the hook is called.
61
62 ### Arguments
63 Your hook callback functions will be called with at least one and possibly two arguments
64
65     function <addon>_<hookname>(App $a, &$b) {
66
67     }
68
69 If you wish to make changes to the calling data, you must declare them as reference variables (with `&`) during function declaration.
70
71 #### $a
72 $a is the Friendica `App` class.
73 It contains a wealth of information about the current state of Friendica:
74
75 * which module has been called,
76 * configuration information,
77 * the page contents at the point the hook was invoked,
78 * profile and user information, etc.
79
80 It is recommeded you call this `$a` to match its usage elsewhere.
81
82 #### $b
83 $b can be called anything you like.
84 This is information specific to the hook currently being processed, and generally contains information that is being immediately processed or acted on that you can use, display, or alter.
85 Remember to declare it with `&` if you wish to alter it.
86
87 ## Admin settings
88
89 Your addon can provide user-specific settings via the `addon_settings` PHP hook, but it can also provide node-wide settings in the administration page of your addon.
90
91 Simply declare a `<addon>_addon_admin(App $a)` function to display the form and a `<addon>_addon_admin_post(App $a)` function to process the data from the form.
92
93 ## Global stylesheets
94
95 If your addon requires adding a stylesheet on all pages of Friendica, add the following hook:
96
97 ```php
98 function <addon>_install()
99 {
100         \Friendica\Core\Hook::register('head', __FILE__, '<addon>_head');
101         ...
102 }
103
104
105 function <addon>_head(App $a)
106 {
107         \Friendica\DI::page()->registerStylesheet(__DIR__ . '/relative/path/to/addon/stylesheet.css');
108 }
109 ```
110
111 `__DIR__` is the folder path of your addon.
112
113 ## JavaScript
114
115 ### Global scripts
116
117 If your addon requires adding a script on all pages of Friendica, add the following hook:
118
119
120 ```php
121 function <addon>_install()
122 {
123         \Friendica\Core\Hook::register('footer', __FILE__, '<addon>_footer');
124         ...
125 }
126
127 function <addon>_footer(App $a)
128 {
129         \Friendica\DI::page()->registerFooterScript(__DIR__ . '/relative/path/to/addon/script.js');
130 }
131 ```
132
133 `__DIR__` is the folder path of your addon.
134
135 ### JavaScript hooks
136
137 The main Friendica script provides hooks via events dispatched on the `document` property.
138 In your Javascript file included as described above, add your event listener like this:
139
140 ```js
141 document.addEventListener(name, callback);
142 ```
143
144 - *name* is the name of the hook and corresponds to a known Friendica JavaScript hook.
145 - *callback* is a JavaScript anonymous function to execute.
146
147 More info about Javascript event listeners: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
148
149 #### Current JavaScript hooks
150
151 ##### postprocess_liveupdate
152 Called at the end of the live update process (XmlHttpRequest) and on a post preview.
153 No additional data is provided.
154
155 ## Modules
156
157 Addons may also act as "modules" and intercept all page requests for a given URL path.
158 In order for a addon to act as a module it needs to declare an empty function `<addon>_module()`.
159
160 If this function exists, you will now receive all page requests for `https://my.web.site/<addon>` - with any number of URL components as additional arguments.
161 These are parsed into the `App\Arguments` object.
162 So `https://my.web.site/addon/arg1/arg2` would give this:
163 ```php
164 DI::args()->getArgc(); // = 3
165 DI::args()->get(0); // = 'addon'
166 DI::args()->get(1); // = 'arg1'
167 DI::args()->get(2); // = 'arg2'
168 ```
169
170 To display a module page, you need to declare the function `<addon>_content(App $a)`, which defines and returns the page body content.
171 They may also contain `<addon>_post(App $a)` which is called before the `<addon>_content` function and typically handles the results of POST forms.
172 You may also have `<addon>_init(App $a)` which is called before `<addon>_content` and should include common logic to your module.
173
174 ## Templates
175
176 If your addon needs some template, you can use the Friendica template system.
177 Friendica uses [smarty3](http://www.smarty.net/) as a template engine.
178
179 Put your tpl files in the *templates/* subfolder of your addon.
180
181 In your code, like in the function addon_name_content(), load the template file and execute it passing needed values:
182
183 ```php
184 use Friendica\Core\Renderer;
185
186 # load template file. first argument is the template name,
187 # second is the addon path relative to friendica top folder
188 $tpl = Renderer::getMarkupTemplate('mytemplate.tpl', __DIR__);
189
190 # apply template. first argument is the loaded template,
191 # second an array of 'name' => 'values' to pass to template
192 $output = Renderer::replaceMacros($tpl, array(
193         'title' => 'My beautiful addon',
194 ));
195 ```
196
197 See also the wiki page [Quick Template Guide](https://github.com/friendica/friendica/wiki/Quick-Template-Guide).
198
199 ## Current PHP hooks
200
201 ### authenticate
202 Called when a user attempts to login.
203 `$b` is an array containing:
204
205 - **username**: the supplied username
206 - **password**: the supplied password
207 - **authenticated**: set this to non-zero to authenticate the user.
208 - **user_record**: successful authentication must also return a valid user record from the database
209
210 ### logged_in
211 Called after a user has successfully logged in.
212 `$b` contains the `$a->user` array.
213
214 ### display_item
215 Called when formatting a post for display.
216 $b is an array:
217
218 - **item**: The item (array) details pulled from the database
219 - **output**: the (string) HTML representation of this item prior to adding it to the page
220
221 ### post_local
222 Called when a status post or comment is entered on the local system.
223 `$b` is the item array of the information to be stored in the database.
224 Please note: body contents are bbcode - not HTML.
225
226 ### post_local_end
227 Called when a local status post or comment has been stored on the local system.
228 `$b` is the item array of the information which has just been stored in the database.
229 Please note: body contents are bbcode - not HTML
230
231 ### post_remote
232 Called when receiving a post from another source. This may also be used to post local activity or system generated messages.
233 `$b` is the item array of information to be stored in the database and the item body is bbcode.
234
235 ### settings_form
236 Called when generating the HTML for the user Settings page.
237 `$b` is the HTML string of the settings page before the final `</form>` tag.
238
239 ### settings_post
240 Called when the Settings pages are submitted.
241 `$b` is the $_POST array.
242
243 ### addon_settings
244 Called when generating the HTML for the addon settings page.
245 `$b` is the (string) HTML of the addon settings page before the final `</form>` tag.
246
247 ### addon_settings_post
248 Called when the Addon Settings pages are submitted.
249 `$b` is the $_POST array.
250
251 ### profile_post
252 Called when posting a profile page.
253 `$b` is the $_POST array.
254
255 ### profile_edit
256 Called prior to output of profile edit page.
257 `$b` is an array containing:
258
259 - **profile**: profile (array) record from the database
260 - **entry**: the (string) HTML of the generated entry
261
262 ### profile_advanced
263 Called when the HTML is generated for the Advanced profile, corresponding to the Profile tab within a person's profile page.
264 `$b` is the HTML string representation of the generated profile.
265 The profile array details are in `$a->profile`.
266
267 ### directory_item
268 Called from the Directory page when formatting an item for display.
269 `$b` is an array:
270
271 - **contact**: contact record array for the person from the database
272 - **entry**: the HTML string of the generated entry
273
274 ### profile_sidebar_enter
275 Called prior to generating the sidebar "short" profile for a page.
276 `$b` is the person's profile array
277
278 ### profile_sidebar
279 Called when generating the sidebar "short" profile for a page.
280 `$b` is an array:
281
282 - **profile**: profile record array for the person from the database
283 - **entry**: the HTML string of the generated entry
284
285 ### contact_block_end
286 Called when formatting the block of contacts/friends on a profile sidebar has completed.
287 `$b` is an array:
288
289 - **contacts**: array of contacts
290 - **output**: the generated HTML string of the contact block
291
292 ### bbcode
293 Called after conversion of bbcode to HTML.
294 `$b` is an HTML string converted text.
295
296 ### html2bbcode
297 Called after tag conversion of HTML to bbcode (e.g. remote message posting)
298 `$b` is a string converted text
299
300 ### head
301 Called when building the `<head>` sections.
302 Stylesheets should be registered using this hook.
303 `$b` is an HTML string of the `<head>` tag.
304
305 ### page_header
306 Called after building the page navigation section.
307 `$b` is a string HTML of nav region.
308
309 ### personal_xrd
310 Called prior to output of personal XRD file.
311 `$b` is an array:
312
313 - **user**: the user record array for the person
314 - **xml**: the complete XML string to be output
315
316 ### home_content
317 Called prior to output home page content, shown to unlogged users.
318 `$b` is the HTML sring of section region.
319
320 ### contact_edit
321 Called when editing contact details on an individual from the Contacts page.
322 $b is an array:
323
324 - **contact**: contact record (array) of target contact
325 - **output**: the (string) generated HTML of the contact edit page
326
327 ### contact_edit_post
328 Called when posting the contact edit page.
329 `$b` is the `$_POST` array
330
331 ### init_1
332 Called just after DB has been opened and before session start.
333 No hook data.
334
335 ### page_end
336 Called after HTML content functions have completed.
337 `$b` is (string) HTML of content div.
338
339 ### footer
340 Called after HTML content functions have completed.
341 Deferred Javascript files should be registered using this hook.
342 `$b` is (string) HTML of footer div/element.
343
344 ### avatar_lookup
345 Called when looking up the avatar. `$b` is an array:
346
347 - **size**: the size of the avatar that will be looked up
348 - **email**: email to look up the avatar for
349 - **url**: the (string) generated URL of the avatar
350
351 ### emailer_send_prepare
352 Called from `Emailer::send()` before building the mime message.
353 `$b` is an array of params to `Emailer::send()`.
354
355 - **fromName**: name of the sender
356 - **fromEmail**: email fo the sender
357 - **replyTo**: replyTo address to direct responses
358 - **toEmail**: destination email address
359 - **messageSubject**: subject of the message
360 - **htmlVersion**: html version of the message
361 - **textVersion**: text only version of the message
362 - **additionalMailHeader**: additions to the smtp mail header
363 - **sent**: default false, if set to true in the hook, the default mailer will be skipped.
364
365 ### emailer_send
366 Called before calling PHP's `mail()`.
367 `$b` is an array of params to `mail()`.
368
369 - **to**
370 - **subject**
371 - **body**
372 - **headers**
373 - **sent**: default false, if set to true in the hook, the default mailer will be skipped.
374
375 ### load_config
376 Called during `App` initialization to allow addons to load their own configuration file(s) with `App::loadConfigFile()`.
377
378 ### nav_info
379 Called after the navigational menu is build in `include/nav.php`.
380 `$b` is an array containing `$nav` from `include/nav.php`.
381
382 ### template_vars
383 Called before vars are passed to the template engine to render the page.
384 The registered function can add,change or remove variables passed to template.
385 `$b` is an array with:
386
387 - **template**: filename of template
388 - **vars**: array of vars passed to the template
389
390 ### acl_lookup_end
391 Called after the other queries have passed.
392 The registered function can add, change or remove the `acl_lookup()` variables.
393
394 - **results**: array of the acl_lookup() vars
395
396 ### prepare_body_init
397 Called at the start of prepare_body
398 Hook data:
399
400 - **item** (input/output): item array
401
402 ### prepare_body_content_filter
403 Called before the HTML conversion in prepare_body. If the item matches a content filter rule set by an addon, it should
404 just add the reason to the filter_reasons element of the hook data.
405 Hook data:
406
407 - **item**: item array (input)
408 - **filter_reasons** (input/output): reasons array
409
410 ### prepare_body
411 Called after the HTML conversion in `prepare_body()`.
412 Hook data:
413
414 - **item** (input): item array
415 - **html** (input/output): converted item body
416 - **is_preview** (input): post preview flag
417 - **filter_reasons** (input): reasons array
418
419 ### prepare_body_final
420 Called at the end of `prepare_body()`.
421 Hook data:
422
423 - **item**: item array (input)
424 - **html**: converted item body (input/output)
425
426 ### put_item_in_cache
427 Called after `prepare_text()` in `put_item_in_cache()`.
428 Hook data:
429
430 - **item** (input): item array
431 - **rendered-html** (input/output): final item body HTML
432 - **rendered-hash** (input/output): original item body hash
433
434 ### magic_auth_success
435 Called when a magic-auth was successful.
436 Hook data:
437
438     visitor => array with the contact record of the visitor
439     url => the query string
440
441 ### jot_networks
442 Called when displaying the post permission screen.
443 Hook data is a list of form fields that need to be displayed along the ACL.
444 Form field array structure is:
445
446 - **type**: `checkbox` or `select`.
447 - **field**: Standard field data structure to be used by `field_checkbox.tpl` and `field_select.tpl`.
448
449 For `checkbox`, **field** is:
450   - [0] (String): Form field name; Mandatory.
451   - [1]: (String): Form field label; Optional, default is none.
452   - [2]: (Boolean): Whether the checkbox should be checked by default; Optional, default is false.
453   - [3]: (String): Additional help text; Optional, default is none.
454   - [4]: (String): Additional HTML attributes; Optional, default is none.
455
456 For `select`, **field** is:
457   - [0] (String): Form field name; Mandatory.
458   - [1] (String): Form field label; Optional, default is none.
459   - [2] (Boolean): Default value to be selected by default; Optional, default is none.
460   - [3] (String): Additional help text; Optional, default is none.
461   - [4] (Array): Associative array of options. Item key is option value, item value is option label; Mandatory.
462
463 ### route_collection
464 Called just before dispatching the router.
465 Hook data is a `\FastRoute\RouterCollector` object that should be used to add addon routes pointing to classes.
466
467 **Notice**: The class whose name is provided in the route handler must be reachable via auto-loader.
468
469 ### probe_detect
470
471 Called before trying to detect the target network of a URL.
472 If any registered hook function sets the `result` key of the hook data array, it will be returned immediately.
473 Hook functions should also return immediately if the hook data contains an existing result.
474
475 Hook data:
476
477 - **uri** (input): the profile URI.
478 - **network** (input): the target network (can be empty for auto-detection).
479 - **uid** (input): the user to return the contact data for (can be empty for public contacts).
480 - **result** (output): Set by the hook function to indicate a successful detection.
481
482 ### support_follow
483
484 Called to assert whether a connector addon provides follow capabilities.
485
486 Hook data:
487 - **protocol** (input): shorthand for the protocol. List of values is available in `src/Core/Protocol.php`.
488 - **result** (output): should be true if the connector provides follow capabilities, left alone otherwise.
489
490 ### support_revoke_follow
491
492 Called to assert whether a connector addon provides follow revocation capabilities.
493
494 Hook data:
495 - **protocol** (input): shorthand for the protocol. List of values is available in `src/Core/Protocol.php`.
496 - **result** (output): should be true if the connector provides follow revocation capabilities, left alone otherwise.
497
498 ### follow
499
500 Called before adding a new contact for a user to handle non-native network remote contact (like Twitter).
501
502 Hook data:
503
504 - **url** (input): URL of the remote contact.
505 - **contact** (output): should be filled with the contact (with uid = user creating the contact) array if follow was successful.
506
507 ### unfollow
508
509 Called when unfollowing a remote contact on a non-native network (like Twitter)
510
511 Hook data:
512 - **contact** (input): the remote contact (uid = local unfollowing user id) array.
513 - **two_way** (input): wether to stop sharing with the remote contact as well.
514 - **result** (output): wether the unfollowing is successful or not.
515
516 ### revoke_follow
517
518 Called when making a remote contact on a non-native network (like Twitter) unfollow you.
519
520 Hook data:
521 - **contact** (input): the remote contact (uid = local revoking user id) array.
522 - **result** (output): a boolean value indicating wether the operation was successful or not.
523
524 ## Complete list of hook callbacks
525
526 Here is a complete list of all hook callbacks with file locations (as of 24-Sep-2018). Please see the source for details of any hooks not documented above.
527
528 ### index.php
529
530     Hook::callAll('init_1');
531     Hook::callAll('app_menu', $arr);
532     Hook::callAll('page_content_top', DI::page()['content']);
533     Hook::callAll($a->module.'_mod_init', $placeholder);
534     Hook::callAll($a->module.'_mod_init', $placeholder);
535     Hook::callAll($a->module.'_mod_post', $_POST);
536     Hook::callAll($a->module.'_mod_afterpost', $placeholder);
537     Hook::callAll($a->module.'_mod_content', $arr);
538     Hook::callAll($a->module.'_mod_aftercontent', $arr);
539     Hook::callAll('page_end', DI::page()['content']);
540
541 ### include/api.php
542
543     Hook::callAll('logged_in', $a->user);
544     Hook::callAll('authenticate', $addon_auth);
545     Hook::callAll('logged_in', $a->user);
546
547 ### include/enotify.php
548
549     Hook::callAll('enotify', $h);
550     Hook::callAll('enotify_store', $datarray);
551     Hook::callAll('enotify_mail', $datarray);
552     Hook::callAll('check_item_notification', $notification_data);
553
554 ### src/Content/Conversation.php
555
556     Hook::callAll('conversation_start', $cb);
557     Hook::callAll('render_location', $locate);
558     Hook::callAll('display_item', $arr);
559     Hook::callAll('display_item', $arr);
560     Hook::callAll('item_photo_menu', $args);
561     Hook::callAll('jot_tool', $jotplugins);
562
563 ### mod/directory.php
564
565     Hook::callAll('directory_item', $arr);
566
567 ### mod/xrd.php
568
569     Hook::callAll('personal_xrd', $arr);
570
571 ### mod/ping.php
572
573     Hook::callAll('network_ping', $arr);
574
575 ### mod/parse_url.php
576
577     Hook::callAll("parse_link", $arr);
578
579 ### src/Module/Delegation.php
580
581     Hook::callAll('home_init', $ret);
582
583 ### mod/acl.php
584
585     Hook::callAll('acl_lookup_end', $results);
586
587 ### mod/network.php
588
589     Hook::callAll('network_content_init', $arr);
590     Hook::callAll('network_tabs', $arr);
591
592 ### mod/friendica.php
593
594     Hook::callAll('about_hook', $o);
595
596 ### mod/profiles.php
597
598     Hook::callAll('profile_post', $_POST);
599     Hook::callAll('profile_edit', $arr);
600
601 ### mod/settings.php
602
603     Hook::callAll('addon_settings_post', $_POST);
604     Hook::callAll('connector_settings_post', $_POST);
605     Hook::callAll('display_settings_post', $_POST);
606     Hook::callAll('settings_post', $_POST);
607     Hook::callAll('addon_settings', $settings_addons);
608     Hook::callAll('connector_settings', $settings_connectors);
609     Hook::callAll('display_settings', $o);
610     Hook::callAll('settings_form', $o);
611
612 ### mod/photos.php
613
614     Hook::callAll('photo_post_init', $_POST);
615     Hook::callAll('photo_post_file', $ret);
616     Hook::callAll('photo_post_end', $foo);
617     Hook::callAll('photo_post_end', $foo);
618     Hook::callAll('photo_post_end', $foo);
619     Hook::callAll('photo_post_end', $foo);
620     Hook::callAll('photo_post_end', intval($item_id));
621     Hook::callAll('photo_upload_form', $ret);
622
623 ### mod/profile.php
624
625     Hook::callAll('profile_advanced', $o);
626
627 ### mod/home.php
628
629     Hook::callAll('home_init', $ret);
630     Hook::callAll("home_content", $content);
631
632 ### mod/poke.php
633
634     Hook::callAll('post_local_end', $arr);
635
636 ### mod/contacts.php
637
638     Hook::callAll('contact_edit_post', $_POST);
639     Hook::callAll('contact_edit', $arr);
640
641 ### mod/tagger.php
642
643     Hook::callAll('post_local_end', $arr);
644
645 ### mod/uexport.php
646
647     Hook::callAll('uexport_options', $options);
648
649 ### mod/register.php
650
651     Hook::callAll('register_post', $arr);
652     Hook::callAll('register_form', $arr);
653
654 ### mod/item.php
655
656     Hook::callAll('post_local_start', $_REQUEST);
657     Hook::callAll('post_local', $datarray);
658     Hook::callAll('post_local_end', $datarray);
659
660 ### mod/editpost.php
661
662     Hook::callAll('jot_tool', $jotplugins);
663
664 ### src/Render/FriendicaSmartyEngine.php
665
666     Hook::callAll("template_vars", $arr);
667
668 ### src/App.php
669
670     Hook::callAll('load_config');
671     Hook::callAll('head');
672     Hook::callAll('footer');
673     Hook::callAll('route_collection');
674
675 ### src/Model/Item.php
676
677     Hook::callAll('post_local', $item);
678     Hook::callAll('post_remote', $item);
679     Hook::callAll('post_local_end', $posted_item);
680     Hook::callAll('post_remote_end', $posted_item);
681     Hook::callAll('tagged', $arr);
682     Hook::callAll('post_local_end', $new_item);
683     Hook::callAll('put_item_in_cache', $hook_data);
684     Hook::callAll('prepare_body_init', $item);
685     Hook::callAll('prepare_body_content_filter', $hook_data);
686     Hook::callAll('prepare_body', $hook_data);
687     Hook::callAll('prepare_body_final', $hook_data);
688
689 ### src/Model/Contact.php
690
691     Hook::callAll('contact_photo_menu', $args);
692     Hook::callAll('follow', $arr);
693
694 ### src/Model/Profile.php
695
696     Hook::callAll('profile_sidebar_enter', $profile);
697     Hook::callAll('profile_sidebar', $arr);
698     Hook::callAll('profile_tabs', $arr);
699     Hook::callAll('zrl_init', $arr);
700     Hook::callAll('magic_auth_success', $arr);
701
702 ### src/Model/Event.php
703
704     Hook::callAll('event_updated', $event['id']);
705     Hook::callAll("event_created", $event['id']);
706
707 ### src/Model/Register.php
708
709     Hook::callAll('authenticate', $addon_auth);
710
711 ### src/Model/User.php
712
713     Hook::callAll('authenticate', $addon_auth);
714     Hook::callAll('register_account', $uid);
715     Hook::callAll('remove_user', $user);
716
717 ### src/Module/PermissionTooltip.php
718
719     Hook::callAll('lockview_content', $item);
720
721 ### src/Module/Settings/Delegation.php
722
723     Hook::callAll('authenticate', $addon_auth);
724
725 ### src/Module/Settings/TwoFactor/Index.php
726
727     Hook::callAll('authenticate', $addon_auth);
728
729 ### src/Security/Authenticate.php
730
731     Hook::callAll('authenticate', $addon_auth);
732
733 ### src/Security/ExAuth.php
734
735     Hook::callAll('authenticate', $addon_auth);
736
737 ### src/Content/ContactBlock.php
738
739     Hook::callAll('contact_block_end', $arr);
740
741 ### src/Content/Text/BBCode.php
742
743     Hook::callAll('bbcode', $text);
744     Hook::callAll('bb2diaspora', $text);
745
746 ### src/Content/Text/HTML.php
747
748     Hook::callAll('html2bbcode', $message);
749
750 ### src/Content/Smilies.php
751
752     Hook::callAll('smilie', $params);
753
754 ### src/Content/Feature.php
755
756     Hook::callAll('isEnabled', $arr);
757     Hook::callAll('get', $arr);
758
759 ### src/Content/ContactSelector.php
760
761     Hook::callAll('network_to_name', $nets);
762
763 ### src/Content/OEmbed.php
764
765     Hook::callAll('oembed_fetch_url', $embedurl, $j);
766
767 ### src/Content/Nav.php
768
769     Hook::callAll('page_header', DI::page()['nav']);
770     Hook::callAll('nav_info', $nav);
771
772 ### src/Core/Authentication.php
773
774     Hook::callAll('logged_in', $a->user);
775
776 ### src/Core/Protocol.php
777
778     Hook::callAll('support_follow', $hook_data);
779     Hook::callAll('support_revoke_follow', $hook_data);
780     Hook::callAll('unfollow', $hook_data);
781     Kook::callAll('revoke_follow', $hook_data);
782
783 ### src/Core/StorageManager
784
785     Hook::callAll('storage_instance', $data);
786
787 ### src/Worker/Directory.php
788
789     Hook::callAll('globaldir_update', $arr);
790
791 ### src/Worker/Notifier.php
792
793     Hook::callAll('notifier_end', $target_item);
794
795 ### src/Module/Login.php
796
797     Hook::callAll('login_hook', $o);
798
799 ### src/Module/Logout.php
800
801     Hook::callAll("logging_out");
802
803 ### src/Object/Post.php
804
805     Hook::callAll('render_location', $locate);
806     Hook::callAll('display_item', $arr);
807
808 ### src/Core/ACL.php
809
810     Hook::callAll('contact_select_options', $x);
811     Hook::callAll($a->module.'_pre_'.$selname, $arr);
812     Hook::callAll($a->module.'_post_'.$selname, $o);
813     Hook::callAll($a->module.'_pre_'.$selname, $arr);
814     Hook::callAll($a->module.'_post_'.$selname, $o);
815     Hook::callAll('jot_networks', $jotnets);
816
817 ### src/Core/Authentication.php
818
819     Hook::callAll('logged_in', $a->user);
820     Hook::callAll('authenticate', $addon_auth);
821
822 ### src/Core/Hook.php
823
824     self::callSingle(self::getApp(), 'hook_fork', $fork_hook, $hookdata);
825
826 ### src/Core/L10n/L10n.php
827
828     Hook::callAll('poke_verbs', $arr);
829
830 ### src/Core/Worker.php
831
832     Hook::callAll("proc_run", $arr);
833
834 ### src/Util/Emailer.php
835
836     Hook::callAll('emailer_send_prepare', $params);
837     Hook::callAll("emailer_send", $hookdata);
838
839 ### src/Util/Map.php
840
841     Hook::callAll('generate_map', $arr);
842     Hook::callAll('generate_named_map', $arr);
843     Hook::callAll('Map::getCoordinates', $arr);
844
845 ### src/Util/Network.php
846
847     Hook::callAll('avatar_lookup', $avatar);
848
849 ### src/Util/ParseUrl.php
850
851     Hook::callAll("getsiteinfo", $siteinfo);
852
853 ### src/Protocol/DFRN.php
854
855     Hook::callAll('atom_feed_end', $atom);
856     Hook::callAll('atom_feed_end', $atom);
857
858 ### src/Protocol/Email.php
859
860     Hook::callAll('email_getmessage', $message);
861     Hook::callAll('email_getmessage_end', $ret);
862
863 ### view/js/main.js
864
865     document.dispatchEvent(new Event('postprocess_liveupdate'));