Changed settings menu to management menu and added capability "Management"
authorChuck Scott <cscott@gaslightmedia.com>
Mon, 21 Sep 2015 00:26:14 +0000 (20:26 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 21 Sep 2015 00:26:14 +0000 (20:26 -0400)
22 files changed:
activate.php
controllers/admin.php
models/admin/management/development.php [new file with mode: 0644]
models/admin/management/import.php [new file with mode: 0644]
models/admin/management/index.php [new file with mode: 0644]
models/admin/management/terms.php [new file with mode: 0644]
models/admin/settings/development.php [deleted file]
models/admin/settings/import.php [deleted file]
models/admin/settings/index.php [deleted file]
models/admin/settings/terms.php [deleted file]
views/admin/management/development.html [new file with mode: 0644]
views/admin/management/header.html [new file with mode: 0644]
views/admin/management/import.html [new file with mode: 0644]
views/admin/management/import/readDatabase.html [new file with mode: 0644]
views/admin/management/index.html [new file with mode: 0644]
views/admin/management/terms.html [new file with mode: 0644]
views/admin/settings/development.html [deleted file]
views/admin/settings/header.html [deleted file]
views/admin/settings/import.html [deleted file]
views/admin/settings/import/readDatabase.html [deleted file]
views/admin/settings/index.html [deleted file]
views/admin/settings/terms.html [deleted file]

index 7897ed6..dceebd5 100644 (file)
@@ -128,6 +128,15 @@ class glmMembersPluginActivate extends glmPluginSupport
                     'subscriber' => false
                 )
             );
+            $this->addRoleCapability('glm_members_management',
+                array(
+                    'administrator' => true,
+                    'author' => false,
+                    'contributor' => false,
+                    'editor' => false,
+                    'subscriber' => false
+                )
+            );
 
             // Set current plugin version
             update_option('glmMembersDatabasePluginVersion', GLM_MEMBERS_PLUGIN_VERSION);
index 969c6f7..38366f1 100644 (file)
@@ -55,7 +55,7 @@ $GLOBALS['glmMembersAdminValidActions'] = array(
                 'accommodationTypes',
                 'amenities',
         ),
-        'settings' => array(
+        'management' => array(
                 'index',            // General Options
                 'terms',            // Terms and Phrases
                 'development',
@@ -418,13 +418,13 @@ class glmMembersAdmin extends GlmPluginSupport
                         'glmMembersAdminMenuConfigure'
                 ));
 
-        // Add a submenu for the "Settings" section
+        // Add a submenu for the "Management" section
         add_submenu_page('glm-members-admin-menu-members',
-                'Member DB Settings', 'Settings',
-                'glm_members_settings', 'glm-members-admin-menu-settings',
+                'Member DB Management', 'Management',
+                'glm_members_management', 'glm-members-admin-menu-management',
                 array(
                         $this,
-                        'glmMembersAdminMenuSettings'
+                        'glmMembersAdminMenuManagement'
                 ));
 
         // Add a submenu for the "Shortcode Reference" section
@@ -517,9 +517,9 @@ class glmMembersAdmin extends GlmPluginSupport
         $this->controller('configure');
     }
 
-    public function glmMembersAdminMenuSettings ()
+    public function glmMembersAdminMenuManagement ()
     {
-        $this->controller('settings');
+        $this->controller('management');
     }
 
     public function glmMembersAdminMenuShortcodes ()
