Committing initial work on Settings to do other hotfix.
authorChuck Scott <cscott@gaslightmedia.com>
Fri, 25 Sep 2015 13:27:47 +0000 (09:27 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Fri, 25 Sep 2015 13:27:47 +0000 (09:27 -0400)
classes/data/settings/dataSettingsGeneral.php
glm-member-db.php
lib/GlmDataAbstract/.~lock.documentation.odt# [new file with mode: 0644]
lib/GlmDataAbstract/DataAbstract.php

index 420693e..6fbd349 100644 (file)
@@ -814,10 +814,6 @@ class GlmDataSettingsGeneral extends GlmDataAbstract
 
         );
 
-        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
-            glmMembersAdmin::addNotice($this->fields, 'DataBlock', 'Table Fields: '.$this->table);
-        }
-
     }
 }
 
index 11c6ac9..722dcae 100644 (file)
@@ -87,6 +87,19 @@ if (file_exists($currentThemeDirectory.'/glm-member-db/plugin.ini')) {
 
 }
 
+// Add General Settings and Terms from the database to $config
+$setGeneral = $wpdb->get_row(
+    'SELECT * FROM '.GLM_MEMBERS_PLUGIN_DB_PREFIX.'settings_general WHERE id = 1;',
+    ARRAY_A
+);
+unset($setGeneral['id']);
+$setTerms = $wpdb->get_row(
+        'SELECT * FROM '.GLM_MEMBERS_PLUGIN_DB_PREFIX.'settings_terms WHERE id = 1;',
+        ARRAY_A
+);
+unset($setTerms['id']);
+$config = array_merge($config, $setGeneral, $setTerms);
+
 // Try to set the DB version option to false (new plugin) - If it's already set this won't do anything.
 add_option('glmMembersDatabaseDbVersion', false);
 
@@ -248,15 +261,6 @@ register_deactivation_hook(__FILE__, 'glmMembersPluginDeactivate');
 
 // Uninstall - Not using. Using "uninstall.php" in the root directory of this plugin.
 
