From 50e3325bb6847fe033fad97f1318df8a0a912fd8 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Wed, 20 Apr 2016 17:16:32 -0400 Subject: [PATCH] Events nearly ready, menu restructure --- glm-member-db-packaging.php | 203 ---------- index.php | 204 +++++++++- .../packaging.php => packaging/index.php} | 4 +- setup/adminMenus.php | 8 + setup/adminTabs.php | 33 -- setup/databaseScripts/readme.txt | 41 ++ setup/validActions.php | 3 + views/admin/member/packaging.html | 2 +- views/admin/members/packaging.html | 2 +- views/admin/packaging/header.html | 8 + views/admin/packaging/index.html | 368 ++++++++++++++++++ 11 files changed, 634 insertions(+), 242 deletions(-) delete mode 100644 glm-member-db-packaging.php rename models/admin/{members/packaging.php => packaging/index.php} (98%) create mode 100644 setup/databaseScripts/readme.txt create mode 100644 views/admin/packaging/header.html create mode 100644 views/admin/packaging/index.html diff --git a/glm-member-db-packaging.php b/glm-member-db-packaging.php deleted file mode 100644 index 478d13e..0000000 --- a/glm-member-db-packaging.php +++ /dev/null @@ -1,203 +0,0 @@ - - * @license http://www.gaslightmedia.com Gaslightmedia - * @version 0.0.3 - */ - -/* - * Plugin and Database Versions - * - * Note that the database version matches the version of the last - * plugin version where there was a change in the database. - * - * Updates to checkDatabase() in glmPluginSupport.php must be - * made together with the DB_VERSION below. ONLY bump the DB - * version when there's a change in the database!! Use the - * version nunmber of that release for the DB version. - * - * We check the plugin version stored in the WordPress option below - * so that we're sure the other add-ons see an up to date - * version from this plugin. - */ -define('GLM_MEMBERS_PACKAGING_PLUGIN_VERSION', '1.0.20'); -define('GLM_MEMBERS_PACKAGING_PLUGIN_DB_VERSION', '1.1.0'); - -// This is the minimum version of the GLM Members DB plugin require for this plugin. -define('GLM_MEMBERS_PACKAGING_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '1.0.57'); - -// Check if plugin version is not current in WordPress option and if needed updated it -if (GLM_MEMBERS_PACKAGING_PLUGIN_VERSION != get_option('glmMembersDatabasePackagingPluginVersion')) { - update_option('glmMembersDatabasePackagingPluginVersion', GLM_MEMBERS_PACKAGING_PLUGIN_VERSION); -} - -/* - * Copyright 2014 Charles Scott (email : cscott@gaslightmedia.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -// Check that we're being called by WordPress. -if (!defined('ABSPATH')) { - die("Please do not call this code directly!"); -} - -/* -* Some initial setup and tests -*/ - -$startupNotices = ''; - -// Get standard defined parameters -require_once('defines.php'); - -// Required to be able to get user capabilities when being called as a filter from the main plugin -require_once(ABSPATH . 'wp-includes/pluggable.php'); - -/* - * Do some checks to make sure the main GLM Member DB is active and of a recceint enough version - */ - -// Function to generate message regarding main GLM Member DB plugin not installed and active -function glmMembersPackagingPluginRequired() { - echo ' -
-

The '.GLM_MEMBERS_PACKAGING_PLUGIN_NAME.' add-on requires the base GLM Member DB plugin to be installed and active!

-

The '.GLM_MEMBERS_PACKAGING_PLUGIN_NAME.' plugin has been de-activated.

-
- '; -} - -/* - * Check installation, activation, and version of main Member DB plugin - */ -include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); -$plugin_name = 'glm-member-db/glm-member-db.php'; -$is_active = is_plugin_active($plugin_name); - -// If it's not active, then warn user and deactivate this add-on plugin -if ($is_active != '1') { - add_action( 'admin_notices', 'glmMembersPackagingPluginRequired' ); - deactivate_plugins('/'.GLM_MEMBERS_PACKAGING_PLUGIN_SLUG.'/'.GLM_MEMBERS_PACKAGING_PLUGIN_SLUG.'.php'); -} - -// Function to generate message regarding main GLM Member DB plugin version is not receint enought to run this add-on -function glmMembersPluginMinVerRequired() { - echo ' -
-

