From 41d6d2141ffb42bd2c012ce46ea6076f7f55ae99 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Thu, 21 Jan 2016 15:16:20 -0500 Subject: [PATCH] Added adminHooks and hooksHelp to be consistent with packaging Add-On --- setup/adminHooks.php | 47 ++++++++++++++++++++++++++++++++++++++++++++ setup/hooksHelp.html | 38 +++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 setup/adminHooks.php create mode 100644 setup/hooksHelp.html diff --git a/setup/adminHooks.php b/setup/adminHooks.php new file mode 100644 index 0000000..4083865 --- /dev/null +++ b/setup/adminHooks.php @@ -0,0 +1,47 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release adminHooks.php,v 1.0 2014/10/31 19:31:47 cscott Exp $ + * @link http://dev.gaslightmedia.com/ + */ + +/* + * Place Misc Hooks and Filters here. If this file exists, it will be included + * by the add-on main plugin script. + * + * Note that filter and hook callback functions must be included in-line as shown below... + * + * add_filter( 'filter_title', function( $parameter ) { + * // Function code + * }); + * + * Also note that parameters will be in the context of the main admin controller constructor. + */ + + +// Add content to member detail page +add_filter('glm-member-db-admin-management-hoooksHelp', function($content) { + + // Read in this plugin/addon hook help file + $fname = GLM_MEMBERS_CONTACTS_PLUGIN_PATH.'/setup/hooksHelp.html'; + if (is_file($fname)) { + $hooksHelp = file_get_contents($fname); + if ($hooksHelp != false) { + $content .= $hooksHelp; + } + } + return $content; + }, + 10, + 2 +); + +?> \ No newline at end of file diff --git a/setup/hooksHelp.html b/setup/hooksHelp.html new file mode 100644 index 0000000..ce62e67 --- /dev/null +++ b/setup/hooksHelp.html @@ -0,0 +1,38 @@ + + +

Contacts Add-On

+ + User Permission Hooks + + + glm_members_permit_admin_member_contacts_tab + Filter + + + Hook to test if the logged in user is permitted to see the member Contacts tab. + + + + glm_members_permit_admin_member_contacts_add_contact + Filter + + + Hook to test if the logged in user is permitted to add a new contact. + + + + glm_members_permit_admin_member_contacts_view_contact + Filter + + + Hook to test if the logged in user is permitted to view a contact. + + + + glm_members_permit_admin_member_contacts_edit_contact + Filter + + + Hook to test if the logged in user is permitted to edit a contact. + + -- 2.17.1