-/*
- *
- * Load any other common files needed
- *
- */
-
-// Load data abstract
-require_once(GLM_MEMBERS_PLUGIN_LIB_PATH.'/GlmDataAbstract/DataAbstract.php');
-
 /*
  *
  * Determine which controller to load
diff --git a/lib/GlmDataAbstract/.~lock.documentation.odt# b/lib/GlmDataAbstract/.~lock.documentation.odt#
new file mode 100644 (file)
index 0000000..0e5b58c
--- /dev/null
@@ -0,0 +1 @@
+,cscott,Ubuntu-1404,24.09.2015 14:41,file:///home/cscott/.config/libreoffice/4;
\ No newline at end of file
index c6fe2e0..4fd7d6c 100755 (executable)
@@ -606,7 +606,7 @@ abstract class GlmDataAbstract
                 ";
                 $res = $this->wpdb->get_row($sql, ARRAY_A);
 
-                if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+                if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
                     glmMembersAdmin::addNotice($sql, 'DataBlock', "pointerOutput() value data query ".$f['field'].(isset($f['as']) ? ' as '.$f['as'] : ''));
                 }
 
@@ -623,7 +623,7 @@ abstract class GlmDataAbstract
                 ";
                 $p_list = $this->wpdb->get_results($sql, ARRAY_A);
 
-                if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+                if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
                     glmMembersAdmin::addNotice($sql, 'DataBlock', "pointerOutput() value data query ".$f['field'].(isset($f['as']) ? ' as '.$f['as'] : ''));
                 }
 
@@ -696,7 +696,7 @@ abstract class GlmDataAbstract
             $res = $this->wpdb->get_row($sql, ARRAY_A);
 
 
-            if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+            if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
                 glmMembersAdmin::addNotice($sql, 'DataBlock', "pointerOutput() value data query ".$f['field'].(isset($f['as']) ? ' as '.$f['as'] : ''));
             }
 
@@ -2376,7 +2376,7 @@ abstract class GlmDataAbstract
 
             } else {
 
-                if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+                if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
                     glmMembersAdmin::addNotice($newImage, 'DataBlock', "DataAbstract - imageInput() wp_get_image_editor($tmpFile) Error");
                 }
 
@@ -2723,7 +2723,7 @@ abstract class GlmDataAbstract
 
         }
 
-        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
             glmMembersAdmin::addNotice($this->fieldData, 'DataBlock', "buildFieldsList() data");
         }
 
@@ -2916,7 +2916,7 @@ abstract class GlmDataAbstract
 
         $stats = $this->wpdb->get_row($sql, ARRAY_A);
 
-        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
             glmMembersAdmin::addNotice($sql, 'DataBlock', "DataAbstract - getStats() query");
             glmMembersAdmin::addNotice($stats, 'DataBlock', "Stats Data");
         }
@@ -2963,7 +2963,7 @@ abstract class GlmDataAbstract
             ";
         }
 
-        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
             glmMembersAdmin::addNotice($sql, 'DataBlock', "DataAbstract - getList() query");
         }
 
@@ -2979,7 +2979,7 @@ abstract class GlmDataAbstract
             $newList[$v['id']] = $this->processOutputData($v, 'l');
         }
 
-        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
             glmMembersAdmin::addNotice($newList, 'DataBlock', "getList() data");
         }
 
@@ -3018,7 +3018,7 @@ abstract class GlmDataAbstract
         $detail = $this->processOutputData($detail, 'g', $fieldVals);
 
 
-        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
             glmMembersAdmin::addNotice($sql, 'DataBlock', "DataAbstract - getEntry() query");
             glmMembersAdmin::addNotice($detail, 'DataBlock', "getEntry() data");
         }
@@ -3149,7 +3149,7 @@ abstract class GlmDataAbstract
         // Check if there's a function to do other checks
         $r = $this->checkOther($r, 'n');
 
-        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
             glmMembersAdmin::addNotice($r, 'DataBlock', "newEntry() data");
         }
 
@@ -3227,7 +3227,7 @@ abstract class GlmDataAbstract
                     ( $fields ) VALUES ( $vals );
                 ";
 
-                if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+                if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
                     glmMembersAdmin::addNotice($sql, 'DataBlock', "insertEntry() Query");
                 }
 
@@ -3235,7 +3235,7 @@ abstract class GlmDataAbstract
                 $this->wpdb->query($sql);
 
                 // Check for query errors
-                if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+                if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
                     $queryError = $this->wpdb->last_error;
                     if (trim($queryError) != '') {
                         glmMembersAdmin::addNotice(
@@ -3249,18 +3249,18 @@ abstract class GlmDataAbstract
                 $r['fieldData']['id'] = $this->wpdb->insert_id;
 
             } else {
-                if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+                if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
                     glmMembersAdmin::addNotice('&nbsp;&nbsp;insertEntry() requested to NOT store new entry!', 'Process');
                 }
             }
 
         } else {
-            if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+            if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
                 glmMembersAdmin::addNotice('&nbsp;&nbspcheckOther() returned bad status.', 'Process');
             }
         }
 
-        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
             glmMembersAdmin::addNotice($r, 'DataBlock', "DataAbstract - insertEntry() data");
         }
 
@@ -3284,7 +3284,7 @@ abstract class GlmDataAbstract
         $detail = $this->wpdb->get_row($sql, ARRAY_A);
 
         // Check for Errors
-        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
             $queryError = $this->wpdb->last_error;
             if (trim($queryError) != '') {
                 glmMembersAdmin::addNotice(
@@ -3302,7 +3302,7 @@ abstract class GlmDataAbstract
         // Process individual fields
         $detail = $this->processOutputData($detail, 'e', true, $id, $idField);
 
-        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
             glmMembersAdmin::addNotice($sql, 'DataBlock', "DataAbstract - editEntry() query");
             glmMembersAdmin::addNotice($detail, 'DataBlock', "editEntry() data");
         }
@@ -3377,7 +3377,7 @@ abstract class GlmDataAbstract
             $this->wpdb->query($sql, ARRAY_A);
 
             // Check for Errors
-            if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+            if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
                 $queryError = $this->wpdb->last_error;
                 if (trim($queryError) != '') {
                     glmMembersAdmin::addNotice(
@@ -3392,7 +3392,7 @@ abstract class GlmDataAbstract
 
         }
 
-        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
             glmMembersAdmin::addNotice($r, 'DataBlock', "updateEntry() data");
         }
 
@@ -3447,7 +3447,7 @@ abstract class GlmDataAbstract
                      WHERE $idField = $id;
                 ";
 
-                if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+                if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
                     glmMembersAdmin::addNotice($sql, 'DataBlock', "DataAbstract - deleteEntry() query");
                 }
 
@@ -3462,7 +3462,7 @@ abstract class GlmDataAbstract
             }
         }
 
-        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+        if (is_admin() && GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE && class_exists('glmMembersAdmin')) {
             glmMembersAdmin::addNotice($detail, 'DataBlock', "deleteEntry() data");
         }