The '.GLM_MEMBERS_PACKAGING_PLUGIN_NAME.' requires that the main GLM Member DB plugin version be no older than ' - .GLM_MEMBERS_PACKAGING_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION.'!
- '.GLM_MEMBERS_PACKAGING_MIN_VERSION_NOTE.'

-

The '.GLM_MEMBERS_PACKAGING_PLUGIN_NAME.' plugin has been de-activated.

-
- '; -} - -/* - * Check for Minimum DB version for main Member DB - */ -$glmMembersDatabasePluginVersion = get_option('glmMembersDatabasePluginVersion'); -if (version_compare($glmMembersDatabasePluginVersion, GLM_MEMBERS_PACKAGING_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION) < 0) { - define('GLM_MEMBERS_PACKAGING_MIN_VERSION_NOTE', "Members DB: $glmMembersDatabasePluginVersion, Packaging Requires: ".GLM_MEMBERS_PACKAGING_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION); - add_action( 'admin_notices', 'glmMembersPluginMinVerRequired'); - deactivate_plugins('/'.GLM_MEMBERS_PACKAGING_PLUGIN_SLUG.'/'.GLM_MEMBERS_PACKAGING_PLUGIN_SLUG.'.php'); -} - -/* - * Register this add-on with the main GLM Member DB plugin and get information on all add-ons loaded. - */ -require_once(GLM_MEMBERS_PACKAGING_PLUGIN_SETUP_PATH.'/validActions.php'); -require_once(GLM_MEMBERS_PACKAGING_PLUGIN_SETUP_PATH.'/shortcodes.php'); -require_once(GLM_MEMBERS_PACKAGING_PLUGIN_DB_SCRIPTS.'/dbVersions.php'); - -// Load Packaging Management Settings data -$packagingManagementSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A ); -unset($packagingManagementSettings['id']); - -function glmMembersRegisterPackaging($addOns) { - - // Add this add-on to the add-ons array - $addOns[GLM_MEMBERS_PACKAGING_PLUGIN_SLUG] = array( - 'dir' => GLM_MEMBERS_PACKAGING_PLUGIN_PATH, - 'name' => GLM_MEMBERS_PACKAGING_PLUGIN_NAME, - 'short_name' => GLM_MEMBERS_PACKAGING_PLUGIN_SHORT_NAME, - 'slug' => GLM_MEMBERS_PACKAGING_PLUGIN_SLUG, - 'actions' => $GLOBALS['glmMembersPackagingAddOnValidActions'], - 'config' => array( - 'settings' => $GLOBALS['packagingManagementSettings'] - ), - 'shortcodes' => $GLOBALS['glmMembersPackagingShortcodes'], - 'shortcodesDescription' => $GLOBALS['glmMembersPackagingShortcodesDescription'], - 'database' => array( - 'dbPrefix' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX, - 'dbCurrentVersion' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_VERSION, - 'dbActiveVersionOption' => GLM_MEMBERS_PACKAGING_PLUGIN_ACTIVE_DB_OPTION, - 'dbScriptPath' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_SCRIPTS, - 'dbVersions' => $GLOBALS['glmMembersPackagingDbVersions'] - ) - ); - - // Return the array with our data added - return $addOns; -} -add_filter('glm-member-db-register-addon','glmMembersRegisterPackaging', 10, 1); - - /* - * - * Activate and Deactivate hooks - * - */ - - // Activate - function glmMembersPackagingPluginActivate () - { - global $wpdb, $config; - require_once (GLM_MEMBERS_PACKAGING_PLUGIN_PATH . '/activate.php'); - new glmMembersPackagingPluginActivate($wpdb, $config); - } - register_activation_hook(__FILE__, 'glmMembersPackagingPluginActivate'); - - // Deactivate - function glmMembersPackagingPluginDeactivate () - { - global $wpdb, $config; - require_once (GLM_MEMBERS_PACKAGING_PLUGIN_PATH . '/deactivate.php'); - $x = new glmMembersPackagingPluginDeactivate($wpdb, $config); - return false; - } - register_deactivation_hook(__FILE__, 'glmMembersPackagingPluginDeactivate'); - -/* - * Hooks for testing capabilities provided by this add-on - */ -require_once(GLM_MEMBERS_PACKAGING_PLUGIN_SETUP_PATH.'/permissions.php'); - diff --git a/index.php b/index.php index 4e6c07c..2db04be 100644 --- a/index.php +++ b/index.php @@ -1,3 +1,203 @@ \ No newline at end of file +/** + * Plugin Name: GLM Members Database Packaging + * Plugin URI: http://www.gaslightmedia.com/ + * Description: Gaslight Media Members Database. + * Version: 1.0.20 + * Author: Chuck Scott + * Author URI: http://www.gaslightmedia.com/ + * License: GPL2 + */ + +/** + * Gaslight Media Members Database Packaging Add-On + * Index + * + * PHP version 5.5 + * + * @category glmWordPressPluginChild + * @package glmMembersDatabasePackagingAddOn + * @author Chuck Scott + * @license http://www.gaslightmedia.com Gaslightmedia + * @version 0.0.3 + */ + +/* + * Plugin and Database Versions + * + * Note that the database version matches the version of the last + * plugin version where there was a change in the database. + * + * Updates to checkDatabase() in glmPluginSupport.php must be + * made together with the DB_VERSION below. ONLY bump the DB + * version when there's a change in the database!! Use the + * version nunmber of that release for the DB version. + * + * We check the plugin version stored in the WordPress option below + * so that we're sure the other add-ons see an up to date + * version from this plugin. + */ +define('GLM_MEMBERS_PACKAGING_PLUGIN_VERSION', '1.0.20'); +define('GLM_MEMBERS_PACKAGING_PLUGIN_DB_VERSION', '1.1.0'); + +// This is the minimum version of the GLM Members DB plugin require for this plugin. +define('GLM_MEMBERS_PACKAGING_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '1.0.57'); + +// Check if plugin version is not current in WordPress option and if needed updated it +if (GLM_MEMBERS_PACKAGING_PLUGIN_VERSION != get_option('glmMembersDatabasePackagingPluginVersion')) { + update_option('glmMembersDatabasePackagingPluginVersion', GLM_MEMBERS_PACKAGING_PLUGIN_VERSION); +} + +/* + * Copyright 2014 Charles Scott (email : cscott@gaslightmedia.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + +// Check that we're being called by WordPress. +if (!defined('ABSPATH')) { + die("Please do not call this code directly!"); +} + +/* +* Some initial setup and tests +*/ + +$startupNotices = ''; + +// Get standard defined parameters +require_once('defines.php'); + +// Required to be able to get user capabilities when being called as a filter from the main plugin +require_once(ABSPATH . 'wp-includes/pluggable.php'); + +/* + * Do some checks to make sure the main GLM Member DB is active and of a recceint enough version + */ + +// Function to generate message regarding main GLM Member DB plugin not installed and active +function glmMembersPackagingPluginRequired() { + echo ' +
+

