Because Steve Needed Me To...
authorChuck Scott <cscott@gaslightmedia.com>
Mon, 5 Aug 2019 20:55:06 +0000 (16:55 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Mon, 5 Aug 2019 20:55:06 +0000 (16:55 -0400)
index.php
setup/commonHooks.php
views/adminServerStats.html
views/adminServerStatsConfig.html
views/ui/f6/form-start.html

index 8f4b6da..f8be78c 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -106,7 +106,6 @@ function glmServerStatsScripts()
             GLM_SERVERSTATS_PLUGIN_VERSION,
             true
             );
-    wp_enqueue_script('glm-usage-foundation6-js', false, array('jquery'), false, true);
     wp_register_style(
             'glm-usage-foundation6-css',
             GLM_SERVERSTATS_PLUGIN_URL . 'css/foundation-6.min.css',
@@ -123,7 +122,7 @@ function glmServerStatsScripts()
     wp_enqueue_style('jquery-style', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css');
 
     // Register and enqueue DateTimePicker
-    wp_register_script(
+    wp_enqueue_script(
         'glm-members-admin-datetimepicker',
         GLM_SERVERSTATS_PLUGIN_URL . 'js/datetimepicker/build/jquery.datetimepicker.full.min.js',
         array(
@@ -131,7 +130,6 @@ function glmServerStatsScripts()
         ),
         GLM_MEMBERS_PLUGIN_VERSION
     );
-    wp_enqueue_script('glm-members-admin-datetimepicker', false, array('jquery'), false, true);
     wp_register_style(
         'glm-members-admin-datetimepicker-css',
         GLM_SERVERSTATS_PLUGIN_URL . 'js/datetimepicker/jquery.datetimepicker.css',
index 7a65fdf..c68b514 100644 (file)
@@ -37,7 +37,7 @@
  * and be able to connect to the server usage statistics database.
  */
 add_filter('glm-serverstats-is-provider', function() {
-    return ((strpos(GLM_SERVERSTATS_SITE_BASE_URL, GLM_SERVERSTATS_PROVIDER_1) !== false || strpos(GLM_SERVERSTATS_SITE_BASE_URL, GLM_SERVERSTATS_PROVIDER_2) !== false));
+    return ((strpos(GLM_SERVERSTATS_SITE_BASE_URL, GLM_SERVERSTATS_PROVIDER_1) !== false || strpos(GLM_SERVERSTATS_SITE_BASE_URL, GLM_SERVERSTATS_PROVIDER_2) !== false) && current_user_can( 'administrator' ));
     },
     10,
     2
index dacfc0d..36a9358 100755 (executable)
 
                 {include file="ui/f6/form-end.html"}
 
+            <div class="usage-section">Customer Section</div>
+         
+        {else}
+        
+            <div class="usage-section">Website Data Usage</div>
+        
         {/if} {* /is provider *}
 
-        <div class="usage-section">Customer Section</div>
-
         <!-- Server Data Usage Stats -->
         <div style="width: 95%;" class="callout">
             <center>
                         <div class="graphContainer">
                             <div class="graph"><img id="twoYearStorageImg" src="{$assetsUrl}/graph.png" class="glmbw-image"></div>
                             <div class="graphTitle">
-                                Montlhy maximum disk space used for past year. The dotted line is our current/planned billing level.
+                                Monthly maximum disk space used for past year. The dotted line is our current/planned billing level.
                             </div>
                         </div>
                         <div class="graphContainer">
index f8e7ba4..138ceb2 100755 (executable)
                                 'max'           => 90,
                                 'width'         => 5,
                                 'helpText'      => 'Number of days after user accepts the cookie pop-up that it will display again.
-                                                <b>Do not set to a real high number. Consider 10-30 days. Set to 0 to test Cookie Popups.</b>'
+                                                    <b>Do not set to a real high number. Consider 10-30 days. Set to 0 to test Cookie Popups.</b>',
+                                'errorText'     => 'Must be between 0 and 90 days!'
                             ]}
                             {include file="ui/f6/number.html"}
 
index 7218e68..0cccdfa 100644 (file)
     </div>
     {if !empty($ui.validateFocusMsg)}
         <script>
-            jQuery(document).ready(function(){
-
+            jQuery(document).ready(function($){
                 $(document).on( 'forminvalid.zf.abide', function( ev, frm ) {
                     console.log( 'forminvalid' );
-                    
-                    
                     $("html, body").animate({ scrollTop: $('#validateMessage{if !empty($ui.validateID)}_{$ui.validateID}{/if}').position().top -10 }, 'slow');
                 });
             });