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