]> git.mxchange.org Git - friendica.git/blob - doc/Addons.md
Show month/halfyear usage
[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 `$data` is an array containing:
246
247 - **addon** (output): Required. The addon folder name.
248 - **title** (output): Required. The addon settings panel title.
249 - **href** (output): Optional. If set, will reduce the panel to a link pointing to this URL, can be relative. Incompatible with the following keys.
250 - **html** (output): Optional. Raw HTML of the addon form elements. Both the `<form>` tags and the submit buttons are taken care of elsewhere.
251 - **submit** (output): Optional. If unset, a default submit button with `name="<addon name>-submit"` will be generated.
252   Can take different value types:
253   - **string**: The label to replace the default one.
254   - **associative array**: A list of submit button, the key is the value of the `name` attribute, the value is the displayed label.
255     The first submit button in this list is considered the main one and themes might emphasize its display.
256
257 #### Examples
258
259 ##### With link
260 ```php
261 $data = [
262         'addon' => 'advancedcontentfilter',
263         'title' => DI::l10n()->t('Advanced Content Filter'),
264         'href'  => 'advancedcontentfilter',
265 ];
266 ```
267 ##### With default submit button
268 ```php
269 $data = [
270         'addon' => 'fromapp',
271         'title' => DI::l10n()->t('FromApp Settings'),
272         'html'  => $html,
273 ];
274 ```
275 ##### With no HTML, just a submit button
276 ```php
277 $data = [
278         'addon'  => 'opmlexport',
279         'title'  => DI::l10n()->t('OPML Export'),
280         'submit' => DI::l10n()->t('Export RSS/Atom contacts'),
281 ];
282 ```
283 ##### With multiple submit buttons
284 ```php
285 $data = [
286         'addon'  => 'catavar',
287         'title'  => DI::l10n()->t('Cat Avatar Settings'),
288         'html'   => $html,
289         'submit' => [
290                 'catavatar-usecat'   => DI::l10n()->t('Use Cat as Avatar'),
291                 'catavatar-morecat'  => DI::l10n()->t('Another random Cat!'),
292                 'catavatar-emailcat' => DI::pConfig()->get(local_user(), 'catavatar', 'seed', false) ? DI::l10n()->t('Reset to email Cat') : null,
293         ],
294 ];
295 ```
296
297 ### addon_settings_post
298 Called when the Addon Settings pages are submitted.
299 `$b` is the $_POST array.
300
301 ### connector_settings
302 Called when generating the HTML for a connector addon settings page.
303 `$data` is an array containing:
304
305 - **connector** (output): Required. The addon folder name.
306 - **title** (output): Required. The addon settings panel title.
307 - **image** (output): Required. The relative path of the logo image of the platform/protocol this addon is connecting to, max size 48x48px.
308 - **enabled** (output): Optional. If set to a falsy value, the connector image will be dimmed.
309 - **html** (output): Optional. Raw HTML of the addon form elements. Both the `<form>` tags and the submit buttons are taken care of elsewhere.
310 - **submit** (output): Optional. If unset, a default submit button with `name="<addon name>-submit"` will be generated.
311   Can take different value types:
312     - **string**: The label to replace the default one.
313       - **associative array**: A list of submit button, the key is the value of the `name` attribute, the value is the displayed label.
314         The first submit button in this list is considered the main one and themes might emphasize its display.
315
316 #### Examples
317
318 ##### With default submit button
319 ```php
320 $data = [
321         'connector' => 'diaspora',
322         'title'     => DI::l10n()->t('Diaspora Export'),
323         'image'     => 'images/diaspora-logo.png',
324         'enabled'   => $enabled,
325         'html'      => $html,
326 ];
327 ```
328
329 ##### With custom submit button label and no logo dim
330 ```php
331 $data = [
332         'connector' => 'ifttt',
333         'title'     => DI::l10n()->t('IFTTT Mirror'),
334         'image'     => 'addon/ifttt/ifttt.png',
335         'html'      => $html,
336         'submit'    => DI::l10n()->t('Generate new key'),
337 ];
338 ```
339
340 ##### With conditional submit buttons
341 ```php
342 $submit = ['pumpio-submit' => DI::l10n()->t('Save Settings')];
343 if ($oauth_token && $oauth_token_secret) {
344         $submit['pumpio-delete'] = DI::l10n()->t('Delete this preset');
345 }
346
347 $data = [
348         'connector' => 'pumpio',
349         'title'     => DI::l10n()->t('Pump.io Import/Export/Mirror'),
350         'image'     => 'images/pumpio.png',
351         'enabled'   => $enabled,
352         'html'      => $html,
353         'submit'    => $submit,
354 ];
355 ```
356
357 ### profile_post
358 Called when posting a profile page.
359 `$b` is the $_POST array.
360
361 ### profile_edit
362 Called prior to output of profile edit page.
363 `$b` is an array containing:
364
365 - **profile**: profile (array) record from the database
366 - **entry**: the (string) HTML of the generated entry
367
368 ### profile_advanced
369 Called when the HTML is generated for the Advanced profile, corresponding to the Profile tab within a person's profile page.
370 `$b` is the HTML string representation of the generated profile.
371 The profile array details are in `$a->profile`.
372
373 ### directory_item
374 Called from the Directory page when formatting an item for display.
375 `$b` is an array:
376
377 - **contact**: contact record array for the person from the database
378 - **entry**: the HTML string of the generated entry
379
380 ### profile_sidebar_enter
381 Called prior to generating the sidebar "short" profile for a page.
382 `$b` is the person's profile array
383
384 ### profile_sidebar
385 Called when generating the sidebar "short" profile for a page.
386 `$b` is an array:
387
388 - **profile**: profile record array for the person from the database
389 - **entry**: the HTML string of the generated entry
390
391 ### contact_block_end
392 Called when formatting the block of contacts/friends on a profile sidebar has completed.
393 `$b` is an array:
394
395 - **contacts**: array of contacts
396 - **output**: the generated HTML string of the contact block
397
398 ### bbcode
399 Called after conversion of bbcode to HTML.
400 `$b` is an HTML string converted text.
401
402 ### html2bbcode
403 Called after tag conversion of HTML to bbcode (e.g. remote message posting)
404 `$b` is a string converted text
405
406 ### head
407 Called when building the `<head>` sections.
408 Stylesheets should be registered using this hook.
409 `$b` is an HTML string of the `<head>` tag.
410
411 ### page_header
412 Called after building the page navigation section.
413 `$b` is a string HTML of nav region.
414
415 ### personal_xrd
416 Called prior to output of personal XRD file.
417 `$b` is an array:
418
419 - **user**: the user record array for the person
420 - **xml**: the complete XML string to be output
421
422 ### home_content
423 Called prior to output home page content, shown to unlogged users.
424 `$b` is the HTML sring of section region.
425
426 ### contact_edit
427 Called when editing contact details on an individual from the Contacts page.
428 $b is an array:
429
430 - **contact**: contact record (array) of target contact
431 - **output**: the (string) generated HTML of the contact edit page
432
433 ### contact_edit_post
434 Called when posting the contact edit page.
435 `$b` is the `$_POST` array
436
437 ### init_1
438 Called just after DB has been opened and before session start.
439 No hook data.
440
441 ### page_end
442 Called after HTML content functions have completed.
443 `$b` is (string) HTML of content div.
444
445 ### footer
446 Called after HTML content functions have completed.
447 Deferred Javascript files should be registered using this hook.
448 `$b` is (string) HTML of footer div/element.
449
450 ### avatar_lookup
451 Called when looking up the avatar. `$b` is an array:
452
453 - **size**: the size of the avatar that will be looked up
454 - **email**: email to look up the avatar for
455 - **url**: the (string) generated URL of the avatar
456
457 ### emailer_send_prepare
458 Called from `Emailer::send()` before building the mime message.
459 `$b` is an array of params to `Emailer::send()`.
460
461 - **fromName**: name of the sender
462 - **fromEmail**: email fo the sender
463 - **replyTo**: replyTo address to direct responses
464 - **toEmail**: destination email address
465 - **messageSubject**: subject of the message
466 - **htmlVersion**: html version of the message
467 - **textVersion**: text only version of the message
468 - **additionalMailHeader**: additions to the smtp mail header
469 - **sent**: default false, if set to true in the hook, the default mailer will be skipped.
470
471 ### emailer_send
472 Called before calling PHP's `mail()`.
473 `$b` is an array of params to `mail()`.
474
475 - **to**
476 - **subject**
477 - **body**
478 - **headers**
479 - **sent**: default false, if set to true in the hook, the default mailer will be skipped.
480
481 ### load_config
482 Called during `App` initialization to allow addons to load their own configuration file(s) with `App::loadConfigFile()`.
483
484 ### nav_info
485 Called after the navigational menu is build in `include/nav.php`.
486 `$b` is an array containing `$nav` from `include/nav.php`.
487
488 ### template_vars
489 Called before vars are passed to the template engine to render the page.
490 The registered function can add,change or remove variables passed to template.
491 `$b` is an array with:
492
493 - **template**: filename of template
494 - **vars**: array of vars passed to the template
495
496 ### acl_lookup_end
497 Called after the other queries have passed.
498 The registered function can add, change or remove the `acl_lookup()` variables.
499
500 - **results**: array of the acl_lookup() vars
501
502 ### prepare_body_init
503 Called at the start of prepare_body
504 Hook data:
505
506 - **item** (input/output): item array
507
508 ### prepare_body_content_filter
509 Called before the HTML conversion in prepare_body. If the item matches a content filter rule set by an addon, it should
510 just add the reason to the filter_reasons element of the hook data.
511 Hook data:
512
513 - **item**: item array (input)
514 - **filter_reasons** (input/output): reasons array
515
516 ### prepare_body
517 Called after the HTML conversion in `prepare_body()`.
518 Hook data:
519
520 - **item** (input): item array
521 - **html** (input/output): converted item body
522 - **is_preview** (input): post preview flag
523 - **filter_reasons** (input): reasons array
524
525 ### prepare_body_final
526 Called at the end of `prepare_body()`.
527 Hook data:
528
529 - **item**: item array (input)
530 - **html**: converted item body (input/output)
531
532 ### put_item_in_cache
533 Called after `prepare_text()` in `put_item_in_cache()`.
534 Hook data:
535
536 - **item** (input): item array
537 - **rendered-html** (input/output): final item body HTML
538 - **rendered-hash** (input/output): original item body hash
539
540 ### magic_auth_success
541 Called when a magic-auth was successful.
542 Hook data:
543
544     visitor => array with the contact record of the visitor
545     url => the query string
546
547 ### jot_networks
548 Called when displaying the post permission screen.
549 Hook data is a list of form fields that need to be displayed along the ACL.
550 Form field array structure is:
551
552 - **type**: `checkbox` or `select`.
553 - **field**: Standard field data structure to be used by `field_checkbox.tpl` and `field_select.tpl`.
554
555 For `checkbox`, **field** is:
556   - [0] (String): Form field name; Mandatory.
557   - [1]: (String): Form field label; Optional, default is none.
558   - [2]: (Boolean): Whether the checkbox should be checked by default; Optional, default is false.
559   - [3]: (String): Additional help text; Optional, default is none.
560   - [4]: (String): Additional HTML attributes; Optional, default is none.
561
562 For `select`, **field** is:
563   - [0] (String): Form field name; Mandatory.
564   - [1] (String): Form field label; Optional, default is none.
565   - [2] (Boolean): Default value to be selected by default; Optional, default is none.
566   - [3] (String): Additional help text; Optional, default is none.
567   - [4] (Array): Associative array of options. Item key is option value, item value is option label; Mandatory.
568
569 ### route_collection
570 Called just before dispatching the router.
571 Hook data is a `\FastRoute\RouterCollector` object that should be used to add addon routes pointing to classes.
572
573 **Notice**: The class whose name is provided in the route handler must be reachable via auto-loader.
574
575 ### probe_detect
576
577 Called before trying to detect the target network of a URL.
578 If any registered hook function sets the `result` key of the hook data array, it will be returned immediately.
579 Hook functions should also return immediately if the hook data contains an existing result.
580
581 Hook data:
582
583 - **uri** (input): the profile URI.
584 - **network** (input): the target network (can be empty for auto-detection).
585 - **uid** (input): the user to return the contact data for (can be empty for public contacts).
586 - **result** (output): Leave null if address isn't relevant to the connector, set to contact array if probe is successful, false otherwise.
587
588 ### item_by_link
589
590 Called when trying to probe an item from a given URI.
591 If any registered hook function sets the `item_id` key of the hook data array, it will be returned immediately.
592 Hook functions should also return immediately if the hook data contains an existing `item_id`.
593
594 Hook data:
595 - **uri** (input): the item URI.
596 - **uid** (input): the user to return the item data for (can be empty for public contacts).
597 - **item_id** (output): Leave null if URI isn't relevant to the connector, set to created item array if probe is successful, false otherwise.
598
599 ### support_follow
600
601 Called to assert whether a connector addon provides follow capabilities.
602
603 Hook data:
604 - **protocol** (input): shorthand for the protocol. List of values is available in `src/Core/Protocol.php`.
605 - **result** (output): should be true if the connector provides follow capabilities, left alone otherwise.
606
607 ### support_revoke_follow
608
609 Called to assert whether a connector addon provides follow revocation capabilities.
610
611 Hook data:
612 - **protocol** (input): shorthand for the protocol. List of values is available in `src/Core/Protocol.php`.
613 - **result** (output): should be true if the connector provides follow revocation capabilities, left alone otherwise.
614
615 ### follow
616
617 Called before adding a new contact for a user to handle non-native network remote contact (like Twitter).
618
619 Hook data:
620
621 - **url** (input): URL of the remote contact.
622 - **contact** (output): should be filled with the contact (with uid = user creating the contact) array if follow was successful.
623
624 ### unfollow
625
626 Called when unfollowing a remote contact on a non-native network (like Twitter)
627
628 Hook data:
629 - **contact** (input): the remote contact (uid = local unfollowing user id) array.
630 - **result** (output): wether the unfollowing is successful or not.
631
632 ### revoke_follow
633
634 Called when making a remote contact on a non-native network (like Twitter) unfollow you.
635
636 Hook data:
637 - **contact** (input): the remote contact (uid = local revoking user id) array.
638 - **result** (output): a boolean value indicating wether the operation was successful or not.
639
640 ### block
641
642 Called when blocking a remote contact on a non-native network (like Twitter).
643
644 Hook data:
645 - **contact** (input): the remote contact (uid = 0) array.
646 - **uid** (input): the user id to issue the block for.
647 - **result** (output): a boolean value indicating wether the operation was successful or not.
648
649 ### unblock
650
651 Called when unblocking a remote contact on a non-native network (like Twitter).
652
653 Hook data:
654 - **contact** (input): the remote contact (uid = 0) array.
655 - **uid** (input): the user id to revoke the block for.
656 - **result** (output): a boolean value indicating wether the operation was successful or not.
657
658 ### storage_instance
659
660 Called when a custom storage is used (e.g. webdav_storage)
661
662 Hook data:
663 - **name** (input): the name of the used storage backend
664 - **data['storage']** (output): the storage instance to use (**must** implement `\Friendica\Core\Storage\IWritableStorage`) 
665
666 ### storage_config
667
668 Called when the admin of the node wants to configure a custom storage (e.g. webdav_storage)
669
670 Hook data:
671 - **name** (input): the name of the used storage backend
672 - **data['storage_config']** (output): the storage configuration instance to use (**must** implement `\Friendica\Core\Storage\Capability\IConfigureStorage`)
673
674 ## Complete list of hook callbacks
675
676 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.
677
678 ### index.php
679
680     Hook::callAll('init_1');
681     Hook::callAll('app_menu', $arr);
682     Hook::callAll('page_content_top', DI::page()['content']);
683     Hook::callAll($a->module.'_mod_init', $placeholder);
684     Hook::callAll($a->module.'_mod_init', $placeholder);
685     Hook::callAll($a->module.'_mod_post', $_POST);
686     Hook::callAll($a->module.'_mod_content', $arr);
687     Hook::callAll($a->module.'_mod_aftercontent', $arr);
688     Hook::callAll('page_end', DI::page()['content']);
689
690 ### include/api.php
691
692     Hook::callAll('logged_in', $a->user);
693     Hook::callAll('authenticate', $addon_auth);
694     Hook::callAll('logged_in', $a->user);
695
696 ### include/enotify.php
697
698     Hook::callAll('enotify', $h);
699     Hook::callAll('enotify_store', $datarray);
700     Hook::callAll('enotify_mail', $datarray);
701     Hook::callAll('check_item_notification', $notification_data);
702
703 ### src/Content/Conversation.php
704
705     Hook::callAll('conversation_start', $cb);
706     Hook::callAll('render_location', $locate);
707     Hook::callAll('display_item', $arr);
708     Hook::callAll('display_item', $arr);
709     Hook::callAll('item_photo_menu', $args);
710     Hook::callAll('jot_tool', $jotplugins);
711
712 ### mod/directory.php
713
714     Hook::callAll('directory_item', $arr);
715
716 ### mod/xrd.php
717
718     Hook::callAll('personal_xrd', $arr);
719
720 ### mod/ping.php
721
722     Hook::callAll('network_ping', $arr);
723
724 ### mod/parse_url.php
725
726     Hook::callAll("parse_link", $arr);
727
728 ### src/Module/Delegation.php
729
730     Hook::callAll('home_init', $ret);
731
732 ### mod/acl.php
733
734     Hook::callAll('acl_lookup_end', $results);
735
736 ### mod/network.php
737
738     Hook::callAll('network_content_init', $arr);
739     Hook::callAll('network_tabs', $arr);
740
741 ### mod/friendica.php
742
743     Hook::callAll('about_hook', $o);
744
745 ### mod/profiles.php
746
747     Hook::callAll('profile_post', $_POST);
748     Hook::callAll('profile_edit', $arr);
749
750 ### mod/settings.php
751
752     Hook::callAll('addon_settings_post', $_POST);
753     Hook::callAll('connector_settings_post', $_POST);
754     Hook::callAll('display_settings_post', $_POST);
755     Hook::callAll('settings_post', $_POST);
756     Hook::callAll('addon_settings', $settings_addons);
757     Hook::callAll('connector_settings', $settings_connectors);
758     Hook::callAll('display_settings', $o);
759     Hook::callAll('settings_form', $o);
760
761 ### mod/photos.php
762
763     Hook::callAll('photo_post_init', $_POST);
764     Hook::callAll('photo_post_file', $ret);
765     Hook::callAll('photo_post_end', $foo);
766     Hook::callAll('photo_post_end', $foo);
767     Hook::callAll('photo_post_end', $foo);
768     Hook::callAll('photo_post_end', $foo);
769     Hook::callAll('photo_post_end', intval($item_id));
770     Hook::callAll('photo_upload_form', $ret);
771
772 ### mod/profile.php
773
774     Hook::callAll('profile_advanced', $o);
775
776 ### mod/home.php
777
778     Hook::callAll('home_init', $ret);
779     Hook::callAll("home_content", $content);
780
781 ### mod/poke.php
782
783     Hook::callAll('post_local_end', $arr);
784
785 ### mod/contacts.php
786
787     Hook::callAll('contact_edit_post', $_POST);
788     Hook::callAll('contact_edit', $arr);
789
790 ### mod/tagger.php
791
792     Hook::callAll('post_local_end', $arr);
793
794 ### mod/uexport.php
795
796     Hook::callAll('uexport_options', $options);
797
798 ### mod/register.php
799
800     Hook::callAll('register_post', $arr);
801     Hook::callAll('register_form', $arr);
802
803 ### mod/item.php
804
805     Hook::callAll('post_local_start', $_REQUEST);
806     Hook::callAll('post_local', $datarray);
807     Hook::callAll('post_local_end', $datarray);
808
809 ### mod/editpost.php
810
811     Hook::callAll('jot_tool', $jotplugins);
812
813 ### src/Render/FriendicaSmartyEngine.php
814
815     Hook::callAll("template_vars", $arr);
816
817 ### src/App.php
818
819     Hook::callAll('load_config');
820     Hook::callAll('head');
821     Hook::callAll('footer');
822     Hook::callAll('route_collection');
823
824 ### src/Model/Item.php
825
826     Hook::callAll('post_local', $item);
827     Hook::callAll('post_remote', $item);
828     Hook::callAll('post_local_end', $posted_item);
829     Hook::callAll('post_remote_end', $posted_item);
830     Hook::callAll('tagged', $arr);
831     Hook::callAll('post_local_end', $new_item);
832     Hook::callAll('put_item_in_cache', $hook_data);
833     Hook::callAll('prepare_body_init', $item);
834     Hook::callAll('prepare_body_content_filter', $hook_data);
835     Hook::callAll('prepare_body', $hook_data);
836     Hook::callAll('prepare_body_final', $hook_data);
837
838 ### src/Model/Contact.php
839
840     Hook::callAll('contact_photo_menu', $args);
841     Hook::callAll('follow', $arr);
842
843 ### src/Model/Profile.php
844
845     Hook::callAll('profile_sidebar_enter', $profile);
846     Hook::callAll('profile_sidebar', $arr);
847     Hook::callAll('profile_tabs', $arr);
848     Hook::callAll('zrl_init', $arr);
849     Hook::callAll('magic_auth_success', $arr);
850
851 ### src/Model/Event.php
852
853     Hook::callAll('event_updated', $event['id']);
854     Hook::callAll("event_created", $event['id']);
855
856 ### src/Model/Register.php
857
858     Hook::callAll('authenticate', $addon_auth);
859
860 ### src/Model/User.php
861
862     Hook::callAll('authenticate', $addon_auth);
863     Hook::callAll('register_account', $uid);
864     Hook::callAll('remove_user', $user);
865
866 ### src/Module/PermissionTooltip.php
867
868     Hook::callAll('lockview_content', $item);
869
870 ### src/Module/Settings/Delegation.php
871
872     Hook::callAll('authenticate', $addon_auth);
873
874 ### src/Module/Settings/TwoFactor/Index.php
875
876     Hook::callAll('authenticate', $addon_auth);
877
878 ### src/Security/Authenticate.php
879
880     Hook::callAll('authenticate', $addon_auth);
881
882 ### src/Security/ExAuth.php
883
884     Hook::callAll('authenticate', $addon_auth);
885
886 ### src/Content/ContactBlock.php
887
888     Hook::callAll('contact_block_end', $arr);
889
890 ### src/Content/Text/BBCode.php
891
892     Hook::callAll('bbcode', $text);
893     Hook::callAll('bb2diaspora', $text);
894
895 ### src/Content/Text/HTML.php
896
897     Hook::callAll('html2bbcode', $message);
898
899 ### src/Content/Smilies.php
900
901     Hook::callAll('smilie', $params);
902
903 ### src/Content/Feature.php
904
905     Hook::callAll('isEnabled', $arr);
906     Hook::callAll('get', $arr);
907
908 ### src/Content/ContactSelector.php
909
910     Hook::callAll('network_to_name', $nets);
911
912 ### src/Content/OEmbed.php
913
914     Hook::callAll('oembed_fetch_url', $embedurl, $j);
915
916 ### src/Content/Nav.php
917
918     Hook::callAll('page_header', DI::page()['nav']);
919     Hook::callAll('nav_info', $nav);
920
921 ### src/Core/Authentication.php
922
923     Hook::callAll('logged_in', $a->user);
924
925 ### src/Core/Protocol.php
926
927     Hook::callAll('support_follow', $hook_data);
928     Hook::callAll('support_revoke_follow', $hook_data);
929     Hook::callAll('unfollow', $hook_data);
930     Hook::callAll('revoke_follow', $hook_data);
931     Hook::callAll('block', $hook_data);
932     Hook::callAll('unblock', $hook_data);
933
934 ### src/Core/StorageManager
935
936     Hook::callAll('storage_instance', $data);
937     Hook::callAll('storage_config', $data);
938
939 ### src/Worker/Directory.php
940
941     Hook::callAll('globaldir_update', $arr);
942
943 ### src/Worker/Notifier.php
944
945     Hook::callAll('notifier_end', $target_item);
946
947 ### src/Module/Login.php
948
949     Hook::callAll('login_hook', $o);
950
951 ### src/Module/Logout.php
952
953     Hook::callAll("logging_out");
954
955 ### src/Object/Post.php
956
957     Hook::callAll('render_location', $locate);
958     Hook::callAll('display_item', $arr);
959
960 ### src/Core/ACL.php
961
962     Hook::callAll('contact_select_options', $x);
963     Hook::callAll($a->module.'_pre_'.$selname, $arr);
964     Hook::callAll($a->module.'_post_'.$selname, $o);
965     Hook::callAll($a->module.'_pre_'.$selname, $arr);
966     Hook::callAll($a->module.'_post_'.$selname, $o);
967     Hook::callAll('jot_networks', $jotnets);
968
969 ### src/Core/Authentication.php
970
971     Hook::callAll('logged_in', $a->user);
972     Hook::callAll('authenticate', $addon_auth);
973
974 ### src/Core/Hook.php
975
976     self::callSingle(self::getApp(), 'hook_fork', $fork_hook, $hookdata);
977
978 ### src/Core/L10n/L10n.php
979
980     Hook::callAll('poke_verbs', $arr);
981
982 ### src/Core/Worker.php
983
984     Hook::callAll("proc_run", $arr);
985
986 ### src/Util/Emailer.php
987
988     Hook::callAll('emailer_send_prepare', $params);
989     Hook::callAll("emailer_send", $hookdata);
990
991 ### src/Util/Map.php
992
993     Hook::callAll('generate_map', $arr);
994     Hook::callAll('generate_named_map', $arr);
995     Hook::callAll('Map::getCoordinates', $arr);
996
997 ### src/Util/Network.php
998
999     Hook::callAll('avatar_lookup', $avatar);
1000
1001 ### src/Util/ParseUrl.php
1002
1003     Hook::callAll("getsiteinfo", $siteinfo);
1004
1005 ### src/Protocol/DFRN.php
1006
1007     Hook::callAll('atom_feed_end', $atom);
1008     Hook::callAll('atom_feed_end', $atom);
1009
1010 ### src/Protocol/Email.php
1011
1012     Hook::callAll('email_getmessage', $message);
1013     Hook::callAll('email_getmessage_end', $ret);
1014
1015 ### view/js/main.js
1016
1017     document.dispatchEvent(new Event('postprocess_liveupdate'));