Various minor fixes to work with Packaging updates.
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 12 Jan 2016 20:11:13 +0000 (15:11 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 12 Jan 2016 20:11:13 +0000 (15:11 -0500)
glm-member-db-contacts.php
models/admin/member/contacts.php
models/admin/profile/index.php
setup/adminMenus.php
views/admin/member/contacts.html
views/admin/profile/header.html [new file with mode: 0644]
views/admin/profile/index.html

index 87f9183..0f61e43 100644 (file)
@@ -3,7 +3,7 @@
  * Plugin Name: GLM Members Database Contacts
  * Plugin URI: http://www.gaslightmedia.com/
  * Description: Gaslight Media Members Database.
- * Version: 1.0.6
+ * Version: 1.0.7
  * Author: Chuck Scott
  * Author URI: http://www.gaslightmedia.com/
  * License: GPL2
@@ -33,7 +33,7 @@
  *  version when there's a change in the database!! Use the
  *  version nunmber of that release for the DB version.
  */
-define('GLM_MEMBERS_CONTACTS_PLUGIN_VERSION', '1.0.6');
+define('GLM_MEMBERS_CONTACTS_PLUGIN_VERSION', '1.0.7');
 define('GLM_MEMBERS_CONTACTS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '1.0.44');
 define('REQUIRED_GLM_MEMBERS_PLUGIN_MIN_DB_VERSION', '1.0.41');
 
@@ -230,7 +230,7 @@ function my_login_redirect( $redirect_to, $request, $user ) {
 
         // If we get here, this is a pure contact user, start them at their profile
 
-        return '/wp-admin/admin.php?page=glm-members-admin-menu-profile';
+        return '/wp-admin/admin.php?page=glm-members-admin-menu-member';
 
     }
 
index 467effd..d98f99f 100644 (file)
@@ -144,6 +144,9 @@ class GlmMembersAdmin_member_contacts extends GlmDataContacts
         // Check that we have good member data
         if (is_array($memberData) && isset($memberData['id']) && $memberData['id'] > 0) {
 
+            // Also store the member id in a WordPress Option in case user clicks "Member" sub-menu
+            update_option('glmMembersDatabaseMemberID', $this->memberID);
+
             $haveMember = true;
             $memberName = $memberData['name'];
 
index 0704d3a..1564bfd 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /**
  * Gaslight Media Members Database
- * Admin Member My Profile
+ * Admin Member User Profile
  *
  * PHP version 5.5
  *
index e735a94..358802b 100644 (file)
@@ -34,8 +34,8 @@
 if ($this->config['loggedInUser']['contactUser']) {
     add_submenu_page(
         $mainMenuSlug,
-        'My Profile',
-        'My Profile',
+        'User Profile',
+        'User Profile',
         'glm_members_edit_my_contact_info',
         'glm-members-admin-menu-profile',
         function() {$this->controller('profile');}
index bb87d19..f1550ce 100644 (file)
@@ -15,7 +15,7 @@
   {if $option == 'list'}
 
     {if apply_filters('glm_members_permit_admin_member_contacts_add_contact', true)}
-    <a href="{$thisURL}?page={$thisPage}&glm_action=contacts&member={$memberID}&option=create" class="button-primary glm-button glm-right">Add New Member Contact</a>
+    <a href="{$thisURL}?page={$thisPage}&glm_action=contacts&member={$memberID}&option=create" class="button button-primary glm-button glm-right">Add New Member Contact</a>
     {/if}
     <form class="glm-right" onSubmit="return false;">
        <span{if $haveFilter} class="glm-notice"{/if}><b>List Filters:</b>&nbsp;&nbsp;</span> 
 
     {if $option == 'create' || $option == 'edit'}
 
-         <a href="{$thisURL}?page={$thisPage}&glm_action=contacts&member={$memberID}" class="button-primary glm-button glm-right">Return to Contact List</a>
+         <a href="{$thisURL}?page={$thisPage}&glm_action=contacts&member={$memberID}" class="button button-primary glm-button glm-right">Return to Contact List</a>
             
       {if $option == 'create'}
         <h2 class="glm-left">Add New Contact</h2>   
       {else}
         {if $contactUpdated}<h2 class="glm-notice glm-flash-updated">Contact Updated</h2>{/if}
-        <a id="deleteContactButton" class="button-primary glm-button glm-right">Delete this Contact</a>
+        <a id="deleteContactButton" class="button button-primary glm-button glm-right">Delete this Contact</a>
         <div id="deleteContactDialog" class="glm-dialog-box" title="Delete Contact">
             <center>
-                <p><a id="deleteContactCancel" class="button-primary">Cancel</a></p>
+                <p><a id="deleteContactCancel" class="button button-primary">Cancel</a></p>
                 <p><input id="deleteContactSubmit" type="submit" value="Delete this contact"></p>
             </center>
             <div class="glm-item-container">
             {if $contactInfo.fieldData.image}
                         <div id="largeImageDialog" class="glm-dialog-box" title="Large sized image">
                             <img src="{$glmPluginMediaURL}/images/large/{$contactInfo.fieldData.image}">
-                            <a id="largeImageCancel" class="button-primary glm-right">Close</a><br>
+                            <a id="largeImageCancel" class="button button-primary glm-right">Close</a><br>
                         </div>
                         <table class="glm-admin-image-edit-table">
                             <tr>
                                 <td>
                                     <input type="checkbox" name="image_delete"> Delete Image<br>
                                     {$contactInfo.fieldData.image}<br>
-                                    <p><div id="largeImageButton" class="button-primary">Show Large Image</div></p>
+                                    <p><div id="largeImageButton" class="button button-primary">Show Large Image</div></p>
                                 </td>
                         
                             </tr>
                     <th>City</th>
                     <td class="glm-item-container">
                         <!--  Add new city dialog -->
-                        <div id="newCityButton" class="button-primary glm-right">Add a new City</div>
+                        <div id="newCityButton" class="button button-secondary glm-right">Add a new City</div>
                         <div id="newCityDialog" class="glm-dialog-box" title="Enter a New City">
                             <table class="glm-admin-table">
                                 <tr>
                                 </tr>
                             </table>
                             <p><span class="glm-required">*</span> Required</p>
-                            <a id="newCityCancel" class="button-primary glm-right">Cancel</a>
+                            <a id="newCityCancel" class="button button-primary glm-right">Cancel</a>
                             <input id="newCitySubmit" type="submit" value="Add new City">
                         </div>
                         <!-- City Selection -->
                     <th {if $contactInfo.fieldRequired.url}class="glm-required"{/if}>Web Address (URL):</th>
                     <td {if $contactInfo.fieldFail.url}class="glm-form-bad-input"{/if}>
             {if $contactInfo.fieldData.url}
-                        <a class="button-primary glm-right" href="http://{$contactInfo.fieldData.url}" target="urlTarget">Test Link</a>
+                        <a class="button button-secondary glm-right" href="http://{$contactInfo.fieldData.url}" target="urlTarget">Test Link</a>
             {/if}
                         http://<input type="text" name="url" value="{$contactInfo.fieldData.url}" class="glm-form-text-input-medium" placeholder="ex: www.gaslightmedia.com">
                         {if $contactInfo.fieldFail.url}<p>{$contactInfo.fieldFail.url}</p>{/if}
   {/if} <!-- /if option -->
 
 {else} <!-- Member not specified or not found -->
-    <h2><span class="glm-error">ERROR:</span> Specified member not found!</h2>
+    <h2 class="glm-error">No current member.</h2>
 {/if}
 
     <script type="text/javascript">
diff --git a/views/admin/profile/header.html b/views/admin/profile/header.html
new file mode 100644 (file)
index 0000000..1186e17
--- /dev/null
@@ -0,0 +1,10 @@
+<div class="wrap">
+    <h2>Your Contact and Log-in Profile</h2>
+    <h2 class="nav-tab-wrapper">
+        <a href="{$thisURL}?page={$thisPage}&glm_action=index" class="nav-tab{if $thisAction==index} nav-tab-active{/if}">User Profile</a>
+{foreach $addOnTabs as $a}
+        <a href="{$thisURL}?page=glm-members-admin-menu-{$a.menu}&glm_action={$a.action}" class="nav-tab{if $thisAction==$a.action} nav-tab-active{/if}">{$a.text}</a>
+{/foreach}        
+    </h2>
+    <div id="glm-admin-content-container">
+    
\ No newline at end of file
index 4d25992..bee564f 100644 (file)
@@ -1,11 +1,4 @@
-<div class="wrap">
-
-    <h2>Your Contact and Log-in Profile</h2>
-  
-    <h2 class="nav-tab-wrapper">
-        <a href="{$thisURL}?page={$thisPage}&glm_action=index" class="nav-tab{if $thisAction==index}-active{/if}">Profile</a>
-    </h2>
-    <div id="glm-admin-content-container">
+{include file="$glmWordpresBasePluginPath/glm-member-db-contacts/views/admin/profile/header.html"}
    
 {if apply_filters('glm_members_permit_admin_profile_index_edit_profile', true)}
 
                     <th>City</th>
                     <td class="glm-item-container">
                         <!--  Add new city dialog -->
-                        <div id="newCityButton" class="button-primary glm-right">Add a new City</div>
+                        <div id="newCityButton" class="button button-secondary glm-right">Add a new City</div>
                         <div id="newCityDialog" class="glm-dialog-box" title="Enter a New City">
                             <table class="glm-admin-table">
                                 <tr>
                                 </tr>
                             </table>
                             <p><span class="glm-required">*</span> Required</p>
-                            <a id="newCityCancel" class="button-primary glm-right">Cancel</a>
+                            <a id="newCityCancel" class="button button-primary glm-right">Cancel</a>
                             <input id="newCitySubmit" type="submit" value="Add new City">
                         </div>
                         <!-- City Selection -->
                     <th {if $contactInfo.fieldRequired.url}class="glm-required"{/if}>Web Address (URL):</th>
                     <td {if $contactInfo.fieldFail.url}class="glm-form-bad-input"{/if}>
             {if $contactInfo.fieldData.url}
-                        <a class="button-primary glm-right" href="http://{$contactInfo.fieldData.url}" target="urlTarget">Test Link</a>
+                        <a class="button button-secondary glm-right" href="http://{$contactInfo.fieldData.url}" target="urlTarget">Test Link</a>
             {/if}
                         http://<input type="text" name="url" value="{$contactInfo.fieldData.url}" class="glm-form-text-input-medium" placeholder="ex: www.gaslightmedia.com">
                         {if $contactInfo.fieldFail.url}<p>{$contactInfo.fieldFail.url}</p>{/if}