aboutsummaryrefslogtreecommitdiffstats
path: root/doc/hook
diff options
context:
space:
mode:
Diffstat (limited to 'doc/hook')
-rw-r--r--doc/hook/activity_filter.bb1
-rw-r--r--doc/hook/activity_order.bb1
-rw-r--r--doc/hook/addon_app_installed_filter.bb18
-rw-r--r--doc/hook/app_installed_filter.bb17
-rw-r--r--doc/hook/attach_delete.bb11
-rw-r--r--doc/hook/content_security_policy.bb39
-rw-r--r--doc/hook/dreport_process.bb7
-rw-r--r--doc/hook/dropdown_extras.bb17
-rw-r--r--doc/hook/network_tabs.bb1
-rw-r--r--doc/hook/page_meta.bb13
-rw-r--r--doc/hook/permit_hook.bb0
-rw-r--r--doc/hook/profile_tabs.bb1
-rw-r--r--doc/hook/system_app_installed_filter.bb18
13 files changed, 142 insertions, 2 deletions
diff --git a/doc/hook/activity_filter.bb b/doc/hook/activity_filter.bb
new file mode 100644
index 000000000..9d0768577
--- /dev/null
+++ b/doc/hook/activity_filter.bb
@@ -0,0 +1 @@
+[h2]activity_filter[/h2]
diff --git a/doc/hook/activity_order.bb b/doc/hook/activity_order.bb
new file mode 100644
index 000000000..4a4670d03
--- /dev/null
+++ b/doc/hook/activity_order.bb
@@ -0,0 +1 @@
+[h2]activity_order[/h2]
diff --git a/doc/hook/addon_app_installed_filter.bb b/doc/hook/addon_app_installed_filter.bb
new file mode 100644
index 000000000..e610b3205
--- /dev/null
+++ b/doc/hook/addon_app_installed_filter.bb
@@ -0,0 +1,18 @@
+[h2]addon_app_installed_filter[/h2]
+
+Allow plugins to filter the result of addon_app_installed.
+
+Code excerpt:
+
+[code]
+ $filter_arr = [
+ 'uid'=>$uid,
+ 'app'=>$app,
+ 'installed'=>$r
+ ];
+ call_hooks('addon_app_installed_filter',$filter_arr);
+ $r = $filter_arr['installed'];
+[/code]
+
+cxref: Zotlabs/Lib/Apps.php
+
diff --git a/doc/hook/app_installed_filter.bb b/doc/hook/app_installed_filter.bb
new file mode 100644
index 000000000..f0d91d6f0
--- /dev/null
+++ b/doc/hook/app_installed_filter.bb
@@ -0,0 +1,17 @@
+[h2]app_installed_filter[/h2]
+
+Allow plugins to filter the result of app_installed.
+
+Code excerpt:
+
+[code]
+ $filter_arr = [
+ 'uid'=>$uid,
+ 'app'=>$app,
+ 'installed'=>$r
+ ];
+ call_hooks('app_installed_filter',$filter_arr);
+ $r = $filter_arr['installed'];
+[/code]
+
+cxref: Zotlabs/Lib/Apps.php
diff --git a/doc/hook/attach_delete.bb b/doc/hook/attach_delete.bb
new file mode 100644
index 000000000..3b63f28d3
--- /dev/null
+++ b/doc/hook/attach_delete.bb
@@ -0,0 +1,11 @@
+[h2]attach_delete[/h2]
+
+Invoked when an attachment is deleted using attach_delete().
+
+[code]
+$arr = ['channel_id' => $channel_id, 'resource' => $resource, 'is_photo'=>$is_photo];
+call_hooks("attach_delete",$arr);
+[/code]
+
+
+See include/attach.php
diff --git a/doc/hook/content_security_policy.bb b/doc/hook/content_security_policy.bb
new file mode 100644
index 000000000..96b8095ae
--- /dev/null
+++ b/doc/hook/content_security_policy.bb
@@ -0,0 +1,39 @@
+[h2]content_security_policy[/h2]
+
+Called to modify CSP settings prior to the output of the Content-Security-Policy header.
+
+This hook permits addons to modify the content-security-policy if necessary to allow loading of foreign js libraries or css styles.
+
+[code]
+if(App::$config['system']['content_security_policy']) {
+ $cspsettings = Array (
+ 'script-src' => Array ("'self'","'unsafe-inline'","'unsafe-eval'"),
+ 'style-src' => Array ("'self'","'unsafe-inline'")
+ );
+ call_hooks('content_security_policy',$cspsettings);
+
+ // Legitimate CSP directives (cxref: https://content-security-policy.com/)
+ $validcspdirectives=Array(
+ "default-src", "script-src", "style-src",
+ "img-src", "connect-src", "font-src",
+ "object-src", "media-src", 'frame-src',
+ 'sandbox', 'report-uri', 'child-src',
+ 'form-action', 'frame-ancestors', 'plugin-types'
+ );
+ $cspheader = "Content-Security-Policy:";
+ foreach ($cspsettings as $cspdirective => $csp) {
+ if (!in_array($cspdirective,$validcspdirectives)) {
+ logger("INVALID CSP DIRECTIVE: ".$cspdirective,LOGGER_DEBUG);
+ continue;
+ }
+ $cspsettingsarray=array_unique($cspsettings[$cspdirective]);
+ $cspsetpolicy = implode(' ',$cspsettingsarray);
+ if ($cspsetpolicy) {
+ $cspheader .= " ".$cspdirective." ".$cspsetpolicy.";";
+ }
+ }
+ header($cspheader);
+}
+[/code]
+
+see: boot.php
diff --git a/doc/hook/dreport_process.bb b/doc/hook/dreport_process.bb
new file mode 100644
index 000000000..3ad331f41
--- /dev/null
+++ b/doc/hook/dreport_process.bb
@@ -0,0 +1,7 @@
+[h2]dreport_process[/h2]
+
+Called for each delivery report received
+
+Passed a delivery_report array.
+
+see: include/zot.php
diff --git a/doc/hook/dropdown_extras.bb b/doc/hook/dropdown_extras.bb
new file mode 100644
index 000000000..6d7110a76
--- /dev/null
+++ b/doc/hook/dropdown_extras.bb
@@ -0,0 +1,17 @@
+[h2]dropdown_extras[/h2]
+
+Modify the dropdown menu available through the cog of items as displayed by conv_item.tpl
+
+This hook allows plugins to add arbitrary html to the cog dropdown of thread items displayed with the conv_item.tpl template.
+
+It is fed an array of ['item' => $item, 'dropdown_extras' => '']. Any additions to the cog menu should be prepended/appended to
+the ['dropdown_extras'] element.
+
+[code]
+$dropdown_extras_arr = [ 'item' => $item , 'dropdown_extras' => '' ];
+call_hooks('dropdown_extras',$dropdown_extras_arr);
+$dropdown_extras = $dropdown_extras_arr['dropdown_extras'];
+[/code]
+
+see: Zotlabs/Lib/ThreadItem.php
+see: view/tpl/conv_item.tpl
diff --git a/doc/hook/network_tabs.bb b/doc/hook/network_tabs.bb
deleted file mode 100644
index 677d7f2b9..000000000
--- a/doc/hook/network_tabs.bb
+++ /dev/null
@@ -1 +0,0 @@
-[h2]network_tabs[/h2]
diff --git a/doc/hook/page_meta.bb b/doc/hook/page_meta.bb
new file mode 100644
index 000000000..30a8f9440
--- /dev/null
+++ b/doc/hook/page_meta.bb
@@ -0,0 +1,13 @@
+[h2]page_meta[/h2]
+
+Called before generating the page header.
+
+[code]
+ $pagemeta = [ 'og:title' => self::$page['title'] ];
+
+ call_hooks('page_meta',$pagemeta);
+ foreach ($pagemeta as $metaproperty => $metavalue) {
+ self::$meta->set($metaproperty,$metavalue);
+ }
+
+[/code]
diff --git a/doc/hook/permit_hook.bb b/doc/hook/permit_hook.bb
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/doc/hook/permit_hook.bb
diff --git a/doc/hook/profile_tabs.bb b/doc/hook/profile_tabs.bb
deleted file mode 100644
index 5b3e9e707..000000000
--- a/doc/hook/profile_tabs.bb
+++ /dev/null
@@ -1 +0,0 @@
-[h2]profile_tabs[/h2]
diff --git a/doc/hook/system_app_installed_filter.bb b/doc/hook/system_app_installed_filter.bb
new file mode 100644
index 000000000..a269a79a8
--- /dev/null
+++ b/doc/hook/system_app_installed_filter.bb
@@ -0,0 +1,18 @@
+[h2]system_app_installed_filter[/h2]
+
+Allow plugins to filter the result of system_app_installed.
+
+Code excerpt:
+
+[code]
+ $filter_arr = [
+ 'uid'=>$uid,
+ 'app'=>$app,
+ 'installed'=>$r
+ ];
+ call_hooks('system_app_installed_filter',$filter_arr);
+ $r = $filter_arr['installed'];
+[/code]
+
+cxref: Zotlabs/Lib/Apps.php
+