From e6b390f9881564137951018b109eaba4ba7d2d42 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Thu, 28 Apr 2016 15:50:42 -0400 Subject: [PATCH] Separated shortcode array into setup file --- controllers/admin.php | 4 ++-- index.php | 23 ++------------------ setup/requiredPages.php | 48 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 23 deletions(-) create mode 100644 setup/requiredPages.php diff --git a/controllers/admin.php b/controllers/admin.php index df662f6e..84eb98b9 100644 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -710,8 +710,8 @@ class glmMembersAdmin extends GlmPluginSupport foreach ($this->config['addOns'] as $a) { // - if (isset($a['required_pages'])) { - $this->createPages($a['required_pages']); + if (isset($a['requiredPages'])) { + $this->createPages($a['requiredPages']); } } diff --git a/index.php b/index.php index 3f53a723..e1e8b303 100644 --- a/index.php +++ b/index.php @@ -272,6 +272,7 @@ add_option('glmMembersDatabaseDbVersion', false); */ require_once(GLM_MEMBERS_PLUGIN_SETUP_PATH.'/validActions.php'); require_once(GLM_MEMBERS_PLUGIN_SETUP_PATH.'/shortcodes.php'); +require_once GLM_MEMBERS_PLUGIN_SETUP_PATH.'/requiredPages.php'; require_once(GLM_MEMBERS_PLUGIN_DB_SCRIPTS.'/dbVersions.php'); $config['addOns'] = array( GLM_MEMBERS_PLUGIN_SLUG => array( @@ -289,27 +290,7 @@ $config['addOns'] = array( 'dbScriptPath' => GLM_MEMBERS_PLUGIN_DB_SCRIPTS, 'dbVersions' => $glmMembersDbVersions ), - 'required_pages' => array( - // These should be in GLM Associate - 'GLM Associate' => array( - 'content' => '', - 'parent' => '0' - ), - // These should be in GLM Members - 'Members Only' => array( - 'content' => 'This page and any child beneath it will automatically be locked to Members Only with the members-only-template.', - 'parent' => '0', - 'template' => 'glm-members-only-template.php' - ), - 'Members List' => array( - 'content' => '[glm-members-list]', - 'parent' => 'GLM Associate' - ), - 'Member Detail' => array( - 'content' => '[glm-member-detail]', - 'parent' => 'GLM Associate' - ) - ) + 'requiredPages' => $glmMembersRequiredPages ) ); diff --git a/setup/requiredPages.php b/setup/requiredPages.php new file mode 100644 index 00000000..504c373e --- /dev/null +++ b/setup/requiredPages.php @@ -0,0 +1,48 @@ + + * @license http://www.gaslightmedia.com Gaslightmedia + * @release requiredPages.php,v 1.0 2014/10/31 19:31:47 glm Exp $ + * @link http://dev.gaslightmedia.com/ + */ + +/* + * Array of required pages + * + * This array lists all of the required pages made available to the main + * member plugin + * + * This array is merged with the data from any registered add-ons + * providing required pages. The plugin providing the required pages + * is designated in the 'plugin' elemeent. + * + */ + +$glmMembersRequiredPages = array( + // These should be in GLM Associate + 'GLM Associate' => array( + 'content' => '', + 'parent' => '0' + ), + // These should be in GLM Members + 'Members Only' => array( + 'content' => 'This page and any child beneath it will automatically be locked to Members Only with the members-only-template.', + 'parent' => '0', + 'template' => 'glm-members-only-template.php' + ), + 'Members List' => array( + 'content' => '[glm-members-list]', + 'parent' => 'GLM Associate' + ), + 'Member Detail' => array( + 'content' => '[glm-member-detail]', + 'parent' => 'GLM Associate' + ) +); -- 2.17.1