From d2d36f6a378a42bef86882a1b49d12cfb7be0004 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Fri, 19 Jul 2019 16:10:49 -0400 Subject: [PATCH] More updates to UI elements and to admin forms for this plugin. --- classes/serverBandwidthSupport.php | 2 +- index.php | 8 +- models/adminServerStats.php | 4 +- models/adminServerStatsConfig.php | 7 +- models/frontCookiePopUp.php | 14 +- models/serverUsageTargetCheck.php | 2 - views/adminServerStats.html | 336 ++++++++++++++------------ views/adminServerStatsConfig.html | 124 +++++++--- views/footer.html | 5 - views/{ui => }/multiSelectSearch.html | 0 views/ui/f6/checkbox.html | 37 +-- views/ui/f6/editor.html | 87 ++++--- views/ui/f6/grid-end.html | 8 +- views/ui/f6/grid-start.html | 26 +- views/ui/f6/image.html | 2 +- views/ui/f6/multicheckboxes.html | 2 +- views/ui/f6/multiselect.html | 2 +- views/ui/f6/number.html | 46 ++-- views/ui/f6/section-end.html | 2 +- views/ui/f6/section-start.html | 4 +- views/ui/f6/select.html | 2 +- views/ui/f6/text-line.html | 2 +- views/ui/f6/text.html | 28 +-- 23 files changed, 445 insertions(+), 305 deletions(-) rename views/{ui => }/multiSelectSearch.html (100%) diff --git a/classes/serverBandwidthSupport.php b/classes/serverBandwidthSupport.php index b7544d6..21087c5 100755 --- a/classes/serverBandwidthSupport.php +++ b/classes/serverBandwidthSupport.php @@ -862,7 +862,7 @@ class glmServerStatsBandwidthSupport */ public function checkEmailNotifications($sendToGlmContact = false, $sendToCustContact = false, $sendAll = false, $site = false, $forceDisplay = false) { -echo "
".print_r($this->config,1)."
";exit; + // Get info on the desired sites for processing $websites = $this->bandwidthLastMonthAllSites(false, $site); diff --git a/index.php b/index.php index 5f07411..9e5bcc4 100755 --- a/index.php +++ b/index.php @@ -284,7 +284,7 @@ register_deactivation_hook(__FILE__, 'glmServerStatsPluginDeactivate'); */ // Called by WordPress scheduler as set below -add_action('glm_serverstats_notify_cron', 'doGlmServerstatsCron'); +//add_action('glm_serverstats_notify_cron', 'doGlmServerstatsCron'); function doGlmServerstatsCron() { trigger_error('GLM Serverstats Cron Called', E_USER_NOTICE); @@ -297,7 +297,7 @@ function doGlmServerstatsCron() { $targetCheckMonth .= '/43'; trigger_error("BLOCKING TARGET CHECK FOR NOW FOR TEST", E_USER_NOTICE); - if (FALSE && $targetCheckMonth != $targetCheckLast) { + if ( false && $targetCheckMonth != $targetCheckLast) { trigger_error('Running Target Check Process for Month = '.$targetCheckMonth, E_USER_NOTICE); @@ -331,8 +331,8 @@ if (apply_filters('glm-serverstats-is-provider', false) || true) { $cronTimestamp = wp_next_scheduled( 'glm_serverstats_notify_cron' ); if (!$cronTimestamp) { -// wp_schedule_event( time(), 'hourly', 'glm_serverstats_notify_cron' ); - wp_schedule_event( time(), 'minute', 'glm_serverstats_notify_cron' ); + wp_schedule_event( time(), 'hourly', 'glm_serverstats_notify_cron' ); +// for testing wp_schedule_event( time(), 'minute', 'glm_serverstats_notify_cron' ); } diff --git a/models/adminServerStats.php b/models/adminServerStats.php index 7bef2f1..1a58bfd 100755 --- a/models/adminServerStats.php +++ b/models/adminServerStats.php @@ -73,11 +73,11 @@ class adminServerStats extends glmServerStatsBandwidthSupport return ['redirect' => 'adminServerStatsConfig']; } -// *** THIS IS HERE TEMPORARILY FOR TEST **** +/* // Enable this code to have serverUsageTargetCheck() run each time this model runs. For Testing Only! require_once GLM_SERVERSTATS_PLUGIN_MODEL_PATH.'/serverUsageTargetCheck.php'; $ServerUsageTargetCheck = new serverUsageTargetCheck(); $ServerUsageTargetCheck->model(); -// *** END OF TEST **** +*/ $haveStats = false; $stats = false; diff --git a/models/adminServerStatsConfig.php b/models/adminServerStatsConfig.php index 6840f35..357c9cd 100755 --- a/models/adminServerStatsConfig.php +++ b/models/adminServerStatsConfig.php @@ -119,8 +119,9 @@ class adminServerStatsConfig extends glmServerStatsBandwidthSupport '

This site uses temporary "Cookies" to store limited information that\'s ' .'required to provide you with a consistent user experience. We don\'t store ' .'personally identifying or other sensitive information in these Cookies and ' - .'these Cookies are erased when you close your Web Browser.

If you\'re ' - .'on a public computer, be sure to close all Web Browsers when you\'re done!

'; + .'these Cookies are erased when you close your Web Browser unless otherwise ' + .'stated when you click "Show more".

If you\'re on a public computer,' + .'be sure to close all Web Browsers when you\'re done!

'; $autoInsertDefault = true; } @@ -149,7 +150,7 @@ class adminServerStatsConfig extends glmServerStatsBandwidthSupport ) ); - // echo "
".print_r($templateData,1)."
"; + // echo "
".var_dump($templateData,1)."
"; // Return status, suggested view, and data to controller return array( diff --git a/models/frontCookiePopUp.php b/models/frontCookiePopUp.php index 3350c74..efba246 100755 --- a/models/frontCookiePopUp.php +++ b/models/frontCookiePopUp.php @@ -23,14 +23,16 @@ $serverstatsConfig = get_option(GLM_SERVERSTATS_PLUGIN_CONFIG_OPTION); } #cookieNoticeBox .title { font-size: .9em; + font-weight: bold; padding-bottom: .5em; border-bottom: 2px solid black; margin-bottom: .5em; } #cookieNoticeBox .button { color: black; + font-size: 1rem; background-color: lightgrey; - padding: 8px 20px; + padding: 2px 10px; z-index: 20; left: 0; top: 0; @@ -46,7 +48,7 @@ $serverstatsConfig = get_option(GLM_SERVERSTATS_PLUGIN_CONFIG_OPTION); Show more Got it!

- + + diff --git a/views/ui/f6/grid-start.html b/views/ui/f6/grid-start.html index 692626e..d104574 100644 --- a/views/ui/f6/grid-start.html +++ b/views/ui/f6/grid-start.html @@ -1,5 +1,5 @@ {* - Foundation 6 - Grid Start + Foundation 6 UI - Grid Start {$ui = [ 'nowrap' => string True if no sections should wrap to the right, @@ -7,7 +7,10 @@ 'sectionColor' => string background color of sections ]} + NOTE: The js/foundation-6.min.js and css/foundation-6.min.css files must be enqueued for this to work. + *} + {$glm_f6_ui_wrapsize = 6 scope="global"} {if isset($ui.nowrap) && $ui.nowrap} {$glm_f6_ui_wrapsize = 12 scope="global"} @@ -34,7 +37,7 @@ background-color: {$glm_f6_ui_section_color} !important; } .glm-f6-ui-field { - margin-bottom: 1rem !important; + margin-bottom: .5rem !important; } .glm-f6-ui-label-container { } @@ -42,6 +45,7 @@ margin-left: 0 !important; } .glm-f6-ui-field-label { + margin-top: 0 !important; } .glm-f6-ui-field-input { margin-bottom: 0 !important; @@ -52,15 +56,29 @@ .glm-f6-ui-field-input-number { margin-bottom: 0 !important; } + .glm-f6-ui-field-messages { + margin-top: 0rem !important; + margin-bottom: 0rem !important; + } .glm-f6-ui-field-data-error { + font-weight: normal !important; + font-size: .8rem !important; + margin-top: 0 !important; } .glm-f6-ui-field-help-text { - margin-bottom: 0 !important; + font-weight: normal !important; + font-size: .8rem !important; + margin-top: 0 !important; } .glm-f6-ui-field-error-text { + top: 0 !important; + font-weight: normal !importantl + font-size: .8rem !important; + margin-top: 0 !important; + margin-bottom: 0 !important; } .glm-f6-ui-text-line { - margin-bottom: 1rem !important; + margin-bottom: 1.2rem !important; }
diff --git a/views/ui/f6/image.html b/views/ui/f6/image.html index 81b2887..cd6b677 100644 --- a/views/ui/f6/image.html +++ b/views/ui/f6/image.html @@ -13,7 +13,7 @@ 'label' => string Label text for this field, 'required' => boolean True if required, 'helpText' => string Help text for this input, - 'errortext' => string Error text that appears when the field doesn't validate, + 'errorText' => string Error text that appears when the field doesn't validate, 'dataError' => string Error from data Abstract Class ]} *} diff --git a/views/ui/f6/multicheckboxes.html b/views/ui/f6/multicheckboxes.html index 9f40622..26612f3 100644 --- a/views/ui/f6/multicheckboxes.html +++ b/views/ui/f6/multicheckboxes.html @@ -14,7 +14,7 @@ 'list' => array Array of list key=value pairs value=>label 'required' => boolean True if required, 'helpText' => string Help text for this input, - 'errortext' => string Error text that appears when the field doesn't validate, + 'errorText' => string Error text that appears when the field doesn't validate, 'dataError' => string Error from data Abstract Class ]} *} diff --git a/views/ui/f6/multiselect.html b/views/ui/f6/multiselect.html index de0ec27..c61f76c 100644 --- a/views/ui/f6/multiselect.html +++ b/views/ui/f6/multiselect.html @@ -17,7 +17,7 @@ 'l_size' => integer select size, 'required' => boolean True if required, 'helpText' => string Help text for this input, - 'errortext' => string Error text that appears when the field doesn't validate, + 'errorText' => string Error text that appears when the field doesn't validate, 'dataError' => string Error from data Abstract Class ]} *} diff --git a/views/ui/f6/number.html b/views/ui/f6/number.html index 8a4e4fe..67036fe 100644 --- a/views/ui/f6/number.html +++ b/views/ui/f6/number.html @@ -1,23 +1,23 @@ {* - Foundation 6 - Number Input Field + Foundation 6 UI - Number Input Field Do not include fields if they're false. (We're not checking for false) {$ui = [ - 'value' => array Data from data abstract if using that, - 'field' => string Name of field that holds the data if not using data abstract, - 'label' => string Label text for this field, - 'placeholder' => string Placeholder string, - 'suffix' => string Suffix text to add after input field, - 'min' => integer Minimum numeric value - 'max' => integer Maximum numeric value - 'width' => integer Size of input field in characters, - 'message' => string Message string to display between label and input, - 'helpText' => string Help text for this input, - 'errortext' => string Error text that appears when the field doesn't validate + 'field' => string Required Name of field that holds the data if not using data abstract, + 'value' => array Required Value of this number field + 'label' => string Required Label text for this field, + 'placeholder' => string Placeholder string, + 'suffix' => string Suffix text to add after input field, + 'min' => integer Minimum numeric value + 'max' => integer Maximum numeric value + 'width' => integer Size of input field in characters, + 'message' => string Message string to display between label and input, + 'helpText' => string Help text for this input, + 'errorText' => string Error text that appears when the field doesn't validate ]} *} -{if !isset($ui.width)} +{if empty($ui.width)} {$ui.width = 5} {else} {$ui.width = $ui.width * .55 + 2.5} @@ -35,21 +35,21 @@ type="number" name="{$ui.field}" value="{$ui.value}" - {if $ui.required}required{/if} - {if isset($ui.errorText)}aria-errormessage="{$ui.field}_ErrorText"{/if} - {if isset($ui.helpText)}aria-describedby="{$ui.field}_HelpText"{/if} - {if isset($ui.placeholder)}placeholder="{$ui.placeholder}"{/if} - {if isset($ui.min)}min="{$ui.min}"{/if} - {if isset($ui.min)}max="{$ui.max}"{/if} + {if !empty($ui.required)}required{/if} + {if !empty($ui.errorText)}aria-errormessage="{$ui.field}_ErrorText"{/if} + {if !empty($ui.helpText)}aria-describedby="{$ui.field}_HelpText"{/if} + {if !empty($ui.placeholder)}placeholder="{$ui.placeholder}"{/if} + {if !empty($ui.min)}min="{$ui.min}"{/if} + {if !empty($ui.min)}max="{$ui.max}"{/if} style="width: {$ui.width}rem;" >
- +
-
- {if isset($ui.helpText)}{$ui.helpText}{/if} - {if true || isset($ui.errorText)}{$ui.errorText}{/if} +
+ {if !empty($ui.helpText)}{$ui.helpText}{/if} + {if !empty($ui.errorText)}{$ui.errorText}{/if}
{/if} diff --git a/views/ui/f6/section-end.html b/views/ui/f6/section-end.html index 8fc3de7..cd10d79 100644 --- a/views/ui/f6/section-end.html +++ b/views/ui/f6/section-end.html @@ -1,5 +1,5 @@ {* - Foundation 6 - Form Section End + Foundation 6 UI - Form Section End No parameters are needed for Section-End *} diff --git a/views/ui/f6/section-start.html b/views/ui/f6/section-start.html index ea15d8e..fb3ab58 100644 --- a/views/ui/f6/section-start.html +++ b/views/ui/f6/section-start.html @@ -1,5 +1,5 @@ {* - Foundation 6 - Form Section Start + Foundation 6 UI - Form Section Start {$ui = [ 'title' => string Section title text, @@ -14,7 +14,7 @@ {else}
{if isset($ui.tip)} - ? + ? {/if}

{$ui.title}

{if isset($ui.helpText)}

{$ui.helpText}

{/if} diff --git a/views/ui/f6/select.html b/views/ui/f6/select.html index 2e26b10..c2a095f 100644 --- a/views/ui/f6/select.html +++ b/views/ui/f6/select.html @@ -16,7 +16,7 @@ 'l_blank' => string Add empty option 'required' => boolean True if required, 'helpText' => string Help text for this input, - 'errortext' => string Error text that appears when the field doesn't validate, + 'errorText' => string Error text that appears when the field doesn't validate, 'dataError' => string Error from data Abstract Class ]} *} diff --git a/views/ui/f6/text-line.html b/views/ui/f6/text-line.html index f8bb358..e362436 100644 --- a/views/ui/f6/text-line.html +++ b/views/ui/f6/text-line.html @@ -1,5 +1,5 @@ {* - Foundation 6 - Text Line (display only) + Foundation 6 UI - Text Line (display only) {$ui = [ 'text' => string Required Text to display, diff --git a/views/ui/f6/text.html b/views/ui/f6/text.html index 71f8675..538bbd0 100644 --- a/views/ui/f6/text.html +++ b/views/ui/f6/text.html @@ -1,5 +1,5 @@ {* - Foundation 6 - Text Input Field + Foundation 6 UI - Text Input Field Do not list parameters if they're false. (We're not checking for false). @@ -13,14 +13,14 @@ 'maxWidth' => string Size of input field using standard style notation ('900px', '15rem', ...), 'maxlength' => integer Maximum number of characters that may be entered, 'helpText' => string Help text for this input, - 'errortext' => string Error text that appears when the field doesn't validate, + 'errorText' => string Error text that appears when the field doesn't validate, 'dataError' => string Error from data Abstract Class 'tip' => string String to display when hover over question mark on right ]} *}
{if (!isset($ui.value) && !isset($ui.field)) || !isset($ui.label)} - Field Error: Required field information not supplied! + Field Error: Required field information not supplied! {else}
@@ -36,19 +36,19 @@ id="{$ui.field}" name="{$ui.field}" value="{$ui.value|escape}" - {if isset($ui.pattern) && $ui.pattern}pattern="{$ui.pattern}"{/if} - {if $ui.required}required{/if} - {if isset($ui.placeholder) && $ui.placeholder}placeholder="{$ui.placeholder}"{/if} - {if isset($ui.errorText)}aria-errormessage="{$ui.field}_ErrorText"{/if} - {if isset($ui.helpText)}aria-describedby="{$ui.field}_HelpText"{/if} - {if isset($ui.maxWidth)}style="max-width: {$ui.maxWidth}"{/if} - {if isset($ui.maxLength)}max-length="{$ui.maxLength}"{/if} + {if !empty($ui.pattern)}pattern="{$ui.pattern}"{/if} + {if !empty($ui.required)}required{/if} + {if !empty($ui.placeholder)}placeholder="{$ui.placeholder}"{/if} + {if !empty($ui.errorText)}aria-errormessage="{$ui.field}_ErrorText"{/if} + {if !empty($ui.helpText)}aria-describedby="{$ui.field}_HelpText"{/if} + {if !empty($ui.maxWidth)}style="max-width: {$ui.maxWidth}"{/if} + {if !empty($ui.maxLength)}max-length="{$ui.maxLength}"{/if} />
-
- {if isset($ui.dataError) && $ui.dataError}{$ui.dataError}{/if} - {if isset($ui.helpText)}{$ui.helpText}{/if} - {if isset($ui.errorText)}{$ui.errorText}{/if} +
+ {if !empty($ui.dataError)}{$ui.dataError}{/if} + {if !empty($ui.errorText)}{$ui.errorText}{/if} + {if !empty($ui.helpText)}{$ui.helpText}
{/if}
{/if} -- 2.17.1