The '.GLM_MEMBERS_PACKAGING_PLUGIN_NAME.' add-on requires the base GLM Member DB plugin to be installed and active!

+

The '.GLM_MEMBERS_PACKAGING_PLUGIN_NAME.' plugin has been de-activated.

+
+ '; +} + +/* + * Check installation, activation, and version of main Member DB plugin + */ +include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); +$plugin_name = 'glm-member-db/index.php'; +$is_active = is_plugin_active($plugin_name); + +// If it's not active, then warn user and deactivate this add-on plugin +if ($is_active != '1') { + add_action( 'admin_notices', 'glmMembersPackagingPluginRequired' ); + deactivate_plugins('/'.GLM_MEMBERS_PACKAGING_PLUGIN_SLUG.'/'.GLM_MEMBERS_PACKAGING_PLUGIN_SLUG.'.php'); +} + +// Function to generate message regarding main GLM Member DB plugin version is not receint enought to run this add-on +function glmMembersPluginMinVerRequired() { + echo ' +
+

The '.GLM_MEMBERS_PACKAGING_PLUGIN_NAME.' requires that the main GLM Member DB plugin version be no older than ' + .GLM_MEMBERS_PACKAGING_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION.'!
+ '.GLM_MEMBERS_PACKAGING_MIN_VERSION_NOTE.'

