]> git.mxchange.org Git - friendica.git/blob - doc/Addons.md
Merge branch '2019.06-rc'
[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         $a->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         $a->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 an array $a->argv, with a corresponding $a->argc indicating the number of URL components.
162 So `https://my.web.site/addon/arg1/arg2` would look for a module named "addon" and pass its module functions the $a App structure (which is available to many components).
163 This will include:
164
165 ```php
166 $a->argc = 3
167 $a->argv = array(0 => 'addon', 1 => 'arg1', 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 # load template file. first argument is the template name,
185 # second is the addon path relative to friendica top folder
186 $tpl = Renderer::getMarkupTemplate('mytemplate.tpl', __DIR__);
187
188 # apply template. first argument is the loaded template,
189 # second an array of 'name' => 'values' to pass to template
190 $output = Renderer::replaceMacros($tpl, array(
191         'title' => 'My beautiful addon',
192 ));
193 ```
194
195 See also the wiki page [Quick Template Guide](https://github.com/friendica/friendica/wiki/Quick-Template-Guide).
196
197 ## Current PHP hooks
198
199 ### authenticate
200 Called when a user attempts to login.
201 `$b` is an array containing:
202
203 - **username**: the supplied username
204 - **password**: the supplied password
205 - **authenticated**: set this to non-zero to authenticate the user.
206 - **user_record**: successful authentication must also return a valid user record from the database
207
208 ### logged_in
209 Called after a user has successfully logged in.
210 `$b` contains the `$a->user` array.
211
212 ### display_item
213 Called when formatting a post for display.
214 $b is an array:
215
216 - **item**: The item (array) details pulled from the database
217 - **output**: the (string) HTML representation of this item prior to adding it to the page
218
219 ### post_local
220 Called when a status post or comment is entered on the local system.
221 `$b` is the item array of the information to be stored in the database.
222 Please note: body contents are bbcode - not HTML.
223
224 ### post_local_end
225 Called when a local status post or comment has been stored on the local system.
226 `$b` is the item array of the information which has just been stored in the database.
227 Please note: body contents are bbcode - not HTML
228
229 ### post_remote
230 Called when receiving a post from another source. This may also be used to post local activity or system generated messages.
231 `$b` is the item array of information to be stored in the database and the item body is bbcode.
232
233 ### settings_form
234 Called when generating the HTML for the user Settings page.
235 `$b` is the HTML string of the settings page before the final `</form>` tag.
236
237 ### settings_post
238 Called when the Settings pages are submitted.
239 `$b` is the $_POST array.
240
241 ### addon_settings
242 Called when generating the HTML for the addon settings page.
243 `$b` is the (string) HTML of the addon settings page before the final `</form>` tag.
244
245 ### addon_settings_post
246 Called when the Addon Settings pages are submitted.
247 `$b` is the $_POST array.
248
249 ### profile_post
250 Called when posting a profile page.
251 `$b` is the $_POST array.
252
253 ### profile_edit
254 Called prior to output of profile edit page.
255 `$b` is an array containing:
256
257 - **profile**: profile (array) record from the database
258 - **entry**: the (string) HTML of the generated entry
259
260 ### profile_advanced
261 Called when the HTML is generated for the Advanced profile, corresponding to the Profile tab within a person's profile page.
262 `$b` is the HTML string representation of the generated profile.
263 The profile array details are in `$a->profile`.
264
265 ### directory_item
266 Called from the Directory page when formatting an item for display.
267 `$b` is an array:
268
269 - **contact**: contact record array for the person from the database
270 - **entry**: the HTML string of the generated entry
271
272 ### profile_sidebar_enter
273 Called prior to generating the sidebar "short" profile for a page.
274 `$b` is the person's profile array
275
276 ### profile_sidebar
277 Called when generating the sidebar "short" profile for a page.
278 `$b` is an array:
279
280 - **profile**: profile record array for the person from the database
281 - **entry**: the HTML string of the generated entry
282
283 ### contact_block_end
284 Called when formatting the block of contacts/friends on a profile sidebar has completed.
285 `$b` is an array:
286
287 - **contacts**: array of contacts
288 - **output**: the generated HTML string of the contact block
289
290 ### bbcode
291 Called after conversion of bbcode to HTML.
292 `$b` is an HTML string converted text.
293
294 ### html2bbcode
295 Called after tag conversion of HTML to bbcode (e.g. remote message posting)
296 `$b` is a string converted text
297
298 ### head
299 Called when building the `<head>` sections.
300 Stylesheets should be registered using this hook.
301 `$b` is an HTML string of the `<head>` tag.
302
303 ### page_header
304 Called after building the page navigation section.
305 `$b` is a string HTML of nav region.
306
307 ### personal_xrd
308 Called prior to output of personal XRD file.
309 `$b` is an array:
310
311 - **user**: the user record array for the person
312 - **xml**: the complete XML string to be output
313
314 ### home_content
315 Called prior to output home page content, shown to unlogged users.
316 `$b` is the HTML sring of section region.
317
318 ### contact_edit
319 Called when editing contact details on an individual from the Contacts page.
320 $b is an array:
321
322 - **contact**: contact record (array) of target contact
323 - **output**: the (string) generated HTML of the contact edit page
324
325 ### contact_edit_post
326 Called when posting the contact edit page.
327 `$b` is the `$_POST` array
328
329 ### init_1
330 Called just after DB has been opened and before session start.
331 No hook data.
332
333 ### page_end
334 Called after HTML content functions have completed.
335 `$b` is (string) HTML of content div.
336
337 ### footer
338 Called after HTML content functions have completed.
339 Deferred Javascript files should be registered using this hook.
340 `$b` is (string) HTML of footer div/element.
341
342 ### avatar_lookup
343 Called when looking up the avatar. `$b` is an array:
344
345 - **size**: the size of the avatar that will be looked up
346 - **email**: email to look up the avatar for
347 - **url**: the (string) generated URL of the avatar
348
349 ### emailer_send_prepare
350 Called from `Emailer::send()` before building the mime message.
351 `$b` is an array of params to `Emailer::send()`.
352
353 - **fromName**: name of the sender
354 - **fromEmail**: email fo the sender
355 - **replyTo**: replyTo address to direct responses
356 - **toEmail**: destination email address
357 - **messageSubject**: subject of the message
358 - **htmlVersion**: html version of the message
359 - **textVersion**: text only version of the message
360 - **additionalMailHeader**: additions to the smtp mail header
361 - **sent**: default false, if set to true in the hook, the default mailer will be skipped.
362
363 ### emailer_send
364 Called before calling PHP's `mail()`.
365 `$b` is an array of params to `mail()`.
366
367 - **to**
368 - **subject**
369 - **body**
370 - **headers**
371 - **sent**: default false, if set to true in the hook, the default mailer will be skipped.
372
373 ### load_config
374 Called during `App` initialization to allow addons to load their own configuration file(s) with `App::loadConfigFile()`.
375
376 ### nav_info
377 Called after the navigational menu is build in `include/nav.php`.
378 `$b` is an array containing `$nav` from `include/nav.php`.
379
380 ### template_vars
381 Called before vars are passed to the template engine to render the page.
382 The registered function can add,change or remove variables passed to template.
383 `$b` is an array with:
384
385 - **template**: filename of template
386 - **vars**: array of vars passed to the template
387
388 ### acl_lookup_end
389 Called after the other queries have passed.
390 The registered function can add, change or remove the `acl_lookup()` variables.
391
392 - **results**: array of the acl_lookup() vars
393
394 ### prepare_body_init
395 Called at the start of prepare_body
396 Hook data:
397
398 - **item** (input/output): item array
399
400 ### prepare_body_content_filter
401 Called before the HTML conversion in prepare_body. If the item matches a content filter rule set by an addon, it should
402 just add the reason to the filter_reasons element of the hook data.
403 Hook data:
404
405 - **item**: item array (input)
406 - **filter_reasons** (input/output): reasons array
407
408 ### prepare_body
409 Called after the HTML conversion in `prepare_body()`.
410 Hook data:
411
412 - **item** (input): item array
413 - **html** (input/output): converted item body
414 - **is_preview** (input): post preview flag
415 - **filter_reasons** (input): reasons array
416
417 ### prepare_body_final
418 Called at the end of `prepare_body()`.
419 Hook data:
420
421 - **item**: item array (input)
422 - **html**: converted item body (input/output)
423
424 ### put_item_in_cache
425 Called after `prepare_text()` in `put_item_in_cache()`.
426 Hook data:
427
428 - **item** (input): item array
429 - **rendered-html** (input/output): final item body HTML
430 - **rendered-hash** (input/output): original item body hash
431
432 ### magic_auth_success
433 Called when a magic-auth was successful.
434 Hook data:
435
436     visitor => array with the contact record of the visitor
437     url => the query string
438
439 ### jot_networks
440 Called when displaying the post permission screen.
441 Hook data is a list of form fields that need to be displayed along the ACL.
442 Form field array structure is:
443
444 - **type**: `checkbox` or `select`.
445 - **field**: Standard field data structure to be used by `field_checkbox.tpl` and `field_select.tpl`.
446
447 For `checkbox`, **field** is:
448   - [0] (String): Form field name; Mandatory. 
449   - [1]: (String): Form field label; Optional, default is none.
450   - [2]: (Boolean): Whether the checkbox should be checked by default; Optional, default is false.
451   - [3]: (String): Additional help text; Optional, default is none.
452   - [4]: (String): Additional HTML attributes; Optional, default is none.
453
454 For `select`, **field** is:
455   - [0] (String): Form field name; Mandatory.
456   - [1] (String): Form field label; Optional, default is none.
457   - [2] (Boolean): Default value to be selected by default; Optional, default is none.
458   - [3] (String): Additional help text; Optional, default is none.
459   - [4] (Array): Associative array of options. Item key is option value, item value is option label; Mandatory. 
460
461 ### route_collection
462 Called just before dispatching the router.
463 Hook data is a `\FastRoute\RouterCollector` object that should be used to add addon routes pointing to classes.
464
465 **Notice**: The class whose name is provided in the route handler must be reachable via auto-loader.
466
467 ## Complete list of hook callbacks
468
469 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.
470
471 ### index.php
472
473     Hook::callAll('init_1');
474     Hook::callAll('app_menu', $arr);
475     Hook::callAll('page_content_top', $a->page['content']);
476     Hook::callAll($a->module.'_mod_init', $placeholder);
477     Hook::callAll($a->module.'_mod_init', $placeholder);
478     Hook::callAll($a->module.'_mod_post', $_POST);
479     Hook::callAll($a->module.'_mod_afterpost', $placeholder);
480     Hook::callAll($a->module.'_mod_content', $arr);
481     Hook::callAll($a->module.'_mod_aftercontent', $arr);
482     Hook::callAll('page_end', $a->page['content']);
483
484 ### include/api.php
485
486     Hook::callAll('logged_in', $a->user);
487     Hook::callAll('authenticate', $addon_auth);
488     Hook::callAll('logged_in', $a->user);
489
490 ### include/enotify.php
491
492     Hook::callAll('enotify', $h);
493     Hook::callAll('enotify_store', $datarray);
494     Hook::callAll('enotify_mail', $datarray);
495     Hook::callAll('check_item_notification', $notification_data);
496
497 ### include/conversation.php
498
499     Hook::callAll('conversation_start', $cb);
500     Hook::callAll('render_location', $locate);
501     Hook::callAll('display_item', $arr);
502     Hook::callAll('display_item', $arr);
503     Hook::callAll('item_photo_menu', $args);
504     Hook::callAll('jot_tool', $jotplugins);
505
506 ### include/text.php
507
508     Hook::callAll('contact_block_end', $arr);
509     Hook::callAll('poke_verbs', $arr);
510     Hook::callAll('put_item_in_cache', $hook_data);
511     Hook::callAll('prepare_body_init', $item);
512     Hook::callAll('prepare_body_content_filter', $hook_data);
513     Hook::callAll('prepare_body', $hook_data);
514     Hook::callAll('prepare_body_final', $hook_data);
515
516 ### include/items.php
517
518     Hook::callAll('page_info_data', $data);
519
520 ### mod/directory.php
521
522     Hook::callAll('directory_item', $arr);
523
524 ### mod/xrd.php
525
526     Hook::callAll('personal_xrd', $arr);
527
528 ### mod/ping.php
529
530     Hook::callAll('network_ping', $arr);
531
532 ### mod/parse_url.php
533
534     Hook::callAll("parse_link", $arr);
535
536 ### mod/manage.php
537
538     Hook::callAll('home_init', $ret);
539
540 ### mod/acl.php
541
542     Hook::callAll('acl_lookup_end', $results);
543
544 ### mod/network.php
545
546     Hook::callAll('network_content_init', $arr);
547     Hook::callAll('network_tabs', $arr);
548
549 ### mod/friendica.php
550
551     Hook::callAll('about_hook', $o);
552
553 ### mod/subthread.php
554
555     Hook::callAll('post_local_end', $arr);
556
557 ### mod/profiles.php
558
559     Hook::callAll('profile_post', $_POST);
560     Hook::callAll('profile_edit', $arr);
561
562 ### mod/settings.php
563
564     Hook::callAll('addon_settings_post', $_POST);
565     Hook::callAll('connector_settings_post', $_POST);
566     Hook::callAll('display_settings_post', $_POST);
567     Hook::callAll('settings_post', $_POST);
568     Hook::callAll('addon_settings', $settings_addons);
569     Hook::callAll('connector_settings', $settings_connectors);
570     Hook::callAll('display_settings', $o);
571     Hook::callAll('settings_form', $o);
572
573 ### mod/photos.php
574
575     Hook::callAll('photo_post_init', $_POST);
576     Hook::callAll('photo_post_file', $ret);
577     Hook::callAll('photo_post_end', $foo);
578     Hook::callAll('photo_post_end', $foo);
579     Hook::callAll('photo_post_end', $foo);
580     Hook::callAll('photo_post_end', $foo);
581     Hook::callAll('photo_post_end', intval($item_id));
582     Hook::callAll('photo_upload_form', $ret);
583
584 ### mod/profile.php
585
586     Hook::callAll('profile_advanced', $o);
587
588 ### mod/home.php
589
590     Hook::callAll('home_init', $ret);
591     Hook::callAll("home_content", $content);
592
593 ### mod/poke.php
594
595     Hook::callAll('post_local_end', $arr);
596
597 ### mod/contacts.php
598
599     Hook::callAll('contact_edit_post', $_POST);
600     Hook::callAll('contact_edit', $arr);
601
602 ### mod/tagger.php
603
604     Hook::callAll('post_local_end', $arr);
605
606 ### mod/lockview.php
607
608     Hook::callAll('lockview_content', $item);
609
610 ### mod/uexport.php
611
612     Hook::callAll('uexport_options', $options);
613
614 ### mod/register.php
615
616     Hook::callAll('register_post', $arr);
617     Hook::callAll('register_form', $arr);
618
619 ### mod/item.php
620
621     Hook::callAll('post_local_start', $_REQUEST);
622     Hook::callAll('post_local', $datarray);
623     Hook::callAll('post_local_end', $datarray);
624
625 ### mod/editpost.php
626
627     Hook::callAll('jot_tool', $jotplugins);
628
629 ### src/Network/FKOAuth1.php
630
631     Hook::callAll('logged_in', $a->user);
632
633 ### src/Render/FriendicaSmartyEngine.php
634
635     Hook::callAll("template_vars", $arr);
636
637 ### src/App.php
638
639     Hook::callAll('load_config');
640     Hook::callAll('head');
641     Hook::callAll('footer');
642     Hook::callAll('route_collection');
643
644 ### src/Model/Item.php
645
646     Hook::callAll('post_local', $item);
647     Hook::callAll('post_remote', $item);
648     Hook::callAll('post_local_end', $posted_item);
649     Hook::callAll('post_remote_end', $posted_item);
650     Hook::callAll('tagged', $arr);
651     Hook::callAll('post_local_end', $new_item);
652
653 ### src/Model/Contact.php
654
655     Hook::callAll('contact_photo_menu', $args);
656     Hook::callAll('follow', $arr);
657
658 ### src/Model/Profile.php
659
660     Hook::callAll('profile_sidebar_enter', $profile);
661     Hook::callAll('profile_sidebar', $arr);
662     Hook::callAll('profile_tabs', $arr);
663     Hook::callAll('zrl_init', $arr);
664     Hook::callAll('magic_auth_success', $arr);
665
666 ### src/Model/Event.php
667
668     Hook::callAll('event_updated', $event['id']);
669     Hook::callAll("event_created", $event['id']);
670
671 ### src/Model/User.php
672
673     Hook::callAll('register_account', $uid);
674     Hook::callAll('remove_user', $user);
675
676 ### src/Content/Text/BBCode.php
677
678     Hook::callAll('bbcode', $text);
679     Hook::callAll('bb2diaspora', $text);
680
681 ### src/Content/Text/HTML.php
682
683     Hook::callAll('html2bbcode', $message);
684
685 ### src/Content/Smilies.php
686
687     Hook::callAll('smilie', $params);
688
689 ### src/Content/Feature.php
690
691     Hook::callAll('isEnabled', $arr);
692     Hook::callAll('get', $arr);
693
694 ### src/Content/ContactSelector.php
695
696     Hook::callAll('network_to_name', $nets);
697     Hook::callAll('gender_selector', $select);
698     Hook::callAll('sexpref_selector', $select);
699     Hook::callAll('marital_selector', $select);
700
701 ### src/Content/OEmbed.php
702
703     Hook::callAll('oembed_fetch_url', $embedurl, $j);
704
705 ### src/Content/Nav.php
706
707     Hook::callAll('page_header', $a->page['nav']);
708     Hook::callAll('nav_info', $nav);
709
710 ### src/Worker/Directory.php
711
712     Hook::callAll('globaldir_update', $arr);
713
714 ### src/Worker/Notifier.php
715
716     Hook::callAll('notifier_end', $target_item);
717
718 ### src/Module/Login.php
719
720     Hook::callAll('authenticate', $addon_auth);
721     Hook::callAll('login_hook', $o);
722
723 ### src/Module/Logout.php
724
725     Hook::callAll("logging_out");
726
727 ### src/Object/Post.php
728
729     Hook::callAll('render_location', $locate);
730     Hook::callAll('display_item', $arr);
731
732 ### src/Core/ACL.php
733
734     Hook::callAll('contact_select_options', $x);
735     Hook::callAll($a->module.'_pre_'.$selname, $arr);
736     Hook::callAll($a->module.'_post_'.$selname, $o);
737     Hook::callAll($a->module.'_pre_'.$selname, $arr);
738     Hook::callAll($a->module.'_post_'.$selname, $o);
739     Hook::callAll('jot_networks', $jotnets);
740
741 ### src/Core/Authentication.php
742
743     Hook::callAll('logged_in', $a->user);
744
745 ### src/Core/Hook.php
746
747     self::callSingle(self::getApp(), 'hook_fork', $fork_hook, $hookdata);
748
749 ### src/Core/Worker.php
750
751     Hook::callAll("proc_run", $arr);
752
753 ### src/Util/Emailer.php
754
755     Hook::callAll('emailer_send_prepare', $params);
756     Hook::callAll("emailer_send", $hookdata);
757
758 ### src/Util/Map.php
759
760     Hook::callAll('generate_map', $arr);
761     Hook::callAll('generate_named_map', $arr);
762     Hook::callAll('Map::getCoordinates', $arr);
763
764 ### src/Util/Network.php
765
766     Hook::callAll('avatar_lookup', $avatar);
767
768 ### src/Util/ParseUrl.php
769
770     Hook::callAll("getsiteinfo", $siteinfo);
771
772 ### src/Protocol/DFRN.php
773
774     Hook::callAll('atom_feed_end', $atom);
775     Hook::callAll('atom_feed_end', $atom);
776
777 ### view/js/main.js
778
779     document.dispatchEvent(new Event('postprocess_liveupdate'));