]> git.mxchange.org Git - friendica.git/blobdiff - doc/Addons.md
Merge pull request #13484 from xundeenergie/better-navigation
[friendica.git] / doc / Addons.md
index 0121f76d8c594378d7ae0b77f048d870e87c31e6..bfccde5ddf8908da796480199ba8a2151c1ec23c 100644 (file)
@@ -221,6 +221,14 @@ Please note: body contents are bbcode - not HTML
 Called when receiving a post from another source. This may also be used to post local activity or system generated messages.
 `$b` is the item array of information to be stored in the database and the item body is bbcode.
 
+### detect_languages
+Called after the language detection. This can be used for alternative language detection methods.
+`$data` is an array:
+
+- **text**: The text that is analyzed.
+- **detected**: (input/output) Array of language codes detected in the related text. The array key is the language code, the array value the probability.
+- **uri-id**: The Uri-Id of the item.
+
 ### addon_settings
 Called when generating the HTML for the addon settings page.
 `$data` is an array containing:
@@ -264,7 +272,7 @@ $data = [
 ##### With multiple submit buttons
 ```php
 $data = [
-       'addon'  => 'catavar',
+       'addon'  => 'catavatar',
        'title'  => DI::l10n()->t('Cat Avatar Settings'),
        'html'   => $html,
        'submit' => [
@@ -402,7 +410,7 @@ Called prior to output of personal XRD file.
 
 ### home_content
 Called prior to output home page content, shown to unlogged users.
-`$b` is the HTML sring of section region.
+`$b` is the HTML string of section region.
 
 ### contact_edit
 Called when editing contact details on an individual from the Contacts page.
@@ -638,6 +646,14 @@ Hook data:
 - **uid** (input): the user id to revoke the block for.
 - **result** (output): a boolean value indicating wether the operation was successful or not.
 
+### support_probe
+
+Called to assert whether a connector addon provides probing capabilities.
+
+Hook data:
+- **protocol** (input): shorthand for the protocol. List of values is available in `src/Core/Protocol.php`.
+- **result** (output): should be true if the connector provides follow capabilities, left alone otherwise.
+
 ### storage_instance
 
 Called when a custom storage is used (e.g. webdav_storage)
@@ -792,6 +808,7 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
 
 ### src/Model/Item.php
 
+    Hook::callAll('detect_languages', $item);
     Hook::callAll('post_local', $item);
     Hook::callAll('post_remote', $item);
     Hook::callAll('post_local_end', $posted_item);
@@ -907,6 +924,7 @@ Here is a complete list of all hook callbacks with file locations (as of 24-Sep-
     Hook::callAll('revoke_follow', $hook_data);
     Hook::callAll('block', $hook_data);
     Hook::callAll('unblock', $hook_data);
+    Hook::callAll('support_probe', $hook_data);
 
 ### src/Core/Logger/Factory.php