* @return void
* @access public
*/
- public function addNotice ($message, $title = false)
+ public static function addNotice ($message, $title = false)
{
$notices = get_option('glmMembersAdminNotices');
$GLOBALS['glmMembersAdminValidActions'] = array(
'members' => array(
- 'index',
- 'display',
- 'edit',
- 'add',
- 'delete'
+ 'index', // member list
+ 'reports',
+ 'other'
),
+ 'member' => array(
+ 'index', // Member Dashboard
+ 'member',
+ 'locations',
+ 'facilities',
+ 'activities',
+ 'accommodations'
+ )
+ ,
'configure' => array(
'index',
'cities',
'regions'
),
'error' => array(
+ 'index',
'badAction'
)
);
}
// Add hooks to WordPress
- add_action('admin_menu', array(
- $this,
- 'configureMenus'
- ));
+ add_action('admin_menu',
+ array(
+ $this,
+ 'configureMenus'
+ ));
// Add admin scripts and css
add_action('admin_enqueue_scripts',
{
wp_enqueue_media();
wp_register_script('glm-members-admin-js',
- GLM_MEMBERS_PLUGIN_URL . 'js/admin.js', array(
+ GLM_MEMBERS_PLUGIN_URL . 'js/admin.js',
+ array(
'jquery'
));
wp_enqueue_script('glm-members-admin-js');
'glmMembersAdminMenuMembers'
));
+ add_submenu_page('glm-members-admin-menu-members', 'Member Information',
+ 'Member', 'glm_members_member', 'glm-members-admin-menu-member',
+ array(
+ $this,
+ 'glmMembersAdminMenuMember'
+ ));
+
add_submenu_page('glm-members-admin-menu-members',
'Configure Members Database', 'Configure',
'glm_members_configure', 'glm-members-admin-menu-configure',
}
// Add Sub Menu Items
+ public function glmMembersAdminMenuMember ()
+ {
+ $this->controller('member');
+ }
+
public function glmMembersAdminMenuConfigure ()
{
$this->controller('configure');
*/
public function controller ($menuItem)
{
+ $errorMsg = '';
/*
* Determine model to execute
}
}
- // Loop as long as there's a model redirect.
+ // Loop till we have a final action
+ $loopCheck = 0;
do {
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+ $this->addNotice("<b>Requested Action:</b> Menu item = $menuItem, Action = $action");
+ }
+
+ $modelRedirect = false;
+
+ // Verify that we have the requested menu item in the valid actions
+ if (!isset($GLOBALS['glmMembersAdminValidActions'][$menuItem])) {
+
+ $modelRedirect = true;
+ $menuItem = 'error';
+ $action = 'index';
+ $errorMsg .= "<b>Model doesn't exist:</b> ".$modelName;
+
+ }
+
// Verify Menu item and action using array at top of this file
- if (! in_array($action,
- $GLOBALS['glmMembersAdminValidActions'][$menuItem])) {
+ if (! isset($GLOBALS['glmMembersAdminValidActions'][$menuItem]) ||
+ ! in_array($action,
+ $GLOBALS['glmMembersAdminValidActions'][$menuItem])) {
$menuItem = 'error';
$action = 'badAction';
}
* Execute the selected model
*/
- // Build model and path and class names and load the model
+ // Build model and path and class names
$modelName = GLM_MEMBERS_PLUGIN_DIR . '/models/admin/' . $menuItem .
'/' . $action . '.php';
$className = 'GlmMembersAdmin_' . $menuItem . '_' . $action;
- require_once ($modelName);
- // Instantiate the model and ask it to perform the work
- $model = new $className($this->wpdb, $this->config);
- $results = $model->modelAction();
+ // If model file doesn't exist - we have an error
+ if (!file_exists($modelName)) {
- // Check if there's been a model redirect request
- $modelRedirect = false;
- if ($results['modelRedirect']) {
+ $modelRedirect = true;
+ $menuItem = 'error';
+ $action = 'index';
+ $errorMsg .= "<b>Model doesn't exist:</b> ".$modelName;
- // Set the new model action
- $action = $results['modelRedirect'];
+ // Otherwise, load and run the model
+ } else {
- // Check if there's also a menu item change
- if ($results['menuItemRedirect']) {
- $menuItem = $results['menuItemRedirect'];
- }
+ // Load the model file
+ require_once ($modelName);
- $modelRedirect = true;
+ // check for an invalid model class name
+ if (!class_exists($className)) {
+
+ $modelRedirect = true;
+ $menuItem = 'error';
+ $action = 'index';
+ $errorMsg .= "<b>Model class doesn't exist:</b> ".$className;
+
+ } else {
+
+ // Instantiate the model and ask it to perform the work
+ $model = new $className($this->wpdb, $this->config);
+ $results = $model->modelAction();
+
+ // Check if there's been a model redirect request
+ if ($results['modelRedirect']) {
+
+ // Set the new model action
+ $action = $results['modelRedirect'];
+
+ // Check if there's also a menu item change
+ if ($results['menuItemRedirect']) {
+ $menuItem = $results['menuItemRedirect'];
+ }
+
+ $modelRedirect = true;
+ }
+
+ // Get the specified view file
+ $view = false;
+ if (isset($results['view'])) {
+ $view = $results['view'];
+ }
+
+ // Check for invalid or missing view file
+ if (!$view || !is_file(GLM_MEMBERS_PLUGIN_DIR . '/views/'.$view)) {
+ $modelRedirect = true;
+ $menuItem = 'error';
+ $action = 'index';
+ $errorMsg .= "<b>Bad or missing view file:</b> ".$view;
+ }
+
+ } // model class exists
+ }
+
+ // This is just a sanity check on this loop to keep it from getting out of control
+ if (++$loopCheck > 10) {
+ die('<h1>Serious failure looping on model load in "controllers/admin.php".</h1>');
+ }
+
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG && $modelRedirect) {
+ $this->addNotice('<b>Redirecting...</b>');
}
// Loop again if there's a model redirect
}
}
+ $smarty->templateAssign ( 'thisAction', $action);
+
+
+ // If there's an error message, add that also
+ if ($errorMsg != '') {
+ $smarty->templateAssign('errorMsg', $errorMsg);
+ }
+
// If view debug has been requested
if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+ glmMembersAdmin::addNotice("<b>Template Data</b><br> $view");
+
$x = $smarty->template->getTemplateVars();
$templateVars = '<pre>' . print_r($x, 1) . '</pre>';
glmMembersAdmin::addNotice($templateVars, 'Template Parameters');
background-color: #fff;
}
+/* Admin Tabs */
+.nav-tab {
+ font-size: 15px !important;
+ font-weight: bold;
+}
+.nav-tab-active {
+ font-size: 15px !important;
+ font-weight: bold;
+ text-decoration: none;
+ border: 2px #ccc solid;
+ border-bottom: 0px;
+ padding: 6px 10px 8px 10px;
+ background-color: #f8f8f8;
+}
+.disabled {
+ pointer-events: none;
+ cursor: default;
+ color: #ccc;
+}
+
/* Admin Forms */
.glm-form-bad-input {
background: #FFaBa9;
// Debug Options
define('GLM_MEMBERS_PLUGIN_ADMIN_DEBUG', true);
+define('GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE', false);
// Plugin Versions
define('GLM_MEMBERS_PLUGIN_VERSION', 0.1);
}
// Check if there's admin notices for output
$notices = get_option('glmMembersAdminNotices');
-if (is_admin() && $notices) {
+if (is_admin() && $notices && !GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
// Add action to output the notices
add_action('admin_notices','glmMembersAdminNotices');
}
public function processOutputData($data, $op = 'l', $forEdit = false, $id = false, $idfield = 'id')
{
+ if ($forEdit) {
+ $fieldRequired = array();
+ $fieldFail = array();
+ }
+
// For each possible field
reset($this->fields);
while (list($k, $v) = each($this->fields )) {
$out = $this->{$type.'Output'}($v, $d, $forEdit, $id, $idfield, $op);
$data[$as] = $out;
+
+ if($forEdit) {
+ $fieldRequired[$as] = (isset($v['required']) && $v['required']);
+ $fieldFail[$as] = false;
+ }
}
}
+ if ($forEdit) {
+ return array(
+ 'fieldData' => $data,
+ 'fieldRequired' => $fieldRequired,
+ 'fieldFail' => $fieldFail
+ );
+ }
return $data;
}
FROM $this->table
WHERE $where;";
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ glmMembersAdmin::addNotice("<pre>".print_r($sql,1)."</pre>", "DataAbstract - getStats() query");
+ }
+
$stats = $this->wpdb->get_results($sql, ARRAY_A);
return $stats['count'];
";
}
-//echo "<pre>$sql</pre>";
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ glmMembersAdmin::addNotice("<pre>".print_r($sql,1)."</pre>", "DataAbstract - getList() query");
+ }
+
+ //echo "<pre>$sql</pre>";
$list = $this->wpdb->get_results($sql, ARRAY_A);
if (count($list) == 0)
$where
;";
- $detail = $this->wpdb->get_results($sql, ARRAY_A);
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ glmMembersAdmin::addNotice("<pre>".print_r($sql,1)."</pre>", "DataAbstract - getEntry() query");
+ }
+
+ $detail = $this->wpdb->get_row($sql, ARRAY_A);
// If nothing was found, simply return false
if ($detail == false) {
$detail = $this->wpdb->get_row($sql, ARRAY_A);
$r['insertedID'] = $detail['currval'];
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ glmMembersAdmin::addNotice("<pre>".print_r($sql,1)."</pre>", "DataAbstract - insertEntry() query");
+ }
+
// Get the data again for output
$r['fieldData'] = $this->getEntry($r['insertedID']);
WHERE $idfield = $id
;";
- $detail = $this->wpdb->get_results($sql, ARRAY_A);
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ glmMembersAdmin::addNotice("<pre>".print_r($sql,1)."</pre>", "DataAbstract - editEntry() query");
+ }
+
+ $detail = $this->wpdb->get_row($sql, ARRAY_A);
// Process individual fields
$detail = $this->processOutputData($detail, 'e', true, $id, $idfield);
WHERE $idField = $id;
";
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ glmMembersAdmin::addNotice("<pre>".print_r($sql,1)."</pre>", "DataAbstract - updateEntry() query");
+ }
+
// Now store the field data
$this->wpdb->query($sql, ARRAY_A);
WHERE $idField = $id;
";
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ glmMembersAdmin::addNotice("<pre>".print_r($sql,1)."</pre>", "DataAbstract - deleteEntry() query");
+ }
+
// Assume things will go fine
try {
$this->wpdb->query($sql, ARRAY_A);
$this->templateAssign ( 'adminDebug', GLM_MEMBERS_PLUGIN_ADMIN_DEBUG);
$this->templateAssign ( 'thisURL', $scriptURL );
$this->templateAssign ( 'thisPage', $_REQUEST['page']);
- $this->templateAssign ( 'thisAction', $action);
$this->templateAssign ( 'glmPluginName', GLM_MEMBERS_PLUGIN_NAME );
$this->templateAssign ( 'thisYear', date ( 'Y' ) );
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-12 20:28:09
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-14 22:12:00
compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/error/badAction.html" */ ?>
<?php /*%%SmartyHeaderCode:210264866954b42dd4bbc715-16113482%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'06926788f51c1a5a54be2a368556f9c37e2780da' =>
array (
0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/error/badAction.html',
- 1 => 1421094485,
+ 1 => 1421264558,
2 => 'file',
),
),
),
'version' => 'Smarty-3.1.21-dev',
'unifunc' => 'content_54b42dd4c09430_68496846',
+ 'variables' =>
+ array (
+ 'errorMsg' => 0,
+ ),
'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_54b42dd4c09430_68496846')) {function content_54b42dd4c09430_68496846($_smarty_tpl) {?><div class="wrap">
<h2>Sorry, we've had an error.</h2>
<p><b>Error: </b>: An invalid action has been specified.</p>
+
+ <?php if ($_smarty_tpl->tpl_vars['errorMsg']->value) {?><p><?php echo $_smarty_tpl->tpl_vars['errorMsg']->value;?>
+</p><?php }?>
<p>Please try again. If you still get the same error, contact Gaslight Media at 231-487-0692 for assistance.</p>
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-13 07:50:35
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-14 18:10:53
compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/members/index.html" */ ?>
<?php /*%%SmartyHeaderCode:206413157254b42f2535e168-27938613%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'081a36d97cdf30d438a1e104c26a275acc180da0' =>
array (
0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/members/index.html',
- 1 => 1421135080,
+ 1 => 1421259050,
2 => 'file',
),
),
'haveMembers' => 0,
'members' => 0,
'i' => 0,
+ 'thisURL' => 0,
'm' => 0,
),
'has_nocache_code' => false,
<?php } else { ?>
<tr class="alternate">
<?php }?>
- <td><?php echo $_smarty_tpl->tpl_vars['m']->value['name'];?>
-</td>
+ <td>
+ <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=glm-members-admin-menu-member&glm_action=index&member_id=<?php echo $_smarty_tpl->tpl_vars['m']->value['id'];?>
+"><?php echo $_smarty_tpl->tpl_vars['m']->value['name'];?>
+</a>
+ </td>
<td>
(nothing here yet)
</td>
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-13 07:00:40
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-14 21:33:37
compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/members/header.html" */ ?>
<?php /*%%SmartyHeaderCode:81165772654b46f32298020-09293550%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'15f83071407dddb0b3c23ae1a70b66cefbd681db' =>
array (
0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/members/header.html',
- 1 => 1421132420,
+ 1 => 1421271213,
2 => 'file',
),
),
'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_54b46f322c0910_93147809')) {function content_54b46f322c0910_93147809($_smarty_tpl) {?><div class="wrap">
-
+ <h2>Your Members</h2>
<h2 class="nav-tab-wrapper">
<a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
-&glm_action=index" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='index') {?>-active<?php }?>">List Members</a>
+&glm_action=index" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='index') {?>-active<?php }?>">List of Members</a>
<a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
-&glm_action=add" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='add') {?>-active<?php }?>">Add New Member</a>
+&glm_action=reports" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='add') {?>-active<?php }?>">Reports</a>
<a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
-&glm_action=other" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='edit') {?>-active<?php }?>">Edit Member</a>
+&glm_action=other" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='edit') {?>-active<?php } else { ?> disabled<?php }?>">Or Something - perahps mailing stuff?</a>
</h2>
<div id="glm-admin-content-container">
<?php }} ?>
--- /dev/null
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-14 21:06:49
+ compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/member/index.html" */ ?>
+<?php /*%%SmartyHeaderCode:163797333154b6ac77c986e8-14104892%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+$_valid = $_smarty_tpl->decodeProperties(array (
+ 'file_dependency' =>
+ array (
+ '1be35689c5d30d774f40ebc45e387f5f95c45e90' =>
+ array (
+ 0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/member/index.html',
+ 1 => 1421269603,
+ 2 => 'file',
+ ),
+ ),
+ 'nocache_hash' => '163797333154b6ac77c986e8-14104892',
+ 'function' =>
+ array (
+ ),
+ 'version' => 'Smarty-3.1.21-dev',
+ 'unifunc' => 'content_54b6ac77cbe666_15018258',
+ 'variables' =>
+ array (
+ 'member' => 0,
+ ),
+ 'has_nocache_code' => false,
+),false); /*/%%SmartyHeaderCode%%*/?>
+<?php if ($_valid && !is_callable('content_54b6ac77cbe666_15018258')) {function content_54b6ac77cbe666_15018258($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/member/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
+
+
+ <h2><?php echo $_smarty_tpl->tpl_vars['member']->value['name'];?>
+</h2>
+ <table>
+ <tr><th>Member Name:</th><td><?php echo $_smarty_tpl->tpl_vars['member']->value['name'];?>
+</tr>
+
+ </table>
+
+<?php echo $_smarty_tpl->getSubTemplate ('admin/footer.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
+
+<?php }} ?>
--- /dev/null
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-14 21:52:27
+ compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/member/member.html" */ ?>
+<?php /*%%SmartyHeaderCode:172471491954b6e51b1368b6-20693769%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+$_valid = $_smarty_tpl->decodeProperties(array (
+ 'file_dependency' =>
+ array (
+ '25c8610e0e0bacafec3046a296066e9f8eceedae' =>
+ array (
+ 0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/member/member.html',
+ 1 => 1421272105,
+ 2 => 'file',
+ ),
+ ),
+ 'nocache_hash' => '172471491954b6e51b1368b6-20693769',
+ 'function' =>
+ array (
+ ),
+ 'variables' =>
+ array (
+ 'haveMember' => 0,
+ 'thisURL' => 0,
+ 'thisPage' => 0,
+ 'member' => 0,
+ ),
+ 'has_nocache_code' => false,
+ 'version' => 'Smarty-3.1.21-dev',
+ 'unifunc' => 'content_54b6e51b158d19_68572085',
+),false); /*/%%SmartyHeaderCode%%*/?>
+<?php if ($_valid && !is_callable('content_54b6e51b158d19_68572085')) {function content_54b6e51b158d19_68572085($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/member/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
+
+
+ <?php if ($_smarty_tpl->tpl_vars['haveMember']->value) {?>
+ <h2>Edit Member</h2>
+ <?php } else { ?>
+ <h2>Add New Member</h2>
+ <?php }?>
+
+ <form action="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
+" method="post" enctype="multipart/form-data">
+ <input type="hidden" name="glm_action" value="add">
+ <input type="hidden" name="option" value="submit">
+ <table class="form-table">
+ <tr>
+ <th <?php if ($_smarty_tpl->tpl_vars['member']->value['fieldRequired']['name']) {?>class="glm-required"<?php }?>>Member Name:</th>
+ <td <?php if ($_smarty_tpl->tpl_vars['member']->value['fieldFail']['name']) {?>class="glm-form-bad-input"<?php }?>>
+ <input type="text" name="name" value="<?php echo $_smarty_tpl->tpl_vars['member']->value['fieldData']['name'];?>
+" class="glm-form-text-input">
+ <?php if ($_smarty_tpl->tpl_vars['member']->value['fieldFail']['name']) {?><p><?php echo $_smarty_tpl->tpl_vars['member']->value['fieldFail']['name'];?>
+</p><?php }?>
+ </td>
+ </tr>
+ <tr>
+ <th>Active:</th>
+ <td>
+ <input type="checkbox" name="active" <?php if ($_smarty_tpl->tpl_vars['member']->value['fieldData']['active']['value']) {?>checked="checked"<?php }?>">
+ <?php if ($_smarty_tpl->tpl_vars['member']->value['fieldFail']['name']) {?><p><?php echo $_smarty_tpl->tpl_vars['member']->value['fieldFail']['name'];?>
+</p><?php }?>
+ </td>
+ </tr>
+ <tr>
+ <th>Member Type:</th>
+ <td>
+ Need to add "enum" type to data abstract.
+ </td>
+ </tr>
+ <tr>
+ <th <?php if ($_smarty_tpl->tpl_vars['member']->value['fieldRequired']['descr']) {?>class="glm-required"<?php }?>>Description:</th>
+ <td <?php if ($_smarty_tpl->tpl_vars['member']->value['fieldFail']['descr']) {?>class="glm-form-bad-input"<?php }?>>
+ <textarea name="descr" class="glm-form-textarea"><?php echo $_smarty_tpl->tpl_vars['member']->value['fieldData']['descr'];?>
+</textarea>
+ <?php if ($_smarty_tpl->tpl_vars['member']->value['fieldFail']['descr']) {?><p><?php echo $_smarty_tpl->tpl_vars['member']->value['fieldFail']['descr'];?>
+</p><?php }?>
+ </td>
+ </tr>
+
+
+ </table>
+ <p><span class="glm-required">*</span> Required</p>
+ <input type="submit" name="Add new member">
+ </form>
+
+<?php echo $_smarty_tpl->getSubTemplate ('admin/footer.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
+
+<?php }} ?>
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-13 07:37:06
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-14 21:35:21
compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/configure/header.html" */ ?>
<?php /*%%SmartyHeaderCode:148991197854b4cb224461f5-92408371%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'3ec5bcbe581d6335e06bc6c9474f73121a83d59b' =>
array (
0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/configure/header.html',
- 1 => 1421134183,
+ 1 => 1421271318,
2 => 'file',
),
),
'function' =>
array (
),
- 'has_nocache_code' => false,
'version' => 'Smarty-3.1.21-dev',
'unifunc' => 'content_54b4cb22446989_15253660',
+ 'variables' =>
+ array (
+ 'glmPluginName' => 0,
+ 'thisURL' => 0,
+ 'thisPage' => 0,
+ 'thisAction' => 0,
+ ),
+ 'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
-<?php if ($_valid && !is_callable('content_54b4cb22446989_15253660')) {function content_54b4cb22446989_15253660($_smarty_tpl) {?><?php }} ?>
+<?php if ($_valid && !is_callable('content_54b4cb22446989_15253660')) {function content_54b4cb22446989_15253660($_smarty_tpl) {?><div class="wrap">
+
+ <h2><?php echo $_smarty_tpl->tpl_vars['glmPluginName']->value;?>
+ Configuration</h2>
+
+ <h2 class="nav-tab-wrapper">
+ <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
+&glm_action=index" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='index') {?>-active<?php }?>">General Options</a>
+ <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
+&glm_action=cities" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='cities') {?>-active<?php }?>">Cities List</a>
+ <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
+&glm_action=states" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='add') {?>-active<?php }?>">States List</a>
+ <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
+&glm_action=countries" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='edit') {?>-active<?php }?>">Countries List</a>
+ <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
+&glm_action=Regions" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='edit') {?>-active<?php }?>">Regions List</a>
+ </h2>
+ <div id="glm-admin-content-container">
+ <?php }} ?>
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-13 07:48:39
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-14 17:04:39
compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/configure/index.html" */ ?>
<?php /*%%SmartyHeaderCode:113537149654b4ca1e9b41e6-15887083%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'47fb9b803e7138d215645f3c977b0b1dc2a9e718' =>
array (
0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/configure/index.html',
- 1 => 1421135161,
+ 1 => 1421255040,
2 => 'file',
),
),
'unifunc' => 'content_54b4ca1e9c5b88_76832702',
'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
-<?php if ($_valid && !is_callable('content_54b4ca1e9c5b88_76832702')) {function content_54b4ca1e9c5b88_76832702($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/configure/headder.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
+<?php if ($_valid && !is_callable('content_54b4ca1e9c5b88_76832702')) {function content_54b4ca1e9c5b88_76832702($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ('admin/configure/header.html', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
<h2>General Configuration</h2>
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-13 07:37:06
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-14 20:47:26
compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/footer.html" */ ?>
<?php /*%%SmartyHeaderCode:146319615854b4cb224487c6-63517443%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'50e78f1400d6db96c588c737669426ab57397d1d' =>
array (
0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/footer.html',
- 1 => 1421125086,
+ 1 => 1421268442,
2 => 'file',
),
),
'function' =>
array (
),
+ 'version' => 'Smarty-3.1.21-dev',
+ 'unifunc' => 'content_54b4cb2244e1c6_97382029',
'variables' =>
array (
'glmPluginName' => 0,
'thisPage' => 0,
),
'has_nocache_code' => false,
- 'version' => 'Smarty-3.1.21-dev',
- 'unifunc' => 'content_54b4cb2244e1c6_97382029',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_54b4cb2244e1c6_97382029')) {function content_54b4cb2244e1c6_97382029($_smarty_tpl) {?>
</div> <!-- / admin content area -->
- <div class="glm-copywright">
+ <div class="glm-copyright">
<?php echo $_smarty_tpl->tpl_vars['glmPluginName']->value;?>
<br>
Copyright © 2014-<?php echo $_smarty_tpl->tpl_vars['thisYear']->value;?>
>
window.open('<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
-&glmDebugWindow=true','GLM_Plugin_Debug','width=800, height=900, left=50, top=50');
+&glmDebugWindow=true','GLM_Plugin_Debug','width=800,height=800,left=50,top=50,resizable=yes,scrollbars=yes');
<?php echo '</script'; ?>
>
<?php }?>
-<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-12 20:29:18
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-14 19:42:46
compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/error/index.html" */ ?>
<?php /*%%SmartyHeaderCode:204984570454b42e9eaf47c6-75708563%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'60cbe99d19bbec013cbca4d9344f2fd4a4152f52' =>
array (
0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/error/index.html',
- 1 => 1421094555,
+ 1 => 1421264555,
2 => 'file',
),
),
'function' =>
array (
),
- 'has_nocache_code' => false,
'version' => 'Smarty-3.1.21-dev',
'unifunc' => 'content_54b42e9eafe502_03625329',
+ 'variables' =>
+ array (
+ 'errorMsg' => 0,
+ ),
+ 'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_54b42e9eafe502_03625329')) {function content_54b42e9eafe502_03625329($_smarty_tpl) {?><div class="wrap">
<h2>Sorry, we've had an error.</h2>
- <p><b>Error: </b>: Unknown error.</p>
+ <?php if ($_smarty_tpl->tpl_vars['errorMsg']->value) {?>
+ <p><?php echo $_smarty_tpl->tpl_vars['errorMsg']->value;?>
+</p>
+ <?php } else { ?>
+ <p><b>Error: </b>: Unknown error.</p>
+ <?php }?>
<p>Please try again. If you still get the same error, contact Gaslight Media at 231-487-0692 for assistance.</p>
--- /dev/null
+<?php /* Smarty version Smarty-3.1.21-dev, created on 2015-01-14 22:28:02
+ compiled from "/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/member/header.html" */ ?>
+<?php /*%%SmartyHeaderCode:8257956454b6ac77cc21f2-25755845%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
+$_valid = $_smarty_tpl->decodeProperties(array (
+ 'file_dependency' =>
+ array (
+ 'c74bd17240f8892f8955e8bedbedd434341aeca9' =>
+ array (
+ 0 => '/var/www/server/wordpress/wp-content/plugins/glm-member-db/views/admin/member/header.html',
+ 1 => 1421274467,
+ 2 => 'file',
+ ),
+ ),
+ 'nocache_hash' => '8257956454b6ac77cc21f2-25755845',
+ 'function' =>
+ array (
+ ),
+ 'version' => 'Smarty-3.1.21-dev',
+ 'unifunc' => 'content_54b6ac77cd9375_10535024',
+ 'variables' =>
+ array (
+ 'thisURL' => 0,
+ 'thisPage' => 0,
+ 'memberID' => 0,
+ 'thisAction' => 0,
+ 'haveMember' => 0,
+ ),
+ 'has_nocache_code' => false,
+),false); /*/%%SmartyHeaderCode%%*/?>
+<?php if ($_valid && !is_callable('content_54b6ac77cd9375_10535024')) {function content_54b6ac77cd9375_10535024($_smarty_tpl) {?><div class="wrap">
+
+ <h2>Member Information</h2>
+
+ <h2 class="nav-tab-wrapper">
+ <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
+&glm_action=index&member_id=<?php echo $_smarty_tpl->tpl_vars['memberID']->value;?>
+" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='index') {?>-active<?php }?> <?php if (!$_smarty_tpl->tpl_vars['haveMember']->value) {?>disabled<?php }?>">Dashboard</a>
+ <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
+&glm_action=member&member_id=<?php echo $_smarty_tpl->tpl_vars['memberID']->value;?>
+" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='member'||!$_smarty_tpl->tpl_vars['haveMember']->value) {?>-active<?php }?>">Member</a>
+ <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
+&glm_action=locations&member_id=<?php echo $_smarty_tpl->tpl_vars['memberID']->value;?>
+" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='locations') {?>-active<?php }?> <?php if (!$_smarty_tpl->tpl_vars['haveMember']->value) {?>disabled<?php }?>">Locations</a>
+ <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
+&glm_action=facilities&member_id=<?php echo $_smarty_tpl->tpl_vars['memberID']->value;?>
+" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='facilities') {?>-active<?php }?> <?php if (!$_smarty_tpl->tpl_vars['haveMember']->value) {?>disabled<?php }?>">Facilities</a>
+ <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
+&glm_action=attractions&member_id=<?php echo $_smarty_tpl->tpl_vars['memberID']->value;?>
+" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='attractions') {?>-active<?php }?> <?php if (!$_smarty_tpl->tpl_vars['haveMember']->value) {?>disabled<?php }?>">Attractions</a>
+ <a href="<?php echo $_smarty_tpl->tpl_vars['thisURL']->value;?>
+?page=<?php echo $_smarty_tpl->tpl_vars['thisPage']->value;?>
+&glm_action=contacts&member_id=<?php echo $_smarty_tpl->tpl_vars['memberID']->value;?>
+" class="nav-tab<?php if ($_smarty_tpl->tpl_vars['thisAction']->value=='contacts') {?>-active<?php }?> <?php if (!$_smarty_tpl->tpl_vars['haveMember']->value) {?>disabled<?php }?>">Contacts</a>
+ </h2>
+ <div id="glm-admin-content-container">
+
+ <?php }} ?>
* This model is called if there is a generic/unknown error
*
*/
-class glmMembersAdminError
+class GlmMembersAdmin_error_index
{
/**
{
// No work to perform here so just return status
+ }
+
+ public function modelAction() {
+
// Return status, any suggested view, and any data to controller
return array(
'status' => true,
- 'view' => false,
+ 'modelRedirect' => false,
+ 'view' => 'admin/error/index.html',
'data' => false
);
+
}
}
--- /dev/null
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * Admin Member Management
+ *
+ * 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_DIR.'/data/dataMembers.php');
+
+/*
+ * This class performs the work for the default action of the "Members" menu
+ * option, which is to display the members dashboard.
+ *
+ */
+class GlmMembersAdmin_member_index extends GlmDataMembers
+{
+
+ /**
+ * 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($this->wpdb, $this->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 ()
+ {
+
+ $success = true;
+ $haveMember = false;
+ $memberData = false;
+ $memberID = 0;
+
+ // Check if a member ID is supplied
+ if (isset($_REQUEST['member_id'])) {
+ // Make sure it's a number
+ $memberID = $_REQUEST['member_id']-0;
+ }
+
+ // If we don't have a member ID, assume this is to add a member and go do that
+ if ($memberID <= 0) {
+
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+ glmMembersAdmin::addNotice(' No member ID supplied.');
+ }
+
+ return array(
+ 'status' => $success,
+ 'menuItemRedirect' => false,
+ 'modelRedirect' => 'member',
+ 'view' => 'admin/member/member.html',
+ 'data' => array(
+ 'haveMember' => false,
+ )
+ );
+ }
+
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+ glmMembersAdmin::addNotice("<b> Member ID specified:</b> $memberID");
+ }
+
+ // Try to get existing member data
+ $memberData = $this->getEntry($memberID);
+
+ // Check that we have data for the specified member ID
+ if ($memberData !== false) {
+ $haveMember = true;
+ }
+
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ glmMembersAdmin::addNotice("<pre>".print_r($memberData,1)."</pre>", 'Member Data');
+ }
+
+ // Compile template data
+ $templateData = array(
+ 'haveMember' => $haveMember,
+ 'memberID' => $memberID,
+ 'member' => $memberData,
+ );
+
+ // Return status, suggested view, and data to controller
+ return array(
+ 'status' => $success,
+ 'menuItemRedirect' => false,
+ 'modelRedirect' => false,
+ 'view' => 'admin/member/index.html',
+ 'data' => $templateData
+ );
+
+ }
+
+
+}
+
+?>
\ No newline at end of file
--- /dev/null
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * Admin Member Edit
+ *
+ * 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_DIR.'/data/dataMembers.php');
+
+/*
+ * This class performs the work for the default action of the "Members" menu
+ * option, which is to display the members dashboard.
+ *
+ */
+class GlmMembersAdmin_member_member extends GlmDataMembers
+{
+
+ /**
+ * 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($this->wpdb, $this->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 ()
+ {
+
+ $success = true;
+ $haveMember = false;
+ $memberData = false;
+ $memberID = 0;
+
+ // Check if a member ID is supplied
+ if (isset($_REQUEST['member_id'])) {
+ // Make sure it's a number
+ $memberID = $_REQUEST['member_id']-0;
+ }
+
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) {
+ glmMembersAdmin::addNotice("<b> Member ID specified:</b> $memberID");
+ }
+
+ // If we have a member ID, try to get the member data
+ if ($memberID > 0) {
+ $memberData = $this->editEntry($memberID);
+ }
+
+ // If we have member data, say so
+ if ($memberData !== false) {
+ $haveMember = true;
+
+ // Otherwise, we're going setup to enter a new one
+ } else {
+
+ $memberData = $this->newEntry();
+ }
+
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ glmMembersAdmin::addNotice("<pre>".print_r($memberData,1)."</pre>", 'Member Data');
+ }
+
+ // Compile template data
+ $templateData = array(
+ 'haveMember' => $haveMember,
+ 'memberID' => $memberID,
+ 'member' => $memberData
+ );
+
+ // Return status, suggested view, and data to controller
+ return array(
+ 'status' => $success,
+ 'menuItemRedirect' => false,
+ 'modelRedirect' => false,
+ 'view' => 'admin/member/member.html',
+ 'data' => $templateData
+ );
+
+ }
+
+
+}
+
+?>
\ No newline at end of file
+++ /dev/null
-<?php
-
-/**
- * Gaslight Media Prototype Management and Display
- * Admin Edit Prototype Model
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package glmPrototypeManagement
- * @author Chuck Scott <cscott@gaslightmedia.com>
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
- * @link http://dev.gaslightmedia.com/
- */
-
-// Load Members data abstract
-require_once(GLM_MEMBERS_PLUGIN_CLASS_DIR.'/data/dataMembers.php');
-
-/*
- * This class performs the work neede to add a new member
- * option, which is to display the members dashboard.
- *
- */
-class GlmMembersAdmin_members_add extends GlmDataMembers
-{
-
- /**
- * 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($this->wpdb, $this->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 ()
- {
-
- // Assume we're just going to display an input form
- $view = 'edit.html';
-
- // Check if this is a submission
- if (isset($_REQUEST['option']) && $_REQUEST['option'] == 'submit') {
- $member = $this->insertEntry();
-
- // If the submission was successful - display the result
- if ($member && $member['status']) {
- $view = 'display.html';
- }
-
- } else {
- // Get the setup data from the data abstract to edit a new member
- $member = $this->newEntry();
- }
-
- // Get result status
- $success = ($member && $member['status']);
-
- // Determine if current user can add, edit, delete prototypes
- $canEdit = current_user_can('glm_proto_edit');
-
- // Return status, suggested view, and data to controller
- return array(
- 'status' => $success,
- 'menuItemRedirect' => false,
- 'modelRedirect' => false,
- 'view' => 'admin/members/'.$view,
- 'data' => array(
- 'newMember' => true,
- 'member' => $member,
- 'canEdit' => $canEdit
- )
- );
-
- }
-
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-
-/**
- * Gaslight Media Prototype Management and Display
- * Admin Delete Selected Prototype Model
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package glmPrototypeManagement
- * @author Chuck Scott <cscott@gaslightmedia.com>
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
- * @link http://dev.gaslightmedia.com/
- */
-
-// Load Members data abstract
-require_once(GLM_MEMBERS_PLUGIN_CLASS_DIR.'/data/dataMembers.php');
-
-/*
- * This class performs the work needed to delete a member.
- */
-class GlmMembersAdmin_members_delete extends GlmDataMembers
-{
-
- /**
- * 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($this->wpdb, $this->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 ()
- {
-
- // Check if we recieved a prototype ID
- $id = $_REQUEST['proto_id'] - 0;
- if ($id > 0) {
-
- // Delete the prototype data
- $res = $this->wpdb->get_row(
- "
- DELETE
- FROM ".$this->wpdb->posts."
- WHERE post_type = 'glm_proto'
- AND id = $id
- ", ARRAY_A);
- }
-
- // Return status - in this case we always redirect to the prototypes
- // index model (list)
- return array(
- 'status' => true,
- 'menuItemRedirect' => 'prototypes',
- 'modelRedirect' => 'index',
- 'view' => false,
- 'data' => false
- );
- }
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-
-/**
- * Gaslight Media Prototype Management and Display
- * Admin Display Selected Prototype Model
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package glmPrototypeManagement
- * @author Chuck Scott <cscott@gaslightmedia.com>
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
- * @link http://dev.gaslightmedia.com/
- */
-
-// Load Members data abstract
-require_once(GLM_MEMBERS_PLUGIN_CLASS_DIR.'/data/dataMembers.php');
-
-/*
- * This class performs the work needed to display member data
- */
-class GlmMembersAdmin_members_display extends GlmDataMembers
-{
-
- /**
- * 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($this->wpdb, $this->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 ()
- {
-
- // Check if we recieved a prototype ID
- $id = $_REQUEST['proto_id'] - 0;
- if ($id > 0) {
-
- // Get the prototype data
- $res = $this->wpdb->get_row(
- "
- SELECT id,
- DATE_FORMAT(post_date, '%Y-%m-%d') p_date,
- post_title,
- post_content
- FROM ".$this->wpdb->posts."
- WHERE post_type = 'glm_proto'
- AND id = $id
- ", ARRAY_A);
-
- // If we have results
- $success = false;
- if ($res['post_content']) {
-
- $success = true;
-
- // Break out the prototype file data
- $d = unserialize($res['post_content']);
- $res['content'] = $d;
- }
- }
-
- // Return status, any suggested view, and any data to controller
- // If 'viewText' exists, it's parsed as smarty template source for output rather than the 'view' file.
- return array(
- 'status' => $success,
- 'menuItemRedirect' => false,
- 'modelRedirect' => false,
- 'view' => 'admin/prototypes/display.html',
- 'viewText' => stripslashes($d['html']),
- 'data' => array(
- 'content' => $res['content']
- )
- );
- }
-}
-
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-
-/**
- * Gaslight Media Prototype Management and Display
- * Admin Edit Prototype Model
- *
- * PHP version 5.5
- *
- * @category glmWordPressPlugin
- * @package glmPrototypeManagement
- * @author Chuck Scott <cscott@gaslightmedia.com>
- * @license http://www.gaslightmedia.com Gaslightmedia
- * @release admin.php,v 1.0 2014/10/31 19:31:47 cscott Exp $
- * @link http://dev.gaslightmedia.com/
- */
-
-// Load Members data abstract
-require_once(GLM_MEMBERS_PLUGIN_CLASS_DIR.'/data/dataMembers.php');
-
-/*
- * This class performs the work needed to add a new prototype.
- */
-class GlmMembersAdmin_members_edit extends GlmDataMembers
-{
-
- /**
- * 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($this->wpdb, $this->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 ()
- {
-
- // Check that we have a prototype ID
- $id = 0;
- if (isset($_REQUEST['proto_id'])) {
- // Make sure it's an integer
- $id = $_REQUEST['proto_id'] - 0;
- }
- if (! $id) {
- echo "FAILURE";
- exit();
- }
-
- // Get the current data for the selected prototype
- // Get the prototype data
- $res = $this->wpdb->get_row(
- "
- SELECT id,
- DATE_FORMAT(post_date, '%Y-%m-%d') p_date,
- post_title,
- post_content
- FROM ".$this->wpdb->posts."
- WHERE post_type = 'glm_proto'
- AND id = $id
- ", ARRAY_A);
-
- // If we have results
- $success = false;
- if ($res['post_content']) {
-
- $success = true;
-
- // Break out the prototype file data
- $content = unserialize($res['post_content']);
- }
-
- // Setup input data array
- $content = array(
- 'glm_proto_title' => $content['title'],
- 'glm_proto_title_error' => '',
- 'glm_proto_width' => $content['width'],
- 'glm_proto_width_error' => '',
- 'glm_proto_height' => $content['height'],
- 'glm_proto_height_error' => '',
- 'glm_proto_html' => stripslashes($content['html']),
- 'glm_proto_html_error' => '',
- 'glm_proto_background' => $content['background'],
- 'glm_proto_background_error' => '',
- 'glm_proto_prototype' => $content['prototype'],
- 'glm_proto_prototype_error' => '',
- 'glm_proto_image3' => $content['image3'],
- 'glm_proto_image3_error' => '',
- 'glm_proto_image4' => $content['image4'],
- 'glm_proto_image4_error' => '',
- 'glm_proto_image5' => $content['image5'],
- 'glm_proto_image5_error' => ''
- );
-
- /*
- * If a protototype update is being submitted
- */
- $submitError = false;
- $submitted = false;
- if (isset($_REQUEST['glm_proto_title'])) {
-
- // Clean up all input
- $content['glm_proto_title'] = sanitize_text_field(
- $_REQUEST['glm_proto_title']);
- $content['glm_proto_width'] = sanitize_text_field(
- $_REQUEST['glm_proto_width']);
- $content['glm_proto_height'] = sanitize_text_field(
- $_REQUEST['glm_proto_height']);
- $content['glm_proto_html'] = stripslashes($_REQUEST['glm_proto_html']);
- $content['glm_proto_background'] = sanitize_text_field(
- $_REQUEST['glm_proto_background']);
- $content['glm_proto_prototype'] = sanitize_text_field(
- $_REQUEST['glm_proto_prototype']);
- $content['glm_proto_image3'] = sanitize_text_field(
- $_REQUEST['glm_proto_image3']);
- $content['glm_proto_image4'] = sanitize_text_field(
- $_REQUEST['glm_proto_image4']);
- $content['glm_proto_image5'] = sanitize_text_field(
- $_REQUEST['glm_proto_image5']);
-
- // Check title field
- if ($content['glm_proto_title'] == '') {
- $content['glm_proto_title_error'] = 'Required title not supplied';
- $submitError = true;
- }
-
- // Check width field
- if ($content['glm_proto_width'] == '') {
- $content['glm_proto_width_error'] = 'Required width not supplied';
- $submitError = true;
- }
-
- // Check height field
- if ($content['glm_proto_height'] == '') {
- $content['glm_proto_height_error'] = 'Required height not supplied';
- $submitError = true;
- }
-
- // Check background image - Not required but must exist if provided
- if ($content['glm_proto_background'] != '' && ! $this->glmProtoIsUploaded(
- $content['glm_proto_background'])) {
- $content['glm_proto_background_error'] = 'Supplied background image does not exists';
- $submitError = true;
- }
-
- // Check prototype image
- if ($content['glm_proto_prototype'] == '') {
- $content['glm_proto_prototype_error'] = 'Required prototype image not supplied ';
- $submitError = true;
- } else {
- $exists = $this->glmProtoIsUploaded(
- $content['glm_proto_prototype']);
- if (! $exists) {
- $content['glm_proto_prototype_error'] .= 'Supplied prototype image does not exists';
- $submitError = true;
- }
- }
-
- // Check image #3 - Not required but must exist if provided
- if ($content['glm_proto_image3'] != '' && ! $this->glmProtoIsUploaded(
- $content['glm_proto_image3'])) {
- $content['glm_proto_image3_error'] = 'Supplied image #3 does not exists';
- $submitError = true;
- }
-
- // Check image #4 - Not required but must exist if provided
- if ($content['glm_proto_image4'] != '' && ! $this->glmProtoIsUploaded(
- $content['glm_proto_image4'])) {
- $content['glm_proto_image4_error'] = 'Supplied image #4 does not exists';
- $submitError = true;
- }
-
- // Check image #5 - Not required but must exist if provided
- if ($content['glm_proto_image5'] != '' && ! $this->glmProtoIsUploaded(
- $content['glm_proto_image5'])) {
- $content['glm_proto_image3_error'] = 'Supplied image #5 does not exists';
- $submitError = true;
- }
-
-
- if (! $submitError) {
-
- // Prepair data for storage
- $date = date('Y-m-d', time());
- $timezoneBackup = date_default_timezone_get();
- date_default_timezone_set("GMT");
- $gmtDate = date('Y-m-d', time());
- date_default_timezone_set($timezoneBackup);
-
- $contentSerialized = serialize(
- array(
- 'title' => $content['glm_proto_title'],
- 'width' => $content['glm_proto_width'],
- 'height' => $content['glm_proto_height'],
- 'html' => $content['glm_proto_html'],
- 'background' => $content['glm_proto_background'],
- 'prototype' => $content['glm_proto_prototype'],
- 'image3' => $content['glm_proto_image3'],
- 'image4' => $content['glm_proto_image4'],
- 'image5' => $content['glm_proto_image5']
- ));
-
- // Store into wp_posts table
- $result = $this->wpdb->update($this->wpdb->posts,
- array(
- 'post_date' => $date,
- 'post_date_gmt' => $gmtDate,
- 'post_content' => $contentSerialized,
- 'post_title' => $content['glm_proto_title'],
- 'post_type' => 'glm_proto'
- ),
- array(
- 'id' => $id
- ));
-
- // If there was a problem storing the prototype, pass that to
- // the template
- if (! $result) {
- $content['glm_proto_title_error'] = 'There was an unknown problem updating this prototype.';
- }
-
- $prototypeSubmitted = true;
- }
- }
-
- // If submitted OK then display success page
- $menuItemRedirect = false;
- $modelRedirect = false;
- if ($prototypeSubmitted) {
-
- $view = 'admin/prototypes/updated.html';
-
- // Prototype was not successfully submitted so redisplay the form.
- } else {
-
- // Select view
- $view = 'admin/prototypes/edit.html';
- }
-
- // Return status, suggested view, and data to controller
- return array(
- 'status' => true,
- 'menuItemRedirect' => false,
- 'modelRedirect' => false,
- 'view' => $view,
- 'data' => array(
- 'content' => $content
- )
- );
- }
-
- /*
- * Check if a file supposedly uploaded to WordPress exists
- *
- * This method accepts a URL to a WordPress file or image, strips the
- * WordPress base file URL to get the remaining path and file name for
- * the file, then adds the base path for WordPress files and checks to
- * see if the file exists.
- *
- * @param string URL of uploaded WordPress file or image
- *
- * @return bool True if it exists, false if not
- */
- private function glmProtoIsUploaded ($url)
- {
-
- // Get current WordPress upload directory/url information
- $paths = wp_upload_dir();
- $base = $paths['baseurl'];
- $path = $paths['basedir'];
-
- // Strip base directory from supplied URL
- $file = substr($url, strlen($base));
-
- // If there's now no file name
- if (trim($file) == '') {
- return false;
- }
-
- // Check if file exists
- $exists = file_exists($path . $file);
-
- return $exists;
- }
-}
-
-?>
\ No newline at end of file
// Get a current list of members
$list = $this->getList();
+ if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG_VERBOSE) {
+ glmMembersAdmin::addNotice("<pre>".print_r($list,1)."</pre>", 'Member Data');
+ }
+
// If we have list entries - even if it's an empty list
$success = true;
$haveMembers = false;
== Frequently Asked Questions ==
-= A question that someone might have =
+= Code for this plugin looks completely different from others. =
+OK, so I just couldn't understand why certain things were done a certain way in WordPress. One of those is
+the way Templates are built. It seems to me that including PHP programing in a template is counter-productive.
+The whole idea of a template is to completely separate programming (the data side) and interface (the template
+side). I've also found many plugins mix code and html all over the place. How people can deal with that is a
+mystery to me. I used to program Web applications like that and believe me it cost me plenty in support.
-An answer to that question.
+Because of all that I've decided to use Smarty Templates for this project. I've been so happy with Smarty
+Templates, and my last large project used them to completely separate data and design. (I know, Smarty is
+kind of like programming and underneath uses PHP, but logically it's all output design.)
-= What about foo bar? =
+This project also has a revised MVC approach that fits with how I see that working in WordPress. It's a
+first pass at really using this particular MVC adaptation, so cut me some slack on this one.
+
+Lastly, I just didn't like the very limited database, form-data processing, and input sanitizing/filtering I
+found in WordPress. To avoid confusing and sloppy code, I decided to migrate my abstract data class from
+my previous project to handle all of this. This makes the "models" here much simpler and makes maintenance
+and extention of this plugin much simpler. You'll see that under lib/GlmDataAbstract. (Note that that class
+is proprietary and requires licensing. You did purchase this plugin, right?) For info on what that class does,
+look at the "documentation.txt" file in that directory. I'm not taking time to even summarize it here since
+I could not do it justice in a paragraph or two.
+
+= How the heck does this plugin work? =
+For the admin side the typical flow is (highly summarized) ...
+
+/index.php -> /controllers/admin.php -> /models/admin/{menu}/{action}.php -> /views/admin/{menu}/{action}.html
+
+Note that the models also bring in data descriptions in the /classes/data directory that are appropriately
+named for the data of interest. The data structure arrays in those files are what the abstract data class
+uses to process input and output and interact with the database tables.
+
+So, if you want to find out how some particular action works, look in that models directory. If you want
+to see the template for a particular output, look in the that views directory. If you want to see what data
+is stored and managed and how it input and structured for output, look at the /classes/data directory.
+
+Beyond all that, good luck. This is my view of the WordPress world. I'm afraid you'll have to live with that.
-Answer to foo bar dilemma.
== Screenshots ==
+++ /dev/null
-<div class="wrap">
-
- <h2 class="nav-tab-wrapper">
- <a href="{$thisURL}?page={$thisPage}&glm_action=cities" class="nav-tab{if $thisAction==index}-active{/if}">Cities List</a>
- <a href="{$thisURL}?page={$thisPage}&glm_action=states" class="nav-tab{if $thisAction==add}-active{/if}">States List</a>
- <a href="{$thisURL}?page={$thisPage}&glm_action=countries" class="nav-tab{if $thisAction==edit}-active{/if}">Countries List</a>
- <a href="{$thisURL}?page={$thisPage}&glm_action=Regions" class="nav-tab{if $thisAction==edit}-active{/if}">Regions List</a>
- </h2>
- <div id="glm-admin-content-container">
-
\ No newline at end of file
--- /dev/null
+<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 Options</a>
+ <a href="{$thisURL}?page={$thisPage}&glm_action=cities" class="nav-tab{if $thisAction==cities}-active{/if}">Cities List</a>
+ <a href="{$thisURL}?page={$thisPage}&glm_action=states" class="nav-tab{if $thisAction==add}-active{/if}">States List</a>
+ <a href="{$thisURL}?page={$thisPage}&glm_action=countries" class="nav-tab{if $thisAction==edit}-active{/if}">Countries List</a>
+ <a href="{$thisURL}?page={$thisPage}&glm_action=Regions" class="nav-tab{if $thisAction==edit}-active{/if}">Regions List</a>
+ </h2>
+ <div id="glm-admin-content-container">
+
\ No newline at end of file
-{include file='admin/configure/headder.html'}
+{include file='admin/configure/header.html'}
<h2>General Configuration</h2>
<h2>Sorry, we've had an error.</h2>
<p><b>Error: </b>: An invalid action has been specified.</p>
+
+ {if $errorMsg}<p>{$errorMsg}</p>{/if}
<p>Please try again. If you still get the same error, contact Gaslight Media at 231-487-0692 for assistance.</p>
<h2>Sorry, we've had an error.</h2>
- <p><b>Error: </b>: Unknown error.</p>
+ {if $errorMsg}
+ <p>{$errorMsg}</p>
+ {else}
+ <p><b>Error: </b>: Unknown error.</p>
+ {/if}
<p>Please try again. If you still get the same error, contact Gaslight Media at 231-487-0692 for assistance.</p>
</div> <!-- / admin content area -->
- <div class="glm-copywright">
+ <div class="glm-copyright">
{$glmPluginName}<br>
Copyright © 2014-{$thisYear} Gaslight Media - All Rights Reserved<br>
<a href="http://www.gaslightmedia.com">http://www.gaslightmedia.com</a>
{if $adminDebug}
<script>
- window.open('{$thisURL}?page={$thisPage}&glmDebugWindow=true','GLM_Plugin_Debug','width=800, height=900, left=50, top=50');
+ window.open('{$thisURL}?page={$thisPage}&glmDebugWindow=true','GLM_Plugin_Debug','width=800,height=800,left=50,top=50,resizable=yes,scrollbars=yes');
</script>
{/if}
--- /dev/null
+<div class="wrap">
+
+ <h2>Member Information</h2>
+
+ <h2 class="nav-tab-wrapper">
+ <a href="{$thisURL}?page={$thisPage}&glm_action=index&member_id={$memberID}" class="nav-tab{if $thisAction==index}-active{/if} {if !$haveMember}disabled{/if}">Dashboard</a>
+ <a href="{$thisURL}?page={$thisPage}&glm_action=member&member_id={$memberID}" class="nav-tab{if $thisAction==member || !$haveMember}-active{/if}">Member</a>
+ <a href="{$thisURL}?page={$thisPage}&glm_action=locations&member_id={$memberID}" class="nav-tab{if $thisAction==locations}-active{/if} {if !$haveMember}disabled{/if}">Locations</a>
+ <a href="{$thisURL}?page={$thisPage}&glm_action=facilities&member_id={$memberID}" class="nav-tab{if $thisAction==facilities}-active{/if} {if !$haveMember}disabled{/if}">Facilities</a>
+ <a href="{$thisURL}?page={$thisPage}&glm_action=attractions&member_id={$memberID}" class="nav-tab{if $thisAction==attractions}-active{/if} {if !$haveMember}disabled{/if}">Attractions</a>
+ <a href="{$thisURL}?page={$thisPage}&glm_action=contacts&member_id={$memberID}" class="nav-tab{if $thisAction==contacts}-active{/if} {if !$haveMember}disabled{/if}">Contacts</a>
+ </h2>
+ <div id="glm-admin-content-container">
+
+
\ No newline at end of file
--- /dev/null
+{include file='admin/member/header.html'}
+
+ <h2>{$member.name}</h2>
+ <table>
+ <tr><th>Member Name:</th><td>{$member.name}</tr>
+
+ </table>
+
+{include file='admin/footer.html'}
--- /dev/null
+{include file='admin/member/header.html'}
+
+ {if $haveMember}
+ <h2>Edit Member</h2>
+ {else}
+ <h2>Add New Member</h2>
+ {/if}
+
+ <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
+ <input type="hidden" name="glm_action" value="add">
+ <input type="hidden" name="option" value="submit">
+ <table class="form-table">
+ <tr>
+ <th {if $member.fieldRequired.name}class="glm-required"{/if}>Member Name:</th>
+ <td {if $member.fieldFail.name}class="glm-form-bad-input"{/if}>
+ <input type="text" name="name" value="{$member.fieldData.name}" class="glm-form-text-input">
+ {if $member.fieldFail.name}<p>{$member.fieldFail.name}</p>{/if}
+ </td>
+ </tr>
+ <tr>
+ <th>Active:</th>
+ <td>
+ <input type="checkbox" name="active" {if $member.fieldData.active.value}checked="checked"{/if}">
+ {if $member.fieldFail.name}<p>{$member.fieldFail.name}</p>{/if}
+ </td>
+ </tr>
+ <tr>
+ <th>Member Type:</th>
+ <td>
+ Need to add "enum" type to data abstract.
+ </td>
+ </tr>
+ <tr>
+ <th {if $member.fieldRequired.descr}class="glm-required"{/if}>Description:</th>
+ <td {if $member.fieldFail.descr}class="glm-form-bad-input"{/if}>
+ <textarea name="descr" class="glm-form-textarea">{$member.fieldData.descr}</textarea>
+ {if $member.fieldFail.descr}<p>{$member.fieldFail.descr}</p>{/if}
+ </td>
+ </tr>
+
+
+ </table>
+ <p><span class="glm-required">*</span> Required</p>
+ <input type="submit" name="Add new member">
+ </form>
+
+{include file='admin/footer.html'}
+++ /dev/null
-{include file='admin/members/header.html'}
-
-
- {if $newMember}
- <h2>Add New Member</h2>
- {else}
- <h2>Edit Member</h2>
- {/if}
-
- <form action="{$thisURL}?page={$thisPage}" method="post" enctype="multipart/form-data">
- <input type="hidden" name="glm_action" value="add">
- <input type="hidden" name="option" value="submit">
- <table class="form-table">
- <tr>
- <th {if $member.fieldRequired.name}class="glm-required"{/if}>Member Name:</th>
- <td {if $member.fieldFail.name}class="glm-form-bad-input"{/if}>
- <input type="text" name="name" value="{$member.fieldData.name}" class="glm-form-text-input">
- {if $member.fieldFail.name}<p>{$member.fieldFail.name}</p>{/if}
- </td>
- </tr>
- <tr>
- <th>Active:</th>
- <td>
- <input type="checkbox" name="active" {if $member.fieldData.active.value}checked="checked"{/if}">
- {if $member.fieldFail.name}<p>{$member.fieldFail.name}</p>{/if}
- </td>
- </tr>
- <tr>
- <th>Member Type:</th>
- <td>
- Need to add "enum" type to data abstract.
- </td>
- </tr>
- <tr>
- <th {if $member.fieldRequired.descr}class="glm-required"{/if}>Description:</th>
- <td {if $member.fieldFail.descr}class="glm-form-bad-input"{/if}>
- <textarea name="descr" class="glm-form-textarea">{$member.fieldData.descr}</textarea>
- {if $member.fieldFail.descr}<p>{$member.fieldFail.descr}</p>{/if}
- </td>
- </tr>
-
-
- </table>
- <p><span class="glm-required">*</span> Required</p>
- <input type="submit" name="Add new member">
- </form>
-
-{include file='admin/footer.html'}
-
-
-
+++ /dev/null
-<div class="wrap">
-
- <h2 class="nav-tab-wrapper">
- <a href="{$thisURL}?page={$thisPage}&glm_action=index" class="nav-tab{if $thisAction==index}-active{/if}">List Members</a>
- <a href="{$thisURL}?page={$thisPage}&glm_action=add" class="nav-tab{if $thisAction==add}-active{/if}">Add New Member</a>
- <a href="{$thisURL}?page={$thisPage}&glm_action=other" class="nav-tab{if $thisAction==edit}-active{/if}">Edit Member</a>
- </h2>
- <div id="glm-admin-content-container">
-
\ No newline at end of file
--- /dev/null
+<div class="wrap">
+ <h2>Your Members</h2>
+ <h2 class="nav-tab-wrapper">
+ <a href="{$thisURL}?page={$thisPage}&glm_action=index" class="nav-tab{if $thisAction==index}-active{/if}">List of Members</a>
+ <a href="{$thisURL}?page={$thisPage}&glm_action=reports" class="nav-tab{if $thisAction==add}-active{/if}">Reports</a>
+ <a href="{$thisURL}?page={$thisPage}&glm_action=other" class="nav-tab{if $thisAction==edit}-active{else} disabled{/if}">Or Something - perahps mailing stuff?</a>
+ </h2>
+ <div id="glm-admin-content-container">
+
\ No newline at end of file
{else}
<tr class="alternate">
{/if}
- <td>{$m.name}</td>
+ <td>
+ <a href="{$thisURL}?page=glm-members-admin-menu-member&glm_action=index&member_id={$m.id}">{$m.name}</a>
+ </td>
<td>
(nothing here yet)
</td>