From 6eae4af47f7bcb238b6483804a087d4b6271dbc9 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Fri, 24 Feb 2017 11:55:15 -0500 Subject: [PATCH] Removed test code Updated hooksHelp so it works --- index.php | 2 -- models/admin/events/list.php | 7 ++++++- setup/adminHooks.php | 18 ++++++++++++++++++ setup/hooksHelp.html | 15 --------------- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/index.php b/index.php index 73169ae..88df22e 100644 --- a/index.php +++ b/index.php @@ -145,8 +145,6 @@ if (is_file(GLM_MEMBERS_EVENTS_PLUGIN_DB_SCRIPTS.'/dbVersions.php')) { } // Load Events Management Settings data -/* None - Need to figure out a smooth way to do this. -*/ $eventsManagementSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_EVENTS_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A ); unset($eventsManagementSettings['id']); diff --git a/models/admin/events/list.php b/models/admin/events/list.php index d2016e9..5b056e1 100644 --- a/models/admin/events/list.php +++ b/models/admin/events/list.php @@ -262,7 +262,6 @@ class GlmMembersAdmin_events_list extends GlmDataEvents $amenities = $Amenities->getList(false); } - if ($event['status']) { $haveEvent = true; $eventAdded = true; @@ -360,6 +359,12 @@ class GlmMembersAdmin_events_list extends GlmDataEvents } else { $option = 'add'; $eventAddError = true; + + // Add any recurrence data that may have been submitted +// if (isset($_REQUEST[''])) { +// NOT COMPLETED +// } + } $view = 'edit'; diff --git a/setup/adminHooks.php b/setup/adminHooks.php index b47200a..851a9d0 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -25,6 +25,24 @@ * * Also note that parameters will be in the context of the main admin controller constructor. */ + +// Add hooksHelp.html file to admin Management hooks output +add_filter('glm-member-db-admin-management-hooksHelp', function($content) { + + // Read in this plugin/addon hook help file + $fname = GLM_MEMBERS_EVENTS_PLUGIN_PATH.'/setup/hooksHelp.html'; + if (is_file($fname)) { + $hooksHelp = file_get_contents($fname); + if ($hooksHelp != false) { + $content .= $hooksHelp; + } + } + return $content; + }, + 10, + 2 +); + add_filter( 'glm-member-db-events-get-events', function( $output ){ $events = $this->wpdb->get_results( "SELECT E.id,E.name,T1.start_time as start diff --git a/setup/hooksHelp.html b/setup/hooksHelp.html index 1e05ae0..11230f7 100644 --- a/setup/hooksHelp.html +++ b/setup/hooksHelp.html @@ -1,20 +1,5 @@ - -/********************************************************************** - * NOTE: THIS IS A EVENTS FILE - DO NOT USE UNMODIFIED - * - * Please change all references to events, Events, or EVENTS to a name - * appropriate for your new Add-On. - * - * This file is used to document hooks provided by this add-on. Content - * here will be displayed in the "Management" page "Hooks" tab. If - * there is no content for this page, this file should be omitted. - * - * Remove this message before using this file in production! - **********************************************************************/ - -

Events Add-On

User Permission Hooks -- 2.17.1