]> git.mxchange.org Git - friendica.git/blob - doc/Addons.md
Merge pull request #13483 from annando/languages
[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" and "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 most one argument
64
65     function <addon>_<hookname>(&$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 #### $b
72 $b can be called anything you like.
73 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.
74 Remember to declare it with `&` if you wish to alter it.
75
76 ## Admin settings
77
78 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.
79
80 Simply declare a `<addon>_addon_admin()` function to display the form and a `<addon>_addon_admin_post()` function to process the data from the form.0
81
82 ## Global stylesheets
83
84 If your addon requires adding a stylesheet on all pages of Friendica, add the following hook:
85
86 ```php
87 function <addon>_install()
88 {
89         \Friendica\Core\Hook::register('head', __FILE__, '<addon>_head');
90         ...
91 }
92
93
94 function <addon>_head()
95 {
96         \Friendica\DI::page()->registerStylesheet(__DIR__ . '/relative/path/to/addon/stylesheet.css');
97 }
98 ```
99
100 `__DIR__` is the folder path of your addon.
101
102 ## JavaScript
103
104 ### Global scripts
105
106 If your addon requires adding a script on all pages of Friendica, add the following hook:
107
108
109 ```php
110 function <addon>_install()
111 {
112         \Friendica\Core\Hook::register('footer', __FILE__, '<addon>_footer');
113         ...
114 }
115
116 function <addon>_footer()
117 {
118         \Friendica\DI::page()->registerFooterScript(__DIR__ . '/relative/path/to/addon/script.js');
119 }
120 ```
121
122 `__DIR__` is the folder path of your addon.
123
124 ### JavaScript hooks
125
126 The main Friendica script provides hooks via events dispatched on the `document` property.
127 In your JavaScript file included as described above, add your event listener like this:
128
129 ```js
130 document.addEventListener(name, callback);
131 ```
132
133 - *name* is the name of the hook and corresponds to a known Friendica JavaScript hook.
134 - *callback* is a JavaScript anonymous function to execute.
135
136 More info about JavaScript event listeners: https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
137
138 #### Current JavaScript hooks
139
140 ##### postprocess_liveupdate
141 Called at the end of the live update process (XmlHttpRequest) and on a post preview.
142 No additional data is provided.
143
144 ## Modules
145
146 Addons may also act as "modules" and intercept all page requests for a given URL path.
147 In order for a addon to act as a module it needs to declare an empty function `<addon>_module()`.
148
149 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.
150 These are parsed into the `App\Arguments` object.
151 So `https://my.web.site/addon/arg1/arg2` would give this:
152 ```php
153 DI::args()->getArgc(); // = 3
154 DI::args()->get(0); // = 'addon'
155 DI::args()->get(1); // = 'arg1'
156 DI::args()->get(2); // = 'arg2'
157 ```
158
159 To display a module page, you need to declare the function `<addon>_content()`, which defines and returns the page body content.
160 They may also contain `<addon>_post()` which is called before the `<addon>_content` function and typically handles the results of POST forms.
161 You may also have `<addon>_init()` which is called before `<addon>_content` and should include common logic to your module.
162
163 ## Templates
164
165 If your addon needs some template, you can use the Friendica template system.
166 Friendica uses [smarty3](http://www.smarty.net/) as a template engine.
167
168 Put your tpl files in the *templates/* subfolder of your addon.
169
170 In your code, like in the function addon_name_content(), load the template file and execute it passing needed values:
171
172 ```php
173 use Friendica\Core\Renderer;
174
175 # load template file. first argument is the template name,
176 # second is the addon path relative to friendica top folder
177 $tpl = Renderer::getMarkupTemplate('mytemplate.tpl', __DIR__);
178
179 # apply template. first argument is the loaded template,
180 # second an array of 'name' => 'values' to pass to template
181 $output = Renderer::replaceMacros($tpl, array(
182         'title' => 'My beautiful addon',
183 ));
184 ```
185
186 See also the wiki page [Quick Template Guide](https://github.com/friendica/friendica/wiki/Quick-Template-Guide).
187
188 ## Current PHP hooks
189
190 ### authenticate
191 Called when a user attempts to login.
192 `$b` is an array containing:
193
194 - **username**: the supplied username
195 - **password**: the supplied password
196 - **authenticated**: set this to non-zero to authenticate the user.
197 - **user_record**: successful authentication must also return a valid user record from the database
198
199 ### logged_in
200 Called after a user has successfully logged in.
201 `$b` contains the `App->user` array.
202
203 ### display_item
204 Called when formatting a post for display.
205 $b is an array:
206
207 - **item**: The item (array) details pulled from the database
208 - **output**: the (string) HTML representation of this item prior to adding it to the page
209
210 ### post_local
211 Called when a status post or comment is entered on the local system.
212 `$b` is the item array of the information to be stored in the database.
213 Please note: body contents are bbcode - not HTML.
214
215 ### post_local_end
216 Called when a local status post or comment has been stored on the local system.
217 `$b` is the item array of the information which has just been stored in the database.
218 Please note: body contents are bbcode - not HTML
219
220 ### post_remote
221 Called when receiving a post from another source. This may also be used to post local activity or system generated messages.
222 `$b` is the item array of information to be stored in the database and the item body is bbcode.
223
224 ### detect_languages
225 Called after the language detection. This can be used for alternative language detection methods.
226 `$data` is an array:
227
228 - **text**: The text that is analyzed.
229 - **detected**: (input/output) Array of language codes detected in the related text.
230
231 ### addon_settings
232 Called when generating the HTML for the addon settings page.
233 `$data` is an array containing:
234
235 - **addon** (output): Required. The addon folder name.
236 - **title** (output): Required. The addon settings panel title.
237 - **href** (output): Optional. If set, will reduce the panel to a link pointing to this URL, can be relative. Incompatible with the following keys.
238 - **html** (output): Optional. Raw HTML of the addon form elements. Both the `<form>` tags and the submit buttons are taken care of elsewhere.
239 - **submit** (output): Optional. If unset, a default submit button with `name="<addon name>-submit"` will be generated.
240   Can take different value types:
241   - **string**: The label to replace the default one.
242   - **associative array**: A list of submit button, the key is the value of the `name` attribute, the value is the displayed label.
243     The first submit button in this list is considered the main one and themes might emphasize its display.
244
245 #### Examples
246
247 ##### With link
248 ```php
249 $data = [
250         'addon' => 'advancedcontentfilter',
251         'title' => DI::l10n()->t('Advanced Content Filter'),
252         'href'  => 'advancedcontentfilter',
253 ];
254 ```
255 ##### With default submit button
256 ```php
257 $data = [
258         'addon' => 'fromapp',
259         'title' => DI::l10n()->t('FromApp Settings'),
260         'html'  => $html,
261 ];
262 ```
263 ##### With no HTML, just a submit button
264 ```php
265 $data = [
266         'addon'  => 'opmlexport',
267         'title'  => DI::l10n()->t('OPML Export'),
268         'submit' => DI::l10n()->t('Export RSS/Atom contacts'),
269 ];
270 ```
271 ##### With multiple submit buttons
272 ```php
273 $data = [
274         'addon'  => 'catavatar',
275         'title'  => DI::l10n()->t('Cat Avatar Settings'),
276         'html'   => $html,
277         'submit' => [
278                 'catavatar-usecat'   => DI::l10n()->t('Use Cat as Avatar'),
279                 'catavatar-morecat'  => DI::l10n()->t('Another random Cat!'),
280                 'catavatar-emailcat' => DI::pConfig()->get(Session::getLocalUser(), 'catavatar', 'seed', false) ? DI::l10n()->t('Reset to email Cat') : null,
281         ],
282 ];
283 ```
284
285 ### addon_settings_post
286 Called when the Addon Settings pages are submitted.
287 `$b` is the $_POST array.
288
289 ### connector_settings
290 Called when generating the HTML for a connector addon settings page.
291 `$data` is an array containing:
292
293 - **connector** (output): Required. The addon folder name.
294 - **title** (output): Required. The addon settings panel title.
295 - **image** (output): Required. The relative path of the logo image of the platform/protocol this addon is connecting to, max size 48x48px.
296 - **enabled** (output): Optional. If set to a falsy value, the connector image will be dimmed.
297 - **html** (output): Optional. Raw HTML of the addon form elements. Both the `<form>` tags and the submit buttons are taken care of elsewhere.
298 - **submit** (output): Optional. If unset, a default submit button with `name="<addon name>-submit"` will be generated.
299   Can take different value types:
300     - **string**: The label to replace the default one.
301       - **associative array**: A list of submit button, the key is the value of the `name` attribute, the value is the displayed label.
302         The first submit button in this list is considered the main one and themes might emphasize its display.
303
304 #### Examples
305
306 ##### With default submit button
307 ```php
308 $data = [
309         'connector' => 'diaspora',
310         'title'     => DI::l10n()->t('Diaspora Export'),
311         'image'     => 'images/diaspora-logo.png',
312         'enabled'   => $enabled,
313         'html'      => $html,
314 ];
315 ```
316
317 ##### With custom submit button label and no logo dim
318 ```php
319 $data = [
320         'connector' => 'ifttt',
321         'title'     => DI::l10n()->t('IFTTT Mirror'),
322         'image'     => 'addon/ifttt/ifttt.png',
323         'html'      => $html,
324         'submit'    => DI::l10n()->t('Generate new key'),
325 ];
326 ```
327
328 ##### With conditional submit buttons
329 ```php
330 $submit = ['pumpio-submit' => DI::l10n()->t('Save Settings')];
331 if ($oauth_token && $oauth_token_secret) {
332         $submit['pumpio-delete'] = DI::l10n()->t('Delete this preset');
333 }
334
335 $data = [
336         'connector' => 'pumpio',
337         'title'     => DI::l10n()->t('Pump.io Import/Export/Mirror'),
338         'image'     => 'images/pumpio.png',
339         'enabled'   => $enabled,
340         'html'      => $html,
341         'submit'    => $submit,
342 ];
343 ```
344
345 ### profile_post
346 Called when posting a profile page.
347 `$b` is the $_POST array.
348
349 ### profile_edit
350 Called prior to output of profile edit page.
351 `$b` is an array containing:
352
353 - **profile**: profile (array) record from the database
354 - **entry**: the (string) HTML of the generated entry
355
356 ### profile_advanced
357 Called when the HTML is generated for the Advanced profile, corresponding to the Profile tab within a person's profile page.
358 `$b` is the HTML string representation of the generated profile.
359 The profile array details are in `App->profile`.
360
361 ### directory_item
362 Called from the Directory page when formatting an item for display.
363 `$b` is an array:
364
365 - **contact**: contact record array for the person from the database
366 - **entry**: the HTML string of the generated entry
367
368 ### profile_sidebar_enter
369 Called prior to generating the sidebar "short" profile for a page.
370 `$b` is the person's profile array
371
372 ### profile_sidebar
373 Called when generating the sidebar "short" profile for a page.
374 `$b` is an array:
375
376 - **profile**: profile record array for the person from the database
377 - **entry**: the HTML string of the generated entry
378
379 ### contact_block_end
380 Called when formatting the block of contacts/friends on a profile sidebar has completed.
381 `$b` is an array:
382
383 - **contacts**: array of contacts
384 - **output**: the generated HTML string of the contact block
385
386 ### bbcode
387 Called after conversion of bbcode to HTML.
388 `$b` is an HTML string converted text.
389
390 ### html2bbcode
391 Called after tag conversion of HTML to bbcode (e.g. remote message posting)
392 `$b` is a string converted text
393
394 ### head
395 Called when building the `<head>` sections.
396 Stylesheets should be registered using this hook.
397 `$b` is an HTML string of the `<head>` tag.
398
399 ### page_header
400 Called after building the page navigation section.
401 `$b` is a string HTML of nav region.
402
403 ### personal_xrd
404 Called prior to output of personal XRD file.
405 `$b` is an array:
406
407 - **user**: the user record array for the person
408 - **xml**: the complete XML string to be output
409
410 ### home_content
411 Called prior to output home page content, shown to unlogged users.
412 `$b` is the HTML string of section region.
413
414 ### contact_edit
415 Called when editing contact details on an individual from the Contacts page.
416 $b is an array:
417
418 - **contact**: contact record (array) of target contact
419 - **output**: the (string) generated HTML of the contact edit page
420
421 ### contact_edit_post
422 Called when posting the contact edit page.
423 `$b` is the `$_POST` array
424
425 ### init_1
426 Called just after DB has been opened and before session start.
427 No hook data.
428
429 ### page_end
430 Called after HTML content functions have completed.
431 `$b` is (string) HTML of content div.
432
433 ### footer
434 Called after HTML content functions have completed.
435 Deferred JavaScript files should be registered using this hook.
436 `$b` is (string) HTML of footer div/element.
437
438 ### avatar_lookup
439 Called when looking up the avatar. `$b` is an array:
440
441 - **size**: the size of the avatar that will be looked up
442 - **email**: email to look up the avatar for
443 - **url**: the (string) generated URL of the avatar
444
445 ### emailer_send_prepare
446 Called from `Emailer::send()` before building the mime message.
447 `$b` is an array of params to `Emailer::send()`.
448
449 - **fromName**: name of the sender
450 - **fromEmail**: email fo the sender
451 - **replyTo**: replyTo address to direct responses
452 - **toEmail**: destination email address
453 - **messageSubject**: subject of the message
454 - **htmlVersion**: html version of the message
455 - **textVersion**: text only version of the message
456 - **additionalMailHeader**: additions to the smtp mail header
457 - **sent**: default false, if set to true in the hook, the default mailer will be skipped.
458
459 ### emailer_send
460 Called before calling PHP's `mail()`.
461 `$b` is an array of params to `mail()`.
462
463 - **to**
464 - **subject**
465 - **body**
466 - **headers**
467 - **sent**: default false, if set to true in the hook, the default mailer will be skipped.
468
469 ### load_config
470 Called during `App` initialization to allow addons to load their own configuration file(s) with `App::loadConfigFile()`.
471
472 ### nav_info
473 Called after the navigational menu is build in `include/nav.php`.
474 `$b` is an array containing `$nav` from `include/nav.php`.
475
476 ### template_vars
477 Called before vars are passed to the template engine to render the page.
478 The registered function can add,change or remove variables passed to template.
479 `$b` is an array with:
480
481 - **template**: filename of template
482 - **vars**: array of vars passed to the template
483
484 ### acl_lookup_end
485 Called after the other queries have passed.
486 The registered function can add, change or remove the `acl_lookup()` variables.
487
488 - **results**: array of the acl_lookup() vars
489
490 ### prepare_body_init
491 Called at the start of prepare_body
492 Hook data:
493
494 - **item** (input/output): item array
495
496 ### prepare_body_content_filter
497 Called before the HTML conversion in prepare_body. If the item matches a content filter rule set by an addon, it should
498 just add the reason to the filter_reasons element of the hook data.
499 Hook data:
500
501 - **item**: item array (input)
502 - **filter_reasons** (input/output): reasons array
503
504 ### prepare_body
505 Called after the HTML conversion in `prepare_body()`.
506 Hook data:
507
508 - **item** (input): item array
509 - **html** (input/output): converted item body
510 - **is_preview** (input): post preview flag
511 - **filter_reasons** (input): reasons array
512
513 ### prepare_body_final
514 Called at the end of `prepare_body()`.
515 Hook data:
516
517 - **item**: item array (input)
518 - **html**: converted item body (input/output)
519
520 ### put_item_in_cache
521 Called after `prepare_text()` in `put_item_in_cache()`.
522 Hook data:
523
524 - **item** (input): item array
525 - **rendered-html** (input/output): final item body HTML
526 - **rendered-hash** (input/output): original item body hash
527
528 ### magic_auth_success
529 Called when a magic-auth was successful.
530 Hook data:
531
532     visitor => array with the contact record of the visitor
533     url => the query string
534
535 ### jot_networks
536 Called when displaying the post permission screen.
537 Hook data is a list of form fields that need to be displayed along the ACL.
538 Form field array structure is:
539
540 - **type**: `checkbox` or `select`.
541 - **field**: Standard field data structure to be used by `field_checkbox.tpl` and `field_select.tpl`.
542
543 For `checkbox`, **field** is:
544   - [0] (String): Form field name; Mandatory.
545   - [1]: (String): Form field label; Optional, default is none.
546   - [2]: (Boolean): Whether the checkbox should be checked by default; Optional, default is false.
547   - [3]: (String): Additional help text; Optional, default is none.
548   - [4]: (String): Additional HTML attributes; Optional, default is none.
549
550 For `select`, **field** is:
551   - [0] (String): Form field name; Mandatory.
552   - [1] (String): Form field label; Optional, default is none.
553   - [2] (Boolean): Default value to be selected by default; Optional, default is none.
554   - [3] (String): Additional help text; Optional, default is none.
555   - [4] (Array): Associative array of options. Item key is option value, item value is option label; Mandatory.
556
557 ### route_collection
558 Called just before dispatching the router.
559 Hook data is a `\FastRoute\RouterCollector` object that should be used to add addon routes pointing to classes.
560
561 **Notice**: The class whose name is provided in the route handler must be reachable via auto-loader.
562
563 ### probe_detect
564
565 Called before trying to detect the target network of a URL.
566 If any registered hook function sets the `result` key of the hook data array, it will be returned immediately.
567 Hook functions should also return immediately if the hook data contains an existing result.
568
569 Hook data:
570
571 - **uri** (input): the profile URI.
572 - **network** (input): the target network (can be empty for auto-detection).
573 - **uid** (input): the user to return the contact data for (can be empty for public contacts).
574 - **result** (output): Leave null if address isn't relevant to the connector, set to contact array if probe is successful, false otherwise.
575
576 ### item_by_link
577
578 Called when trying to probe an item from a given URI.
579 If any registered hook function sets the `item_id` key of the hook data array, it will be returned immediately.
580 Hook functions should also return immediately if the hook data contains an existing `item_id`.
581
582 Hook data:
583 - **uri** (input): the item URI.
584 - **uid** (input): the user to return the item data for (can be empty for public contacts).
585 - **item_id** (output): Leave null if URI isn't relevant to the connector, set to created item array if probe is successful, false otherwise.
586
587 ### support_follow
588
589 Called to assert whether a connector addon provides follow capabilities.
590
591 Hook data:
592 - **protocol** (input): shorthand for the protocol. List of values is available in `src/Core/Protocol.php`.
593 - **result** (output): should be true if the connector provides follow capabilities, left alone otherwise.
594
595 ### support_revoke_follow
596
597 Called to assert whether a connector addon provides follow revocation capabilities.
598
599 Hook data:
600 - **protocol** (input): shorthand for the protocol. List of values is available in `src/Core/Protocol.php`.
601 - **result** (output): should be true if the connector provides follow revocation capabilities, left alone otherwise.
602
603 ### follow
604
605 Called before adding a new contact for a user to handle non-native network remote contact (like Twitter).
606
607 Hook data:
608
609 - **url** (input): URL of the remote contact.
610 - **contact** (output): should be filled with the contact (with uid = user creating the contact) array if follow was successful.
611
612 ### unfollow
613
614 Called when unfollowing a remote contact on a non-native network (like Twitter)
615
616 Hook data:
617 - **contact** (input): the target public contact (uid = 0) array.
618 - **uid** (input): the id of the source local user.
619 - **result** (output): wether the unfollowing is successful or not.
620
621 ### revoke_follow
622
623 Called when making a remote contact on a non-native network (like Twitter) unfollow you.
624
625 Hook data:
626 - **contact** (input): the target public contact (uid = 0) array.
627 - **uid** (input): the id of the source local user.
628 - **result** (output): a boolean value indicating wether the operation was successful or not.
629
630 ### block
631
632 Called when blocking a remote contact on a non-native network (like Twitter).
633
634 Hook data:
635 - **contact** (input): the remote contact (uid = 0) array.
636 - **uid** (input): the user id to issue the block for.
637 - **result** (output): a boolean value indicating wether the operation was successful or not.
638
639 ### unblock
640
641 Called when unblocking a remote contact on a non-native network (like Twitter).
642
643 Hook data:
644 - **contact** (input): the remote contact (uid = 0) array.
645 - **uid** (input): the user id to revoke the block for.
646 - **result** (output): a boolean value indicating wether the operation was successful or not.
647
648 ### support_probe
649
650 Called to assert whether a connector addon provides probing capabilities.
651
652 Hook data:
653 - **protocol** (input): shorthand for the protocol. List of values is available in `src/Core/Protocol.php`.
654 - **result** (output): should be true if the connector provides follow capabilities, left alone otherwise.
655
656 ### storage_instance
657
658 Called when a custom storage is used (e.g. webdav_storage)
659
660 Hook data:
661 - **name** (input): the name of the used storage backend
662 - **data['storage']** (output): the storage instance to use (**must** implement `\Friendica\Core\Storage\IWritableStorage`) 
663
664 ### storage_config
665
666 Called when the admin of the node wants to configure a custom storage (e.g. webdav_storage)
667
668 Hook data:
669 - **name** (input): the name of the used storage backend
670 - **data['storage_config']** (output): the storage configuration instance to use (**must** implement `\Friendica\Core\Storage\Capability\IConfigureStorage`)
671
672 ## Complete list of hook callbacks
673
674 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.
675
676 ### index.php
677
678     Hook::callAll('init_1');
679     Hook::callAll('app_menu', $arr);
680     Hook::callAll('page_content_top', DI::page()['content']);
681     Hook::callAll($a->module.'_mod_init', $placeholder);
682     Hook::callAll($a->module.'_mod_init', $placeholder);
683     Hook::callAll($a->module.'_mod_post', $_POST);
684     Hook::callAll($a->module.'_mod_content', $arr);
685     Hook::callAll($a->module.'_mod_aftercontent', $arr);
686     Hook::callAll('page_end', DI::page()['content']);
687
688 ### include/api.php
689
690     Hook::callAll('logged_in', $a->user);
691     Hook::callAll('authenticate', $addon_auth);
692     Hook::callAll('logged_in', $a->user);
693
694 ### include/enotify.php
695
696     Hook::callAll('enotify', $h);
697     Hook::callAll('enotify_store', $datarray);
698     Hook::callAll('enotify_mail', $datarray);
699     Hook::callAll('check_item_notification', $notification_data);
700
701 ### src/Content/Conversation.php
702
703     Hook::callAll('conversation_start', $cb);
704     Hook::callAll('render_location', $locate);
705     Hook::callAll('display_item', $arr);
706     Hook::callAll('display_item', $arr);
707     Hook::callAll('item_photo_menu', $args);
708     Hook::callAll('jot_tool', $jotplugins);
709
710 ### mod/directory.php
711
712     Hook::callAll('directory_item', $arr);
713
714 ### mod/xrd.php
715
716     Hook::callAll('personal_xrd', $arr);
717
718 ### mod/parse_url.php
719
720     Hook::callAll("parse_link", $arr);
721
722 ### src/Module/Delegation.php
723
724     Hook::callAll('home_init', $ret);
725
726 ### mod/acl.php
727
728     Hook::callAll('acl_lookup_end', $results);
729
730 ### mod/network.php
731
732     Hook::callAll('network_content_init', $arr);
733     Hook::callAll('network_tabs', $arr);
734
735 ### mod/friendica.php
736
737     Hook::callAll('about_hook', $o);
738
739 ### mod/profiles.php
740
741     Hook::callAll('profile_post', $_POST);
742     Hook::callAll('profile_edit', $arr);
743
744 ### mod/settings.php
745
746     Hook::callAll('addon_settings_post', $_POST);
747     Hook::callAll('connector_settings_post', $_POST);
748     Hook::callAll('display_settings_post', $_POST);
749     Hook::callAll('addon_settings', $settings_addons);
750     Hook::callAll('connector_settings', $settings_connectors);
751     Hook::callAll('display_settings', $o);
752
753 ### mod/photos.php
754
755     Hook::callAll('photo_post_init', $_POST);
756     Hook::callAll('photo_post_file', $ret);
757     Hook::callAll('photo_post_end', $foo);
758     Hook::callAll('photo_post_end', $foo);
759     Hook::callAll('photo_post_end', $foo);
760     Hook::callAll('photo_post_end', $foo);
761     Hook::callAll('photo_post_end', intval($item_id));
762     Hook::callAll('photo_upload_form', $ret);
763
764 ### mod/profile.php
765
766     Hook::callAll('profile_advanced', $o);
767
768 ### mod/home.php
769
770     Hook::callAll('home_init', $ret);
771     Hook::callAll("home_content", $content);
772
773 ### mod/contacts.php
774
775     Hook::callAll('contact_edit_post', $_POST);
776     Hook::callAll('contact_edit', $arr);
777
778 ### mod/tagger.php
779
780     Hook::callAll('post_local_end', $arr);
781
782 ### mod/uexport.php
783
784     Hook::callAll('uexport_options', $options);
785
786 ### mod/register.php
787
788     Hook::callAll('register_post', $arr);
789     Hook::callAll('register_form', $arr);
790
791 ### mod/item.php
792
793     Hook::callAll('post_local_start', $_REQUEST);
794     Hook::callAll('post_local', $datarray);
795     Hook::callAll('post_local_end', $datarray);
796
797 ### src/Render/FriendicaSmartyEngine.php
798
799     Hook::callAll("template_vars", $arr);
800
801 ### src/App.php
802
803     Hook::callAll('load_config');
804     Hook::callAll('head');
805     Hook::callAll('footer');
806     Hook::callAll('route_collection');
807
808 ### src/Model/Item.php
809
810     Hook::callAll('detect_languages', $item);
811     Hook::callAll('post_local', $item);
812     Hook::callAll('post_remote', $item);
813     Hook::callAll('post_local_end', $posted_item);
814     Hook::callAll('post_remote_end', $posted_item);
815     Hook::callAll('tagged', $arr);
816     Hook::callAll('post_local_end', $new_item);
817     Hook::callAll('put_item_in_cache', $hook_data);
818     Hook::callAll('prepare_body_init', $item);
819     Hook::callAll('prepare_body_content_filter', $hook_data);
820     Hook::callAll('prepare_body', $hook_data);
821     Hook::callAll('prepare_body_final', $hook_data);
822
823 ### src/Model/Contact.php
824
825     Hook::callAll('contact_photo_menu', $args);
826     Hook::callAll('follow', $arr);
827
828 ### src/Model/Profile.php
829
830     Hook::callAll('profile_sidebar_enter', $profile);
831     Hook::callAll('profile_sidebar', $arr);
832     Hook::callAll('profile_tabs', $arr);
833     Hook::callAll('zrl_init', $arr);
834     Hook::callAll('magic_auth_success', $arr);
835
836 ### src/Model/Event.php
837
838     Hook::callAll('event_updated', $event['id']);
839     Hook::callAll("event_created", $event['id']);
840
841 ### src/Model/Register.php
842
843     Hook::callAll('authenticate', $addon_auth);
844
845 ### src/Model/User.php
846
847     Hook::callAll('authenticate', $addon_auth);
848     Hook::callAll('register_account', $uid);
849     Hook::callAll('remove_user', $user);
850
851 ### src/Module/Notifications/Ping.php
852
853     Hook::callAll('network_ping', $arr);
854
855 ### src/Module/PermissionTooltip.php
856
857     Hook::callAll('lockview_content', $item);
858
859 ### src/Module/Post/Edit.php
860
861     Hook::callAll('jot_tool', $jotplugins);
862
863 ### src/Module/Settings/Delegation.php
864
865     Hook::callAll('authenticate', $addon_auth);
866
867 ### src/Module/Settings/TwoFactor/Index.php
868
869     Hook::callAll('authenticate', $addon_auth);
870
871 ### src/Security/Authenticate.php
872
873     Hook::callAll('authenticate', $addon_auth);
874
875 ### src/Security/ExAuth.php
876
877     Hook::callAll('authenticate', $addon_auth);
878
879 ### src/Content/ContactBlock.php
880
881     Hook::callAll('contact_block_end', $arr);
882
883 ### src/Content/Text/BBCode.php
884
885     Hook::callAll('bbcode', $text);
886     Hook::callAll('bb2diaspora', $text);
887
888 ### src/Content/Text/HTML.php
889
890     Hook::callAll('html2bbcode', $message);
891
892 ### src/Content/Smilies.php
893
894     Hook::callAll('smilie', $params);
895
896 ### src/Content/Feature.php
897
898     Hook::callAll('isEnabled', $arr);
899     Hook::callAll('get', $arr);
900
901 ### src/Content/ContactSelector.php
902
903     Hook::callAll('network_to_name', $nets);
904
905 ### src/Content/OEmbed.php
906
907     Hook::callAll('oembed_fetch_url', $embedurl, $j);
908
909 ### src/Content/Nav.php
910
911     Hook::callAll('page_header', DI::page()['nav']);
912     Hook::callAll('nav_info', $nav);
913
914 ### src/Core/Authentication.php
915
916     Hook::callAll('logged_in', $a->user);
917
918 ### src/Core/Protocol.php
919
920     Hook::callAll('support_follow', $hook_data);
921     Hook::callAll('support_revoke_follow', $hook_data);
922     Hook::callAll('unfollow', $hook_data);
923     Hook::callAll('revoke_follow', $hook_data);
924     Hook::callAll('block', $hook_data);
925     Hook::callAll('unblock', $hook_data);
926     Hook::callAll('support_probe', $hook_data);
927
928 ### src/Core/Logger/Factory.php
929
930     Hook::callAll('logger_instance', $data);
931
932 ### src/Core/StorageManager
933
934     Hook::callAll('storage_instance', $data);
935     Hook::callAll('storage_config', $data);
936
937 ### src/Worker/Directory.php
938
939     Hook::callAll('globaldir_update', $arr);
940
941 ### src/Worker/Notifier.php
942
943     Hook::callAll('notifier_end', $target_item);
944
945 ### src/Module/Login.php
946
947     Hook::callAll('login_hook', $o);
948
949 ### src/Module/Logout.php
950
951     Hook::callAll("logging_out");
952
953 ### src/Object/Post.php
954
955     Hook::callAll('render_location', $locate);
956     Hook::callAll('display_item', $arr);
957
958 ### src/Core/ACL.php
959
960     Hook::callAll('contact_select_options', $x);
961     Hook::callAll($a->module.'_pre_'.$selname, $arr);
962     Hook::callAll($a->module.'_post_'.$selname, $o);
963     Hook::callAll($a->module.'_pre_'.$selname, $arr);
964     Hook::callAll($a->module.'_post_'.$selname, $o);
965     Hook::callAll('jot_networks', $jotnets);
966
967 ### src/Core/Authentication.php
968
969     Hook::callAll('logged_in', $a->user);
970     Hook::callAll('authenticate', $addon_auth);
971
972 ### src/Core/Hook.php
973
974     self::callSingle(self::getApp(), 'hook_fork', $fork_hook, $hookdata);
975
976 ### src/Core/Worker.php
977
978     Hook::callAll("proc_run", $arr);
979
980 ### src/Util/Emailer.php
981
982     Hook::callAll('emailer_send_prepare', $params);
983     Hook::callAll("emailer_send", $hookdata);
984
985 ### src/Util/Map.php
986
987     Hook::callAll('generate_map', $arr);
988     Hook::callAll('generate_named_map', $arr);
989     Hook::callAll('Map::getCoordinates', $arr);
990
991 ### src/Util/Network.php
992
993     Hook::callAll('avatar_lookup', $avatar);
994
995 ### src/Util/ParseUrl.php
996
997     Hook::callAll("getsiteinfo", $siteinfo);
998
999 ### src/Protocol/DFRN.php
1000
1001     Hook::callAll('atom_feed_end', $atom);
1002     Hook::callAll('atom_feed_end', $atom);
1003
1004 ### src/Protocol/Email.php
1005
1006     Hook::callAll('email_getmessage', $message);
1007     Hook::callAll('email_getmessage_end', $ret);
1008
1009 ### view/js/main.js
1010
1011     document.dispatchEvent(new Event('postprocess_liveupdate'));