+

The '.GLM_MEMBERS_PACKAGING_PLUGIN_NAME.' plugin has been de-activated.

+
+ '; +} + +/* + * Check for Minimum DB version for main Member DB + */ +$glmMembersDatabasePluginVersion = get_option('glmMembersDatabasePluginVersion'); +if (version_compare($glmMembersDatabasePluginVersion, GLM_MEMBERS_PACKAGING_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION) < 0) { + define('GLM_MEMBERS_PACKAGING_MIN_VERSION_NOTE', "Members DB: $glmMembersDatabasePluginVersion, Packaging Requires: ".GLM_MEMBERS_PACKAGING_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION); + add_action( 'admin_notices', 'glmMembersPluginMinVerRequired'); + deactivate_plugins('/'.GLM_MEMBERS_PACKAGING_PLUGIN_SLUG.'/'.GLM_MEMBERS_PACKAGING_PLUGIN_SLUG.'.php'); +} + +/* + * Register this add-on with the main GLM Member DB plugin and get information on all add-ons loaded. + */ +require_once(GLM_MEMBERS_PACKAGING_PLUGIN_SETUP_PATH.'/validActions.php'); +require_once(GLM_MEMBERS_PACKAGING_PLUGIN_SETUP_PATH.'/shortcodes.php'); +require_once(GLM_MEMBERS_PACKAGING_PLUGIN_DB_SCRIPTS.'/dbVersions.php'); + +// Load Packaging Management Settings data +$packagingManagementSettings = $wpdb->get_row( "SELECT * FROM ".GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX."management WHERE id = 1", ARRAY_A ); +unset($packagingManagementSettings['id']); + +function glmMembersRegisterPackaging($addOns) { + + // Add this add-on to the add-ons array + $addOns[GLM_MEMBERS_PACKAGING_PLUGIN_SLUG] = array( + 'dir' => GLM_MEMBERS_PACKAGING_PLUGIN_PATH, + 'name' => GLM_MEMBERS_PACKAGING_PLUGIN_NAME, + 'short_name' => GLM_MEMBERS_PACKAGING_PLUGIN_SHORT_NAME, + 'slug' => GLM_MEMBERS_PACKAGING_PLUGIN_SLUG, + 'actions' => $GLOBALS['glmMembersPackagingAddOnValidActions'], + 'config' => array( + 'settings' => $GLOBALS['packagingManagementSettings'] + ), + 'shortcodes' => $GLOBALS['glmMembersPackagingShortcodes'], + 'shortcodesDescription' => $GLOBALS['glmMembersPackagingShortcodesDescription'], + 'database' => array( + 'dbPrefix' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_PREFIX, + 'dbCurrentVersion' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_VERSION, + 'dbActiveVersionOption' => GLM_MEMBERS_PACKAGING_PLUGIN_ACTIVE_DB_OPTION, + 'dbScriptPath' => GLM_MEMBERS_PACKAGING_PLUGIN_DB_SCRIPTS, + 'dbVersions' => $GLOBALS['glmMembersPackagingDbVersions'] + ) + ); + + // Return the array with our data added + return $addOns; +} +add_filter('glm-member-db-register-addon','glmMembersRegisterPackaging', 10, 1); + + /* + * + * Activate and Deactivate hooks + * + */ + + // Activate + function glmMembersPackagingPluginActivate () + { + global $wpdb, $config; + require_once (GLM_MEMBERS_PACKAGING_PLUGIN_PATH . '/activate.php'); + new glmMembersPackagingPluginActivate($wpdb, $config); + } + register_activation_hook(__FILE__, 'glmMembersPackagingPluginActivate'); + + // Deactivate + function glmMembersPackagingPluginDeactivate () + { + global $wpdb, $config; + require_once (GLM_MEMBERS_PACKAGING_PLUGIN_PATH . '/deactivate.php'); + $x = new glmMembersPackagingPluginDeactivate($wpdb, $config); + return false; + } + register_deactivation_hook(__FILE__, 'glmMembersPackagingPluginDeactivate'); + +/* + * Hooks for testing capabilities provided by this add-on + */ +require_once(GLM_MEMBERS_PACKAGING_PLUGIN_SETUP_PATH.'/permissions.php'); + diff --git a/models/admin/members/packaging.php b/models/admin/packaging/index.php similarity index 98% rename from models/admin/members/packaging.php rename to models/admin/packaging/index.php index e91f034..5c4d09b 100644 --- a/models/admin/members/packaging.php +++ b/models/admin/packaging/index.php @@ -28,7 +28,7 @@ require_once(GLM_MEMBERS_PACKAGING_PLUGIN_CLASS_PATH.'/data/dataPackages.php'); * @release SVN: $Id: packaging.php,v 1.0 2011/01/25 19:31:47 cscott * Exp $ */ -class GlmMembersAdmin_members_packaging extends GlmDataPackages +class GlmMembersAdmin_packaging_index extends GlmDataPackages { /** @@ -314,7 +314,7 @@ class GlmMembersAdmin_members_packaging extends GlmDataPackages return array( 'status' => true, 'modelRedirect' => false, - 'view' => 'admin/members/packaging.html', + 'view' => 'admin/packaging/index.html', 'data' => $templateData ); diff --git a/setup/adminMenus.php b/setup/adminMenus.php index d23d5c2..0600747 100644 --- a/setup/adminMenus.php +++ b/setup/adminMenus.php @@ -30,5 +30,13 @@ * */ +add_submenu_page( + 'glm-members-admin-menu-members', // Parent slug + 'Packaging', // Page title + 'Packaging', // Menu Title + 'glm_members_members', // Capability required + 'glm-members-admin-menu-packaging-index', // Menu slug + function() {$this->controller('packaging');} +); ?> diff --git a/setup/adminTabs.php b/setup/adminTabs.php index 63129a1..81d6150 100644 --- a/setup/adminTabs.php +++ b/setup/adminTabs.php @@ -33,22 +33,6 @@ * */ -if (apply_filters('glm_members_permit_admin_members_packages_tab', true)) { - add_filter('glm-member-db-add-tab-for-members', - function($addOnTabs) { - $newTabs = array( - array( - 'text' => 'Packaging', - 'menu' => 'members', - 'action' => 'packaging' - ) - ); - $addOnTabs = array_merge($addOnTabs, $newTabs); - return $addOnTabs; - } - ); -} - if (apply_filters('glm_members_permit_admin_member_packages_tab', true)) { add_filter('glm-member-db-add-tab-for-member', function($addOnTabs) { @@ -65,21 +49,4 @@ if (apply_filters('glm_members_permit_admin_member_packages_tab', true)) { ); } -if (apply_filters('glm_members_permit_admin_members_packages_tab', true)) { - add_filter('glm-member-db-add-tab-for-management', - function($addOnTabs) { - $newTabs = array( - array( - 'text' => 'Packaging', - 'menu' => 'management', - 'action' => 'packaging' - ) - ); - $addOnTabs = array_merge($addOnTabs, $newTabs); - return $addOnTabs; - } - ); -} - - ?> \ No newline at end of file diff --git a/setup/databaseScripts/readme.txt b/setup/databaseScripts/readme.txt new file mode 100644 index 0000000..141d8b5 --- /dev/null +++ b/setup/databaseScripts/readme.txt @@ -0,0 +1,41 @@ +This directory contains database creation and update scripts for this add-on. + +The files in this directory are checked by the checkDatabase() function in the +main plugin classes/glmPluginSupport.php file. + +This directory is optional. If there are no data tables that need to be created +for this add-on, there should be no files in this directory. The directory may +also be deleted. + +See the "examples" directory for a sample of what can go in this directory. +Procedure to update database +----------------------------- + +0) Make a backup copy of the site's database. + +1) Rename "create_database_Vx.x.x.sql" to new version number. + example: create_database_V0.0.9.sql -> create_database_V0.0.10.sql + +2) Edit renamed create database file and make desired changes + +3) Add a new "update_database_Vx.x.x.sql" named with the correct version #. + +4) Edit new update database files with SQL script to make the necessary changes + from the previous version to the new version. (i.e. to add new fields, + rename fields, insert records, ...) + +5) Optionally add an "update_database_Vx.x.x.php" file if PHP scripting is + needed to update database content. (i.e. to make changes to database content) + +6) Edit the "dbVersions.php" file and add a new line for the new version. + *** Now please be sure to add a date for each entry *** + i.e. '1.1.2' => array('version' => '1.1.2', 'tables' => 14, 'date' => '4/11/16') + +7) When this is all done, edit the index.php file for the plugin/add-on and + change "GLM_MEMBERS_{addon}_PLUGIN_DB_VERSION" defined parameter where + {addon} is the add-on name. + +8) Go to an admin menu item for the main member db plugin or any add-on. If all + goes well, the main plugin should have detected the change and updated the + database. If not, restore the database and try again. +9) Check the database to make sure the changes to fields and data are correct. diff --git a/setup/validActions.php b/setup/validActions.php index 0d5a336..d700301 100644 --- a/setup/validActions.php +++ b/setup/validActions.php @@ -38,6 +38,9 @@ $glmMembersPackagingAddOnValidActions = array( 'member' => array( 'packaging' => GLM_MEMBERS_PACKAGING_PLUGIN_SLUG ), + 'packaging' => array( + 'index' => GLM_MEMBERS_PACKAGING_PLUGIN_SLUG + ), 'management' => array( 'packaging' => GLM_MEMBERS_PACKAGING_PLUGIN_SLUG ) diff --git a/views/admin/member/packaging.html b/views/admin/member/packaging.html index 765a075..03f6977 100644 --- a/views/admin/member/packaging.html +++ b/views/admin/member/packaging.html @@ -78,7 +78,7 @@ {php} wp_editor('{$packageInfo.fieldData.descr|escape:quotes}', 'glm_descr', array( - // 'media_buttons' => true, + 'media_buttons' => false, // 'quicktags' => false, // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. 'textarea_name' => 'descr', diff --git a/views/admin/members/packaging.html b/views/admin/members/packaging.html index 7aed491..951076d 100644 --- a/views/admin/members/packaging.html +++ b/views/admin/members/packaging.html @@ -65,7 +65,7 @@ {php} wp_editor('{$packageInfo.fieldData.descr|escape:quotes}', 'glm_descr', array( - // 'media_buttons' => true, + 'media_buttons' => false, // 'quicktags' => false, // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. 'textarea_name' => 'descr', diff --git a/views/admin/packaging/header.html b/views/admin/packaging/header.html new file mode 100644 index 0000000..678e976 --- /dev/null +++ b/views/admin/packaging/header.html @@ -0,0 +1,8 @@ +
+

