First-activation now properly set, createPages doesn't displace ID unless first-activ...
authorlaury <laury@gaslightmedia.com>
Fri, 20 May 2016 21:14:24 +0000 (17:14 -0400)
committerlaury <laury@gaslightmedia.com>
Fri, 20 May 2016 21:14:24 +0000 (17:14 -0400)
activate.php
classes/glmPluginSupport.php
css/front.css
setup/shortcodes.php
views/admin/shortcodes/index.html

index 228d448..e29c3cc 100644 (file)
@@ -94,10 +94,10 @@ class glmMembersPluginActivate extends glmPluginSupport
 
         }
         
-        if (get_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION, 'none') == 'none') {
-            update_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION, true);
+        if (get_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION, 'None') == 'None') {
+            update_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION, 'true');
         } else {
-            update_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION, false);
+            update_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION, 'false');
         }
     }
 
index 0dd64a7..5fe414e 100644 (file)
@@ -533,10 +533,15 @@ return; // Off for now ** Need to make this switchable in management
             //  is checked by translating the page title.
             $newSlug = sanitize_title($requiredPageInfo['title']);
             $existingSlug = $this->verify_post_slug($newSlug);
-            if ($newSlug == $existingSlug) {
-                $existingID = $this->get_post_id_by_slug($newSlug);
-                update_option($option, $existingID);   
+            
+            // But only run this if it is the first time this plugin is activated
+            if (get_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION) == 'true') {
+                if ($newSlug == $existingSlug) {
+                    $existingID = $this->get_post_id_by_slug($newSlug);
+                    update_option($option, $existingID);   
+                }
             }
+            
             $existingPost = get_post(get_option($option));
             // If a post with the ID set in the option does not exist
             if ( !$existingPost) {
@@ -572,7 +577,9 @@ return; // Off for now ** Need to make this switchable in management
                 // No page created
             }
         }
-
+        if (get_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION) == 'true') {
+            update_option(GLM_MEMBERS_PLUGIN_OPTION_FIRST_ACTIVATION, 'false');
+        }
     }
 
     public function insertReqPage($pTitle = '--bad page--', $pContent = '', $pPublish = 'publish', $pType = 'page', $pAuthor = '1', $pTemplate = 'index.php', $pParent = '0')
index 0c3ced5..117d8a0 100644 (file)
@@ -80,6 +80,9 @@
     font-size: 24px;
     line-height: 1;
 }
+.glm-member-list-image-border img {
+    float: right;
+}
 .glm-member-db-list-grid-view .glm-member-title {
     font-size: 24px;
     font-weight: normal;
     overflow: hidden;
     position: absolute;
     top: 13px;
-    width: 100px;
+    width: 120px;
 }
 #glm-member-detail-takeback-mini:hover {
     text-decoration: none;
-    width: 170px;
+    width: 190px;
     -webkit-transition: width 0.5s ease;
     -moz-transition:    width 0.5s ease;
     -o-transition:      width 0.5s ease;
index 64f774b..ffdd336 100644 (file)
@@ -167,7 +167,8 @@ $glmMembersShortcodes = array(
 $glmMembersShortcodesDescription = '
 
 <!-- glm-members-list -->
-
+<table id="glm-table-shortcodes-members" class="glm-admin-table glm-shortcodes-table">
+    <tr><th>Shortcode</th><th>Attribute</th><th>Description</th></tr>
     <tr>
         <th>[glm-members-list]</th>
         <td>&nbsp;</td>
@@ -359,5 +360,5 @@ $glmMembersShortcodesDescription = '
             </p>
         </td>
     </tr>
-
+ </table>
 ';
index b9cfc4e..d87855d 100644 (file)
     <p><pre>[glm-members-list category="11"]</pre></p>
 
     <p>&nbsp;</p>
-        
-    <table class="glm-admin-table">
-        <tr><th>Shortcode</th><th>Attribute</th><th>Description</th></tr>
-        
+    
+    <h2 class="nav-tab-wrapper" style="margin-bottom: 1em;">
+        <a id="glm-shortcodes-members" data-show-table="glm-table-shortcodes-members" class="glm-shortcodes-tab nav-tab nav-tab-active">Members</a>
+        <a id="glm-shortcodes-packaging" data-show-table="glm-table-shortcodes-packaging" class="glm-shortcodes-tab nav-tab">Packaging</a>
+        <a id="glm-shortcodes-events" data-show-table="glm-table-shortcodes-events" class="glm-shortcodes-tab nav-tab">Events</a>
+<!--        <a id="glm-shortcodes-contacts" data-show-table="glm-table-shortcodes-contacts" class="glm-shortcodes-tab nav-tab">Contacts</a>-->
+<!--        <a id="glm-shortcodes-socials" data-show-table="glm-table-shortcodes-socials" class="glm-shortcodes-tab nav-tab">Socials</a>-->
+    </h2>
+    
         {$shortcodesDescription}
         
-    </table>
-    
+        <script>    
+        jQuery(document).ready(function($) {
+            
+            /*
+             * Edit area tabs
+             */
+            $('.glm-shortcodes-tab').click( function() {
+
+                // Clear tabl highlights and hide all tables
+                $('.glm-shortcodes-tab').removeClass('nav-tab-active');
+                $('.glm-shortcodes-table').addClass('glm-hidden');
+                
+                // Highlight selected tab
+                $(this).addClass('nav-tab-active');
+                
+                // Show selected table
+                var table = $(this).attr('data-show-table');
+                $('#' + table).removeClass('glm-hidden');
+                
+                
+            });
+        })
+        </script>
 {include file='admin/footer.html'}