Separated shortcode array into setup file
authorLaury GvR <laury@gaslightmedia.com>
Thu, 28 Apr 2016 19:50:42 +0000 (15:50 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 28 Apr 2016 19:50:42 +0000 (15:50 -0400)
controllers/admin.php
index.php
setup/requiredPages.php [new file with mode: 0644]

index df662f6..84eb98b 100644 (file)
@@ -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']);
             }
         }
         
index 3f53a72..e1e8b30 100644 (file)
--- 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 (file)
index 0000000..504c373
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+/**
+ * Gaslight Media Members Database
+ * GLM Members Main Add-On Required Pages
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Gaslight Media <dev@gaslightmedia.com>
+ * @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'
+    )
+);