All Packages

+ +
+ + \ No newline at end of file diff --git a/views/admin/packaging/index.html b/views/admin/packaging/index.html new file mode 100644 index 0000000..b13fd6d --- /dev/null +++ b/views/admin/packaging/index.html @@ -0,0 +1,368 @@ +{include file='admin/packaging/header.html'} + + {if $packageUpdated}

Package Updated

{/if} + {if $packageError}

Error submitting package, see below...

{/if} + +{if $option == 'edit' || $option == 'add'} + + {if apply_filters('glm_members_permit_admin_members_packaging_edit_package', true)} + + + {if $option == 'edit'} +

Edit Multi-Member Package

+ Delete this Package + +
+
+

Cancel

+

+
+
+

WARNING:

+

+ Clicking the "Delete this Package" button above will + delete all of the data and images associated with this package. + +

+

+ Once deleted, this information will no longer be available and cannot be retrieved! +

+
+
+ {else} +

Add new Multi-Member Package

+ {/if} + Return to Package List + + +
+ + + + {if $havePackage} + + + {else} + + {/if} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Title: + + {if $packageInfo.fieldFail.title}

{$packageInfo.fieldFail.title}

{/if} +
Active: + +
Description: + {php} + wp_editor('{$packageInfo.fieldData.descr|escape:quotes}', 'glm_descr', array( + 'media_buttons' => false, + // 'quicktags' => false, + // 'wpautop' => false, NOTE: Dont's use. Problem when numerous spaces before text. + 'textarea_name' => 'descr', + 'editor_height' => 200, // Height in px, overrides editor_rows + // 'textarea_rows' => 8 + )); + {/php} + {if $packageInfo.fieldFail.descr}

{$packageInfo.fieldFail.descr}

{/if} +
Short Description: + + {if $packageInfo.fieldFail.short_descr}

{$packageInfo.fieldFail.short_descr}

{/if} +
Image: + + {if $packageInfo.fieldData.image} + + + + + {/if} + +
+
+ +
+
+ Delete Image
+ {$packageInfo.fieldData.image}
+
New image:
+
+ {if $packageInfo.fieldFail.image}

{$packageInfo.fieldFail.image}

{/if} +
Start Date: + + {if $packageInfo.fieldFail.start_date}

{$packageInfo.fieldFail.start_date}

{/if} +
End Date: + + {if $packageInfo.fieldFail.end_date}

{$packageInfo.fieldFail.end_date}

{/if} +
Expire Date: + + {if $packageInfo.fieldFail.expire_date}

{$packageInfo.fieldFail.expire_date}

{/if} +
Pricing Description: + + {if $packageInfo.fieldFail.pricing}

{$packageInfo.fieldFail.pricing}

{/if} +
Display Order: + + {if $packageInfo.fieldFail.position}

{$packageInfo.fieldFail.position}

{/if} +
Participating Members + + + Search to add a member:
+ + + + + +
+
  • + + + + + + + + + +
    Package Member:{ memberName }
    Active:
    Package Element Title:
    Description:
    Short Description:
    Image:
    +
  • +
    + +
    +
      + {if $havePackageMembers} + + {foreach $packageMembers as $i} +
    • + + +
      + + + + + + + + +
      Package Member:{$i.memberName}
      Active:
      Package Element Title:
      Description:
      Short Description:
      Image:
      +
      +
    • + {/foreach} + {else} +
    • No members have been added to this package yet.
      Please select a member above.
    • + {/if} +
    +
    +
    + +
    + + {else} + + + + + + + + + + + + + +
    Title:{$packageInfo.fieldData.title}
    Name for URLs:{$packageInfo.fieldData.package_slug}
    Active:{$packageInfo.fieldData.active.name}
    Description:{$packageInfo.fieldData.descr}
    Short Description:{$packageInfo.fieldData.short_descr}
    Image:
    Start Date:{$packageInfo.fieldData.start_date.date}
    End Date:{$packageInfo.fieldData.end_date.date}
    Expiration Date:{$packageInfo.fieldData.expire_date.date}
    Pricing Description:{$packageInfo.fieldData.pricing}
    Display Order:{$packageInfo.fieldData.position}
    + + {/if} + +{else} + + {if apply_filters('glm_members_permit_admin_members_packaging_add_package', true)} +
      Add a Multi-Member Package
    + {/if} + + +
    + List Filters:   + All   + Member   + Multi-Member   + Search:    + +
    + + +

    Packages

    + + + + + + + + + + + + + {if $havePackages} + {foreach $packages as $p} + + + + + + + + {/foreach} + {else} + + {/if} + +
    PackageMemberStartEndExpire
    + {if $p.ref_type.value} + {$p.title} + {else} + {$p.title} + {/if} + + {$p.ref_dest_name} + + {$p.start_date.date} + + {$p.end_date.date} + + {$p.expire_date.date} +
    (no packages listed)
    + +{/if} + + + +{include file='admin/footer.html'} -- 2.17.1