diff --git a/models/admin/management/development.php b/models/admin/management/development.php
new file mode 100644 (file)
index 0000000..ee2b9bb
--- /dev/null
@@ -0,0 +1,345 @@
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * Admin Development
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @version  0.1
+ */
+
+/*
+ * This class performs the work for the default action of the "Members" menu
+ * option, which is to display the members dashboard.
+ *
+ */
+class GlmMembersAdmin_management_development
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+
+    /*
+     * Constructor
+     *
+     * This contructor sets up this model. At this time that only includes
+     * storing away the WordPress data object.
+     *
+     * @return object Class object
+     *
+     */
+    public function __construct ($wpdb, $config)
+    {
+
+        // Save WordPress Database object
+        $this->wpdb = $wpdb;
+
+        // Save plugin configuration object
+        $this->config = $config;
+
+    }
+
+    /*
+     * Perform Model Action
+     *
+     * This method does the work for this model and returns any resulting data
+     *
+     * @return array Status and data array
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * 'menuItemRedirect'
+     *
+     * If not false, provides a menu item the controller should
+     * execute after this one. Normally if this is used, there would also be a
+     * modelRedirect value supplied as well.
+     *
+     * 'modelRedirect'
+     *
+     * If not false, provides an action the controller should execute after
+     * this one.
+     *
+     * 'view'
+     *
+     * A suggested view name that the contoller should use instead of the
+     * default view for this model or false to indicate that the default view
+     * should be used.
+     *
+     * 'data'
+     *
+     * Data that the model is returning for use in merging with the view to
+     * produce output.
+     *
+     */
+    public function modelAction ($actionData = false)
+    {
+
+        // Get current database version
+        $dbVersion = GLM_MEMBERS_PLUGIN_DB_VERSION;
+        settype($dbVersion, 'string');
+
+        $templateData['resultMessage'] = '';
+        $templateData['success'] = false;
+        $templateData['haveNotices'] = false;
+        $notices = array();
+        $templateData['haveMembers'] = false;
+        $templateData['import'] = false;
+        $templateData['importNotice'] = false;
+        $templateData['haveDatabaseTableList'] = false;
+
+        // Load database activation class to get access to database version information
+        require_once (GLM_MEMBERS_PLUGIN_PATH . '/activate.php');
+        $activate = new glmMembersPluginActivate($this->wpdb, $this->config, true);
+
+        $option = '';
+        if (isset($_REQUEST['option']) && $_REQUEST['option'] != '') {
+            $option = $_REQUEST['option'];
+        }
+
+        switch($option) {
+
+            case 'import_connections':
+
+                // Load Member Info Data Class and get info data for later use
+                require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/glmMemberImportFromConnections.php');
+                $Connections = new GlmMemberImportFromConnections($this->wpdb, $this->config);
+
+                if (isset($_REQUEST['import']) && $_REQUEST['import'] == 'now') {
+
+                    // Reset the database
+                    if (!$this->deleteDataTables($dbVersion)) {
+                        glmMembersAdmin::addNotice('<b>Unable to delete the database tables while resetting the database.</b><br>', 'AdminError');
+                        break;
+                    }
+                    if (!$this->createDataTables($dbVersion)) {
+                        glmMembersAdmin::addNotice('<b>Unable to create the database tables while resetting the database.</b><br>', 'AdminError');
+                        break;
+                    }
+                    glmMembersAdmin::addNotice('<b>Database tables have been reset in preparation importing members.</b><br>', 'AdminNotice');
+
+                    // Delete Images
+                    foreach( new RecursiveIteratorIterator(
+                        new RecursiveDirectoryIterator( GLM_MEMBERS_PLUGIN_IMAGES_PATH, FilesystemIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS ),
+                        RecursiveIteratorIterator::CHILD_FIRST ) as $value ) {
+                            if ($value->isFile()) {
+                                unlink( $value );
+                            }
+                        }
+
+                    $templateData['import'] = true;
+                    $templateData['membersImported'] = $Connections->doImport();
+
+                } else {
+
+                    // Check if Connections is not installed or not active. If active, gets count of entries.
+                    $c = $Connections->checkConnections();
+                    if ($c === false) {
+                        glmMembersAdmin::addNotice('<b>Connections Business Directory plugin is not installed or not active!</b><br>'.print_r($c,1), 'AdminError');
+                        break;
+                    }
+                    $templateData['numbEntries'] = $c;
+                    $importNotice = 'Connections Business Directory plugin is active.<br>Number of businesses listed: '.$c.'<br>';
+
+                    // Get the basic business data for review.
+                    $templateData['members'] = $Connections->getList();
+                    if ($templateData['members'] === false) {
+                        $importNotice = 'No businesses were retieved.';
+                        break;
+                    }
+
+                    $templateData['haveMembers'] = true;
+
+                    if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+                        glmMembersAdmin::addNotice($templateData['members'], 'DataBlock', 'Base Members Data');
+                    }
+
+                }
+
+                break;
+
+            case 'drop':
+            case 'reset':
+
+                $del = $this->deleteDataTables($dbVersion);
+
+                if ($del) {
+                    glmMembersAdmin::addNotice('New database tables for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin have been deleted.', 'AdminNotice');
+
+                }
+
+                if ($option != 'reset') {
+                    break;
+                }
+
+            case 'create':
+
+                $create = $this->createDataTables($dbVersion);
+
+                // If there were no errors
+                if ($create) {
+
+                    // Notify the user that the database has been installed
+                    glmMembersAdmin::addNotice('New database tables installed for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin.', 'AdminNotice');
+
+                    // Save the version of the installed database
+                    update_option('glmMembersDatabaseDbVersion', $dbVersion);
+
+                }
+
+                break;
+
+            case 'list':
+
+                    // Check if the database version set for this plugin is invalid.
+                    if (!isset($activate->dbVersions[$dbVersion])) {
+                        $templateData['resultMessage'] .= "The last database version set for the ".GLM_MEMBERS_PLUGIN_NAME." (V$dbVersion) isn't valid.<br>";
+                        break;
+                    }
+
+                    // Get the number of tables for this plugin database version that should exist.
+                    $tables = $activate->dbVersions[$dbVersion]['tables'];
+
+                    // Get the number of tables for this plugin that do currently exist.
+                    $existingTables = $this->wpdb->get_results("
+                        SELECT table_name
+                          FROM information_schema.tables
+                         WHERE table_name like '".GLM_MEMBERS_PLUGIN_DB_PREFIX."%';
+                    ", ARRAY_A);
+
+                    if (is_array($existingTables)) {
+
+
+
+
+                        $templateData['resultMessage'] .= '<b>Current database tables</b><br><ul>';
+                        foreach($existingTables as $t){
+                            $templateData['resultMessage'] .= "<li>".$t['table_name'].'</li><br>';
+                        }
+                        $templateData['resultMessage'] .= '</ul>';
+                    } else {
+                        $templateData['resultMessage'] .= '<b>No tables currently exist</b><br>';
+                    }
+
+                break;
+
+            default:
+
+                break;
+
+        }
+
+        // Return status, suggested view, and data to controller
+        return array(
+            'status' => true,
+            'menuItemRedirect' => false,
+            'modelRedirect' => false,
+            'view' => 'admin/management/development.html',
+            'data' => $templateData
+        );
+
+    }
+
+    /*
+     * Delete Members Database Tables
+     *
+     * @param string $dbVersion Current version of Members Database
+     *
+     * @return boolean
+     * @access public
+     */
+    public function deleteDataTables($dbVersion)
+    {
+
+        // Read in Database deletion script - assumes the current db version.
+        $sqlFile = GLM_MEMBERS_PLUGIN_DB_SCRIPTS.'/drop_database_V'.$dbVersion.'.sql';
+        $sql = file_get_contents($sqlFile);
+
+        // Replace {prefix} with table name prefix
+        $sql = str_replace('{prefix}', GLM_MEMBERS_PLUGIN_DB_PREFIX, $sql);
+
+        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+            glmMembersAdmin::addNotice('Dropping all database tables', 'Process');
+            glmMembersAdmin::addNotice($sql, 'DataBlock', 'Drop Tables SQL');
+        }
+
+        // Removing the tables using the script
+        $this->wpdb->query($sql);
+
+        // If there's been an error, display in debug Alert
+        $queryError = $this->wpdb->last_error;
+        if ($queryError) {
+            glmMembersAdmin::addNotice('<b>Error when deleting database: Database tables may not have existed.</b><br>Check following message.<br>'.$queryError, 'AdminError');
+            return false;
+        }
+
+        return true;
+
+    }
+
+    /*
+     * Create Members Database Tables
+     *
+     * @param string $dbVersion Current version of Members Database
+     *
+     * @return boolean
+     * @access public
+     */
+    public function createDataTables($dbVersion)
+    {
+
+        // Read in Database creation script
+        $sqlFile = GLM_MEMBERS_PLUGIN_DB_SCRIPTS.'/create_database_V'.$dbVersion.'.sql';
+        $sql = file_get_contents($sqlFile);
+
+        // Replace {prefix} with table name prefix
+        $sql = str_replace('{prefix}', GLM_MEMBERS_PLUGIN_DB_PREFIX, $sql);
+
+        // Split script into separate queries by looking for lines with only "---"
+        $queries = preg_split('/^----$/m', $sql);
+
+        // Try executing all queries to build database
+        $qForDebug = '';
+        do {
+            $q = current($queries);
+            $this->wpdb->query($q);
+            $queryError = $this->wpdb->last_error;
+
+            if ($queryError) {
+                glmMembersAdmin::addNotice('<b>Error when creating database: Database tables may already exist.</b><br>Check following message.<br>'.$queryError, 'AdminError');
+                return false;
+            }
+            $qForDebug .= $queryError.$q;
+
+        } while ($queryError == '' && next($queries));
+
+        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+            glmMembersAdmin::addNotice('Creating database tables', 'Process');
+            glmMembersAdmin::addNotice($qForDebug, 'DataBlock', 'Create Tables SQL');
+        }
+
+        return true;
+
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/models/admin/management/import.php b/models/admin/management/import.php
new file mode 100644 (file)
index 0000000..db7b959
--- /dev/null
@@ -0,0 +1,1097 @@
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * Admin Data Import
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @version  0.1
+ */
+
+/*
+ * This class performs the work for the default action of the "Members" menu
+ * option, which is to display the members dashboard.
+ *
+ */
+class GlmMembersAdmin_management_import
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+
+    /*
+     * Constructor
+     *
+     * This contructor sets up this model. At this time that only includes
+     * storing away the WordPress data object.
+     *
+     * @return object Class object
+     *
+     */
+    public function __construct ($wpdb, $config)
+    {
+
+        // Save WordPress Database object
+        $this->wpdb = $wpdb;
+
+        // Save plugin configuration object
+        $this->config = $config;
+
+    }
+
+    /*
+     * Perform Model Action
+     *
+     * This method does the work for this model and returns any resulting data
+     *
+     * @return array Status and data array
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * 'menuItemRedirect'
+     *
+     * If not false, provides a menu item the controller should
+     * execute after this one. Normally if this is used, there would also be a
+     * modelRedirect value supplied as well.
+     *
+     * 'modelRedirect'
+     *
+     * If not false, provides an action the controller should execute after
+     * this one.
+     *
+     * 'view'
+     *
+     * A suggested view name that the contoller should use instead of the
+     * default view for this model or false to indicate that the default view
+     * should be used.
+     *
+     * 'data'
+     *
+     * Data that the model is returning for use in merging with the view to
+     * produce output.
+     *
+     */
+    public function modelAction ($actionData = false)
+    {
+
+        $templateData = array();
+
+        $requestedView = false;
+        $failure = false;
+
+        $option = '';
+
+        // If there has been a redirect
+        if ($actionData) {
+
+            $templateData = $actionData;
+            $option = 'importSelect';
+
+        // Otherwise check the request for desired option
+        } elseif (isset($_REQUEST['option']) && $_REQUEST['option'] != '') {
+
+            $option = $_REQUEST['option'];
+
+        // Fall back to importSelect
+        } else {
+
+            $option = 'importSelect';
+
+        }
+
+        switch($option) {
+
+            case 'importSelect':
+
+                $requestedView = 'import.html';
+
+                break;
+
+            case 'readDatabase':
+
+                /*
+                 * Check all input
+                 */
+
+                // Check hostname
+                $dbServer = preg_replace("/[^a-zA-Z0-9\._-]+/", "", trim($_REQUEST['dbServer']));
+                $templateData['dbServer'] = array('value' => $dbServer, 'problem' => false);
+                if (!$dbServer || $dbServer == '' || $dbServer != trim($_REQUEST['dbServer'])) {
+                    $templateData['dbServer']['problem'] = 'Server name or IP address was not provided or contained invalid characters.';
+                    $failure = true;
+                }
+
+                // Check database port #
+                $dbPort = preg_replace("/[^0-9]+/", "", trim($_REQUEST['dbPort']));
+                $templateData['dbPort'] = array('value' => $dbPort, 'problem' => false);
+                if (!$dbPort || $dbPort == '' || $dbPort != trim($_REQUEST['dbPort'])) {
+                    $templateData['dbPort']['problem'] = 'Server port was not provided or is not a valid nummber.';
+                    $failure = true;
+                }
+
+                // Check database name
+                $dbName = preg_replace("/[^a-zA-Z0-9_]+/", "", trim($_REQUEST['dbName']));
+                $templateData['dbName'] = array('value' => $dbName, 'problem' => false);
+                if (!$dbName || $dbName == '' || $dbName != trim($_REQUEST['dbName'])) {
+                    $templateData['dbName']['problem'] = 'Database name was not provided or is not valid for Postgres.';
+                    $failure = true;
+                }
+
+                // Check database user
+                $dbUser = preg_replace("/[^a-zA-Z0-9_]+/", "", trim($_REQUEST['dbUser']));
+                $templateData['dbUser'] = array('value' => $dbUser, 'problem' => false);
+                if (!$dbUser || $dbUser == '' || $dbUser != trim($_REQUEST['dbUser'])) {
+                    $templateData['dbUser']['problem'] = 'Database user was not provided or is not valid for Postgres.';
+                    $failure = true;
+                }
+
+                // Check Image URL
+                $dbImageURL = filter_var($_REQUEST['dbImageURL'], FILTER_SANITIZE_URL);
+                $templateData['dbImageURL'] = array('value' => $dbImageURL, 'problem' => false);
+                if (!$dbImageURL || $dbImageURL == '' || $dbImageURL != trim($_REQUEST['dbImageURL'])) {
+                    $templateData['dbImageURL']['problem'] = 'Image URL does not appear to be valid.';
+                    $failure = true;
+                }
+
+                if ($failure) {
+                    $templateData['genError'] = 'There was a problem with the database connection information you provided. See below for specific instructions.';
+                }
+
+                /*
+                 * Determine if source database is sane
+                 */
+
+                // Connect to database
+                if (!$failure) {
+                    $connString = "host=$dbServer port=$dbPort dbname=$dbName user=$dbUser";
+                    $db = @pg_connect($connString);
+                    if (!$db) {
+
+                        $err = error_get_last();
+                        $templateData['genError']  = 'There was a problem connecting to the database. The error message was...<br>'.$err['message'];
+                        $failure = true;
+
+                    }
+                }
+
+                // Determine if the members schema exists
+                if (!$failure) {
+                    $sql = "
+                        SELECT EXISTS
+                            (
+                            SELECT 1
+                              FROM information_schema.schemata AS exists
+                             WHERE schema_name = 'members'
+                            ) AS isMembers
+                    ;";
+                    $res = pg_query($db, $sql);
+                    if (pg_fetch_result($res, 0, 'isMembers') == 'f') {
+                        $templateData['genError']  = 'The "members" schema was not found! Is this the right database?';
+                        $failure = true;
+                    }
+                }
+
+                /*
+                 * Load data from source database
+                 */
+
+                // Attempt to get member base data
+                if (!$failure) {
+                    $sql = "
+                        SELECT *
+                          FROM members.member
+                         ORDER BY member_id
+                    ;";
+                    $res = pg_query($db, $sql);
+                    $rows = pg_num_rows($res);
+                    if ($rows == 0) {
+                        $templateData['genError']  = 'There does not appear to be any members listed in this database!';
+                        $failure = true;
+                    } else {
+                        $member = pg_fetch_all($res);
+                        if (count($member) != $rows) {
+                            $notice = pg_last_notice($res);
+                            $templateData['genError']  = 'While reading base member data, we did not receive the expected number of members! ';
+                            if ($notice) {
+                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
+                            }
+                            $failure = true;
+                        }
+                    }
+                }
+
+                // Read in all amenities
+                if (!$failure) {
+                    $sql = "
+                            SELECT *
+                              FROM members.amenity
+                             ORDER BY amenity_name
+                        ;";
+                    $res = pg_query($db, $sql);
+                    $rows = pg_num_rows($res);
+                    if ($rows == 0) {
+                        $templateData['genError']  = 'There does not appear to be any cities listed in this database!';
+                        $failure = true;
+                    } else {
+                        $tmp = pg_fetch_all($res);
+                        if (count($tmp) != $rows) {
+                            $notice = pg_last_notice($res);
+                            $templateData['genError']  = 'While reading amenity data, we did not receive the expected number of amenities! ';
+                            if ($notice) {
+                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
+                            }
+                            $failure = true;
+                        } else {
+
+                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
+                            $amenity = array();
+
+                            // Reprocess into array indexed by amenity_id
+                            foreach ($tmp as $x) {
+                                $amenity[$x['amenity_id']] = $x;
+                            }
+                        }
+                    }
+                }
+
+                // Read in member/amenity cross-reference table
+                if (!$failure) {
+                    $sql = "
+                            SELECT *
+                              FROM members.member_amenity
+                        ;";
+                    $res = pg_query($db, $sql);
+                    $rows = pg_num_rows($res);
+                    if ($rows == 0) {
+                        $templateData['genError']  = 'There does not appear to be any member/amenity cross-reference entries listed in this database!';
+                        $failure = true;
+                    } else {
+                        $tmp = pg_fetch_all($res);
+                        if (count($tmp) != $rows) {
+                            $notice = pg_last_notice($res);
+                            $templateData['genError']  = 'While reading amenity data, we did not receive the expected number of amenities! ';
+                            if ($notice) {
+                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
+                            }
+                            $failure = true;
+                        } else {
+
+                            // Since there was no problem, we'll post-process the ameities into an array indexed by amenity_id
+                            $membAmen = array();
+
+                            // Reprocess into array grouped by member with the main index the member ID
+                            foreach ($tmp as $x) {
+
+                                // If member entry hasn't been created yet, add it now
+                                if (!isset($membAmen[$x['member_id']])) {
+                                    $membAmen[$x['member_id']] = array();
+                                }
+
+                                $membAmen[$x['member_id']][] = $x;
+                            }
+                        }
+                    }
+                }
+
+                // Read in all credit card types
+                if (!$failure) {
+                    $sql = "
+                            SELECT *
+                              FROM members.ccard_type
+                        ;";
+                    $res = pg_query($db, $sql);
+                    $rows = pg_num_rows($res);
+                    if ($rows == 0) {
+                        $templateData['genError']  = 'There does not appear to be any credit card types listed in this database!';
+                        $failure = true;
+                    } else {
+                        $tmp = pg_fetch_all($res);
+                        if (count($tmp) != $rows) {
+                            $notice = pg_last_notice($res);
+                            $templateData['genError']  = 'While reading credit card type data, we did not receive the expected number of credit card types! ';
+                            if ($notice) {
+                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
+                            }
+                            $failure = true;
+                        } else {
+
+                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
+                            $ccard = array();
+
+                            // Reprocess into array indexed by ccard_type_id
+                            foreach ($tmp as $x) {
+                                $ccard[$x['ccard_type_id']] = $x;
+                            }
+                        }
+                    }
+                }
+
+                // Read in member/credit card cross-reference table
+                if (!$failure) {
+                    $sql = "
+                            SELECT *
+                              FROM members.member_ccard_type
+                        ;";
+                    $res = pg_query($db, $sql);
+                    $rows = pg_num_rows($res);
+                    if ($rows == 0) {
+                        $templateData['genError']  = 'There does not appear to be any member/credit card cross-reference entries listed in this database!';
+                        $failure = true;
+                    } else {
+                        $tmp = pg_fetch_all($res);
+                        if (count($tmp) != $rows) {
+                            $notice = pg_last_notice($res);
+                            $templateData['genError']  = 'While reading member/credit card cross-reference data, we did not receive the expected number of entries! ';
+                            if ($notice) {
+                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
+                            }
+                            $failure = true;
+                        } else {
+
+                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
+                            $membCcard = array();
+
+                            // Reprocess into array grouped by member with the main index the member ID
+                            foreach ($tmp as $x) {
+
+                                // If member entry hasn't been created yet, add it now
+                                if (!isset($membCcard[$x['member_id']])) {
+                                    $membCcard[$x['member_id']] = array();
+                                }
+
+                                $membCcard[$x['member_id']][] = $x;
+                            }
+                        }
+                    }
+                }
+
+
+                // Read in all member categories
+                if (!$failure) {
+                    $sql = "
+                            SELECT *
+                              FROM members.category
+                             ORDER BY category_id
+                        ;";
+                    $res = pg_query($db, $sql);
+                    $rows = pg_num_rows($res);
+                    if ($rows == 0) {
+                        $templateData['genError']  = 'There does not appear to be any categories listed in this database!';
+                        $failure = true;
+                    } else {
+                        $tmp = pg_fetch_all($res);
+                        if (count($tmp) != $rows) {
+                            $notice = pg_last_notice($res);
+                            $templateData['genError']  = 'While reading category data, we did not receive the expected number of categories! ';
+                            if ($notice) {
+                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
+                            }
+                            $failure = true;
+                        } else {
+
+                            // Since there was no problem, we'll post-process the categories into a higherarchical array
+                            $category = array();
+
+                            // Process top level categories first
+                            foreach ($tmp as $x) {
+
+                                // If this is a top level category
+                                if ($x['parent_id'] == 0) {
+                                    $category[$x['category_id']] = $x;
+                                    $category[$x['category_id']]['subcat'] = array();
+                                }
+
+                            }
+
+                            // Now process all sub-categories
+                            reset($tmp);
+                            foreach ($tmp as $x) {
+
+                                // If this is NOT a top level category
+                                if ($x['parent_id'] > 0) {
+
+                                    // Check if we have the requested parent as a top-level category
+                                    if (isset($category[$x['parent_id']])) {
+                                        $category[$x['parent_id']]['subcat'][$x['category_id']] = $x;
+                                    } else {
+                                        $templateData['genError']  = 'There is at least one sub-category that does not have a matching top-level parent! ('.$x['name'].')<br>
+                                                This could be a third-level category. Perhaps we can handle this when we have time to work on this a bit.';
+                                        $failure = true;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+
+                // Read in member/Category cross-reference table
+                if (!$failure) {
+                    $sql = "
+                            SELECT *
+                              FROM members.member_category
+                        ;";
+                    $res = pg_query($db, $sql);
+                    $rows = pg_num_rows($res);
+                    if ($rows == 0) {
+                        $templateData['genError']  = 'There does not appear to be any member/category cross-reference entries listed in this database!';
+                        $failure = true;
+                    } else {
+                        $tmp = pg_fetch_all($res);
+                        if (count($tmp) != $rows) {
+                            $notice = pg_last_notice($res);
+                            $templateData['genError']  = 'While reading category data, we did not receive the expected number of categories! ';
+                            if ($notice) {
+                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
+                            }
+                            $failure = true;
+                        } else {
+
+                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
+                            $membCat = array();
+
+                            // Reprocess into array grouped by member with the main index the member ID
+                            foreach ($tmp as $x) {
+
+                                // If member entry hasn't been created yet, add it now
+                                if (!isset($membCat[$x['member_id']])) {
+                                    $membCat[$x['member_id']] = array();
+                                }
+
+                                $membCat[$x['member_id']][] = $x;
+                            }
+                        }
+                    }
+                }
+
+
+
+                // Read in all cities
+                if (!$failure) {
+                    $sql = "
+                            SELECT *
+                              FROM members.city
+                             ORDER BY city_name
+                        ;";
+                    $res = pg_query($db, $sql);
+                    $rows = pg_num_rows($res);
+                    if ($rows == 0) {
+                        $templateData['genError']  = 'There does not appear to be any cities listed in this database!';
+                        $failure = true;
+                    } else {
+                        $tmp = pg_fetch_all($res);
+                        if (count($tmp) != $rows) {
+                            $notice = pg_last_notice($res);
+                            $templateData['genError']  = 'While reading city data, we did not receive the expected number of cities! ';
+                            if ($notice) {
+                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
+                            }
+                            $failure = true;
+                        } else {
+
+                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
+                            $city = array();
+
+                            // Reprocess into array indexed by city_id
+                            foreach ($tmp as $x) {
+                                $city[$x['city_id']] = $x;
+                            }
+                        }
+                    }
+                }
+
+                // Read in all states
+                if (!$failure) {
+                    $sql = "
+                            SELECT *
+                              FROM members.state
+                             ORDER BY state_name
+                        ;";
+                    $res = pg_query($db, $sql);
+                    $rows = pg_num_rows($res);
+                    if ($rows == 0) {
+                        $templateData['genError']  = 'There does not appear to be any states listed in this database!';
+                        $failure = true;
+                    } else {
+                        $tmp = pg_fetch_all($res);
+                        if (count($tmp) != $rows) {
+                            $notice = pg_last_notice($res);
+                            $templateData['genError']  = 'While reading state data, we did not receive the expected number of states! ';
+                            if ($notice) {
+                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
+                            }
+                            $failure = true;
+                        } else {
+
+                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
+                            $state = array();
+
+                            // Reprocess into array indexed by state_id
+                            foreach ($tmp as $x) {
+                                $state[$x['state_id']] = $x;
+                            }
+                        }
+                    }
+                }
+
+                // Read in all regions
+                if (!$failure) {
+                    $sql = "
+                            SELECT *
+                              FROM members.region
+                        ;";
+                    $res = pg_query($db, $sql);
+                    $rows = pg_num_rows($res);
+                    if ($rows == 0) {
+                        $templateData['genError']  = 'There does not appear to be any regions listed in this database!';
+                        $failure = true;
+                    } else {
+                        $tmp = pg_fetch_all($res);
+                        if (count($tmp) != $rows) {
+                            $notice = pg_last_notice($res);
+                            $templateData['genError']  = 'While reading region data, we did not receive the expected number of regions! ';
+                            if ($notice) {
+                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
+                            }
+                            $failure = true;
+                        } else {
+
+                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
+                            $region = array();
+
+                            // Reprocess into array indexed by state_id
+                            foreach ($tmp as $x) {
+                                $region[$x['region_id']] = $x;
+                            }
+                        }
+                    }
+                }
+
+
+
+                // Read in all member photos for member image gallery
+                if (!$failure) {
+                    $sql = "
+                            SELECT *
+                              FROM members.member_photos
+                        ;";
+                    $res = pg_query($db, $sql);
+                    $rows = pg_num_rows($res);
+                    if ($rows == 0) {
+                        $templateData['genError']  = 'There does not appear to be any member photos listed in this database!';
+                        $failure = true;
+                    } else {
+                        $tmp = pg_fetch_all($res);
+                        if (count($tmp) != $rows) {
+                            $notice = pg_last_notice($res);
+                            $templateData['genError']  = 'While reading member photo data, we did not receive the expected number of member photos! ';
+                            if ($notice) {
+                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
+                            }
+                            $failure = true;
+                        } else {
+
+                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
+                            $image = array();
+
+                            // Reprocess into array grouped by member with the main index the member ID
+                            foreach ($tmp as $x) {
+
+                                // If member entry hasn't been created yet, add it now
+                                if (!isset($image[$x['member_id']])) {
+                                    $image[$x['member_id']] = array();
+                                }
+
+                                $image[$x['member_id']][] = $x;
+                            }
+                        }
+                    }
+                }
+
+                /*
+                 * If requested, reset the database
+                 */
+
+                // Reset database is Option is selected
+                if (!$failure && isset($_REQUEST['dbReset']) && $_REQUEST['dbReset'] == 'on') {
+
+                    // Get current db version
+                    $dbVersion = GLM_MEMBERS_PLUGIN_DB_VERSION;
+
+                    // Reset the database
+                    if (!$this->deleteDataTables($dbVersion)) {
+                        glmMembersAdmin::addNotice('<b>Unable to delete the database tables while resetting the database.</b><br>', 'AdminError');
+                        break;
+                    }
+                    if (!$this->createDataTables($dbVersion)) {
+                        glmMembersAdmin::addNotice('<b>Unable to create the database tables while resetting the database.</b><br>', 'AdminError');
+                        break;
+                    }
+
+                    glmMembersAdmin::addNotice('<b>Database tables have been reset in preparation importing members.</b><br>', 'AdminNotice');
+
+                    // Delete Images
+                    foreach( new RecursiveIteratorIterator(
+
+                        new RecursiveDirectoryIterator( GLM_MEMBERS_PLUGIN_IMAGES_PATH, FilesystemIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS ),
+                        RecursiveIteratorIterator::CHILD_FIRST ) as $value ) {
+                            if ($value->isFile()) {
+                                unlink( $value );
+                            }
+                        }
+
+                }
+
+                /*
+                 * Start importing data
+                 */
+
+                if (!$failure) {
+
+                    // Import Cities
+                    while (list ($key, $val) = each ($city) ) {
+
+                        $res = $this->wpdb->insert(
+                                GLM_MEMBERS_PLUGIN_DB_PREFIX.'cities',
+                                array(
+                                        'name' => $val['city_name'],
+                                ),
+                                array(
+                                        '%s',
+                                )
+                        );
+                        $city[$key]['new_id'] = $this->wpdb->insert_id;
+
+                    }
+
+                    // Import Regions
+                    while (list ($key, $val) = each ($region) ) {
+
+                        $res = $this->wpdb->insert(
+                                GLM_MEMBERS_PLUGIN_DB_PREFIX.'regions',
+                                array(
+                                        'name' => $val['region_name'],
+                                        'descr' => '',
+                                        'short_descr' => ''
+                                ),
+                                array(
+                                        '%s',
+                                        '%s',
+                                        '%s'
+                                )
+                        );
+                        $region[$key]['new_id'] = $this->wpdb->insert_id;
+
+                    }
+
+                    // Import Amenities
+                    while (list ($key, $val) = each ($amenity) ) {
+
+                        $res = $this->wpdb->insert(
+                            GLM_MEMBERS_PLUGIN_DB_PREFIX.'amenities',
+                            array(
+                                'active' => true,
+                                'name' => $val['amenity_name'],
+                                'descr' => '',
+                                'short_descr' => '',
+                                'ref_type' => $this->config['ref_type_numb']['MemberInfo']
+                            ),
+                            array(
+                                '%d',
+                                '%s',
+                                '%s',
+                                '%s',
+                                '%d'
+                            )
+                        );
+                        $amenity[$key]['new_id'] = $this->wpdb->insert_id;
+
+                    }
+
+                    // Import Categories
+                    $catTrans = array();
+                    while (list ($key, $val) = each ($category) ) {
+
+                        $res = $this->wpdb->insert(
+                                GLM_MEMBERS_PLUGIN_DB_PREFIX.'categories',
+                                array(
+                                        'name' => $val['name'],
+                                        'descr' => '',
+                                        'short_descr' => '',
+                                        'parent' => 0
+                                ),
+                                array(
+                                        '%s',
+                                        '%s',
+                                        '%s',
+                                        '%d'
+                                )
+                        );
+                        $newID = $this->wpdb->insert_id;
+                        $category[$key]['new_id'] = $newID;
+                        $category[$key]['new_parent'] = 0;
+
+                        $catTrans[$key]  = array(
+                            'new' => $newID,
+                            'parent' => 0
+                        );
+
+                        // Do any sub-cats for this category
+                        while (list ($key2, $val2) = each ($val['subcat']) ) {
+
+                            $res = $this->wpdb->insert(
+                                    GLM_MEMBERS_PLUGIN_DB_PREFIX.'categories',
+                                    array(
+                                            'name' => $val2['name'],
+                                            'descr' => '',
+                                            'short_descr' => '',
+                                            'parent' => $category[$key]['new_id']
+                                    ),
+                                    array(
+                                            '%s',
+                                            '%s',
+                                            '%s',
+                                            '%d'
+                                    )
+                            );
+                            $newID2 = $this->wpdb->insert_id;
+                            $category[$key]['subcat'][$key2]['new_id'] = $newID;
+                            $category[$key]['subcat'][$key2]['new_parent'] = $category[$key]['new_id'];
+
+                            $catTrans[$key2]  = array(
+                                    'new' => $newID2,
+                                    'parent' => $newID
+                            );
+
+                        }
+                    }
+
+
+
+                    // Index Credit Card types - Match to card types in configuration
+                    while (list ($key, $val) = each ($ccard) ) {
+                        reset($this->config['credit_card_numb']);
+                        while (list ($key2, $val2) = each ($this->config['credit_card_numb']) ) {
+                            if (substr($val['ccard_type_name'], 0, 3) == substr(($key2), 0, 3)) {
+                                $ccard[$key]['bitpos'] = $val2;
+                            }
+                        }
+                    }
+
+                    /*
+                     * Create Defaults Not Provided By Old Member DB
+                     */
+
+                    // Member Types
+                    $res = $this->wpdb->insert(
+                            GLM_MEMBERS_PLUGIN_DB_PREFIX.'member_type',
+                            array(
+                                    'name' => 'Default',
+                                    'descr' => '',
+                            ),
+                            array(
+                                    '%s',
+                                    '%s',
+                            )
+                    );
+                    $defaultMemberType = $this->wpdb->insert_id;
+
+                    /*
+                     * Now Start Adding Members
+                     */
+
+                    // Import Members
+                    while (list ($key, $val) = each ($member) ) {
+
+                        $res = $this->wpdb->insert(
+                                GLM_MEMBERS_PLUGIN_DB_PREFIX.'members',
+                                array(
+                                        'access' => $this->config['memb_access_numb']['Full'],
+                                        'member_type' => $defaultMemberType,
+                                        'created' => date('Y-m-d'),
+                                        'name' => $val['member_name']
+                                ),
+                                array(
+                                        '%d',
+                                        '%d',
+                                        '%s',
+                                        '%s'
+                                )
+                        );
+                        $membID = $this->wpdb->insert_id;
+                        $member[$key]['new_id'] = $membID;
+
+                        // Create truncated short_descr from descritions - Less tags, html encoded characters, newlines, tabs, etc.
+                        $stripped = str_replace(PHP_EOL, '', preg_replace('/\t+/', '', preg_replace("/&#?[a-z0-9]{2,8};/i", "", strip_tags($val['description']))));
+                        $short_descr = implode(' ', array_slice(explode(' ', $stripped), 0, 30));
+                        if (strlen($short_descr) < strlen($stripped)) {
+                            $short_descr .= ' ...';
+                        }
+
+                        // Build Credit Card bitmap
+                        $ccBits = 0;
+                        if (isset($membCcard[$val['member_id']])) {
+                            foreach ($membCcard[$val['member_id']] as $c) {
+                                $b = $ccard[$c['ccard_type_id']]['bitpos'];
+                                $ccBits += pow(2, $b);
+                            }
+                        }
+
+                        // Insert Member Information Record
+                        $res = $this->wpdb->insert(
+                                GLM_MEMBERS_PLUGIN_DB_PREFIX.'member_info',
+                                array(
+                                        'member' => $membID,
+                                        'member_name' => $val['member_name'],
+                                        'status' => $this->config['status_numb']['Active'],
+                                        'reference_name' => 'Imported Membmer Information',
+                                        'descr' => $val['description'],
+                                        'short_descr' => $short_descr,
+                                        'addr1' => $val['street'],
+                                        'addr2' => '',
+                                        'city' => $city[$val['city_id']]['new_id'],
+                                        'state' => $state[$val['state_id']]['state_abb'],
+                                        'country' => 'US',
+                                        'zip' => $val['zip'],
+                                        'lat' => $val['lat'],
+                                        'lon' => $val['lon'],
+                                        'region' => (isset($region[$val['region']]) ? $region[$val['region']]['new_id'] : 0),
+                                        'phone' => $val['phone'],
+                                        'toll_free' => $val['toll_free'],
+                                        'url' => $val['url'],
+                                        'email' => $val['process_email'],
+                                        'logo' => '',
+                                        'cc_type' => $ccBits,
+                                        'notes' => '',
+                                        'create_time' => $val['create_date'],
+                                        'modify_time' => $val['last_update']
+                                ),
+                                array(
+                                        '%d',
+                                        '%s',
+                                        '%d',
+                                        '%s',
+                                        '%s',
+                                        '%s',
+                                        '%s',
+                                        '%s',
+                                        '%d',
+                                        '%s',
+                                        '%s',
+                                        '%s',
+                                        '%f',
+                                        '%f',
+                                        '%d',
+                                        '%s',
+                                        '%s',
+                                        '%s',
+                                        '%s',
+                                        '%s',
+                                        '%d',
+                                        '%s',
+                                        '%s',
+                                        '%s'
+                                )
+                        );
+                        $mID = $this->wpdb->insert_id;
+                        $member[$key]['new_id'] = $mID;
+
+                        // Add Member Categories
+                        if (isset($membCat[$val['member_id']])) {
+                            foreach ($membCat[$val['member_id']] as $c) {
+
+                                $res = $this->wpdb->insert(
+                                        GLM_MEMBERS_PLUGIN_DB_PREFIX.'category_member_info',
+                                        array(
+                                                'category' => $catTrans[$c['category_id']]['new'],
+                                                'member_info' => $mID
+                                        ),
+                                        array(
+                                                '%d',
+                                                '%d'
+                                        )
+                                );
+
+                            }
+                        }
+
+                        // Add Member Amenities
+                        if (isset($membAmen[$val['member_id']])) {
+                            foreach ($membAmen[$val['member_id']] as $a) {
+
+                                $res = $this->wpdb->insert(
+                                        GLM_MEMBERS_PLUGIN_DB_PREFIX.'amenity_ref',
+                                        array(
+                                                'amenity' => $amenity[$a['amenity_id']]['new_id'],
+                                                'ref_type' => $this->config['ref_type_numb']['MemberInfo'],
+                                                'ref_dest' => $mID
+                                        ),
+                                        array(
+                                                '%d',
+                                                '%d',
+                                                '%d'
+                                        )
+                                );
+
+                            }
+                        }
+
+
+                    }
+
+                    // Import
+
+                }
+
+                // If everything is OK, make data available to the template
+                if (!$failure) {
+                    $templateData['member'] = $member;
+                    $templateData['defaultMemberType'] = $defaultMemberType;
+                    $templateData['amenity'] = $amenity;
+                    $templateData['membAmen'] = $membAmen;
+                    $templateData['category'] = $category;
+                    $templateData['membCat'] = $membCat;
+                    $templateData['catTrans'] = $catTrans;
+                    $templateData['city'] = $city;
+                    $templateData['state'] = $state;
+                    $templateData['region'] = $region;
+                    $templateData['ccard'] = $ccard;
+                    $templateData['membCcard'] = $membCcard;
+                    $templateData['image'] = $image;
+                }
+
+
+                if ($failure) {
+                    return array(
+                            'status' => true,
+                            'menuItemRedirect' => 'management',
+                            'modelRedirect' => 'import',
+                            'view' => 'admin/management/import.html',
+                            'data' => $templateData
+                    );
+
+                }
+
+                $requestedView = 'import/readDatabase.html';
+
+                break;
+
+            default:
+
+                break;
+
+        }
+
+        // Return status, suggested view, and data to controller
+        return array(
+            'status' => true,
+            'menuItemRedirect' => false,
+            'modelRedirect' => false,
+            'view' => 'admin/management/'.$requestedView,
+            'data' => $templateData
+        );
+
+    }
+
+    /*
+     * Delete Members Database Tables
+     *
+     * @param string $dbVersion Current version of Members Database
+     *
+     * @return boolean
+     * @access public
+     */
+    public function deleteDataTables($dbVersion)
+    {
+
+        // Read in Database deletion script - assumes the current db version.
+        $sqlFile = GLM_MEMBERS_PLUGIN_DB_SCRIPTS.'/drop_database_V'.$dbVersion.'.sql';
+        $sql = file_get_contents($sqlFile);
+
+        // Replace {prefix} with table name prefix
+        $sql = str_replace('{prefix}', GLM_MEMBERS_PLUGIN_DB_PREFIX, $sql);
+
+        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+            glmMembersAdmin::addNotice('Dropping all database tables', 'Process');
+            glmMembersAdmin::addNotice($sql, 'DataBlock', 'Drop Tables SQL');
+        }
+
+        // Removing the tables using the script
+        $this->wpdb->query($sql);
+
+        // If there's been an error, display in debug Alert
+        $queryError = $this->wpdb->last_error;
+        if ($queryError) {
+            glmMembersAdmin::addNotice('<b>Error when deleting database: Database tables may not have existed.</b><br>Check following message.<br>'.$queryError, 'AdminError');
+        }
+
+        return true;
+
+    }
+
+    /*
+     * Create Members Database Tables
+     *
+     * @param string $dbVersion Current version of Members Database
+     *
+     * @return boolean
+     * @access public
+     */
+    public function createDataTables($dbVersion)
+    {
+
+        // Read in Database creation script
+        $sqlFile = GLM_MEMBERS_PLUGIN_DB_SCRIPTS.'/create_database_V'.$dbVersion.'.sql';
+        $sql = file_get_contents($sqlFile);
+
+        // Replace {prefix} with table name prefix
+        $sql = str_replace('{prefix}', GLM_MEMBERS_PLUGIN_DB_PREFIX, $sql);
+
+        // Split script into separate queries by looking for lines with only "---"
+        $queries = preg_split('/^----$/m', $sql);
+
+        // Try executing all queries to build database
+        $qForDebug = '';
+        do {
+            $q = current($queries);
+            $this->wpdb->query($q);
+            $queryError = $this->wpdb->last_error;
+
+            if ($queryError) {
+                glmMembersAdmin::addNotice('<b>Error when creating database: Database tables may already exist.</b><br>Check following message.<br>'.$queryError, 'AdminError');
+                return false;
+            }
+            $qForDebug .= $queryError.$q;
+
+        } while ($queryError == '' && next($queries));
+
+        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+            glmMembersAdmin::addNotice('Creating database tables', 'Process');
+            glmMembersAdmin::addNotice($qForDebug, 'DataBlock', 'Create Tables SQL');
+        }
+
+        return true;
+
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/models/admin/management/index.php b/models/admin/management/index.php
new file mode 100644 (file)
index 0000000..f96ce95
--- /dev/null
@@ -0,0 +1,185 @@
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * Admin Configure
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @version  0.1
+ */
+
+// Load Members data abstract
+require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/settings/dataSettingsGeneral.php');
+
+/*
+ * This class performs the work for the default action of the "Members" menu
+ * option, which is to display the members dashboard.
+ *
+ */
+class GlmMembersAdmin_management_index extends GlmDataSettingsGeneral
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+
+    /*
+     * Constructor
+     *
+     * This contructor sets up this model. At this time that only includes
+     * storing away the WordPress data object.
+     *
+     * @return object Class object
+     *
+     */
+    public function __construct ($wpdb, $config)
+    {
+
+        // Save WordPress Database object
+        $this->wpdb = $wpdb;
+
+        // Save plugin configuration object
+        $this->config = $config;
+
+        // Run constructor for members data class
+        parent::__construct(false, false);
+
+    }
+
+    /*
+     * Perform Model Action
+     *
+     * This method does the work for this model and returns any resulting data
+     *
+     * @return array Status and data array
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * 'menuItemRedirect'
+     *
+     * If not false, provides a menu item the controller should
+     * execute after this one. Normally if this is used, there would also be a
+     * modelRedirect value supplied as well.
+     *
+     * 'modelRedirect'
+     *
+     * If not false, provides an action the controller should execute after
+     * this one.
+     *
+     * 'view'
+     *
+     * A suggested view name that the contoller should use instead of the
+     * default view for this model or false to indicate that the default view
+     * should be used.
+     *
+     * 'data'
+     *
+     * Data that the model is returning for use in merging with the view to
+     * produce output.
+     *
+     */
+    public function modelAction ($actionData = false)
+    {
+        // General settings are always stored in a record with ID=1.
+        $id = 1;
+
+        // Determine if current user can edit configurations
+        if (!current_user_can('glm_members_configure')) {
+            return array(
+                    'status' => false,
+                    'menuItemRedirect' => 'error',
+                    'modelRedirect' => 'index',
+                    'view' => 'admin/error/index.html',
+                    'data' => array(
+                            'reason' => 'User does not have rights to make configuration changes.'
+                    )
+            );
+        }
+
+        // Check for submission option
+        $option = '';
+        if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'submit') {
+            $option = $_REQUEST['option'];
+        }
+
+        switch($option) {
+
+            // Update the settings and redisplay the form
+            case 'submit':
+
+                // Update the general settings
+                $generalSettings = $this->updateEntry(1);
+
+                // Display admin message that the data has been updated
+                glmMembersAdmin::addNotice('General Settings for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin have been updated.', 'AdminNotice');
+
+                break;
+
+            // Default is to get the current settings and display the form
+            default:
+
+                // Try to get the first (should be only) entry for general settings.
+                $generalSettings = $this->editEntry($id);
+
+                if ($generalSettings === false) {
+
+                    if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+                        glmMembersAdmin::addNotice("<b>&nbsp;&nbsp;/modesl/admin/settings/index.php: Unable to load General Settings.", 'Alert');
+                    }
+/*
+                    return array(
+                        'status' => false,
+                        'menuItemRedirect' => 'error',
+                        'modelRedirect' => 'index',
+                        'view' => 'admin/error/index.html',
+                        'data' => array(
+                            'reason' => 'Unable to create general settings entry in database.'
+                        )
+                    );
+*/
+                }
+
+                break;
+
+        }
+
+        // Compile template data
+        $templateData = array(
+            'reason' => '',
+            'settings' => $generalSettings,
+            'timezones' =>  DateTimeZone::listIdentifiers()
+//            'canEdit' => $canEdit
+        );
+
+        // Return status, suggested view, and data to controller
+        return array(
+            'status' => true,
+            'menuItemRedirect' => false,
+            'modelRedirect' => false,
+            'view' => 'admin/management/index.html',
+            'data' => $templateData
+        );
+
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/models/admin/management/terms.php b/models/admin/management/terms.php
new file mode 100644 (file)
index 0000000..392698a
--- /dev/null
@@ -0,0 +1,184 @@
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * Admin Settings Terms
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package  glmMembersDatabase
+ * @author   Chuck Scott <cscott@gaslightmedia.com>
+ * @license  http://www.gaslightmedia.com Gaslightmedia
+ * @version  0.1
+ */
+
+// Load Members data abstract
+require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/settings/dataSettingsTerms.php');
+
+/*
+ * This class performs the work for the default action of the "Members" menu
+ * option, which is to display the members dashboard.
+ *
+ */
+class GlmMembersAdmin_management_terms extends GlmDataSettingsTerms
+{
+
+    /**
+     * WordPress Database Object
+     *
+     * @var $wpdb
+     * @access public
+     */
+    public $wpdb;
+    /**
+     * Plugin Configuration Data
+     *
+     * @var $config
+     * @access public
+     */
+    public $config;
+
+    /*
+     * Constructor
+     *
+     * This contructor sets up this model. At this time that only includes
+     * storing away the WordPress data object.
+     *
+     * @return object Class object
+     *
+     */
+    public function __construct ($wpdb, $config)
+    {
+
+        // Save WordPress Database object
+        $this->wpdb = $wpdb;
+
+        // Save plugin configuration object
+        $this->config = $config;
+
+        // Run constructor for members data class
+        parent::__construct(false, false);
+
+    }
+
+    /*
+     * Perform Model Action
+     *
+     * This method does the work for this model and returns any resulting data
+     *
+     * @return array Status and data array
+     *
+     * 'status'
+     *
+     * True if successfull and false if there was a fatal failure.
+     *
+     * 'menuItemRedirect'
+     *
+     * If not false, provides a menu item the controller should
+     * execute after this one. Normally if this is used, there would also be a
+     * modelRedirect value supplied as well.
+     *
+     * 'modelRedirect'
+     *
+     * If not false, provides an action the controller should execute after
+     * this one.
+     *
+     * 'view'
+     *
+     * A suggested view name that the contoller should use instead of the
+     * default view for this model or false to indicate that the default view
+     * should be used.
+     *
+     * 'data'
+     *
+     * Data that the model is returning for use in merging with the view to
+     * produce output.
+     *
+     */
+    public function modelAction ($actionData = false)
+    {
+        // General settings are always stored in a record with ID=1.
+        $id = 1;
+
+        // Determine if current user can edit configurations
+        if (!current_user_can('glm_members_configure')) {
+            return array(
+                    'status' => false,
+                    'menuItemRedirect' => 'error',
+                    'modelRedirect' => 'index',
+                    'view' => 'admin/error/index.html',
+                    'data' => array(
+                            'reason' => 'User does not have rights to make configuration changes.'
+                    )
+            );
+        }
+
+        // Check for submission option
+        $option = '';
+        if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'submit') {
+            $option = $_REQUEST['option'];
+        }
+
+        switch($option) {
+
+            // Update the settings and redisplay the form
+            case 'submit':
+
+                // Update the general settings
+                $termsSettings = $this->updateEntry(1);
+
+                // Display admin message that the data has been updated
+                glmMembersAdmin::addNotice('Terms Settings for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin have been updated.', 'AdminNotice');
+
+                break;
+
+            // Default is to get the current settings and display the form
+            default:
+
+                // Try to get the first (should be only) entry for general settings.
+                $termsSettings = $this->editEntry($id);
+
+                // Check that we actually have the terms
+                if ($termsSettings === false) {
+
+                    if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+                        glmMembersAdmin::addNotice("<b>/modesl/admin/settings/terms.php:</b> Unable to load Terms Settings.", 'Alert');
+                    }
+
+                    return array(
+                        'status' => false,
+                        'menuItemRedirect' => 'error',
+                        'modelRedirect' => 'index',
+                        'view' => 'admin/error/index.html',
+                        'data' => array(
+                            'reason' => 'Unable to create terms settings entry in database.'
+                        )
+                    );
+                }
+
+                break;
+
+        }
+
+        // Compile template data
+        $templateData = array(
+            'reason' => '',
+            'settings' => $termsSettings,
+//            'canEdit' => $canEdit
+        );
+
+        // Return status, suggested view, and data to controller
+        return array(
+            'status' => true,
+            'menuItemRedirect' => false,
+            'modelRedirect' => false,
+            'view' => 'admin/management/terms.html',
+            'data' => $templateData
+        );
+
+    }
+
+}
+
+?>
\ No newline at end of file
diff --git a/models/admin/settings/development.php b/models/admin/settings/development.php
deleted file mode 100644 (file)
index bded5bd..0000000
+++ /dev/null
@@ -1,345 +0,0 @@
-<?php
-
-/**
- * Gaslight Media Members Database
- * Admin Development
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package  glmMembersDatabase
- * @author   Chuck Scott <cscott@gaslightmedia.com>
- * @license  http://www.gaslightmedia.com Gaslightmedia
- * @version  0.1
- */
-
-/*
- * This class performs the work for the default action of the "Members" menu
- * option, which is to display the members dashboard.
- *
- */
-class GlmMembersAdmin_settings_development
-{
-
-    /**
-     * WordPress Database Object
-     *
-     * @var $wpdb
-     * @access public
-     */
-    public $wpdb;
-    /**
-     * Plugin Configuration Data
-     *
-     * @var $config
-     * @access public
-     */
-    public $config;
-
-    /*
-     * Constructor
-     *
-     * This contructor sets up this model. At this time that only includes
-     * storing away the WordPress data object.
-     *
-     * @return object Class object
-     *
-     */
-    public function __construct ($wpdb, $config)
-    {
-
-        // Save WordPress Database object
-        $this->wpdb = $wpdb;
-
-        // Save plugin configuration object
-        $this->config = $config;
-
-    }
-
-    /*
-     * Perform Model Action
-     *
-     * This method does the work for this model and returns any resulting data
-     *
-     * @return array Status and data array
-     *
-     * 'status'
-     *
-     * True if successfull and false if there was a fatal failure.
-     *
-     * 'menuItemRedirect'
-     *
-     * If not false, provides a menu item the controller should
-     * execute after this one. Normally if this is used, there would also be a
-     * modelRedirect value supplied as well.
-     *
-     * 'modelRedirect'
-     *
-     * If not false, provides an action the controller should execute after
-     * this one.
-     *
-     * 'view'
-     *
-     * A suggested view name that the contoller should use instead of the
-     * default view for this model or false to indicate that the default view
-     * should be used.
-     *
-     * 'data'
-     *
-     * Data that the model is returning for use in merging with the view to
-     * produce output.
-     *
-     */
-    public function modelAction ($actionData = false)
-    {
-
-        // Get current database version
-        $dbVersion = GLM_MEMBERS_PLUGIN_DB_VERSION;
-        settype($dbVersion, 'string');
-
-        $templateData['resultMessage'] = '';
-        $templateData['success'] = false;
-        $templateData['haveNotices'] = false;
-        $notices = array();
-        $templateData['haveMembers'] = false;
-        $templateData['import'] = false;
-        $templateData['importNotice'] = false;
-        $templateData['haveDatabaseTableList'] = false;
-
-        // Load database activation class to get access to database version information
-        require_once (GLM_MEMBERS_PLUGIN_PATH . '/activate.php');
-        $activate = new glmMembersPluginActivate($this->wpdb, $this->config, true);
-
-        $option = '';
-        if (isset($_REQUEST['option']) && $_REQUEST['option'] != '') {
-            $option = $_REQUEST['option'];
-        }
-
-        switch($option) {
-
-            case 'import_connections':
-
-                // Load Member Info Data Class and get info data for later use
-                require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/glmMemberImportFromConnections.php');
-                $Connections = new GlmMemberImportFromConnections($this->wpdb, $this->config);
-
-                if (isset($_REQUEST['import']) && $_REQUEST['import'] == 'now') {
-
-                    // Reset the database
-                    if (!$this->deleteDataTables($dbVersion)) {
-                        glmMembersAdmin::addNotice('<b>Unable to delete the database tables while resetting the database.</b><br>', 'AdminError');
-                        break;
-                    }
-                    if (!$this->createDataTables($dbVersion)) {
-                        glmMembersAdmin::addNotice('<b>Unable to create the database tables while resetting the database.</b><br>', 'AdminError');
-                        break;
-                    }
-                    glmMembersAdmin::addNotice('<b>Database tables have been reset in preparation importing members.</b><br>', 'AdminNotice');
-
-                    // Delete Images
-                    foreach( new RecursiveIteratorIterator(
-                        new RecursiveDirectoryIterator( GLM_MEMBERS_PLUGIN_IMAGES_PATH, FilesystemIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS ),
-                        RecursiveIteratorIterator::CHILD_FIRST ) as $value ) {
-                            if ($value->isFile()) {
-                                unlink( $value );
-                            }
-                        }
-
-                    $templateData['import'] = true;
-                    $templateData['membersImported'] = $Connections->doImport();
-
-                } else {
-
-                    // Check if Connections is not installed or not active. If active, gets count of entries.
-                    $c = $Connections->checkConnections();
-                    if ($c === false) {
-                        glmMembersAdmin::addNotice('<b>Connections Business Directory plugin is not installed or not active!</b><br>'.print_r($c,1), 'AdminError');
-                        break;
-                    }
-                    $templateData['numbEntries'] = $c;
-                    $importNotice = 'Connections Business Directory plugin is active.<br>Number of businesses listed: '.$c.'<br>';
-
-                    // Get the basic business data for review.
-                    $templateData['members'] = $Connections->getList();
-                    if ($templateData['members'] === false) {
-                        $importNotice = 'No businesses were retieved.';
-                        break;
-                    }
-
-                    $templateData['haveMembers'] = true;
-
-                    if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
-                        glmMembersAdmin::addNotice($templateData['members'], 'DataBlock', 'Base Members Data');
-                    }
-
-                }
-
-                break;
-
-            case 'drop':
-            case 'reset':
-
-                $del = $this->deleteDataTables($dbVersion);
-
-                if ($del) {
-                    glmMembersAdmin::addNotice('New database tables for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin have been deleted.', 'AdminNotice');
-
-                }
-
-                if ($option != 'reset') {
-                    break;
-                }
-
-            case 'create':
-
-                $create = $this->createDataTables($dbVersion);
-
-                // If there were no errors
-                if ($create) {
-
-                    // Notify the user that the database has been installed
-                    glmMembersAdmin::addNotice('New database tables installed for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin.', 'AdminNotice');
-
-                    // Save the version of the installed database
-                    update_option('glmMembersDatabaseDbVersion', $dbVersion);
-
-                }
-
-                break;
-
-            case 'list':
-
-                    // Check if the database version set for this plugin is invalid.
-                    if (!isset($activate->dbVersions[$dbVersion])) {
-                        $templateData['resultMessage'] .= "The last database version set for the ".GLM_MEMBERS_PLUGIN_NAME." (V$dbVersion) isn't valid.<br>";
-                        break;
-                    }
-
-                    // Get the number of tables for this plugin database version that should exist.
-                    $tables = $activate->dbVersions[$dbVersion]['tables'];
-
-                    // Get the number of tables for this plugin that do currently exist.
-                    $existingTables = $this->wpdb->get_results("
-                        SELECT table_name
-                          FROM information_schema.tables
-                         WHERE table_name like '".GLM_MEMBERS_PLUGIN_DB_PREFIX."%';
-                    ", ARRAY_A);
-
-                    if (is_array($existingTables)) {
-
-
-
-
-                        $templateData['resultMessage'] .= '<b>Current database tables</b><br><ul>';
-                        foreach($existingTables as $t){
-                            $templateData['resultMessage'] .= "<li>".$t['table_name'].'</li><br>';
-                        }
-                        $templateData['resultMessage'] .= '</ul>';
-                    } else {
-                        $templateData['resultMessage'] .= '<b>No tables currently exist</b><br>';
-                    }
-
-                break;
-
-            default:
-
-                break;
-
-        }
-
-        // Return status, suggested view, and data to controller
-        return array(
-            'status' => true,
-            'menuItemRedirect' => false,
-            'modelRedirect' => false,
-            'view' => 'admin/settings/development.html',
-            'data' => $templateData
-        );
-
-    }
-
-    /*
-     * Delete Members Database Tables
-     *
-     * @param string $dbVersion Current version of Members Database
-     *
-     * @return boolean
-     * @access public
-     */
-    public function deleteDataTables($dbVersion)
-    {
-
-        // Read in Database deletion script - assumes the current db version.
-        $sqlFile = GLM_MEMBERS_PLUGIN_DB_SCRIPTS.'/drop_database_V'.$dbVersion.'.sql';
-        $sql = file_get_contents($sqlFile);
-
-        // Replace {prefix} with table name prefix
-        $sql = str_replace('{prefix}', GLM_MEMBERS_PLUGIN_DB_PREFIX, $sql);
-
-        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
-            glmMembersAdmin::addNotice('Dropping all database tables', 'Process');
-            glmMembersAdmin::addNotice($sql, 'DataBlock', 'Drop Tables SQL');
-        }
-
-        // Removing the tables using the script
-        $this->wpdb->query($sql);
-
-        // If there's been an error, display in debug Alert
-        $queryError = $this->wpdb->last_error;
-        if ($queryError) {
-            glmMembersAdmin::addNotice('<b>Error when deleting database: Database tables may not have existed.</b><br>Check following message.<br>'.$queryError, 'AdminError');
-            return false;
-        }
-
-        return true;
-
-    }
-
-    /*
-     * Create Members Database Tables
-     *
-     * @param string $dbVersion Current version of Members Database
-     *
-     * @return boolean
-     * @access public
-     */
-    public function createDataTables($dbVersion)
-    {
-
-        // Read in Database creation script
-        $sqlFile = GLM_MEMBERS_PLUGIN_DB_SCRIPTS.'/create_database_V'.$dbVersion.'.sql';
-        $sql = file_get_contents($sqlFile);
-
-        // Replace {prefix} with table name prefix
-        $sql = str_replace('{prefix}', GLM_MEMBERS_PLUGIN_DB_PREFIX, $sql);
-
-        // Split script into separate queries by looking for lines with only "---"
-        $queries = preg_split('/^----$/m', $sql);
-
-        // Try executing all queries to build database
-        $qForDebug = '';
-        do {
-            $q = current($queries);
-            $this->wpdb->query($q);
-            $queryError = $this->wpdb->last_error;
-
-            if ($queryError) {
-                glmMembersAdmin::addNotice('<b>Error when creating database: Database tables may already exist.</b><br>Check following message.<br>'.$queryError, 'AdminError');
-                return false;
-            }
-            $qForDebug .= $queryError.$q;
-
-        } while ($queryError == '' && next($queries));
-
-        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
-            glmMembersAdmin::addNotice('Creating database tables', 'Process');
-            glmMembersAdmin::addNotice($qForDebug, 'DataBlock', 'Create Tables SQL');
-        }
-
-        return true;
-
-    }
-
-}
-
-?>
\ No newline at end of file
diff --git a/models/admin/settings/import.php b/models/admin/settings/import.php
deleted file mode 100644 (file)
index 6cfecf5..0000000
+++ /dev/null
@@ -1,1097 +0,0 @@
-<?php
-
-/**
- * Gaslight Media Members Database
- * Admin Data Import
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package  glmMembersDatabase
- * @author   Chuck Scott <cscott@gaslightmedia.com>
- * @license  http://www.gaslightmedia.com Gaslightmedia
- * @version  0.1
- */
-
-/*
- * This class performs the work for the default action of the "Members" menu
- * option, which is to display the members dashboard.
- *
- */
-class GlmMembersAdmin_settings_import
-{
-
-    /**
-     * WordPress Database Object
-     *
-     * @var $wpdb
-     * @access public
-     */
-    public $wpdb;
-    /**
-     * Plugin Configuration Data
-     *
-     * @var $config
-     * @access public
-     */
-    public $config;
-
-    /*
-     * Constructor
-     *
-     * This contructor sets up this model. At this time that only includes
-     * storing away the WordPress data object.
-     *
-     * @return object Class object
-     *
-     */
-    public function __construct ($wpdb, $config)
-    {
-
-        // Save WordPress Database object
-        $this->wpdb = $wpdb;
-
-        // Save plugin configuration object
-        $this->config = $config;
-
-    }
-
-    /*
-     * Perform Model Action
-     *
-     * This method does the work for this model and returns any resulting data
-     *
-     * @return array Status and data array
-     *
-     * 'status'
-     *
-     * True if successfull and false if there was a fatal failure.
-     *
-     * 'menuItemRedirect'
-     *
-     * If not false, provides a menu item the controller should
-     * execute after this one. Normally if this is used, there would also be a
-     * modelRedirect value supplied as well.
-     *
-     * 'modelRedirect'
-     *
-     * If not false, provides an action the controller should execute after
-     * this one.
-     *
-     * 'view'
-     *
-     * A suggested view name that the contoller should use instead of the
-     * default view for this model or false to indicate that the default view
-     * should be used.
-     *
-     * 'data'
-     *
-     * Data that the model is returning for use in merging with the view to
-     * produce output.
-     *
-     */
-    public function modelAction ($actionData = false)
-    {
-
-        $templateData = array();
-
-        $requestedView = false;
-        $failure = false;
-
-        $option = '';
-
-        // If there has been a redirect
-        if ($actionData) {
-
-            $templateData = $actionData;
-            $option = 'importSelect';
-
-        // Otherwise check the request for desired option
-        } elseif (isset($_REQUEST['option']) && $_REQUEST['option'] != '') {
-
-            $option = $_REQUEST['option'];
-
-        // Fall back to importSelect
-        } else {
-
-            $option = 'importSelect';
-
-        }
-
-        switch($option) {
-
-            case 'importSelect':
-
-                $requestedView = 'import.html';
-
-                break;
-
-            case 'readDatabase':
-
-                /*
-                 * Check all input
-                 */
-
-                // Check hostname
-                $dbServer = preg_replace("/[^a-zA-Z0-9\._-]+/", "", trim($_REQUEST['dbServer']));
-                $templateData['dbServer'] = array('value' => $dbServer, 'problem' => false);
-                if (!$dbServer || $dbServer == '' || $dbServer != trim($_REQUEST['dbServer'])) {
-                    $templateData['dbServer']['problem'] = 'Server name or IP address was not provided or contained invalid characters.';
-                    $failure = true;
-                }
-
-                // Check database port #
-                $dbPort = preg_replace("/[^0-9]+/", "", trim($_REQUEST['dbPort']));
-                $templateData['dbPort'] = array('value' => $dbPort, 'problem' => false);
-                if (!$dbPort || $dbPort == '' || $dbPort != trim($_REQUEST['dbPort'])) {
-                    $templateData['dbPort']['problem'] = 'Server port was not provided or is not a valid nummber.';
-                    $failure = true;
-                }
-
-                // Check database name
-                $dbName = preg_replace("/[^a-zA-Z0-9_]+/", "", trim($_REQUEST['dbName']));
-                $templateData['dbName'] = array('value' => $dbName, 'problem' => false);
-                if (!$dbName || $dbName == '' || $dbName != trim($_REQUEST['dbName'])) {
-                    $templateData['dbName']['problem'] = 'Database name was not provided or is not valid for Postgres.';
-                    $failure = true;
-                }
-
-                // Check database user
-                $dbUser = preg_replace("/[^a-zA-Z0-9_]+/", "", trim($_REQUEST['dbUser']));
-                $templateData['dbUser'] = array('value' => $dbUser, 'problem' => false);
-                if (!$dbUser || $dbUser == '' || $dbUser != trim($_REQUEST['dbUser'])) {
-                    $templateData['dbUser']['problem'] = 'Database user was not provided or is not valid for Postgres.';
-                    $failure = true;
-                }
-
-                // Check Image URL
-                $dbImageURL = filter_var($_REQUEST['dbImageURL'], FILTER_SANITIZE_URL);
-                $templateData['dbImageURL'] = array('value' => $dbImageURL, 'problem' => false);
-                if (!$dbImageURL || $dbImageURL == '' || $dbImageURL != trim($_REQUEST['dbImageURL'])) {
-                    $templateData['dbImageURL']['problem'] = 'Image URL does not appear to be valid.';
-                    $failure = true;
-                }
-
-                if ($failure) {
-                    $templateData['genError'] = 'There was a problem with the database connection information you provided. See below for specific instructions.';
-                }
-
-                /*
-                 * Determine if source database is sane
-                 */
-
-                // Connect to database
-                if (!$failure) {
-                    $connString = "host=$dbServer port=$dbPort dbname=$dbName user=$dbUser";
-                    $db = @pg_connect($connString);
-                    if (!$db) {
-
-                        $err = error_get_last();
-                        $templateData['genError']  = 'There was a problem connecting to the database. The error message was...<br>'.$err['message'];
-                        $failure = true;
-
-                    }
-                }
-
-                // Determine if the members schema exists
-                if (!$failure) {
-                    $sql = "
-                        SELECT EXISTS
-                            (
-                            SELECT 1
-                              FROM information_schema.schemata AS exists
-                             WHERE schema_name = 'members'
-                            ) AS isMembers
-                    ;";
-                    $res = pg_query($db, $sql);
-                    if (pg_fetch_result($res, 0, 'isMembers') == 'f') {
-                        $templateData['genError']  = 'The "members" schema was not found! Is this the right database?';
-                        $failure = true;
-                    }
-                }
-
-                /*
-                 * Load data from source database
-                 */
-
-                // Attempt to get member base data
-                if (!$failure) {
-                    $sql = "
-                        SELECT *
-                          FROM members.member
-                         ORDER BY member_id
-                    ;";
-                    $res = pg_query($db, $sql);
-                    $rows = pg_num_rows($res);
-                    if ($rows == 0) {
-                        $templateData['genError']  = 'There does not appear to be any members listed in this database!';
-                        $failure = true;
-                    } else {
-                        $member = pg_fetch_all($res);
-                        if (count($member) != $rows) {
-                            $notice = pg_last_notice($res);
-                            $templateData['genError']  = 'While reading base member data, we did not receive the expected number of members! ';
-                            if ($notice) {
-                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
-                            }
-                            $failure = true;
-                        }
-                    }
-                }
-
-                // Read in all amenities
-                if (!$failure) {
-                    $sql = "
-                            SELECT *
-                              FROM members.amenity
-                             ORDER BY amenity_name
-                        ;";
-                    $res = pg_query($db, $sql);
-                    $rows = pg_num_rows($res);
-                    if ($rows == 0) {
-                        $templateData['genError']  = 'There does not appear to be any cities listed in this database!';
-                        $failure = true;
-                    } else {
-                        $tmp = pg_fetch_all($res);
-                        if (count($tmp) != $rows) {
-                            $notice = pg_last_notice($res);
-                            $templateData['genError']  = 'While reading amenity data, we did not receive the expected number of amenities! ';
-                            if ($notice) {
-                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
-                            }
-                            $failure = true;
-                        } else {
-
-                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
-                            $amenity = array();
-
-                            // Reprocess into array indexed by amenity_id
-                            foreach ($tmp as $x) {
-                                $amenity[$x['amenity_id']] = $x;
-                            }
-                        }
-                    }
-                }
-
-                // Read in member/amenity cross-reference table
-                if (!$failure) {
-                    $sql = "
-                            SELECT *
-                              FROM members.member_amenity
-                        ;";
-                    $res = pg_query($db, $sql);
-                    $rows = pg_num_rows($res);
-                    if ($rows == 0) {
-                        $templateData['genError']  = 'There does not appear to be any member/amenity cross-reference entries listed in this database!';
-                        $failure = true;
-                    } else {
-                        $tmp = pg_fetch_all($res);
-                        if (count($tmp) != $rows) {
-                            $notice = pg_last_notice($res);
-                            $templateData['genError']  = 'While reading amenity data, we did not receive the expected number of amenities! ';
-                            if ($notice) {
-                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
-                            }
-                            $failure = true;
-                        } else {
-
-                            // Since there was no problem, we'll post-process the ameities into an array indexed by amenity_id
-                            $membAmen = array();
-
-                            // Reprocess into array grouped by member with the main index the member ID
-                            foreach ($tmp as $x) {
-
-                                // If member entry hasn't been created yet, add it now
-                                if (!isset($membAmen[$x['member_id']])) {
-                                    $membAmen[$x['member_id']] = array();
-                                }
-
-                                $membAmen[$x['member_id']][] = $x;
-                            }
-                        }
-                    }
-                }
-
-                // Read in all credit card types
-                if (!$failure) {
-                    $sql = "
-                            SELECT *
-                              FROM members.ccard_type
-                        ;";
-                    $res = pg_query($db, $sql);
-                    $rows = pg_num_rows($res);
-                    if ($rows == 0) {
-                        $templateData['genError']  = 'There does not appear to be any credit card types listed in this database!';
-                        $failure = true;
-                    } else {
-                        $tmp = pg_fetch_all($res);
-                        if (count($tmp) != $rows) {
-                            $notice = pg_last_notice($res);
-                            $templateData['genError']  = 'While reading credit card type data, we did not receive the expected number of credit card types! ';
-                            if ($notice) {
-                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
-                            }
-                            $failure = true;
-                        } else {
-
-                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
-                            $ccard = array();
-
-                            // Reprocess into array indexed by ccard_type_id
-                            foreach ($tmp as $x) {
-                                $ccard[$x['ccard_type_id']] = $x;
-                            }
-                        }
-                    }
-                }
-
-                // Read in member/credit card cross-reference table
-                if (!$failure) {
-                    $sql = "
-                            SELECT *
-                              FROM members.member_ccard_type
-                        ;";
-                    $res = pg_query($db, $sql);
-                    $rows = pg_num_rows($res);
-                    if ($rows == 0) {
-                        $templateData['genError']  = 'There does not appear to be any member/credit card cross-reference entries listed in this database!';
-                        $failure = true;
-                    } else {
-                        $tmp = pg_fetch_all($res);
-                        if (count($tmp) != $rows) {
-                            $notice = pg_last_notice($res);
-                            $templateData['genError']  = 'While reading member/credit card cross-reference data, we did not receive the expected number of entries! ';
-                            if ($notice) {
-                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
-                            }
-                            $failure = true;
-                        } else {
-
-                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
-                            $membCcard = array();
-
-                            // Reprocess into array grouped by member with the main index the member ID
-                            foreach ($tmp as $x) {
-
-                                // If member entry hasn't been created yet, add it now
-                                if (!isset($membCcard[$x['member_id']])) {
-                                    $membCcard[$x['member_id']] = array();
-                                }
-
-                                $membCcard[$x['member_id']][] = $x;
-                            }
-                        }
-                    }
-                }
-
-
-                // Read in all member categories
-                if (!$failure) {
-                    $sql = "
-                            SELECT *
-                              FROM members.category
-                             ORDER BY category_id
-                        ;";
-                    $res = pg_query($db, $sql);
-                    $rows = pg_num_rows($res);
-                    if ($rows == 0) {
-                        $templateData['genError']  = 'There does not appear to be any categories listed in this database!';
-                        $failure = true;
-                    } else {
-                        $tmp = pg_fetch_all($res);
-                        if (count($tmp) != $rows) {
-                            $notice = pg_last_notice($res);
-                            $templateData['genError']  = 'While reading category data, we did not receive the expected number of categories! ';
-                            if ($notice) {
-                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
-                            }
-                            $failure = true;
-                        } else {
-
-                            // Since there was no problem, we'll post-process the categories into a higherarchical array
-                            $category = array();
-
-                            // Process top level categories first
-                            foreach ($tmp as $x) {
-
-                                // If this is a top level category
-                                if ($x['parent_id'] == 0) {
-                                    $category[$x['category_id']] = $x;
-                                    $category[$x['category_id']]['subcat'] = array();
-                                }
-
-                            }
-
-                            // Now process all sub-categories
-                            reset($tmp);
-                            foreach ($tmp as $x) {
-
-                                // If this is NOT a top level category
-                                if ($x['parent_id'] > 0) {
-
-                                    // Check if we have the requested parent as a top-level category
-                                    if (isset($category[$x['parent_id']])) {
-                                        $category[$x['parent_id']]['subcat'][$x['category_id']] = $x;
-                                    } else {
-                                        $templateData['genError']  = 'There is at least one sub-category that does not have a matching top-level parent! ('.$x['name'].')<br>
-                                                This could be a third-level category. Perhaps we can handle this when we have time to work on this a bit.';
-                                        $failure = true;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-
-                // Read in member/Category cross-reference table
-                if (!$failure) {
-                    $sql = "
-                            SELECT *
-                              FROM members.member_category
-                        ;";
-                    $res = pg_query($db, $sql);
-                    $rows = pg_num_rows($res);
-                    if ($rows == 0) {
-                        $templateData['genError']  = 'There does not appear to be any member/category cross-reference entries listed in this database!';
-                        $failure = true;
-                    } else {
-                        $tmp = pg_fetch_all($res);
-                        if (count($tmp) != $rows) {
-                            $notice = pg_last_notice($res);
-                            $templateData['genError']  = 'While reading category data, we did not receive the expected number of categories! ';
-                            if ($notice) {
-                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
-                            }
-                            $failure = true;
-                        } else {
-
-                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
-                            $membCat = array();
-
-                            // Reprocess into array grouped by member with the main index the member ID
-                            foreach ($tmp as $x) {
-
-                                // If member entry hasn't been created yet, add it now
-                                if (!isset($membCat[$x['member_id']])) {
-                                    $membCat[$x['member_id']] = array();
-                                }
-
-                                $membCat[$x['member_id']][] = $x;
-                            }
-                        }
-                    }
-                }
-
-
-
-                // Read in all cities
-                if (!$failure) {
-                    $sql = "
-                            SELECT *
-                              FROM members.city
-                             ORDER BY city_name
-                        ;";
-                    $res = pg_query($db, $sql);
-                    $rows = pg_num_rows($res);
-                    if ($rows == 0) {
-                        $templateData['genError']  = 'There does not appear to be any cities listed in this database!';
-                        $failure = true;
-                    } else {
-                        $tmp = pg_fetch_all($res);
-                        if (count($tmp) != $rows) {
-                            $notice = pg_last_notice($res);
-                            $templateData['genError']  = 'While reading city data, we did not receive the expected number of cities! ';
-                            if ($notice) {
-                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
-                            }
-                            $failure = true;
-                        } else {
-
-                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
-                            $city = array();
-
-                            // Reprocess into array indexed by city_id
-                            foreach ($tmp as $x) {
-                                $city[$x['city_id']] = $x;
-                            }
-                        }
-                    }
-                }
-
-                // Read in all states
-                if (!$failure) {
-                    $sql = "
-                            SELECT *
-                              FROM members.state
-                             ORDER BY state_name
-                        ;";
-                    $res = pg_query($db, $sql);
-                    $rows = pg_num_rows($res);
-                    if ($rows == 0) {
-                        $templateData['genError']  = 'There does not appear to be any states listed in this database!';
-                        $failure = true;
-                    } else {
-                        $tmp = pg_fetch_all($res);
-                        if (count($tmp) != $rows) {
-                            $notice = pg_last_notice($res);
-                            $templateData['genError']  = 'While reading state data, we did not receive the expected number of states! ';
-                            if ($notice) {
-                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
-                            }
-                            $failure = true;
-                        } else {
-
-                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
-                            $state = array();
-
-                            // Reprocess into array indexed by state_id
-                            foreach ($tmp as $x) {
-                                $state[$x['state_id']] = $x;
-                            }
-                        }
-                    }
-                }
-
-                // Read in all regions
-                if (!$failure) {
-                    $sql = "
-                            SELECT *
-                              FROM members.region
-                        ;";
-                    $res = pg_query($db, $sql);
-                    $rows = pg_num_rows($res);
-                    if ($rows == 0) {
-                        $templateData['genError']  = 'There does not appear to be any regions listed in this database!';
-                        $failure = true;
-                    } else {
-                        $tmp = pg_fetch_all($res);
-                        if (count($tmp) != $rows) {
-                            $notice = pg_last_notice($res);
-                            $templateData['genError']  = 'While reading region data, we did not receive the expected number of regions! ';
-                            if ($notice) {
-                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
-                            }
-                            $failure = true;
-                        } else {
-
-                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
-                            $region = array();
-
-                            // Reprocess into array indexed by state_id
-                            foreach ($tmp as $x) {
-                                $region[$x['region_id']] = $x;
-                            }
-                        }
-                    }
-                }
-
-
-
-                // Read in all member photos for member image gallery
-                if (!$failure) {
-                    $sql = "
-                            SELECT *
-                              FROM members.member_photos
-                        ;";
-                    $res = pg_query($db, $sql);
-                    $rows = pg_num_rows($res);
-                    if ($rows == 0) {
-                        $templateData['genError']  = 'There does not appear to be any member photos listed in this database!';
-                        $failure = true;
-                    } else {
-                        $tmp = pg_fetch_all($res);
-                        if (count($tmp) != $rows) {
-                            $notice = pg_last_notice($res);
-                            $templateData['genError']  = 'While reading member photo data, we did not receive the expected number of member photos! ';
-                            if ($notice) {
-                                $templateData['genError'] .= 'Perhaps the following message will help.<br>'.$notice;
-                            }
-                            $failure = true;
-                        } else {
-
-                            // Since there was no problem, we'll post-process the cities into an array indexed by city_id
-                            $image = array();
-
-                            // Reprocess into array grouped by member with the main index the member ID
-                            foreach ($tmp as $x) {
-
-                                // If member entry hasn't been created yet, add it now
-                                if (!isset($image[$x['member_id']])) {
-                                    $image[$x['member_id']] = array();
-                                }
-
-                                $image[$x['member_id']][] = $x;
-                            }
-                        }
-                    }
-                }
-
-                /*
-                 * If requested, reset the database
-                 */
-
-                // Reset database is Option is selected
-                if (!$failure && isset($_REQUEST['dbReset']) && $_REQUEST['dbReset'] == 'on') {
-
-                    // Get current db version
-                    $dbVersion = GLM_MEMBERS_PLUGIN_DB_VERSION;
-
-                    // Reset the database
-                    if (!$this->deleteDataTables($dbVersion)) {
-                        glmMembersAdmin::addNotice('<b>Unable to delete the database tables while resetting the database.</b><br>', 'AdminError');
-                        break;
-                    }
-                    if (!$this->createDataTables($dbVersion)) {
-                        glmMembersAdmin::addNotice('<b>Unable to create the database tables while resetting the database.</b><br>', 'AdminError');
-                        break;
-                    }
-
-                    glmMembersAdmin::addNotice('<b>Database tables have been reset in preparation importing members.</b><br>', 'AdminNotice');
-
-                    // Delete Images
-                    foreach( new RecursiveIteratorIterator(
-
-                        new RecursiveDirectoryIterator( GLM_MEMBERS_PLUGIN_IMAGES_PATH, FilesystemIterator::SKIP_DOTS | FilesystemIterator::UNIX_PATHS ),
-                        RecursiveIteratorIterator::CHILD_FIRST ) as $value ) {
-                            if ($value->isFile()) {
-                                unlink( $value );
-                            }
-                        }
-
-                }
-
-                /*
-                 * Start importing data
-                 */
-
-                if (!$failure) {
-
-                    // Import Cities
-                    while (list ($key, $val) = each ($city) ) {
-
-                        $res = $this->wpdb->insert(
-                                GLM_MEMBERS_PLUGIN_DB_PREFIX.'cities',
-                                array(
-                                        'name' => $val['city_name'],
-                                ),
-                                array(
-                                        '%s',
-                                )
-                        );
-                        $city[$key]['new_id'] = $this->wpdb->insert_id;
-
-                    }
-
-                    // Import Regions
-                    while (list ($key, $val) = each ($region) ) {
-
-                        $res = $this->wpdb->insert(
-                                GLM_MEMBERS_PLUGIN_DB_PREFIX.'regions',
-                                array(
-                                        'name' => $val['region_name'],
-                                        'descr' => '',
-                                        'short_descr' => ''
-                                ),
-                                array(
-                                        '%s',
-                                        '%s',
-                                        '%s'
-                                )
-                        );
-                        $region[$key]['new_id'] = $this->wpdb->insert_id;
-
-                    }
-
-                    // Import Amenities
-                    while (list ($key, $val) = each ($amenity) ) {
-
-                        $res = $this->wpdb->insert(
-                            GLM_MEMBERS_PLUGIN_DB_PREFIX.'amenities',
-                            array(
-                                'active' => true,
-                                'name' => $val['amenity_name'],
-                                'descr' => '',
-                                'short_descr' => '',
-                                'ref_type' => $this->config['ref_type_numb']['MemberInfo']
-                            ),
-                            array(
-                                '%d',
-                                '%s',
-                                '%s',
-                                '%s',
-                                '%d'
-                            )
-                        );
-                        $amenity[$key]['new_id'] = $this->wpdb->insert_id;
-
-                    }
-
-                    // Import Categories
-                    $catTrans = array();
-                    while (list ($key, $val) = each ($category) ) {
-
-                        $res = $this->wpdb->insert(
-                                GLM_MEMBERS_PLUGIN_DB_PREFIX.'categories',
-                                array(
-                                        'name' => $val['name'],
-                                        'descr' => '',
-                                        'short_descr' => '',
-                                        'parent' => 0
-                                ),
-                                array(
-                                        '%s',
-                                        '%s',
-                                        '%s',
-                                        '%d'
-                                )
-                        );
-                        $newID = $this->wpdb->insert_id;
-                        $category[$key]['new_id'] = $newID;
-                        $category[$key]['new_parent'] = 0;
-
-                        $catTrans[$key]  = array(
-                            'new' => $newID,
-                            'parent' => 0
-                        );
-
-                        // Do any sub-cats for this category
-                        while (list ($key2, $val2) = each ($val['subcat']) ) {
-
-                            $res = $this->wpdb->insert(
-                                    GLM_MEMBERS_PLUGIN_DB_PREFIX.'categories',
-                                    array(
-                                            'name' => $val2['name'],
-                                            'descr' => '',
-                                            'short_descr' => '',
-                                            'parent' => $category[$key]['new_id']
-                                    ),
-                                    array(
-                                            '%s',
-                                            '%s',
-                                            '%s',
-                                            '%d'
-                                    )
-                            );
-                            $newID2 = $this->wpdb->insert_id;
-                            $category[$key]['subcat'][$key2]['new_id'] = $newID;
-                            $category[$key]['subcat'][$key2]['new_parent'] = $category[$key]['new_id'];
-
-                            $catTrans[$key2]  = array(
-                                    'new' => $newID2,
-                                    'parent' => $newID
-                            );
-
-                        }
-                    }
-
-
-
-                    // Index Credit Card types - Match to card types in configuration
-                    while (list ($key, $val) = each ($ccard) ) {
-                        reset($this->config['credit_card_numb']);
-                        while (list ($key2, $val2) = each ($this->config['credit_card_numb']) ) {
-                            if (substr($val['ccard_type_name'], 0, 3) == substr(($key2), 0, 3)) {
-                                $ccard[$key]['bitpos'] = $val2;
-                            }
-                        }
-                    }
-
-                    /*
-                     * Create Defaults Not Provided By Old Member DB
-                     */
-
-                    // Member Types
-                    $res = $this->wpdb->insert(
-                            GLM_MEMBERS_PLUGIN_DB_PREFIX.'member_type',
-                            array(
-                                    'name' => 'Default',
-                                    'descr' => '',
-                            ),
-                            array(
-                                    '%s',
-                                    '%s',
-                            )
-                    );
-                    $defaultMemberType = $this->wpdb->insert_id;
-
-                    /*
-                     * Now Start Adding Members
-                     */
-
-                    // Import Members
-                    while (list ($key, $val) = each ($member) ) {
-
-                        $res = $this->wpdb->insert(
-                                GLM_MEMBERS_PLUGIN_DB_PREFIX.'members',
-                                array(
-                                        'access' => $this->config['memb_access_numb']['Full'],
-                                        'member_type' => $defaultMemberType,
-                                        'created' => date('Y-m-d'),
-                                        'name' => $val['member_name']
-                                ),
-                                array(
-                                        '%d',
-                                        '%d',
-                                        '%s',
-                                        '%s'
-                                )
-                        );
-                        $membID = $this->wpdb->insert_id;
-                        $member[$key]['new_id'] = $membID;
-
-                        // Create truncated short_descr from descritions - Less tags, html encoded characters, newlines, tabs, etc.
-                        $stripped = str_replace(PHP_EOL, '', preg_replace('/\t+/', '', preg_replace("/&#?[a-z0-9]{2,8};/i", "", strip_tags($val['description']))));
-                        $short_descr = implode(' ', array_slice(explode(' ', $stripped), 0, 30));
-                        if (strlen($short_descr) < strlen($stripped)) {
-                            $short_descr .= ' ...';
-                        }
-
-                        // Build Credit Card bitmap
-                        $ccBits = 0;
-                        if (isset($membCcard[$val['member_id']])) {
-                            foreach ($membCcard[$val['member_id']] as $c) {
-                                $b = $ccard[$c['ccard_type_id']]['bitpos'];
-                                $ccBits += pow(2, $b);
-                            }
-                        }
-
-                        // Insert Member Information Record
-                        $res = $this->wpdb->insert(
-                                GLM_MEMBERS_PLUGIN_DB_PREFIX.'member_info',
-                                array(
-                                        'member' => $membID,
-                                        'member_name' => $val['member_name'],
-                                        'status' => $this->config['status_numb']['Active'],
-                                        'reference_name' => 'Imported Membmer Information',
-                                        'descr' => $val['description'],
-                                        'short_descr' => $short_descr,
-                                        'addr1' => $val['street'],
-                                        'addr2' => '',
-                                        'city' => $city[$val['city_id']]['new_id'],
-                                        'state' => $state[$val['state_id']]['state_abb'],
-                                        'country' => 'US',
-                                        'zip' => $val['zip'],
-                                        'lat' => $val['lat'],
-                                        'lon' => $val['lon'],
-                                        'region' => (isset($region[$val['region']]) ? $region[$val['region']]['new_id'] : 0),
-                                        'phone' => $val['phone'],
-                                        'toll_free' => $val['toll_free'],
-                                        'url' => $val['url'],
-                                        'email' => $val['process_email'],
-                                        'logo' => '',
-                                        'cc_type' => $ccBits,
-                                        'notes' => '',
-                                        'create_time' => $val['create_date'],
-                                        'modify_time' => $val['last_update']
-                                ),
-                                array(
-                                        '%d',
-                                        '%s',
-                                        '%d',
-                                        '%s',
-                                        '%s',
-                                        '%s',
-                                        '%s',
-                                        '%s',
-                                        '%d',
-                                        '%s',
-                                        '%s',
-                                        '%s',
-                                        '%f',
-                                        '%f',
-                                        '%d',
-                                        '%s',
-                                        '%s',
-                                        '%s',
-                                        '%s',
-                                        '%s',
-                                        '%d',
-                                        '%s',
-                                        '%s',
-                                        '%s'
-                                )
-                        );
-                        $mID = $this->wpdb->insert_id;
-                        $member[$key]['new_id'] = $mID;
-
-                        // Add Member Categories
-                        if (isset($membCat[$val['member_id']])) {
-                            foreach ($membCat[$val['member_id']] as $c) {
-
-                                $res = $this->wpdb->insert(
-                                        GLM_MEMBERS_PLUGIN_DB_PREFIX.'category_member_info',
-                                        array(
-                                                'category' => $catTrans[$c['category_id']]['new'],
-                                                'member_info' => $mID
-                                        ),
-                                        array(
-                                                '%d',
-                                                '%d'
-                                        )
-                                );
-
-                            }
-                        }
-
-                        // Add Member Amenities
-                        if (isset($membAmen[$val['member_id']])) {
-                            foreach ($membAmen[$val['member_id']] as $a) {
-
-                                $res = $this->wpdb->insert(
-                                        GLM_MEMBERS_PLUGIN_DB_PREFIX.'amenity_ref',
-                                        array(
-                                                'amenity' => $amenity[$a['amenity_id']]['new_id'],
-                                                'ref_type' => $this->config['ref_type_numb']['MemberInfo'],
-                                                'ref_dest' => $mID
-                                        ),
-                                        array(
-                                                '%d',
-                                                '%d',
-                                                '%d'
-                                        )
-                                );
-
-                            }
-                        }
-
-
-                    }
-
-                    // Import
-
-                }
-
-                // If everything is OK, make data available to the template
-                if (!$failure) {
-                    $templateData['member'] = $member;
-                    $templateData['defaultMemberType'] = $defaultMemberType;
-                    $templateData['amenity'] = $amenity;
-                    $templateData['membAmen'] = $membAmen;
-                    $templateData['category'] = $category;
-                    $templateData['membCat'] = $membCat;
-                    $templateData['catTrans'] = $catTrans;
-                    $templateData['city'] = $city;
-                    $templateData['state'] = $state;
-                    $templateData['region'] = $region;
-                    $templateData['ccard'] = $ccard;
-                    $templateData['membCcard'] = $membCcard;
-                    $templateData['image'] = $image;
-                }
-
-
-                if ($failure) {
-                    return array(
-                            'status' => true,
-                            'menuItemRedirect' => 'settings',
-                            'modelRedirect' => 'import',
-                            'view' => 'admin/settings/import.html',
-                            'data' => $templateData
-                    );
-
-                }
-
-                $requestedView = 'import/readDatabase.html';
-
-                break;
-
-            default:
-
-                break;
-
-        }
-
-        // Return status, suggested view, and data to controller
-        return array(
-            'status' => true,
-            'menuItemRedirect' => false,
-            'modelRedirect' => false,
-            'view' => 'admin/settings/'.$requestedView,
-            'data' => $templateData
-        );
-
-    }
-
-    /*
-     * Delete Members Database Tables
-     *
-     * @param string $dbVersion Current version of Members Database
-     *
-     * @return boolean
-     * @access public
-     */
-    public function deleteDataTables($dbVersion)
-    {
-
-        // Read in Database deletion script - assumes the current db version.
-        $sqlFile = GLM_MEMBERS_PLUGIN_DB_SCRIPTS.'/drop_database_V'.$dbVersion.'.sql';
-        $sql = file_get_contents($sqlFile);
-
-        // Replace {prefix} with table name prefix
-        $sql = str_replace('{prefix}', GLM_MEMBERS_PLUGIN_DB_PREFIX, $sql);
-
-        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
-            glmMembersAdmin::addNotice('Dropping all database tables', 'Process');
-            glmMembersAdmin::addNotice($sql, 'DataBlock', 'Drop Tables SQL');
-        }
-
-        // Removing the tables using the script
-        $this->wpdb->query($sql);
-
-        // If there's been an error, display in debug Alert
-        $queryError = $this->wpdb->last_error;
-        if ($queryError) {
-            glmMembersAdmin::addNotice('<b>Error when deleting database: Database tables may not have existed.</b><br>Check following message.<br>'.$queryError, 'AdminError');
-        }
-
-        return true;
-
-    }
-
-    /*
-     * Create Members Database Tables
-     *
-     * @param string $dbVersion Current version of Members Database
-     *
-     * @return boolean
-     * @access public
-     */
-    public function createDataTables($dbVersion)
-    {
-
-        // Read in Database creation script
-        $sqlFile = GLM_MEMBERS_PLUGIN_DB_SCRIPTS.'/create_database_V'.$dbVersion.'.sql';
-        $sql = file_get_contents($sqlFile);
-
-        // Replace {prefix} with table name prefix
-        $sql = str_replace('{prefix}', GLM_MEMBERS_PLUGIN_DB_PREFIX, $sql);
-
-        // Split script into separate queries by looking for lines with only "---"
-        $queries = preg_split('/^----$/m', $sql);
-
-        // Try executing all queries to build database
-        $qForDebug = '';
-        do {
-            $q = current($queries);
-            $this->wpdb->query($q);
-            $queryError = $this->wpdb->last_error;
-
-            if ($queryError) {
-                glmMembersAdmin::addNotice('<b>Error when creating database: Database tables may already exist.</b><br>Check following message.<br>'.$queryError, 'AdminError');
-                return false;
-            }
-            $qForDebug .= $queryError.$q;
-
-        } while ($queryError == '' && next($queries));
-
-        if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
-            glmMembersAdmin::addNotice('Creating database tables', 'Process');
-            glmMembersAdmin::addNotice($qForDebug, 'DataBlock', 'Create Tables SQL');
-        }
-
-        return true;
-
-    }
-
-}
-
-?>
\ No newline at end of file
diff --git a/models/admin/settings/index.php b/models/admin/settings/index.php
deleted file mode 100644 (file)
index e9244c6..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-<?php
-
-/**
- * Gaslight Media Members Database
- * Admin Configure
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package  glmMembersDatabase
- * @author   Chuck Scott <cscott@gaslightmedia.com>
- * @license  http://www.gaslightmedia.com Gaslightmedia
- * @version  0.1
- */
-
-// Load Members data abstract
-require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/settings/dataSettingsGeneral.php');
-
-/*
- * This class performs the work for the default action of the "Members" menu
- * option, which is to display the members dashboard.
- *
- */
-class GlmMembersAdmin_settings_index extends GlmDataSettingsGeneral
-{
-
-    /**
-     * WordPress Database Object
-     *
-     * @var $wpdb
-     * @access public
-     */
-    public $wpdb;
-    /**
-     * Plugin Configuration Data
-     *
-     * @var $config
-     * @access public
-     */
-    public $config;
-
-    /*
-     * Constructor
-     *
-     * This contructor sets up this model. At this time that only includes
-     * storing away the WordPress data object.
-     *
-     * @return object Class object
-     *
-     */
-    public function __construct ($wpdb, $config)
-    {
-
-        // Save WordPress Database object
-        $this->wpdb = $wpdb;
-
-        // Save plugin configuration object
-        $this->config = $config;
-
-        // Run constructor for members data class
-        parent::__construct(false, false);
-
-    }
-
-    /*
-     * Perform Model Action
-     *
-     * This method does the work for this model and returns any resulting data
-     *
-     * @return array Status and data array
-     *
-     * 'status'
-     *
-     * True if successfull and false if there was a fatal failure.
-     *
-     * 'menuItemRedirect'
-     *
-     * If not false, provides a menu item the controller should
-     * execute after this one. Normally if this is used, there would also be a
-     * modelRedirect value supplied as well.
-     *
-     * 'modelRedirect'
-     *
-     * If not false, provides an action the controller should execute after
-     * this one.
-     *
-     * 'view'
-     *
-     * A suggested view name that the contoller should use instead of the
-     * default view for this model or false to indicate that the default view
-     * should be used.
-     *
-     * 'data'
-     *
-     * Data that the model is returning for use in merging with the view to
-     * produce output.
-     *
-     */
-    public function modelAction ($actionData = false)
-    {
-        // General settings are always stored in a record with ID=1.
-        $id = 1;
-
-        // Determine if current user can edit configurations
-        if (!current_user_can('glm_members_configure')) {
-            return array(
-                    'status' => false,
-                    'menuItemRedirect' => 'error',
-                    'modelRedirect' => 'index',
-                    'view' => 'admin/error/index.html',
-                    'data' => array(
-                            'reason' => 'User does not have rights to make configuration changes.'
-                    )
-            );
-        }
-
-        // Check for submission option
-        $option = '';
-        if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'submit') {
-            $option = $_REQUEST['option'];
-        }
-
-        switch($option) {
-
-            // Update the settings and redisplay the form
-            case 'submit':
-
-                // Update the general settings
-                $generalSettings = $this->updateEntry(1);
-
-                // Display admin message that the data has been updated
-                glmMembersAdmin::addNotice('General Settings for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin have been updated.', 'AdminNotice');
-
-                break;
-
-            // Default is to get the current settings and display the form
-            default:
-
-                // Try to get the first (should be only) entry for general settings.
-                $generalSettings = $this->editEntry($id);
-
-                if ($generalSettings === false) {
-
-                    if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
-                        glmMembersAdmin::addNotice("<b>&nbsp;&nbsp;/modesl/admin/settings/index.php: Unable to load General Settings.", 'Alert');
-                    }
-/*
-                    return array(
-                        'status' => false,
-                        'menuItemRedirect' => 'error',
-                        'modelRedirect' => 'index',
-                        'view' => 'admin/error/index.html',
-                        'data' => array(
-                            'reason' => 'Unable to create general settings entry in database.'
-                        )
-                    );
-*/
-                }
-
-                break;
-
-        }
-
-        // Compile template data
-        $templateData = array(
-            'reason' => '',
-            'settings' => $generalSettings,
-            'timezones' =>  DateTimeZone::listIdentifiers()
-//            'canEdit' => $canEdit
-        );
-
-        // Return status, suggested view, and data to controller
-        return array(
-            'status' => true,
-            'menuItemRedirect' => false,
-            'modelRedirect' => false,
-            'view' => 'admin/settings/index.html',
-            'data' => $templateData
-        );
-
-    }
-
-}
-
-?>
\ No newline at end of file
diff --git a/models/admin/settings/terms.php b/models/admin/settings/terms.php
deleted file mode 100644 (file)
index 9db4ce6..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-<?php
-
-/**
- * Gaslight Media Members Database
- * Admin Settings Terms
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package  glmMembersDatabase
- * @author   Chuck Scott <cscott@gaslightmedia.com>
- * @license  http://www.gaslightmedia.com Gaslightmedia
- * @version  0.1
- */
-
-// Load Members data abstract
-require_once(GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/settings/dataSettingsTerms.php');
-
-/*
- * This class performs the work for the default action of the "Members" menu
- * option, which is to display the members dashboard.
- *
- */
-class GlmMembersAdmin_settings_terms extends GlmDataSettingsTerms
-{
-
-    /**
-     * WordPress Database Object
-     *
-     * @var $wpdb
-     * @access public
-     */
-    public $wpdb;
-    /**
-     * Plugin Configuration Data
-     *
-     * @var $config
-     * @access public
-     */
-    public $config;
-
-    /*
-     * Constructor
-     *
-     * This contructor sets up this model. At this time that only includes
-     * storing away the WordPress data object.
-     *
-     * @return object Class object
-     *
-     */
-    public function __construct ($wpdb, $config)
-    {
-
-        // Save WordPress Database object
-        $this->wpdb = $wpdb;
-
-        // Save plugin configuration object
-        $this->config = $config;
-
-        // Run constructor for members data class
-        parent::__construct(false, false);
-
-    }
-
-    /*
-     * Perform Model Action
-     *
-     * This method does the work for this model and returns any resulting data
-     *
-     * @return array Status and data array
-     *
-     * 'status'
-     *
-     * True if successfull and false if there was a fatal failure.
-     *
-     * 'menuItemRedirect'
-     *
-     * If not false, provides a menu item the controller should
-     * execute after this one. Normally if this is used, there would also be a
-     * modelRedirect value supplied as well.
-     *
-     * 'modelRedirect'
-     *
-     * If not false, provides an action the controller should execute after
-     * this one.
-     *
-     * 'view'
-     *
-     * A suggested view name that the contoller should use instead of the
-     * default view for this model or false to indicate that the default view
-     * should be used.
-     *
-     * 'data'
-     *
-     * Data that the model is returning for use in merging with the view to
-     * produce output.
-     *
-     */
-    public function modelAction ($actionData = false)
-    {
-        // General settings are always stored in a record with ID=1.
-        $id = 1;
-
-        // Determine if current user can edit configurations
-        if (!current_user_can('glm_members_configure')) {
-            return array(
-                    'status' => false,
-                    'menuItemRedirect' => 'error',
-                    'modelRedirect' => 'index',
-                    'view' => 'admin/error/index.html',
-                    'data' => array(
-                            'reason' => 'User does not have rights to make configuration changes.'
-                    )
-            );
-        }
-
-        // Check for submission option
-        $option = '';
-        if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'submit') {
-            $option = $_REQUEST['option'];
-        }
-
-        switch($option) {
-
-            // Update the settings and redisplay the form
-            case 'submit':
-
-                // Update the general settings
-                $termsSettings = $this->updateEntry(1);
-
-                // Display admin message that the data has been updated
-                glmMembersAdmin::addNotice('Terms Settings for the '.GLM_MEMBERS_PLUGIN_NAME.' plugin have been updated.', 'AdminNotice');
-
-                break;
-
-            // Default is to get the current settings and display the form
-            default:
-
-                // Try to get the first (should be only) entry for general settings.
-                $termsSettings = $this->editEntry($id);
-
-                // Check that we actually have the terms
-                if ($termsSettings === false) {
-
-                    if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
-                        glmMembersAdmin::addNotice("<b>/modesl/admin/settings/terms.php:</b> Unable to load Terms Settings.", 'Alert');
-                    }
-
-                    return array(
-                        'status' => false,
-                        'menuItemRedirect' => 'error',
-                        'modelRedirect' => 'index',
-                        'view' => 'admin/error/index.html',
-                        'data' => array(
-                            'reason' => 'Unable to create terms settings entry in database.'
-                        )
-                    );
-                }
-
-                break;
-
-        }
-
-        // Compile template data
-        $templateData = array(
-            'reason' => '',
-            'settings' => $termsSettings,
-//            'canEdit' => $canEdit
-        );
-
-        // Return status, suggested view, and data to controller
-        return array(
-            'status' => true,
-            'menuItemRedirect' => false,
-            'modelRedirect' => false,
-            'view' => 'admin/settings/terms.html',
-            'data' => $templateData
-        );
-
-    }
-
-}
-
-?>
\ No newline at end of file
diff --git a/views/admin/management/development.html b/views/admin/management/development.html
new file mode 100644 (file)
index 0000000..4ce4fe2
--- /dev/null
@@ -0,0 +1,135 @@
+{include file='admin/management/header.html'}
+    
+    <p>Note: Customers will not have access to this tab.</p>
+    
+    <h2>Development Activities</h2>
+    
+    <ul>
+        <li>
+            <H3>Import</H3>
+            <ul>
+                <li>
+                    <p>
+                        <a href="{$thisURL}?page={$thisPage}&glm_action=development&option=import_connections">Import data from "Connections" business directory</a>
+
+    {if $importNotice} 
+                        <div class="glm-indent glm-notice">{$importNotice}</div>
+    {/if}
+                    </p>
+
+    {if $import}
+
+                    <h3 style="margin-left: 2em;">Members imported: {$membersImported}</h3>
+                    
+    {else}
+        {if $haveMembers}
+                    <form action="{$thisURL}?page={$thisPage}&glm_action=development&option=import_connections" method="POST">
+                        <div class="glm-item-container">
+                            <b>Default data to use when importing members.</b>
+                            <table>
+                                <tr><td>Default member type: </td><td><input type="text" name="memberType" value="Standard"></td></tr>
+                                <tr><td>Default region name: </td><td><input type="text" name="region" value="Region"></td></tr>
+                            </table>
+                        </div>
+                        <p>
+                            <input class="glm-right" type="submit" value="Click here to import all members not marked as Skip">
+                            <span id="skipAll" class="button-primary">Skip All</span>&nbsp;&nbsp;
+                            <span id="skipNone" class="button-primary">Import All</span>
+                        </p>
+                        <div class="glm-nitice glm-indent">
+                            <ul class="glm-required glm-indent">
+                                <li>*** THIS ACTION WILL FULLY RESET YOUR MEMBERS DATABASE ***</li>
+                                <li>This action does not check for duplicate members!</li>
+                            </ul>
+                        </div>
+                        <input type="hidden" name="import" value="now">
+                        <table class="wp-list-table widefat fixed posts glm-admin-table">
+                            <thead>
+                                <tr>
+                                    <th>Skip</th>
+                                    <th>Name</th>
+                                    <th>Addr Line 1</th>
+                                    <th>Addr Line 2</th>
+                                    <th>Addr Line 3</th>
+                                    <th>City</th>
+                                    <th>State</th>
+                                    <th>ZIP</th>
+                                    <th>Country</th>
+                                    <th>Lat/Lon</th>
+                                </tr>
+                            </thead>
+                            <tbody>
+            {foreach $members as $m}
+                                <tr class="alternate">
+                                    <td><input type="checkbox" name="skip[{$m.id}]" class="skip">{$m.id}</td>
+                                    <td>{$m.organization}</td>
+                {assign var="i" value="0"}                        
+                {foreach $m.addresses as $a}
+                    {if $i++ gt 1}
+                                <tr>
+                                    <td>&nbsp;</td>
+                                    <td>&nbsp;</td>
+                    {/if}                                
+                                    <td>{$a.line_1}</td>
+                                    <td>{$a.line_2}</td>
+                                    <td>{$a.line_3}</td>
+                                    <td>{$a.city}</td>
+                                    <td>{$a.state}</td>
+                                    <td>{$a.zipcode}</td>
+                                    <td>{$a.country}</td>
+                                    <td>{$a.latitude|number_format:3:".":","}/{$a.longitude|number_format:3:".":","}</td>
+                                </tr>
+                {/foreach}
+            {/foreach}               
+                            </tbody>         
+                        </table>
+                    </form>
+        {/if}
+    {/if}
+                </li>
+            </ul>
+            <H3>Database</H3>
+            <ul>
+                <li><a href="{$thisURL}?page={$thisPage}&glm_action=development&option=drop">Drop database tables</a> (WARNING: Destroys all current data)</li>
+                <li><a href="{$thisURL}?page={$thisPage}&glm_action=development&option=create">Create database tables</a></li>
+                <li><a href="{$thisURL}?page={$thisPage}&glm_action=development&option=reset">Fully Reset Database (drop/create)</a> (WARNING: Destroys all current data)</li>
+                <li><a href="{$thisURL}?page={$thisPage}&glm_action=development&option=list">List database tables</a></li>
+            </ul>
+        </li>
+    </ul>
+
+    <div>
+        <h3>Docuemtation and References</h3>    
+        <p><a href="{$baseURL}/lib/GlmDataAbstract/GlmDataAbstract_Programmers_Manual.pdf">Data Abstract Class Documentation</a></p>
+    </div>
+{if $resultMessage}    
+    <div>
+        <hr>
+        {$resultMessage}
+    </div>
+{/if}    
+    
+{if $haveMembers}
+    <script type="text/javascript">
+        jQuery(document).ready(function($) {
+
+               $('#skipAll').click(function(event) {
+                   $('.skip').each(function() { //loop through each checkbox
+                       this.checked = true;  //select all checkboxes with class "checkbox1"              
+                   });
+                   return false;
+           });
+               
+            $('#skipNone').click(function(event) {
+                $('.skip').each(function() { //loop through each checkbox
+                    this.checked = false;  //select all checkboxes with class "checkbox1"              
+                });
+                return false;
+            });
+               
+        });
+    </script>
+{/if}            
+    
+    
+{include file='admin/footer.html'}
diff --git a/views/admin/management/header.html b/views/admin/management/header.html
new file mode 100644 (file)
index 0000000..10ae4a5
--- /dev/null
@@ -0,0 +1,12 @@
+<div class="wrap">
+
+    <h2>{$glmPluginName} Configuration</h2>
+       
+    <h2 class="nav-tab-wrapper">
+        <a href="{$thisURL}?page={$thisPage}&glm_action=index" class="nav-tab{if $thisAction==index}-active{/if}">General Settings</a>
+        <a href="{$thisURL}?page={$thisPage}&glm_action=terms" class="nav-tab{if $thisAction==terms}-active{/if}">Terms and Phrases</a>
+        <a href="{$thisURL}?page={$thisPage}&glm_action=development" class="nav-tab{if $thisAction==development}-active{/if}">Development</a>
+        <a href="{$thisURL}?page={$thisPage}&glm_action=import" class="nav-tab{if $thisAction==import}-active{/if}">Data Import</a>
+    </h2>
+    <div id="glm-admin-content-container">
+    
\ No newline at end of file
diff --git a/views/admin/management/import.html b/views/admin/management/import.html
new file mode 100644 (file)
index 0000000..6fda579
--- /dev/null
@@ -0,0 +1,95 @@
+{include file='admin/management/header.html'}
+    
+    <p>Note: Customers will not have access to this tab.</p>
+    
+    <h2>Data Import</h2>
+    <p>
+        This process export data from a legacy Gaslight Media Member DB database and imports that data into this plugin. It will only work with a Postgres database.
+        The process will include the following steps.
+    </p>
+    <ol>
+        <li class="glm-ol-selected">Provide information on the legacy database from which we'll be extracting data.</li>
+        <li>Test that database to make sure it's compatible with this process.</li>
+        <li>Read the needed data from the legacy database.</li>
+        <li>Review the extracted data to make sure it looks like the data you want to import.</li>
+        <li>Import the extracted data into is plugin</li>
+        <li>Review resulst</li>
+    </ol>
+    
+
+    <h3>Data Import Step 1</h3>
+{if isset($genError)}    
+    <p>
+        <h3 class="glm-error">Oops!</h3>
+        <p class="glm-error">{$genError}</p>
+    </p>
+{/if}    
+    <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
+        <input type="hidden" name="glm_action" value="import">
+        <input type="hidden" name="option" value="readDatabase">
+        
+        <table class="glm-admin-table">
+        
+            <!-- Debug Settings -->
+        
+            <tr>
+                <th>Database Server: </th>
+                <td>
+                    <input class="glm-form-text-input-medium" type="text" name="dbServer" placeholder="(complete host name or IP address)" value="{if isset($dbServer)}{$dbServer.value}{/if}">
+       {if isset($dbServer)}
+                    <p class="glm-error">{$dbServer.problem}</p>
+       {/if}
+                </td>
+            </tr>
+            <tr>
+                <th>Database Port #: </th>
+                <td>
+                    <input class="glm-form-text-input-short" type="text" name="dbPort" value="{if isset($dbPort)}{$dbPort.value}{else}5432{/if}">
+       {if isset($dbPort)}
+                    <p class="glm-error">{$dbPort.problem}</p>
+       {/if}
+                </td>
+            </tr>
+            <tr>
+                <th>Database Name: </th>
+                <td>
+                    <input class="glm-form-text-input-medium" type="text" name="dbName" placeholder="(name of database}" value="{if isset($dbName)}{$dbName.value}{/if}">
+       {if isset($dbName)}
+                    <p class="glm-error">{$dbName.problem}</p>
+       {/if}
+                </td>
+            </tr>
+            <tr>
+                <th>Database User: </th>
+                <td>
+                    <input class="glm-form-text-input-medium" type="text" name="dbUser" placeholder="(user with read access to this database)" value="{if isset($dbUser)}{$dbUser.value}{/if}">
+        {if isset($dbUser)}
+                    <p class="glm-error">{$dbUser.problem}</p>
+       {/if}
+                </td>
+            </tr>
+            <tr>
+                <th>Base Original Image URL: </th>
+                <td>
+                    <input class="glm-form-text-input-medium-long" type="text" name="dbImageURL" placeholder="(i.e. http://is0.gaslightmedia.com/mountpleasantwow/original/)" value="{if isset($dbImageURL)}{$dbImageURL.value}{/if}">
+        {if isset($dbImageURL)}
+                    <p class="glm-error">{$dbImageURL.problem}</p>
+       {/if}
+                </td>
+            </tr>
+            <tr>
+                <th>Reset Database Before Import: </th>
+                <td>
+                    <input type="checkbox" name="dbReset">
+                    <br>NOTE: Selecting this option will remove all existing data from the Member database!
+                    <br>If you do not select this option, the new data will be added to the database and there will be no attempt to match up imported data with the existing data.
+                </td>
+            </tr>
+        </table>
+        
+        <input type="submit" value="Select Member" class="button-primary">
+        
+    </form>
+            
+    
+{include file='admin/footer.html'}
diff --git a/views/admin/management/import/readDatabase.html b/views/admin/management/import/readDatabase.html
new file mode 100644 (file)
index 0000000..2f3b8db
--- /dev/null
@@ -0,0 +1,56 @@
+{include file='admin/management/header.html'}
+    
+    <p>Note: Customers will not have access to this tab.</p>
+    
+    <h2>Data Import - Test Database</h2>
+    <ol>
+        <li>Provide information on the legacy database from which we'll be extracting data.</li>
+        <li class="glm-ol-selected">Test database to make sure it's compatible with this process.</li>
+        <li>Read the needed data from the legacy database.</li>
+        <li>Review the extracted data to make sure it looks like the data you want to import.</li>
+        <li>Import the extracted data into is plugin</li>
+        <li>Review resulst</li>
+    </ol>
+    
+
+    <h3>Data Import Step 2</h3>
+{if isset($genError)}    
+    <p>
+        <h3 class="glm-error">Oops!</h3>
+        <p class="glm-error">{$genError}</p>
+    </p>
+{/if}    
+    <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
+        <input type="hidden" name="glm_action" value="import">
+        <input type="hidden" name="option" value="testDatabase">
+        
+        <table class="glm-admin-table">
+        
+            <!-- Debug Settings -->
+        
+            <tr>
+                <th>Database Server: </th>
+                <td>
+                    <input type="text" name="dbServer" placeholder="(complete host name or IP address)">
+                </td>
+            </tr>
+            <tr>
+                <th>Database Name: </th>
+                <td>
+                    <input type="text" name="dbName" placeholder="(name of database}">
+                </td>
+            </tr>
+            <tr>
+                <th>Database User: </th>
+                <td>
+                    <input type="text" name="dbUser" placeholder="(user with read access to this database)">
+                </td>
+            </tr>
+        </table>
+        
+        <input type="submit" value="Select Member" class="button-primary">
+        
+    </form>
+            
+    
+{include file='admin/footer.html'}
diff --git a/views/admin/management/index.html b/views/admin/management/index.html
new file mode 100644 (file)
index 0000000..1e8f1c8
--- /dev/null
@@ -0,0 +1,297 @@
+{include file='admin/management/header.html'}
+    
+    <h1>*** Not using these settings yet! ***</h1>
+    
+    <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
+        <input type="hidden" name="glm_action" value="index">
+        <input type="hidden" name="option" value="submit">
+        
+        <table class="glm-admin-table">
+        
+            <!-- Debug Settings -->
+        
+            <tr><td colspan="2"><h2>Debug Settings</h2></td></tr>
+            <tr>
+                <th>Admin Debug Information:</th>
+                <td>
+                    <input type="checkbox" name="admin_debug"{if $settings.fieldData.admin_debug.value} checked="checked"{/if}>
+                </td>
+            </tr>
+            <tr>
+                <th>Admin Debug Verbose:</th>
+                <td>
+                    <input type="checkbox" name="admin_debug_verbose"{if $settings.fieldData.admin_debug_verbose.value} checked="checked"{/if}>
+                </td>
+            </tr>
+            <tr>
+                <th>Front-End Debug Information:</th>
+                <td>
+                    <input type="checkbox" name="front_debug"{if $settings.fieldData.front_debug.value} checked="checked"{/if}>
+                </td>
+            </tr>
+            <tr>
+                <th>Front-End Debug Verbose:</th>
+                <td>
+                    <input type="checkbox" name="front_debug_verbose"{if $settings.fieldData.front_debug_verbose.value} checked="checked"{/if}>
+                </td>
+            </tr>
+            <tr><td colspan="2"><hr></td></tr>
+            <tr><td colspan="2"><h2>Misc. Settings</h2></td></tr>
+            <tr>
+                <th {if $settings.fieldRequired.google_maps_api_key}class="glm-required"{/if}>Google Maps API Key:</th>
+                <td {if $settings.fieldFail.google_maps_api_key}class="glm-form-bad-input"{/if}>
+                    <input type="text" name="google_maps_api_key" value="{$settings.fieldData.google_maps_api_key}" class="glm-form-text-input-medium">
+                    {if $settings.fieldFail.google_maps_api_key}<p>{$settings.fieldFail.google_maps_api_key}</p>{/if}
+                    <br>Optional: See Google Maps JAVAscript API V3 documentation for information.
+                </td>
+            </tr>
+            <tr>
+                <th {if $settings.fieldRequired.maps_default_lat}class="glm-required"{/if}>Default Map Location:</th>
+                <td {if $settings.fieldFail.maps_default_lat || $settings.fieldFail.maps_default_lon}class="glm-form-bad-input"{/if}>
+                    <label for="maps_default_lat">Lat:</label>
+                    <input type="text" name="maps_default_lat" value="{$settings.fieldData.maps_default_lat}" class="glm-form-text-input-small"><br>
+                    <label for="maps_default_lon">Lon:</label>
+                    <input type="text" name="maps_default_lon" value="{$settings.fieldData.maps_default_lon}" class="glm-form-text-input-small">
+                    <br>Please enter values in decimal degrees.
+                    {if $settings.fieldFail.maps_default_lat}<p>{$settings.fieldFail.maps_default_lat}</p>{/if}
+                    {if $settings.fieldFail.maps_default_lon}<p>{$settings.fieldFail.maps_default_lon}</p>{/if}
+                </td>
+            </tr>
+            <tr>
+                <th {if $settings.fieldRequired.time_zone}class="glm-required"{/if}>Time Zone:</th>
+                <td {if $settings.fieldFail.time_zone}class="glm-form-bad-input"{/if}>
+                    <select name="time_zone">
+        {foreach $timezones as $tz}
+                        <option value="{$tz}"{if $tz == $settings.fieldData.time_zone} selected="selected"{/if}>{$tz}</option>
+        {/foreach}
+                    </select>
+                    {if $settings.fieldFail.time_zone}<p>{$settings.fieldFail.time_zone}</p>{/if}
+                </td>
+            </tr>
+            
+            <!-- Member List Page Options -->
+            
+            <tr><td colspan="2"><hr></td></tr>
+            <tr><td colspan="2"><h2>Member List Page Options</h2></td></tr>
+            <tr>
+                <th>Show Map:</th>
+                <td>
+                    <input type="checkbox" name="list_show_map"{if $settings.fieldData.list_show_map.value} checked="checked"{/if}>
+                </td>
+            </tr>
+            <tr>
+                <th>Map Options:</th>
+                <td>
+                    <table class="glm-admin-table">
+                        <tr><th>Show Member Name as Link to Detail:</th><td><input type="checkbox" name="list_map_show_detaillink"{if $settings.fieldData.list_map_show_detaillink.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Logo:</th><td><input type="checkbox" name="list_map_show_logo"{if $settings.fieldData.list_map_show_logo.value} checked="checked"{/if}></td></tr>
+                        
+                        <tr>
+                            <th>Logo Size:</th>
+                            <td>
+                                <select name="list_map_logo_size">
+                    {foreach from=$settings.fieldData.list_map_logo_size.list item=v}
+                                    <option value="{$v.value}"{if $v.default} selected="selected"{/if}>{$v.name}</option>
+                    {/foreach}
+                                </select>
+                            </td>
+                        </tr>
+                        
+                        <tr><th>Show Description:</th><td><input type="checkbox" name="list_map_show_descr"{if $settings.fieldData.list_map_show_descr.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Short Description:</th><td><input type="checkbox" name="list_map_show_short_descr"{if $settings.fieldData.list_map_show_short_descr.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Address:</th><td><input type="checkbox" name="list_map_show_address"{if $settings.fieldData.list_map_show_address.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Street:</th><td><input type="checkbox" name="list_map_show_street"{if $settings.fieldData.list_map_show_street.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show City, State, ZIP:</th><td><input type="checkbox" name="list_map_show_citystatezip"{if $settings.fieldData.list_map_show_citystatezip.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Country:</th><td><input type="checkbox" name="list_map_show_country"{if $settings.fieldData.list_map_show_country.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Region:</th><td><input type="checkbox" name="list_map_show_region"{if $settings.fieldData.list_map_show_region.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Phone:</th><td><input type="checkbox" name="list_map_show_phone"{if $settings.fieldData.list_map_show_phone.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Toll Free:</th><td><input type="checkbox" name="list_map_show_tollfree"{if $settings.fieldData.list_map_show_tollfree.value} checked="checked"{/if}></td></tr>
+                        <tr>
+                            <th>Show URL:</th>
+                            <td>
+                                <input type="checkbox" name="list_map_show_url"{if $settings.fieldData.list_map_show_url.value} checked="checked"{/if}>
+                                Display URL as a link: <input type="checkbox" name="list_map_show_url_newtarget"{if $settings.fieldData.list_map_show_url_newtarget.value} checked="checked"{/if}>
+                            </td>
+                        </tr>
+                        <tr><th>Show Categories:</th><td><input type="checkbox" name="list_map_show_categories"{if $settings.fieldData.list_map_show_categories.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Credit Cards:</th><td><input type="checkbox" name="list_map_show_creditcards"{if $settings.fieldData.list_map_show_creditcards.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Amenitiies:</th><td><input type="checkbox" name="list_map_show_amenities"{if $settings.fieldData.list_map_show_amenities.value} checked="checked"{/if}></td></tr>
+                    </table>
+                </td>
+            </tr>
+            <tr>
+                <th>Show Search Form:</th>
+                <td>
+                    <input type="checkbox" name="list_show_search"{if $settings.fieldData.list_show_search.value} checked="checked"{/if}>
+                </td>
+            </tr>
+            <tr>
+                <th>Search Form Options:</th>
+                <td>
+                    <table class="glm-admin-table">
+                        <tr><th>Text Search:</th><td><input type="checkbox" name="list_show_search_text"{if $settings.fieldData.list_show_search_text.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Category Search:</th><td><input type="checkbox" name="list_show_search_category"{if $settings.fieldData.list_show_search_category.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Amenities Search:</th><td><input type="checkbox" name="list_show_search_amenities"{if $settings.fieldData.list_show_search_amenities.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Alpha Index:</th><td><input type="checkbox" name="list_show_search_alpha"{if $settings.fieldData.list_show_search_alpha.value} checked="checked"{/if}></td></tr>
+                        
+                    </table>
+                </td>
+            </tr>
+            <tr>
+                <th>Show Member List:</th>
+                <td>
+                    <input type="checkbox" name="list_show_list"{if $settings.fieldData.list_show_list.value} checked="checked"{/if}>
+                </td>
+            </tr>
+            <tr>
+                <th>Member List Options</th>
+                <td>
+                    <table class="glm-admin-table">
+                        <tr><th>Show Member Name as Link to Detail:</th><td><input type="checkbox" name="list_show_detail_link"{if $settings.fieldData.list_show_detail_link.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Member Logo:</th><td><input type="checkbox" name="list_show_logo"{if $settings.fieldData.list_show_logo.value} checked="checked"{/if}></td></tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.list_logo_size}class="glm-required"{/if}>Logo Size:</th>
+                            <td {if $settings.fieldFail.list_logo_size}class="glm-form-bad-input"{/if}>
+                                <select name="list_logo_size">
+                    {foreach from=$settings.fieldData.list_logo_size.list item=v}
+                                    <option value="{$v.value}"{if $v.default} selected="selected"{/if}>{$v.name}</option>
+                    {/foreach}
+                                </select>
+                                {if $settings.fieldFail.list_logo_size}<p>{$settings.fieldFail.list_logo_size}</p>{/if}
+                            </td>
+                        </tr>            
+                        <tr><th>Show Address:</th><td><input type="checkbox" name="list_show_address"{if $settings.fieldData.list_show_address.value} checked="checked"{/if}></td></tr>
+                        </tr>
+                            <tr>
+                            <th>Address Options:</th>
+                            <td>  
+                                <table class="glm-admin-table">
+                                    <tr><th>Show Street:</th><td><input type="checkbox" name="list_show_street"{if $settings.fieldData.list_show_street.value} checked="checked"{/if}></td></tr>
+                                    <tr><th>Show City, State, ZIP:</th><td><input type="checkbox" name="list_show_citystatezip"{if $settings.fieldData.list_show_citystatezip.value} checked="checked"{/if}></td></tr>
+                                    <tr><th>Show Country:</th><td><input type="checkbox" name="list_show_country"{if $settings.fieldData.list_show_country.value} checked="checked"{/if}></td></tr>                      
+                                </table>
+                            </td>
+                        </tr>
+                        <tr><th>Show Region:</th><td><input type="checkbox" name="list_show_region"{if $settings.fieldData.list_show_region.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Description:</th><td><input type="checkbox" name="list_show_descr"{if $settings.fieldData.list_show_descr.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Short Description:</th><td><input type="checkbox" name="list_show_short_descr"{if $settings.fieldData.list_show_short_descr.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Phone Number:</th><td><input type="checkbox" name="list_show_phone"{if $settings.fieldData.list_show_phone.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Toll Free Phone Number:</th><td><input type="checkbox" name="list_show_tollfree"{if $settings.fieldData.list_show_tollfree.value} checked="checked"{/if}></td></tr>
+                        <tr>
+                            <th>Show URL:</th>
+                            <td>
+                                <input type="checkbox" name="list_show_url"{if $settings.fieldData.list_show_url.value} checked="checked"{/if}>
+                                Display URL as a link: <input type="checkbox" name="list_show_url_newtarget"{if $settings.fieldData.list_show_url_newtarget.value} checked="checked"{/if}>
+                            </td>
+                        </tr>
+                        <tr><th>Show Categories:</th><td><input type="checkbox" name="list_show_categories"{if $settings.fieldData.list_show_categories.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Credit Cards Accepted:</th><td><input type="checkbox" name="list_show_creditcards"{if $settings.fieldData.list_show_creditcards.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Amenities:</th><td><input type="checkbox" name="list_show_amenities"{if $settings.fieldData.list_show_amenities.value} checked="checked"{/if}></td></tr>
+                    </table>
+                </td>
+            </tr>
+            
+            <!-- Member Detail Page Options -->
+            
+            <tr><td colspan="2"><hr></td></tr>
+            <tr><td colspan="2"><h2>Member Detail Page Options</h2></td></tr>
+            <tr>
+                <th>Show Map:</th>
+                <td>
+                    <input type="checkbox" name="detail_show_map"{if $settings.fieldData.detail_show_map.value} checked="checked"{/if}>
+                </td>
+            </tr>
+            <tr>
+                <th>Map Options:</th>
+                <td>
+                    <table class="glm-admin-table">
+                        <tr><th>Show Logo:</th><td><input type="checkbox" name="detail_map_show_logo"{if $settings.fieldData.detail_map_show_logo.value} checked="checked"{/if}></td></tr>
+                        <tr>
+                            <th>Logo Size:</th>
+                            <td>
+                                <select name="detail_map_logo_size">
+                    {foreach from=$settings.fieldData.detail_map_logo_size.list item=v}
+                                    <option value="{$v.value}"{if $v.default} selected="selected"{/if}>{$v.name}</option>
+                    {/foreach}
+                                </select>
+                            </td>
+                        </tr>
+                        <tr><th>Show Description:</th><td><input type="checkbox" name="detail_map_show_descr"{if $settings.fieldData.detail_map_show_descr.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Short Description:</th><td><input type="checkbox" name="detail_map_show_short_descr"{if $settings.fieldData.detail_map_show_short_descr.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Address:</th><td><input type="checkbox" name="detail_map_show_address"{if $settings.fieldData.detail_map_show_address.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Street:</th><td><input type="checkbox" name="detail_map_show_street"{if $settings.fieldData.detail_map_show_street.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show City, State, ZIP:</th><td><input type="checkbox" name="detail_map_show_citystatezip"{if $settings.fieldData.detail_map_show_citystatezip.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Country:</th><td><input type="checkbox" name="detail_map_show_country"{if $settings.fieldData.detail_map_show_country.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Region:</th><td><input type="checkbox" name="detail_map_show_region"{if $settings.fieldData.detail_map_show_region.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Phone:</th><td><input type="checkbox" name="detail_map_show_phone"{if $settings.fieldData.detail_map_show_phone.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Toll Free:</th><td><input type="checkbox" name="detail_map_show_tollfree"{if $settings.fieldData.detail_map_show_tollfree.value} checked="checked"{/if}></td></tr>
+                        <tr>
+                            <th>Show URL:</th>
+                            <td>
+                                <input type="checkbox" name="detail_map_show_url"{if $settings.fieldData.detail_map_show_url.value} checked="checked"{/if}>
+                                Display URL as a link: <input type="checkbox" name="detail_map_show_url_newtarget"{if $settings.fieldData.detail_map_show_url_newtarget.value} checked="checked"{/if}>
+                            </td>
+                        </tr>
+                        <tr><th>Show Categories:</th><td><input type="checkbox" name="detail_map_show_categories"{if $settings.fieldData.detail_map_show_categories.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Credit Cards:</th><td><input type="checkbox" name="detail_map_show_creditcards"{if $settings.fieldData.detail_map_show_creditcards.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Amenitiies:</th><td><input type="checkbox" name="detail_map_show_amenities"{if $settings.fieldData.detail_map_show_amenities.value} checked="checked"{/if}></td></tr>
+                    </table>
+                </td>
+            </tr>
+            <tr>
+                <th>Show Directions:</th>
+                <td>
+                    <input type="checkbox" name="detail_show_directions"{if $settings.fieldData.detail_show_directions.value} checked="checked"{/if}>
+                </td>
+            </tr>
+            <tr>
+                <th>Member Detail Options:</th>
+                <td>
+                    <table class="glm-admin-table">
+                        <tr><th>Show Member Logo:</th><td><input type="checkbox" name="detail_show_logo"{if $settings.fieldData.detail_show_logo.value} checked="checked"{/if}></td></tr>
+                       <tr>
+                            <th {if $settings.fieldRequired.detail_logo_size}class="glm-required"{/if}>Logo Size:</th>
+                            <td {if $settings.fieldFail.detail_logo_size}class="glm-form-bad-input"{/if}>
+                                <select name="detail_logo_size">
+                    {foreach from=$settings.fieldData.detail_logo_size.list item=v}
+                                    <option value="{$v.value}"{if $v.default} selected="selected"{/if}>{$v.name}</option>
+                    {/foreach}
+                                </select>
+                                {if $settings.fieldFail.detail_logo_size}<p>{$settings.fieldFail.detail_logo_size}</p>{/if}
+                            </td>
+                        </tr>            
+                        <tr><th>Show Address:</th><td><input type="checkbox" name="detail_show_address"{if $settings.fieldData.detail_show_address.value} checked="checked"{/if}></td></tr>
+                        </tr>
+                            <tr>
+                            <th>Address Options:</th>
+                            <td>  
+                                <table class="glm-admin-table">
+                                    <tr><th>Show Street:</th><td><input type="checkbox" name="detail_show_street"{if $settings.fieldData.detail_show_street.value} checked="checked"{/if}></td></tr>
+                                    <tr><th>Show City, State, ZIP:</th><td><input type="checkbox" name="detail_show_citystatezip"{if $settings.fieldData.detail_show_citystatezip.value} checked="checked"{/if}></td></tr>
+                                    <tr><th>Show Country:</th><td><input type="checkbox" name="detail_show_country"{if $settings.fieldData.detail_show_country.value} checked="checked"{/if}></td></tr>                      
+                                </table>
+                            </td>
+                        </tr>
+                        <tr><th>Show Region:</th><td><input type="checkbox" name="detail_show_region"{if $settings.fieldData.detail_show_region.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Description:</th><td><input type="checkbox" name="detail_show_descr"{if $settings.fieldData.detail_show_descr.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Short Description:</th><td><input type="checkbox" name="detail_show_short_descr"{if $settings.fieldData.detail_show_short_descr.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Phone Number:</th><td><input type="checkbox" name="detail_show_phone"{if $settings.fieldData.detail_show_phone.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Toll Free Phone Number:</th><td><input type="checkbox" name="detail_show_tollfree"{if $settings.fieldData.detail_show_tollfree.value} checked="checked"{/if}></td></tr>
+                        <tr>
+                            <th>Show URL:</th>
+                            <td>
+                                <input type="checkbox" name="detail_show_url"{if $settings.fieldData.detail_show_url.value} checked="checked"{/if}>
+                                Display URL as a link: <input type="checkbox" name="detail_show_url_newtarget"{if $settings.fieldData.detail_show_url_newtarget.value} checked="checked"{/if}>
+                            </td>
+                        </tr>
+                        <tr><th>Show Categories:</th><td><input type="checkbox" name="detail_show_categories"{if $settings.fieldData.detail_show_categories.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Credit Cards Accepted:</th><td><input type="checkbox" name="detail_show_creditcards"{if $settings.fieldData.detail_show_creditcards.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Amenities:</th><td><input type="checkbox" name="detail_show_amenities"{if $settings.fieldData.detail_show_amenities.value} checked="checked"{/if}></td></tr>
+                        <tr><th>Show Image Gallery:</th><td><input type="checkbox" name="detail_show_imagegallery"{if $settings.fieldData.detail_show_imagegallery.value} checked="checked"{/if}></td></tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+        <input type="submit" value="Update Settings" class="button-primary">
+    </form>
+{include file='admin/footer.html'}
diff --git a/views/admin/management/terms.html b/views/admin/management/terms.html
new file mode 100644 (file)
index 0000000..8508b65
--- /dev/null
@@ -0,0 +1,376 @@
+{include file='admin/management/header.html'}
+    
+    <h1>*** Not using these settings yet! ***</h1>
+    
+    <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
+        <input type="hidden" name="glm_action" value="terms">
+        <input type="hidden" name="option" value="submit">
+        
+        <table class="glm-admin-table">
+        
+            <!-- Admin Menus -->
+        
+            <tr><td colspan="2"><h2>Admin Menu and Tab Names</h2></td></tr>
+            <tr>
+                <th {if $settings.fieldRequired.term_admin_menu_members}class="glm-required"{/if}>Members Menu:</th>
+                <td {if $settings.fieldFail.term_admin_menu_members}class="glm-form-bad-input"{/if}>
+                    <input type="text" name="term_admin_menu_members" value="{$settings.fieldData.term_admin_menu_members}" class="glm-form-text-input-medium">
+                    {if $settings.fieldFail.term_admin_menu_members}<p>{$settings.fieldFail.term_admin_menu_members}</p>{/if}
+                </td>
+            </tr>
+            <tr>
+                <th>Members Menu Tabs:</th>
+                <td>
+                    <table class="glm-admin-table">
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_members_dashboard}class="glm-required"{/if}>Main Dashboard:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_members_dashboard}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_members_dashboard" value="{$settings.fieldData.term_admin_menu_members_dashboard}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_members_dashboard}<p>{$settings.fieldFail.term_admin_menu_members_dashboard}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_members_list}class="glm-required"{/if}>Member List:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_members_list}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_members_list" value="{$settings.fieldData.term_admin_menu_members_list}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_members_list}<p>{$settings.fieldFail.term_admin_menu_members_list}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_members_reports}class="glm-required"{/if}>Reports:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_members_reports}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_members_reports" value="{$settings.fieldData.term_admin_menu_members_reports}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_members_reports}<p>{$settings.fieldFail.term_admin_menu_members_reports}</p>{/if}
+                            </td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+            <tr>
+                <th {if $settings.fieldRequired.term_admin_menu_member}class="glm-required"{/if}>Member Menu:</th>
+                <td {if $settings.fieldFail.term_admin_menu_member}class="glm-form-bad-input"{/if}>
+                    <input type="text" name="term_admin_menu_member" value="{$settings.fieldData.term_admin_menu_member}" class="glm-form-text-input-medium">
+                    {if $settings.fieldFail.term_admin_menu_member}<p>{$settings.fieldFail.term_admin_menu_member}</p>{/if}
+                </td>
+            </tr>
+            <tr>
+                <th>Member Menu Tabs:</th>
+                <td>
+                    <table class="glm-admin-table">
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_member_dashboard}class="glm-required"{/if}>Member Dashboard:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_member_dashboard}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_member_dashboard" value="{$settings.fieldData.term_admin_menu_member_dashboard}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_member_dashboard}<p>{$settings.fieldFail.term_admin_menu_member_dashboard}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_member_info}class="glm-required"{/if}>Member Info:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_member_info}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_member_info" value="{$settings.fieldData.term_admin_menu_member_info}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_member_info}<p>{$settings.fieldFail.term_admin_menu_member_info}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_member_locations}class="glm-required"{/if}>Locations:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_member_locations}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_member_locations" value="{$settings.fieldData.term_admin_menu_member_locations}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_member_locations}<p>{$settings.fieldFail.term_admin_menu_member_locations}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_member_facilities}class="glm-required"{/if}>Facilities:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_member_facilities}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_member_facilities" value="{$settings.fieldData.term_admin_menu_member_facilities}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_member_facilities}<p>{$settings.fieldFail.term_admin_menu_member_facilities}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_member_attractions}class="glm-required"{/if}>Attractions:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_member_attractions}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_member_attractions" value="{$settings.fieldData.term_admin_menu_member_attractions}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_member_attractions}<p>{$settings.fieldFail.term_admin_menu_member_attractions}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_member_contacts}class="glm-required"{/if}>Contacts:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_member_contacts}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_member_contacts" value="{$settings.fieldData.term_admin_menu_member_contacts}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_member_contacts}<p>{$settings.fieldFail.term_admin_menu_member_contacts}</p>{/if}
+                            </td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+            <tr>
+                <th {if $settings.fieldRequired.term_admin_menu_configure}class="glm-required"{/if}>Configure Menu:</th>
+                <td {if $settings.fieldFail.term_admin_menu_configure}class="glm-form-bad-input"{/if}>
+                    <input type="text" name="term_admin_menu_configure" value="{$settings.fieldData.term_admin_menu_configure}" class="glm-form-text-input-medium">
+                    {if $settings.fieldFail.term_admin_menu_configure}<p>{$settings.fieldFail.term_admin_menu_configure}</p>{/if}
+                </td>
+            </tr>
+            <tr>
+                <th>Configure Menu Tabs:</th>
+                <td>
+                    <table class="glm-admin-table">
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_configure_member_types}class="glm-required"{/if}>Member Types:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_configure_member_types}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_configure_member_types" value="{$settings.fieldData.term_admin_menu_configure_member_types}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_configure_member_types}<p>{$settings.fieldFail.term_admin_menu_configure_member_types}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_configure_member_cats}class="glm-required"{/if}>Member Categories:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_configure_member_cats}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_configure_member_cats" value="{$settings.fieldData.term_admin_menu_configure_member_cats}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_configure_member_cats}<p>{$settings.fieldFail.term_admin_menu_configure_member_cats}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_configure_accom_types}class="glm-required"{/if}>Accommodation Types:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_configure_accom_types}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_configure_accom_types" value="{$settings.fieldData.term_admin_menu_configure_accom_types}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_configure_accom_types}<p>{$settings.fieldFail.term_admin_menu_configure_accom_types}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_configure_amenities}class="glm-required"{/if}>Amenities:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_configure_amenities}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_configure_amenities" value="{$settings.fieldData.term_admin_menu_configure_amenities}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_configure_amenities}<p>{$settings.fieldFail.term_admin_menu_configure_amenities}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_configure_cities}class="glm-required"{/if}>Cities:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_configure_cities}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_configure_cities" value="{$settings.fieldData.term_admin_menu_configure_cities}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_configure_cities}<p>{$settings.fieldFail.term_admin_menu_configure_cities}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_configure_regions}class="glm-required"{/if}>Regions:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_configure_regions}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_configure_regions" value="{$settings.fieldData.term_admin_menu_configure_regions}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_configure_regions}<p>{$settings.fieldFail.term_admin_menu_configure_regions}</p>{/if}
+                            </td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+            <tr>
+                <th {if $settings.fieldRequired.term_admin_menu_settings}class="glm-required"{/if}>Settings Menu:</th>
+                <td {if $settings.fieldFail.term_admin_menu_settings}class="glm-form-bad-input"{/if}>
+                    <input type="text" name="term_admin_menu_settings" value="{$settings.fieldData.term_admin_menu_settings}" class="glm-form-text-input-medium">
+                    {if $settings.fieldFail.term_admin_menu_settings}<p>{$settings.fieldFail.term_admin_menu_settings}</p>{/if}
+                </td>
+            </tr>
+            <tr>
+                <th>Settings Menu Tabs:</th>
+                <td>
+                    <table class="glm-admin-table">
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_settings_general}class="glm-required"{/if}>General Settings:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_settings_general}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_settings_general" value="{$settings.fieldData.term_admin_menu_settings_general}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_settings_general}<p>{$settings.fieldFail.term_admin_menu_settings_general}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_settings_terms}class="glm-required"{/if}>Terms & Phrases:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_settings_terms}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_settings_terms" value="{$settings.fieldData.term_admin_menu_settings_terms}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_settings_terms}<p>{$settings.fieldFail.term_admin_menu_settings_terms}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_admin_menu_settings_development}class="glm-required"{/if}>Development:</th>
+                            <td {if $settings.fieldFail.term_admin_menu_settings_development}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_admin_menu_settings_development" value="{$settings.fieldData.term_admin_menu_settings_development}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_admin_menu_settings_development}<p>{$settings.fieldFail.term_admin_menu_settings_development}</p>{/if}
+                            </td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+            <tr><td colspan="2"><hr></td></tr>
+            <tr><td colspan="2"><h2>Terms</h2></td></tr>
+            <tr>
+                <th>Member:</th>
+                <td>
+                    <table class="glm-admin-table">
+                        <tr>
+                            <th {if $settings.fieldRequired.term_member}class="glm-required"{/if}>Normal:</th>
+                            <td {if $settings.fieldFail.term_member}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_member" value="{$settings.fieldData.term_member}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_member}<p>{$settings.fieldFail.term_member}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_member_cap}class="glm-required"{/if}>Capitalized:</th>
+                            <td {if $settings.fieldFail.term_member_cap}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_member_cap" value="{$settings.fieldData.term_member_cap}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_member_cap}<p>{$settings.fieldFail.term_member_cap}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_member_plur}class="glm-required"{/if}>Plural:</th>
+                            <td {if $settings.fieldFail.term_member_plur}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_member_plur" value="{$settings.fieldData.term_member_plur}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_member_plur}<p>{$settings.fieldFail.term_member_plur}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_member_plur_cap}class="glm-required"{/if}>Plural Capitalized:</th>
+                            <td {if $settings.fieldFail.term_member_plur_cap}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_member_plur_cap" value="{$settings.fieldData.term_member_plur_cap}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_member_plur_cap}<p>{$settings.fieldFail.term_member_plur_cap}</p>{/if}
+                            </td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+            <tr>
+                <th>Location:</th>
+                <td>
+                    <table class="glm-admin-table">
+                        <tr>
+                            <th {if $settings.fieldRequired.term_location}class="glm-required"{/if}>Normal:</th>
+                            <td {if $settings.fieldFail.term_location}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_location" value="{$settings.fieldData.term_location}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_location}<p>{$settings.fieldFail.term_location}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_location_cap}class="glm-required"{/if}>Capitalized:</th>
+                            <td {if $settings.fieldFail.term_location_cap}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_location_cap" value="{$settings.fieldData.term_location_cap}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_location_cap}<p>{$settings.fieldFail.term_location_cap}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_location_plur}class="glm-required"{/if}>Plural:</th>
+                            <td {if $settings.fieldFail.term_location_plur}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_location_plur" value="{$settings.fieldData.term_location_plur}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_location_plur}<p>{$settings.fieldFail.term_location_plur}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_location_plur_cap}class="glm-required"{/if}>Plural Capitalized:</th>
+                            <td {if $settings.fieldFail.term_location_plur_cap}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_location_plur_cap" value="{$settings.fieldData.term_location_plur_cap}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_location_plur_cap}<p>{$settings.fieldFail.term_location_plur_cap}</p>{/if}
+                            </td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+            <tr>
+                <th>Facility:</th>
+                <td>
+                    <table class="glm-admin-table">
+                        <tr>
+                            <th {if $settings.fieldRequired.term_facility}class="glm-required"{/if}>Normal:</th>
+                            <td {if $settings.fieldFail.term_facility}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_facility" value="{$settings.fieldData.term_facility}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_facility}<p>{$settings.fieldFail.term_facility}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_facility_cap}class="glm-required"{/if}>Capitalized:</th>
+                            <td {if $settings.fieldFail.term_facility_cap}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_facility_cap" value="{$settings.fieldData.term_facility_cap}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_facility_cap}<p>{$settings.fieldFail.term_facility_cap}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_facility_plur}class="glm-required"{/if}>Plural:</th>
+                            <td {if $settings.fieldFail.term_facility_plur}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_facility_plur" value="{$settings.fieldData.term_facility_plur}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_facility_plur}<p>{$settings.fieldFail.term_facility_plur}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_facility_plur_cap}class="glm-required"{/if}>Plural Capitalized:</th>
+                            <td {if $settings.fieldFail.term_facility_plur_cap}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_facility_plur_cap" value="{$settings.fieldData.term_facility_plur_cap}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_facility_plur_cap}<p>{$settings.fieldFail.term_facility_plur_cap}</p>{/if}
+                            </td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+            <tr>
+                <th>Attraction:</th>
+                <td>
+                    <table class="glm-admin-table">
+                        <tr>
+                            <th {if $settings.fieldRequired.term_attraction}class="glm-required"{/if}>Normal:</th>
+                            <td {if $settings.fieldFail.term_attraction}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_attraction" value="{$settings.fieldData.term_attraction}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_attraction}<p>{$settings.fieldFail.term_attraction}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_attraction_cap}class="glm-required"{/if}>Capitalized:</th>
+                            <td {if $settings.fieldFail.term_attraction_cap}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_attraction_cap" value="{$settings.fieldData.term_attraction_cap}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_attraction_cap}<p>{$settings.fieldFail.term_attraction_cap}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_attraction_plur}class="glm-required"{/if}>Plural:</th>
+                            <td {if $settings.fieldFail.term_attraction_plur}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_attraction_plur" value="{$settings.fieldData.term_attraction_plur}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_attraction_plur}<p>{$settings.fieldFail.term_attraction_plur}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_attraction_plur_cap}class="glm-required"{/if}>Plural Capitalized:</th>
+                            <td {if $settings.fieldFail.term_attraction_plur_cap}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_attraction_plur_cap" value="{$settings.fieldData.term_attraction_plur_cap}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_attraction_plur_cap}<p>{$settings.fieldFail.term_attraction_plur_cap}</p>{/if}
+                            </td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+            <tr>
+                <th>Contact:</th>
+                <td>
+                    <table class="glm-admin-table">
+                        <tr>
+                            <th {if $settings.fieldRequired.term_contact}class="glm-required"{/if}>Normal:</th>
+                            <td {if $settings.fieldFail.term_contact}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_contact" value="{$settings.fieldData.term_contact}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_contact}<p>{$settings.fieldFail.term_contact}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_contact_cap}class="glm-required"{/if}>Capitalized:</th>
+                            <td {if $settings.fieldFail.term_contact_cap}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_contact_cap" value="{$settings.fieldData.term_contact_cap}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_contact_cap}<p>{$settings.fieldFail.term_contact_cap}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_contact_plur}class="glm-required"{/if}>Plural:</th>
+                            <td {if $settings.fieldFail.term_contact_plur}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_contact_plur" value="{$settings.fieldData.term_contact_plur}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_contact_plur}<p>{$settings.fieldFail.term_contact_plur}</p>{/if}
+                            </td>
+                        </tr>
+                        <tr>
+                            <th {if $settings.fieldRequired.term_contact_plur_cap}class="glm-required"{/if}>Plural Capitalized:</th>
+                            <td {if $settings.fieldFail.term_contact_plur_cap}class="glm-form-bad-input"{/if}>
+                                <input type="text" name="term_contact_plur_cap" value="{$settings.fieldData.term_contact_plur_cap}" class="glm-form-text-input-medium">
+                                {if $settings.fieldFail.term_contact_plur_cap}<p>{$settings.fieldFail.term_contact_plur_cap}</p>{/if}
+                            </td>
+                        </tr>
+                    </table>
+                </td>
+            </tr>
+        </table>
+        <input type="submit" value="Update Settings" class="button-primary">
+    </form>
+{include file='admin/footer.html'}
diff --git a/views/admin/settings/development.html b/views/admin/settings/development.html
deleted file mode 100644 (file)
index 87ef9dd..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-{include file='admin/settings/header.html'}
-    
-    <p>Note: Customers will not have access to this tab.</p>
-    
-    <h2>Development Activities</h2>
-    
-    <ul>
-        <li>
-            <H3>Import</H3>
-            <ul>
-                <li>
-                    <p>
-                        <a href="{$thisURL}?page={$thisPage}&glm_action=development&option=import_connections">Import data from "Connections" business directory</a>
-
-    {if $importNotice} 
-                        <div class="glm-indent glm-notice">{$importNotice}</div>
-    {/if}
-                    </p>
-
-    {if $import}
-
-                    <h3 style="margin-left: 2em;">Members imported: {$membersImported}</h3>
-                    
-    {else}
-        {if $haveMembers}
-                    <form action="{$thisURL}?page={$thisPage}&glm_action=development&option=import_connections" method="POST">
-                        <div class="glm-item-container">
-                            <b>Default data to use when importing members.</b>
-                            <table>
-                                <tr><td>Default member type: </td><td><input type="text" name="memberType" value="Standard"></td></tr>
-                                <tr><td>Default region name: </td><td><input type="text" name="region" value="Region"></td></tr>
-                            </table>
-                        </div>
-                        <p>
-                            <input class="glm-right" type="submit" value="Click here to import all members not marked as Skip">
-                            <span id="skipAll" class="button-primary">Skip All</span>&nbsp;&nbsp;
-                            <span id="skipNone" class="button-primary">Import All</span>
-                        </p>
-                        <div class="glm-nitice glm-indent">
-                            <ul class="glm-required glm-indent">
-                                <li>*** THIS ACTION WILL FULLY RESET YOUR MEMBERS DATABASE ***</li>
-                                <li>This action does not check for duplicate members!</li>
-                            </ul>
-                        </div>
-                        <input type="hidden" name="import" value="now">
-                        <table class="wp-list-table widefat fixed posts glm-admin-table">
-                            <thead>
-                                <tr>
-                                    <th>Skip</th>
-                                    <th>Name</th>
-                                    <th>Addr Line 1</th>
-                                    <th>Addr Line 2</th>
-                                    <th>Addr Line 3</th>
-                                    <th>City</th>
-                                    <th>State</th>
-                                    <th>ZIP</th>
-                                    <th>Country</th>
-                                    <th>Lat/Lon</th>
-                                </tr>
-                            </thead>
-                            <tbody>
-            {foreach $members as $m}
-                                <tr class="alternate">
-                                    <td><input type="checkbox" name="skip[{$m.id}]" class="skip">{$m.id}</td>
-                                    <td>{$m.organization}</td>
-                {assign var="i" value="0"}                        
-                {foreach $m.addresses as $a}
-                    {if $i++ gt 1}
-                                <tr>
-                                    <td>&nbsp;</td>
-                                    <td>&nbsp;</td>
-                    {/if}                                
-                                    <td>{$a.line_1}</td>
-                                    <td>{$a.line_2}</td>
-                                    <td>{$a.line_3}</td>
-                                    <td>{$a.city}</td>
-                                    <td>{$a.state}</td>
-                                    <td>{$a.zipcode}</td>
-                                    <td>{$a.country}</td>
-                                    <td>{$a.latitude|number_format:3:".":","}/{$a.longitude|number_format:3:".":","}</td>
-                                </tr>
-                {/foreach}
-            {/foreach}               
-                            </tbody>         
-                        </table>
-                    </form>
-        {/if}
-    {/if}
-                </li>
-            </ul>
-            <H3>Database</H3>
-            <ul>
-                <li><a href="{$thisURL}?page={$thisPage}&glm_action=development&option=drop">Drop database tables</a> (WARNING: Destroys all current data)</li>
-                <li><a href="{$thisURL}?page={$thisPage}&glm_action=development&option=create">Create database tables</a></li>
-                <li><a href="{$thisURL}?page={$thisPage}&glm_action=development&option=reset">Fully Reset Database (drop/create)</a> (WARNING: Destroys all current data)</li>
-                <li><a href="{$thisURL}?page={$thisPage}&glm_action=development&option=list">List database tables</a></li>
-            </ul>
-        </li>
-    </ul>
-
-    <div>
-        <h3>Docuemtation and References</h3>    
-        <p><a href="{$baseURL}/lib/GlmDataAbstract/GlmDataAbstract_Programmers_Manual.pdf">Data Abstract Class Documentation</a></p>
-    </div>
-{if $resultMessage}    
-    <div>
-        <hr>
-        {$resultMessage}
-    </div>
-{/if}    
-    
-{if $haveMembers}
-    <script type="text/javascript">
-        jQuery(document).ready(function($) {
-
-               $('#skipAll').click(function(event) {
-                   $('.skip').each(function() { //loop through each checkbox
-                       this.checked = true;  //select all checkboxes with class "checkbox1"              
-                   });
-                   return false;
-           });
-               
-            $('#skipNone').click(function(event) {
-                $('.skip').each(function() { //loop through each checkbox
-                    this.checked = false;  //select all checkboxes with class "checkbox1"              
-                });
-                return false;
-            });
-               
-        });
-    </script>
-{/if}            
-    
-    
-{include file='admin/footer.html'}
diff --git a/views/admin/settings/header.html b/views/admin/settings/header.html
deleted file mode 100644 (file)
index 10ae4a5..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<div class="wrap">
-
-    <h2>{$glmPluginName} Configuration</h2>
-       
-    <h2 class="nav-tab-wrapper">
-        <a href="{$thisURL}?page={$thisPage}&glm_action=index" class="nav-tab{if $thisAction==index}-active{/if}">General Settings</a>
-        <a href="{$thisURL}?page={$thisPage}&glm_action=terms" class="nav-tab{if $thisAction==terms}-active{/if}">Terms and Phrases</a>
-        <a href="{$thisURL}?page={$thisPage}&glm_action=development" class="nav-tab{if $thisAction==development}-active{/if}">Development</a>
-        <a href="{$thisURL}?page={$thisPage}&glm_action=import" class="nav-tab{if $thisAction==import}-active{/if}">Data Import</a>
-    </h2>
-    <div id="glm-admin-content-container">
-    
\ No newline at end of file
diff --git a/views/admin/settings/import.html b/views/admin/settings/import.html
deleted file mode 100644 (file)
index c05d239..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-{include file='admin/settings/header.html'}
-    
-    <p>Note: Customers will not have access to this tab.</p>
-    
-    <h2>Data Import</h2>
-    <p>
-        This process export data from a legacy Gaslight Media Member DB database and imports that data into this plugin. It will only work with a Postgres database.
-        The process will include the following steps.
-    </p>
-    <ol>
-        <li class="glm-ol-selected">Provide information on the legacy database from which we'll be extracting data.</li>
-        <li>Test that database to make sure it's compatible with this process.</li>
-        <li>Read the needed data from the legacy database.</li>
-        <li>Review the extracted data to make sure it looks like the data you want to import.</li>
-        <li>Import the extracted data into is plugin</li>
-        <li>Review resulst</li>
-    </ol>
-    
-
-    <h3>Data Import Step 1</h3>
-{if isset($genError)}    
-    <p>
-        <h3 class="glm-error">Oops!</h3>
-        <p class="glm-error">{$genError}</p>
-    </p>
-{/if}    
-    <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
-        <input type="hidden" name="glm_action" value="import">
-        <input type="hidden" name="option" value="readDatabase">
-        
-        <table class="glm-admin-table">
-        
-            <!-- Debug Settings -->
-        
-            <tr>
-                <th>Database Server: </th>
-                <td>
-                    <input class="glm-form-text-input-medium" type="text" name="dbServer" placeholder="(complete host name or IP address)" value="{if isset($dbServer)}{$dbServer.value}{/if}">
-       {if isset($dbServer)}
-                    <p class="glm-error">{$dbServer.problem}</p>
-       {/if}
-                </td>
-            </tr>
-            <tr>
-                <th>Database Port #: </th>
-                <td>
-                    <input class="glm-form-text-input-short" type="text" name="dbPort" value="{if isset($dbPort)}{$dbPort.value}{else}5432{/if}">
-       {if isset($dbPort)}
-                    <p class="glm-error">{$dbPort.problem}</p>
-       {/if}
-                </td>
-            </tr>
-            <tr>
-                <th>Database Name: </th>
-                <td>
-                    <input class="glm-form-text-input-medium" type="text" name="dbName" placeholder="(name of database}" value="{if isset($dbName)}{$dbName.value}{/if}">
-       {if isset($dbName)}
-                    <p class="glm-error">{$dbName.problem}</p>
-       {/if}
-                </td>
-            </tr>
-            <tr>
-                <th>Database User: </th>
-                <td>
-                    <input class="glm-form-text-input-medium" type="text" name="dbUser" placeholder="(user with read access to this database)" value="{if isset($dbUser)}{$dbUser.value}{/if}">
-        {if isset($dbUser)}
-                    <p class="glm-error">{$dbUser.problem}</p>
-       {/if}
-                </td>
-            </tr>
-            <tr>
-                <th>Base Original Image URL: </th>
-                <td>
-                    <input class="glm-form-text-input-medium-long" type="text" name="dbImageURL" placeholder="(i.e. http://is0.gaslightmedia.com/mountpleasantwow/original/)" value="{if isset($dbImageURL)}{$dbImageURL.value}{/if}">
-        {if isset($dbImageURL)}
-                    <p class="glm-error">{$dbImageURL.problem}</p>
-       {/if}
-                </td>
-            </tr>
-            <tr>
-                <th>Reset Database Before Import: </th>
-                <td>
-                    <input type="checkbox" name="dbReset">
-                    <br>NOTE: Selecting this option will remove all existing data from the Member database!
-                    <br>If you do not select this option, the new data will be added to the database and there will be no attempt to match up imported data with the existing data.
-                </td>
-            </tr>
-        </table>
-        
-        <input type="submit" value="Select Member" class="button-primary">
-        
-    </form>
-            
-    
-{include file='admin/footer.html'}
diff --git a/views/admin/settings/import/readDatabase.html b/views/admin/settings/import/readDatabase.html
deleted file mode 100644 (file)
index 7fe5168..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-{include file='admin/settings/header.html'}
-    
-    <p>Note: Customers will not have access to this tab.</p>
-    
-    <h2>Data Import - Test Database</h2>
-    <ol>
-        <li>Provide information on the legacy database from which we'll be extracting data.</li>
-        <li class="glm-ol-selected">Test database to make sure it's compatible with this process.</li>
-        <li>Read the needed data from the legacy database.</li>
-        <li>Review the extracted data to make sure it looks like the data you want to import.</li>
-        <li>Import the extracted data into is plugin</li>
-        <li>Review resulst</li>
-    </ol>
-    
-
-    <h3>Data Import Step 2</h3>
-{if isset($genError)}    
-    <p>
-        <h3 class="glm-error">Oops!</h3>
-        <p class="glm-error">{$genError}</p>
-    </p>
-{/if}    
-    <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
-        <input type="hidden" name="glm_action" value="import">
-        <input type="hidden" name="option" value="testDatabase">
-        
-        <table class="glm-admin-table">
-        
-            <!-- Debug Settings -->
-        
-            <tr>
-                <th>Database Server: </th>
-                <td>
-                    <input type="text" name="dbServer" placeholder="(complete host name or IP address)">
-                </td>
-            </tr>
-            <tr>
-                <th>Database Name: </th>
-                <td>
-                    <input type="text" name="dbName" placeholder="(name of database}">
-                </td>
-            </tr>
-            <tr>
-                <th>Database User: </th>
-                <td>
-                    <input type="text" name="dbUser" placeholder="(user with read access to this database)">
-                </td>
-            </tr>
-        </table>
-        
-        <input type="submit" value="Select Member" class="button-primary">
-        
-    </form>
-            
-    
-{include file='admin/footer.html'}
diff --git a/views/admin/settings/index.html b/views/admin/settings/index.html
deleted file mode 100644 (file)
index f4826d2..0000000
+++ /dev/null
@@ -1,297 +0,0 @@
-{include file='admin/settings/header.html'}
-    
-    <h1>*** Not using these settings yet! ***</h1>
-    
-    <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
-        <input type="hidden" name="glm_action" value="index">
-        <input type="hidden" name="option" value="submit">
-        
-        <table class="glm-admin-table">
-        
-            <!-- Debug Settings -->
-        
-            <tr><td colspan="2"><h2>Debug Settings</h2></td></tr>
-            <tr>
-                <th>Admin Debug Information:</th>
-                <td>
-                    <input type="checkbox" name="admin_debug"{if $settings.fieldData.admin_debug.value} checked="checked"{/if}>
-                </td>
-            </tr>
-            <tr>
-                <th>Admin Debug Verbose:</th>
-                <td>
-                    <input type="checkbox" name="admin_debug_verbose"{if $settings.fieldData.admin_debug_verbose.value} checked="checked"{/if}>
-                </td>
-            </tr>
-            <tr>
-                <th>Front-End Debug Information:</th>
-                <td>
-                    <input type="checkbox" name="front_debug"{if $settings.fieldData.front_debug.value} checked="checked"{/if}>
-                </td>
-            </tr>
-            <tr>
-                <th>Front-End Debug Verbose:</th>
-                <td>
-                    <input type="checkbox" name="front_debug_verbose"{if $settings.fieldData.front_debug_verbose.value} checked="checked"{/if}>
-                </td>
-            </tr>
-            <tr><td colspan="2"><hr></td></tr>
-            <tr><td colspan="2"><h2>Misc. Settings</h2></td></tr>
-            <tr>
-                <th {if $settings.fieldRequired.google_maps_api_key}class="glm-required"{/if}>Google Maps API Key:</th>
-                <td {if $settings.fieldFail.google_maps_api_key}class="glm-form-bad-input"{/if}>
-                    <input type="text" name="google_maps_api_key" value="{$settings.fieldData.google_maps_api_key}" class="glm-form-text-input-medium">
-                    {if $settings.fieldFail.google_maps_api_key}<p>{$settings.fieldFail.google_maps_api_key}</p>{/if}
-                    <br>Optional: See Google Maps JAVAscript API V3 documentation for information.
-                </td>
-            </tr>
-            <tr>
-                <th {if $settings.fieldRequired.maps_default_lat}class="glm-required"{/if}>Default Map Location:</th>
-                <td {if $settings.fieldFail.maps_default_lat || $settings.fieldFail.maps_default_lon}class="glm-form-bad-input"{/if}>
-                    <label for="maps_default_lat">Lat:</label>
-                    <input type="text" name="maps_default_lat" value="{$settings.fieldData.maps_default_lat}" class="glm-form-text-input-small"><br>
-                    <label for="maps_default_lon">Lon:</label>
-                    <input type="text" name="maps_default_lon" value="{$settings.fieldData.maps_default_lon}" class="glm-form-text-input-small">
-                    <br>Please enter values in decimal degrees.
-                    {if $settings.fieldFail.maps_default_lat}<p>{$settings.fieldFail.maps_default_lat}</p>{/if}
-                    {if $settings.fieldFail.maps_default_lon}<p>{$settings.fieldFail.maps_default_lon}</p>{/if}
-                </td>
-            </tr>
-            <tr>
-                <th {if $settings.fieldRequired.time_zone}class="glm-required"{/if}>Time Zone:</th>
-                <td {if $settings.fieldFail.time_zone}class="glm-form-bad-input"{/if}>
-                    <select name="time_zone">
-        {foreach $timezones as $tz}
-                        <option value="{$tz}"{if $tz == $settings.fieldData.time_zone} selected="selected"{/if}>{$tz}</option>
-        {/foreach}
-                    </select>
-                    {if $settings.fieldFail.time_zone}<p>{$settings.fieldFail.time_zone}</p>{/if}
-                </td>
-            </tr>
-            
-            <!-- Member List Page Options -->
-            
-            <tr><td colspan="2"><hr></td></tr>
-            <tr><td colspan="2"><h2>Member List Page Options</h2></td></tr>
-            <tr>
-                <th>Show Map:</th>
-                <td>
-                    <input type="checkbox" name="list_show_map"{if $settings.fieldData.list_show_map.value} checked="checked"{/if}>
-                </td>
-            </tr>
-            <tr>
-                <th>Map Options:</th>
-                <td>
-                    <table class="glm-admin-table">
-                        <tr><th>Show Member Name as Link to Detail:</th><td><input type="checkbox" name="list_map_show_detaillink"{if $settings.fieldData.list_map_show_detaillink.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Logo:</th><td><input type="checkbox" name="list_map_show_logo"{if $settings.fieldData.list_map_show_logo.value} checked="checked"{/if}></td></tr>
-                        
-                        <tr>
-                            <th>Logo Size:</th>
-                            <td>
-                                <select name="list_map_logo_size">
-                    {foreach from=$settings.fieldData.list_map_logo_size.list item=v}
-                                    <option value="{$v.value}"{if $v.default} selected="selected"{/if}>{$v.name}</option>
-                    {/foreach}
-                                </select>
-                            </td>
-                        </tr>
-                        
-                        <tr><th>Show Description:</th><td><input type="checkbox" name="list_map_show_descr"{if $settings.fieldData.list_map_show_descr.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Short Description:</th><td><input type="checkbox" name="list_map_show_short_descr"{if $settings.fieldData.list_map_show_short_descr.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Address:</th><td><input type="checkbox" name="list_map_show_address"{if $settings.fieldData.list_map_show_address.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Street:</th><td><input type="checkbox" name="list_map_show_street"{if $settings.fieldData.list_map_show_street.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show City, State, ZIP:</th><td><input type="checkbox" name="list_map_show_citystatezip"{if $settings.fieldData.list_map_show_citystatezip.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Country:</th><td><input type="checkbox" name="list_map_show_country"{if $settings.fieldData.list_map_show_country.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Region:</th><td><input type="checkbox" name="list_map_show_region"{if $settings.fieldData.list_map_show_region.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Phone:</th><td><input type="checkbox" name="list_map_show_phone"{if $settings.fieldData.list_map_show_phone.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Toll Free:</th><td><input type="checkbox" name="list_map_show_tollfree"{if $settings.fieldData.list_map_show_tollfree.value} checked="checked"{/if}></td></tr>
-                        <tr>
-                            <th>Show URL:</th>
-                            <td>
-                                <input type="checkbox" name="list_map_show_url"{if $settings.fieldData.list_map_show_url.value} checked="checked"{/if}>
-                                Display URL as a link: <input type="checkbox" name="list_map_show_url_newtarget"{if $settings.fieldData.list_map_show_url_newtarget.value} checked="checked"{/if}>
-                            </td>
-                        </tr>
-                        <tr><th>Show Categories:</th><td><input type="checkbox" name="list_map_show_categories"{if $settings.fieldData.list_map_show_categories.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Credit Cards:</th><td><input type="checkbox" name="list_map_show_creditcards"{if $settings.fieldData.list_map_show_creditcards.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Amenitiies:</th><td><input type="checkbox" name="list_map_show_amenities"{if $settings.fieldData.list_map_show_amenities.value} checked="checked"{/if}></td></tr>
-                    </table>
-                </td>
-            </tr>
-            <tr>
-                <th>Show Search Form:</th>
-                <td>
-                    <input type="checkbox" name="list_show_search"{if $settings.fieldData.list_show_search.value} checked="checked"{/if}>
-                </td>
-            </tr>
-            <tr>
-                <th>Search Form Options:</th>
-                <td>
-                    <table class="glm-admin-table">
-                        <tr><th>Text Search:</th><td><input type="checkbox" name="list_show_search_text"{if $settings.fieldData.list_show_search_text.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Category Search:</th><td><input type="checkbox" name="list_show_search_category"{if $settings.fieldData.list_show_search_category.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Amenities Search:</th><td><input type="checkbox" name="list_show_search_amenities"{if $settings.fieldData.list_show_search_amenities.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Alpha Index:</th><td><input type="checkbox" name="list_show_search_alpha"{if $settings.fieldData.list_show_search_alpha.value} checked="checked"{/if}></td></tr>
-                        
-                    </table>
-                </td>
-            </tr>
-            <tr>
-                <th>Show Member List:</th>
-                <td>
-                    <input type="checkbox" name="list_show_list"{if $settings.fieldData.list_show_list.value} checked="checked"{/if}>
-                </td>
-            </tr>
-            <tr>
-                <th>Member List Options</th>
-                <td>
-                    <table class="glm-admin-table">
-                        <tr><th>Show Member Name as Link to Detail:</th><td><input type="checkbox" name="list_show_detail_link"{if $settings.fieldData.list_show_detail_link.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Member Logo:</th><td><input type="checkbox" name="list_show_logo"{if $settings.fieldData.list_show_logo.value} checked="checked"{/if}></td></tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.list_logo_size}class="glm-required"{/if}>Logo Size:</th>
-                            <td {if $settings.fieldFail.list_logo_size}class="glm-form-bad-input"{/if}>
-                                <select name="list_logo_size">
-                    {foreach from=$settings.fieldData.list_logo_size.list item=v}
-                                    <option value="{$v.value}"{if $v.default} selected="selected"{/if}>{$v.name}</option>
-                    {/foreach}
-                                </select>
-                                {if $settings.fieldFail.list_logo_size}<p>{$settings.fieldFail.list_logo_size}</p>{/if}
-                            </td>
-                        </tr>            
-                        <tr><th>Show Address:</th><td><input type="checkbox" name="list_show_address"{if $settings.fieldData.list_show_address.value} checked="checked"{/if}></td></tr>
-                        </tr>
-                            <tr>
-                            <th>Address Options:</th>
-                            <td>  
-                                <table class="glm-admin-table">
-                                    <tr><th>Show Street:</th><td><input type="checkbox" name="list_show_street"{if $settings.fieldData.list_show_street.value} checked="checked"{/if}></td></tr>
-                                    <tr><th>Show City, State, ZIP:</th><td><input type="checkbox" name="list_show_citystatezip"{if $settings.fieldData.list_show_citystatezip.value} checked="checked"{/if}></td></tr>
-                                    <tr><th>Show Country:</th><td><input type="checkbox" name="list_show_country"{if $settings.fieldData.list_show_country.value} checked="checked"{/if}></td></tr>                      
-                                </table>
-                            </td>
-                        </tr>
-                        <tr><th>Show Region:</th><td><input type="checkbox" name="list_show_region"{if $settings.fieldData.list_show_region.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Description:</th><td><input type="checkbox" name="list_show_descr"{if $settings.fieldData.list_show_descr.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Short Description:</th><td><input type="checkbox" name="list_show_short_descr"{if $settings.fieldData.list_show_short_descr.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Phone Number:</th><td><input type="checkbox" name="list_show_phone"{if $settings.fieldData.list_show_phone.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Toll Free Phone Number:</th><td><input type="checkbox" name="list_show_tollfree"{if $settings.fieldData.list_show_tollfree.value} checked="checked"{/if}></td></tr>
-                        <tr>
-                            <th>Show URL:</th>
-                            <td>
-                                <input type="checkbox" name="list_show_url"{if $settings.fieldData.list_show_url.value} checked="checked"{/if}>
-                                Display URL as a link: <input type="checkbox" name="list_show_url_newtarget"{if $settings.fieldData.list_show_url_newtarget.value} checked="checked"{/if}>
-                            </td>
-                        </tr>
-                        <tr><th>Show Categories:</th><td><input type="checkbox" name="list_show_categories"{if $settings.fieldData.list_show_categories.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Credit Cards Accepted:</th><td><input type="checkbox" name="list_show_creditcards"{if $settings.fieldData.list_show_creditcards.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Amenities:</th><td><input type="checkbox" name="list_show_amenities"{if $settings.fieldData.list_show_amenities.value} checked="checked"{/if}></td></tr>
-                    </table>
-                </td>
-            </tr>
-            
-            <!-- Member Detail Page Options -->
-            
-            <tr><td colspan="2"><hr></td></tr>
-            <tr><td colspan="2"><h2>Member Detail Page Options</h2></td></tr>
-            <tr>
-                <th>Show Map:</th>
-                <td>
-                    <input type="checkbox" name="detail_show_map"{if $settings.fieldData.detail_show_map.value} checked="checked"{/if}>
-                </td>
-            </tr>
-            <tr>
-                <th>Map Options:</th>
-                <td>
-                    <table class="glm-admin-table">
-                        <tr><th>Show Logo:</th><td><input type="checkbox" name="detail_map_show_logo"{if $settings.fieldData.detail_map_show_logo.value} checked="checked"{/if}></td></tr>
-                        <tr>
-                            <th>Logo Size:</th>
-                            <td>
-                                <select name="detail_map_logo_size">
-                    {foreach from=$settings.fieldData.detail_map_logo_size.list item=v}
-                                    <option value="{$v.value}"{if $v.default} selected="selected"{/if}>{$v.name}</option>
-                    {/foreach}
-                                </select>
-                            </td>
-                        </tr>
-                        <tr><th>Show Description:</th><td><input type="checkbox" name="detail_map_show_descr"{if $settings.fieldData.detail_map_show_descr.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Short Description:</th><td><input type="checkbox" name="detail_map_show_short_descr"{if $settings.fieldData.detail_map_show_short_descr.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Address:</th><td><input type="checkbox" name="detail_map_show_address"{if $settings.fieldData.detail_map_show_address.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Street:</th><td><input type="checkbox" name="detail_map_show_street"{if $settings.fieldData.detail_map_show_street.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show City, State, ZIP:</th><td><input type="checkbox" name="detail_map_show_citystatezip"{if $settings.fieldData.detail_map_show_citystatezip.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Country:</th><td><input type="checkbox" name="detail_map_show_country"{if $settings.fieldData.detail_map_show_country.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Region:</th><td><input type="checkbox" name="detail_map_show_region"{if $settings.fieldData.detail_map_show_region.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Phone:</th><td><input type="checkbox" name="detail_map_show_phone"{if $settings.fieldData.detail_map_show_phone.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Toll Free:</th><td><input type="checkbox" name="detail_map_show_tollfree"{if $settings.fieldData.detail_map_show_tollfree.value} checked="checked"{/if}></td></tr>
-                        <tr>
-                            <th>Show URL:</th>
-                            <td>
-                                <input type="checkbox" name="detail_map_show_url"{if $settings.fieldData.detail_map_show_url.value} checked="checked"{/if}>
-                                Display URL as a link: <input type="checkbox" name="detail_map_show_url_newtarget"{if $settings.fieldData.detail_map_show_url_newtarget.value} checked="checked"{/if}>
-                            </td>
-                        </tr>
-                        <tr><th>Show Categories:</th><td><input type="checkbox" name="detail_map_show_categories"{if $settings.fieldData.detail_map_show_categories.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Credit Cards:</th><td><input type="checkbox" name="detail_map_show_creditcards"{if $settings.fieldData.detail_map_show_creditcards.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Amenitiies:</th><td><input type="checkbox" name="detail_map_show_amenities"{if $settings.fieldData.detail_map_show_amenities.value} checked="checked"{/if}></td></tr>
-                    </table>
-                </td>
-            </tr>
-            <tr>
-                <th>Show Directions:</th>
-                <td>
-                    <input type="checkbox" name="detail_show_directions"{if $settings.fieldData.detail_show_directions.value} checked="checked"{/if}>
-                </td>
-            </tr>
-            <tr>
-                <th>Member Detail Options:</th>
-                <td>
-                    <table class="glm-admin-table">
-                        <tr><th>Show Member Logo:</th><td><input type="checkbox" name="detail_show_logo"{if $settings.fieldData.detail_show_logo.value} checked="checked"{/if}></td></tr>
-                       <tr>
-                            <th {if $settings.fieldRequired.detail_logo_size}class="glm-required"{/if}>Logo Size:</th>
-                            <td {if $settings.fieldFail.detail_logo_size}class="glm-form-bad-input"{/if}>
-                                <select name="detail_logo_size">
-                    {foreach from=$settings.fieldData.detail_logo_size.list item=v}
-                                    <option value="{$v.value}"{if $v.default} selected="selected"{/if}>{$v.name}</option>
-                    {/foreach}
-                                </select>
-                                {if $settings.fieldFail.detail_logo_size}<p>{$settings.fieldFail.detail_logo_size}</p>{/if}
-                            </td>
-                        </tr>            
-                        <tr><th>Show Address:</th><td><input type="checkbox" name="detail_show_address"{if $settings.fieldData.detail_show_address.value} checked="checked"{/if}></td></tr>
-                        </tr>
-                            <tr>
-                            <th>Address Options:</th>
-                            <td>  
-                                <table class="glm-admin-table">
-                                    <tr><th>Show Street:</th><td><input type="checkbox" name="detail_show_street"{if $settings.fieldData.detail_show_street.value} checked="checked"{/if}></td></tr>
-                                    <tr><th>Show City, State, ZIP:</th><td><input type="checkbox" name="detail_show_citystatezip"{if $settings.fieldData.detail_show_citystatezip.value} checked="checked"{/if}></td></tr>
-                                    <tr><th>Show Country:</th><td><input type="checkbox" name="detail_show_country"{if $settings.fieldData.detail_show_country.value} checked="checked"{/if}></td></tr>                      
-                                </table>
-                            </td>
-                        </tr>
-                        <tr><th>Show Region:</th><td><input type="checkbox" name="detail_show_region"{if $settings.fieldData.detail_show_region.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Description:</th><td><input type="checkbox" name="detail_show_descr"{if $settings.fieldData.detail_show_descr.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Short Description:</th><td><input type="checkbox" name="detail_show_short_descr"{if $settings.fieldData.detail_show_short_descr.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Phone Number:</th><td><input type="checkbox" name="detail_show_phone"{if $settings.fieldData.detail_show_phone.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Toll Free Phone Number:</th><td><input type="checkbox" name="detail_show_tollfree"{if $settings.fieldData.detail_show_tollfree.value} checked="checked"{/if}></td></tr>
-                        <tr>
-                            <th>Show URL:</th>
-                            <td>
-                                <input type="checkbox" name="detail_show_url"{if $settings.fieldData.detail_show_url.value} checked="checked"{/if}>
-                                Display URL as a link: <input type="checkbox" name="detail_show_url_newtarget"{if $settings.fieldData.detail_show_url_newtarget.value} checked="checked"{/if}>
-                            </td>
-                        </tr>
-                        <tr><th>Show Categories:</th><td><input type="checkbox" name="detail_show_categories"{if $settings.fieldData.detail_show_categories.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Credit Cards Accepted:</th><td><input type="checkbox" name="detail_show_creditcards"{if $settings.fieldData.detail_show_creditcards.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Amenities:</th><td><input type="checkbox" name="detail_show_amenities"{if $settings.fieldData.detail_show_amenities.value} checked="checked"{/if}></td></tr>
-                        <tr><th>Show Image Gallery:</th><td><input type="checkbox" name="detail_show_imagegallery"{if $settings.fieldData.detail_show_imagegallery.value} checked="checked"{/if}></td></tr>
-                    </table>
-                </td>
-            </tr>
-        </table>
-        <input type="submit" value="Update Settings" class="button-primary">
-    </form>
-{include file='admin/footer.html'}
diff --git a/views/admin/settings/terms.html b/views/admin/settings/terms.html
deleted file mode 100644 (file)
index 5b239b0..0000000
+++ /dev/null
@@ -1,376 +0,0 @@
-{include file='admin/settings/header.html'}
-    
-    <h1>*** Not using these settings yet! ***</h1>
-    
-    <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
-        <input type="hidden" name="glm_action" value="terms">
-        <input type="hidden" name="option" value="submit">
-        
-        <table class="glm-admin-table">
-        
-            <!-- Admin Menus -->
-        
-            <tr><td colspan="2"><h2>Admin Menu and Tab Names</h2></td></tr>
-            <tr>
-                <th {if $settings.fieldRequired.term_admin_menu_members}class="glm-required"{/if}>Members Menu:</th>
-                <td {if $settings.fieldFail.term_admin_menu_members}class="glm-form-bad-input"{/if}>
-                    <input type="text" name="term_admin_menu_members" value="{$settings.fieldData.term_admin_menu_members}" class="glm-form-text-input-medium">
-                    {if $settings.fieldFail.term_admin_menu_members}<p>{$settings.fieldFail.term_admin_menu_members}</p>{/if}
-                </td>
-            </tr>
-            <tr>
-                <th>Members Menu Tabs:</th>
-                <td>
-                    <table class="glm-admin-table">
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_members_dashboard}class="glm-required"{/if}>Main Dashboard:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_members_dashboard}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_members_dashboard" value="{$settings.fieldData.term_admin_menu_members_dashboard}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_members_dashboard}<p>{$settings.fieldFail.term_admin_menu_members_dashboard}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_members_list}class="glm-required"{/if}>Member List:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_members_list}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_members_list" value="{$settings.fieldData.term_admin_menu_members_list}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_members_list}<p>{$settings.fieldFail.term_admin_menu_members_list}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_members_reports}class="glm-required"{/if}>Reports:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_members_reports}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_members_reports" value="{$settings.fieldData.term_admin_menu_members_reports}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_members_reports}<p>{$settings.fieldFail.term_admin_menu_members_reports}</p>{/if}
-                            </td>
-                        </tr>
-                    </table>
-                </td>
-            </tr>
-            <tr>
-                <th {if $settings.fieldRequired.term_admin_menu_member}class="glm-required"{/if}>Member Menu:</th>
-                <td {if $settings.fieldFail.term_admin_menu_member}class="glm-form-bad-input"{/if}>
-                    <input type="text" name="term_admin_menu_member" value="{$settings.fieldData.term_admin_menu_member}" class="glm-form-text-input-medium">
-                    {if $settings.fieldFail.term_admin_menu_member}<p>{$settings.fieldFail.term_admin_menu_member}</p>{/if}
-                </td>
-            </tr>
-            <tr>
-                <th>Member Menu Tabs:</th>
-                <td>
-                    <table class="glm-admin-table">
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_member_dashboard}class="glm-required"{/if}>Member Dashboard:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_member_dashboard}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_member_dashboard" value="{$settings.fieldData.term_admin_menu_member_dashboard}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_member_dashboard}<p>{$settings.fieldFail.term_admin_menu_member_dashboard}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_member_info}class="glm-required"{/if}>Member Info:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_member_info}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_member_info" value="{$settings.fieldData.term_admin_menu_member_info}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_member_info}<p>{$settings.fieldFail.term_admin_menu_member_info}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_member_locations}class="glm-required"{/if}>Locations:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_member_locations}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_member_locations" value="{$settings.fieldData.term_admin_menu_member_locations}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_member_locations}<p>{$settings.fieldFail.term_admin_menu_member_locations}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_member_facilities}class="glm-required"{/if}>Facilities:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_member_facilities}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_member_facilities" value="{$settings.fieldData.term_admin_menu_member_facilities}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_member_facilities}<p>{$settings.fieldFail.term_admin_menu_member_facilities}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_member_attractions}class="glm-required"{/if}>Attractions:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_member_attractions}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_member_attractions" value="{$settings.fieldData.term_admin_menu_member_attractions}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_member_attractions}<p>{$settings.fieldFail.term_admin_menu_member_attractions}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_member_contacts}class="glm-required"{/if}>Contacts:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_member_contacts}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_member_contacts" value="{$settings.fieldData.term_admin_menu_member_contacts}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_member_contacts}<p>{$settings.fieldFail.term_admin_menu_member_contacts}</p>{/if}
-                            </td>
-                        </tr>
-                    </table>
-                </td>
-            </tr>
-            <tr>
-                <th {if $settings.fieldRequired.term_admin_menu_configure}class="glm-required"{/if}>Configure Menu:</th>
-                <td {if $settings.fieldFail.term_admin_menu_configure}class="glm-form-bad-input"{/if}>
-                    <input type="text" name="term_admin_menu_configure" value="{$settings.fieldData.term_admin_menu_configure}" class="glm-form-text-input-medium">
-                    {if $settings.fieldFail.term_admin_menu_configure}<p>{$settings.fieldFail.term_admin_menu_configure}</p>{/if}
-                </td>
-            </tr>
-            <tr>
-                <th>Configure Menu Tabs:</th>
-                <td>
-                    <table class="glm-admin-table">
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_configure_member_types}class="glm-required"{/if}>Member Types:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_configure_member_types}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_configure_member_types" value="{$settings.fieldData.term_admin_menu_configure_member_types}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_configure_member_types}<p>{$settings.fieldFail.term_admin_menu_configure_member_types}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_configure_member_cats}class="glm-required"{/if}>Member Categories:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_configure_member_cats}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_configure_member_cats" value="{$settings.fieldData.term_admin_menu_configure_member_cats}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_configure_member_cats}<p>{$settings.fieldFail.term_admin_menu_configure_member_cats}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_configure_accom_types}class="glm-required"{/if}>Accommodation Types:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_configure_accom_types}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_configure_accom_types" value="{$settings.fieldData.term_admin_menu_configure_accom_types}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_configure_accom_types}<p>{$settings.fieldFail.term_admin_menu_configure_accom_types}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_configure_amenities}class="glm-required"{/if}>Amenities:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_configure_amenities}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_configure_amenities" value="{$settings.fieldData.term_admin_menu_configure_amenities}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_configure_amenities}<p>{$settings.fieldFail.term_admin_menu_configure_amenities}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_configure_cities}class="glm-required"{/if}>Cities:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_configure_cities}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_configure_cities" value="{$settings.fieldData.term_admin_menu_configure_cities}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_configure_cities}<p>{$settings.fieldFail.term_admin_menu_configure_cities}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_configure_regions}class="glm-required"{/if}>Regions:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_configure_regions}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_configure_regions" value="{$settings.fieldData.term_admin_menu_configure_regions}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_configure_regions}<p>{$settings.fieldFail.term_admin_menu_configure_regions}</p>{/if}
-                            </td>
-                        </tr>
-                    </table>
-                </td>
-            </tr>
-            <tr>
-                <th {if $settings.fieldRequired.term_admin_menu_settings}class="glm-required"{/if}>Settings Menu:</th>
-                <td {if $settings.fieldFail.term_admin_menu_settings}class="glm-form-bad-input"{/if}>
-                    <input type="text" name="term_admin_menu_settings" value="{$settings.fieldData.term_admin_menu_settings}" class="glm-form-text-input-medium">
-                    {if $settings.fieldFail.term_admin_menu_settings}<p>{$settings.fieldFail.term_admin_menu_settings}</p>{/if}
-                </td>
-            </tr>
-            <tr>
-                <th>Settings Menu Tabs:</th>
-                <td>
-                    <table class="glm-admin-table">
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_settings_general}class="glm-required"{/if}>General Settings:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_settings_general}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_settings_general" value="{$settings.fieldData.term_admin_menu_settings_general}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_settings_general}<p>{$settings.fieldFail.term_admin_menu_settings_general}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_settings_terms}class="glm-required"{/if}>Terms & Phrases:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_settings_terms}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_settings_terms" value="{$settings.fieldData.term_admin_menu_settings_terms}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_settings_terms}<p>{$settings.fieldFail.term_admin_menu_settings_terms}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_admin_menu_settings_development}class="glm-required"{/if}>Development:</th>
-                            <td {if $settings.fieldFail.term_admin_menu_settings_development}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_admin_menu_settings_development" value="{$settings.fieldData.term_admin_menu_settings_development}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_admin_menu_settings_development}<p>{$settings.fieldFail.term_admin_menu_settings_development}</p>{/if}
-                            </td>
-                        </tr>
-                    </table>
-                </td>
-            </tr>
-            <tr><td colspan="2"><hr></td></tr>
-            <tr><td colspan="2"><h2>Terms</h2></td></tr>
-            <tr>
-                <th>Member:</th>
-                <td>
-                    <table class="glm-admin-table">
-                        <tr>
-                            <th {if $settings.fieldRequired.term_member}class="glm-required"{/if}>Normal:</th>
-                            <td {if $settings.fieldFail.term_member}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_member" value="{$settings.fieldData.term_member}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_member}<p>{$settings.fieldFail.term_member}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_member_cap}class="glm-required"{/if}>Capitalized:</th>
-                            <td {if $settings.fieldFail.term_member_cap}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_member_cap" value="{$settings.fieldData.term_member_cap}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_member_cap}<p>{$settings.fieldFail.term_member_cap}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_member_plur}class="glm-required"{/if}>Plural:</th>
-                            <td {if $settings.fieldFail.term_member_plur}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_member_plur" value="{$settings.fieldData.term_member_plur}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_member_plur}<p>{$settings.fieldFail.term_member_plur}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_member_plur_cap}class="glm-required"{/if}>Plural Capitalized:</th>
-                            <td {if $settings.fieldFail.term_member_plur_cap}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_member_plur_cap" value="{$settings.fieldData.term_member_plur_cap}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_member_plur_cap}<p>{$settings.fieldFail.term_member_plur_cap}</p>{/if}
-                            </td>
-                        </tr>
-                    </table>
-                </td>
-            </tr>
-            <tr>
-                <th>Location:</th>
-                <td>
-                    <table class="glm-admin-table">
-                        <tr>
-                            <th {if $settings.fieldRequired.term_location}class="glm-required"{/if}>Normal:</th>
-                            <td {if $settings.fieldFail.term_location}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_location" value="{$settings.fieldData.term_location}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_location}<p>{$settings.fieldFail.term_location}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_location_cap}class="glm-required"{/if}>Capitalized:</th>
-                            <td {if $settings.fieldFail.term_location_cap}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_location_cap" value="{$settings.fieldData.term_location_cap}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_location_cap}<p>{$settings.fieldFail.term_location_cap}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_location_plur}class="glm-required"{/if}>Plural:</th>
-                            <td {if $settings.fieldFail.term_location_plur}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_location_plur" value="{$settings.fieldData.term_location_plur}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_location_plur}<p>{$settings.fieldFail.term_location_plur}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_location_plur_cap}class="glm-required"{/if}>Plural Capitalized:</th>
-                            <td {if $settings.fieldFail.term_location_plur_cap}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_location_plur_cap" value="{$settings.fieldData.term_location_plur_cap}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_location_plur_cap}<p>{$settings.fieldFail.term_location_plur_cap}</p>{/if}
-                            </td>
-                        </tr>
-                    </table>
-                </td>
-            </tr>
-            <tr>
-                <th>Facility:</th>
-                <td>
-                    <table class="glm-admin-table">
-                        <tr>
-                            <th {if $settings.fieldRequired.term_facility}class="glm-required"{/if}>Normal:</th>
-                            <td {if $settings.fieldFail.term_facility}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_facility" value="{$settings.fieldData.term_facility}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_facility}<p>{$settings.fieldFail.term_facility}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_facility_cap}class="glm-required"{/if}>Capitalized:</th>
-                            <td {if $settings.fieldFail.term_facility_cap}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_facility_cap" value="{$settings.fieldData.term_facility_cap}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_facility_cap}<p>{$settings.fieldFail.term_facility_cap}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_facility_plur}class="glm-required"{/if}>Plural:</th>
-                            <td {if $settings.fieldFail.term_facility_plur}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_facility_plur" value="{$settings.fieldData.term_facility_plur}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_facility_plur}<p>{$settings.fieldFail.term_facility_plur}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_facility_plur_cap}class="glm-required"{/if}>Plural Capitalized:</th>
-                            <td {if $settings.fieldFail.term_facility_plur_cap}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_facility_plur_cap" value="{$settings.fieldData.term_facility_plur_cap}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_facility_plur_cap}<p>{$settings.fieldFail.term_facility_plur_cap}</p>{/if}
-                            </td>
-                        </tr>
-                    </table>
-                </td>
-            </tr>
-            <tr>
-                <th>Attraction:</th>
-                <td>
-                    <table class="glm-admin-table">
-                        <tr>
-                            <th {if $settings.fieldRequired.term_attraction}class="glm-required"{/if}>Normal:</th>
-                            <td {if $settings.fieldFail.term_attraction}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_attraction" value="{$settings.fieldData.term_attraction}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_attraction}<p>{$settings.fieldFail.term_attraction}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_attraction_cap}class="glm-required"{/if}>Capitalized:</th>
-                            <td {if $settings.fieldFail.term_attraction_cap}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_attraction_cap" value="{$settings.fieldData.term_attraction_cap}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_attraction_cap}<p>{$settings.fieldFail.term_attraction_cap}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_attraction_plur}class="glm-required"{/if}>Plural:</th>
-                            <td {if $settings.fieldFail.term_attraction_plur}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_attraction_plur" value="{$settings.fieldData.term_attraction_plur}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_attraction_plur}<p>{$settings.fieldFail.term_attraction_plur}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_attraction_plur_cap}class="glm-required"{/if}>Plural Capitalized:</th>
-                            <td {if $settings.fieldFail.term_attraction_plur_cap}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_attraction_plur_cap" value="{$settings.fieldData.term_attraction_plur_cap}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_attraction_plur_cap}<p>{$settings.fieldFail.term_attraction_plur_cap}</p>{/if}
-                            </td>
-                        </tr>
-                    </table>
-                </td>
-            </tr>
-            <tr>
-                <th>Contact:</th>
-                <td>
-                    <table class="glm-admin-table">
-                        <tr>
-                            <th {if $settings.fieldRequired.term_contact}class="glm-required"{/if}>Normal:</th>
-                            <td {if $settings.fieldFail.term_contact}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_contact" value="{$settings.fieldData.term_contact}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_contact}<p>{$settings.fieldFail.term_contact}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_contact_cap}class="glm-required"{/if}>Capitalized:</th>
-                            <td {if $settings.fieldFail.term_contact_cap}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_contact_cap" value="{$settings.fieldData.term_contact_cap}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_contact_cap}<p>{$settings.fieldFail.term_contact_cap}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_contact_plur}class="glm-required"{/if}>Plural:</th>
-                            <td {if $settings.fieldFail.term_contact_plur}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_contact_plur" value="{$settings.fieldData.term_contact_plur}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_contact_plur}<p>{$settings.fieldFail.term_contact_plur}</p>{/if}
-                            </td>
-                        </tr>
-                        <tr>
-                            <th {if $settings.fieldRequired.term_contact_plur_cap}class="glm-required"{/if}>Plural Capitalized:</th>
-                            <td {if $settings.fieldFail.term_contact_plur_cap}class="glm-form-bad-input"{/if}>
-                                <input type="text" name="term_contact_plur_cap" value="{$settings.fieldData.term_contact_plur_cap}" class="glm-form-text-input-medium">
-                                {if $settings.fieldFail.term_contact_plur_cap}<p>{$settings.fieldFail.term_contact_plur_cap}</p>{/if}
-                            </td>
-                        </tr>
-                    </table>
-                </td>
-            </tr>
-        </table>
-        <input type="submit" value="Update Settings" class="button-primary">
-    </form>
-{include file='admin/footer.html'}