Various improvements and fixes
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 17 Sep 2019 18:59:06 +0000 (14:59 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 17 Sep 2019 18:59:06 +0000 (14:59 -0400)
Website selectin table now more browser friendly
Updated usage reports and summaries
Usage report text now editable and can add custom text for sending to selected site
Added cookie pop-up test link in admin
Fixed problem with date changes for grahs

activate.php
classes/serverBandwidthSupport.php
defines.php
models/adminServerStats.php
models/ajaxSendUsageReport.php
readme.txt
views/adminServerStats.html
views/ui/f6/form-edit-start.html
views/ui/f6/form-start.html
views/ui/f6/form-summary-start.html
views/ui/f6/submit.html

index 5650962..e89aff1 100755 (executable)
@@ -58,19 +58,19 @@ class glmServerStatsPluginActivate
 
             $pageContent = "
 <div style=\"display:inline-block\">
-    <a name=\"cookies\"><h2>Cookies and Privacy</h2></a>
+    <h2>Cookies and Privacy</h2></a>
     <p>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 unless otherwise stated when you click \"Show more\".</p>
     <p>If you're on a public computer, be sure to close all Web Browsers when you're done!</p>
 </div>
 <div style=\"display:inline-block\">
-    <a name=\"additional\"></a><h2>Additional Privacy Information</h2>
+    <h2>Additional Privacy Information</h2>
     <p><b>GDPR:</b> The EU GDPR legislation obligates us to tell you how we use information you supply through this Website. We intentionally limit the information we ask you to supply to what is absolutely necessary to provide the service you request. Unless otherwise stated, we don't share any supplied information with any other person or organization other than as required and as authorized by you. Payment related information you supply will only be used to complete a transaction and will not be stored on our systems.</p>
     <p><b>ACCESS LOGS:</b> We retain access logs entries for a certain period of time for the sole purpose of ensuring security of our systems and compliance of acceptable use by users of this site. We don't share log entries with anyone unless obligated to do so by way of a lawful request from a law enforcement agency or court with appropriate jurisdiction.</p>
     <p><b>PERMANENT COOKIES:</b> This Website may use \"Permanent Cookies\" that are retained by your Web Browser. This type of Cookie is used to help you when you return to this Website at a later time. If you're using a public computer, be sure to delete all cookies before closing the Browser.</p>
     <p><b>TRACKING:</b> We may track where you go within this site. This helps us provide you with relevant information and to evaluate how we may improve the site. We don't share this tracking information with anyone unless otherwise stated here.</p>
-    <p><b>SHARED TRACKING:</b> This site may contain third-party shared tracking features. These features may collect and share tracking information with affiliated Websites and advertisers to help them provide you with more relevant information. This site may also contain third-party shared tracking features that permit a third-party to collect and report traffic statistics to the owner of this site. We don't permit shared tracking to include personal information of any user.</p>
+    <p><b>SHARED TRACKING:</b> This site may contain third-party shared tracking features. These features may collect and share tracking information with affiliatedwWebsites and advertisers to help them provide you with more relevant information. This site may also contain third-party shared tracking features that permit a third-party to collect and report traffic statistics to the owner of this site. We don't permit shared tracking to include personal information of any user.</p>
     <p><b>HTTPS:</b> This Website uses the secure \"HTTPS\" protocol for all pages and content. This makes it very difficult for anyone who may tap into Internet traffic to read what you submit and what is being sent back to you. If you feel that the possibility of someone intercepting information you submit or knowledge of the pages you access presents a significant risk to you, please don't use this Website.</p>
-    <p><b>LOGGED IN USERS:</b> We don't store passwords you use to log in as plain text, instead they're encrypted before being stored in our systems. When you enter that password again to log in, we encrypt that and and match it to the encrypted password that had been stored. There is no way to decrypt the stored passwords, but it may be possilbe for others to guess simple passwords. You should always use more complex passwords that don't include words or names people would associate with you. You should also try to avoid using the same password for everything you log into and should not make those passwords easily accessible to anyone else.</p>
+    <p><b>LOGGED IN USERS:</b> We don't store passwords you use to log in as plain text, instead they're encrypted before being stored in our systems. When you enter that password again to log in, we encrypt that and match it to the encrypted password that had been stored. There is no way to decrypt the stored passwords, but it may be possible for others to guess simple passwords. You should always use more complex passwords that don't include words or names people would associate with you. You should also try to avoid using the same password for everything you log into and should not make those passwords easily accessible to anyone else.</p>
     <p><b>FORMS:</b> Personal information requested in forms on this site is limited to what is required to provide you with the information and services you request. Please don't provide additional personal information in these forms that is not requested. If you are uncomfortable with submitting any requested information, please call or write to us directly using the address and phone numbers on this site. We don't supply any of the information you provide to any other individual or organization unless you check a box in the submission form specifically authorizing us to do so.</p>
     <p><b>PAYMENT INFORMATION:</b> We only use the payment information you provide to complete a paid transaction. We don't retain any payment information beyond that point. If you check a box asking us to store credit card or similar information for future use, we pass that request on to the credit card processing service and they store that information on their systems. All we store on our systems is a \"token\" that can only be used to process another authorized transaction on your behalf through this Website with the same credit card processing service.</p>
 </div>
index e971880..cb88654 100755 (executable)
@@ -171,6 +171,7 @@ class glmServerStatsBandwidthSupport
                 SELECT R.websitefk as id,
                        W.name as name,
                        W.glm_contact,
+                       W.cust_contact_name,
                        W.cust_contact,
                        W.target,
                        COALESCE ( SUM(R.bytesin)/1000000000, 0 ) as data_in,
@@ -697,10 +698,11 @@ class glmServerStatsBandwidthSupport
      * @return integer Number of sites notified
      *
      */
-    public function checkEmailNotifications($sendToGlmContact = false, $sendToCustContact = false, $sendAll = false, $site = false, $forceDisplay = false)
+    public function checkEmailNotifications($sendToGlmContact = false, $sendToCustContact = false, $sendAll = false, $site = false, $forceDisplay = false, $additionalText = '')
     {
 
         $glmFromContact = get_option(GLM_SERVERSTATS_PLUGIN_REPORT_CONTACT);
+        $glmNoticeEmail = get_option(GLM_SERVERSTATS_PLUGIN_REPORT_CONTENT);
 
         // Get info on the desired sites for processing
         $websites = $this->bandwidthLastMonthAllSites(false, $site);
@@ -738,6 +740,7 @@ class glmServerStatsBandwidthSupport
 
         // For each website retrieved
         foreach ($websites as $site) {
+echo "<pre>".print_r($site,1)."</pre>";
 
             $mesg = '';
 
@@ -753,12 +756,12 @@ class glmServerStatsBandwidthSupport
                 $glmMesg .= '
                     <tr>
                         <td align="left">'.$site['name'].'</td>
-                        <td align="left">'.sprintf('%.3f', $site['target']).' Gigabytes</td>
-                        <td align="left">'.sprintf('%.3f', $site['data_total']).' Gigabytes</td>
+                        <td align="right">'.sprintf('%.3f', $site['target']).' Gigabytes</td>
+                        <td align="right">'.sprintf('%.3f', $site['data_total']).' Gigabytes</td>
                         <td style="'.$styleClauseTraffic.'" align="right">'.sprintf('%.0f', $site['target_percent']).'%</td>
                         <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
-                        <td align="left">'.sprintf('%.3f', $site['disk_target']).' Gigabytes</td>
-                        <td align="left">'.sprintf('%.3f', $site['storage']).' Gigabytes</td>
+                        <td align="right">'.sprintf('%.3f', $site['disk_target']).' Gigabytes</td>
+                        <td align="right">'.sprintf('%.3f', $site['storage']).' Gigabytes</td>
                         <td style="'.$styleClauseDisk.'" align="right">'.sprintf('%.0f', $site['disk_target_percent']).'%</td>
                 ';
 
@@ -768,8 +771,10 @@ class glmServerStatsBandwidthSupport
                     $numbReportingWithContactEmail++;
 
                     $dataTable = '
+                        <p>
                         <table>
-                            <tr><th align="left">Website:</th><td>'.$site['name'].'</td>
+                            <tr><th align="left">Website:</th><td>'.$site['name'].'</td></tr>
+                            <tr><th align="left">Month Reported:</th><td>'.$month.'</td></tr>
                             <tr><td colspan="2">&nbsp;</td></tr>
                             <tr><td colspan="2">Traffic</td></tr>
                             <tr><th align="left">Target:</th><td>'.sprintf('%.3f', $site['target']).' Gigabytes</td></tr>
@@ -781,34 +786,22 @@ class glmServerStatsBandwidthSupport
                             <tr><th align="left">Last Month:</th><td>'.sprintf('%.3f', $site['storage']).' Gigabytes</td></tr>
                             <tr><th style="'.$styleClauseDisk.' padding-right: 1em;" align="left">Percent of Target:</th><td>'.sprintf('%.0f', $site['disk_target_percent']).'%</td></tr>
                         </table>
+                        </p>
                     ';
 
+                    // Set Salutation
+                    $salutation = 'Dear Gaslight Media Website Owner';
+                    if (trim($site['cust_contact_name']) != '') {
+                        $salutation = 'Dear '.trim($site['cust_contact_name']);
+                    }
+
 
                     // If stats were exceeded then use this message
                     if ($site['exceeded']) {
 
-                        $mesg = '
-                            <p>Dear Gaslight Media Website Owner:</p>
-                            <p>Congratulations, your Website has exceeded the agreed-upon traffic or disk usage target for '.$month.'.</p>
-                            '.$dataTable.'
-                            <p>
-                                This is good because it means your Website is getting more traffic!
-                            </p>
-                            <p>
-                                Unlike other hosting providers, Gaslight Media doesn\'t automatically increase your monthly hosting fees simply because your Website exceeded the
-                                agreed-upon service level for one month. Instead, we see this as an opportunity to look at your current and future needs. If
-                                you\'re likely to continue exceeding this target, we can talk about a change in your hosting agreement to make sure you continue to
-                                serve your Website users effectively.
-                            </p>
-                            <p>
-                                You can review and print details of your Website usage as well as short-term and long-term graphs by going to the "GLM Data Usage"
-                                menu in the administrative area of your Website.
-                            </p>
-                            <p>
-                                If you wish we can have these notices directed to a different E-Mail address.
-                                Please contact us if you have any questions about this or other concerns. Otherwise, we\'ll contact you soon to talk about the
-                                good performance of your Website and discuss plans for the future.
-                            </p>
+                        $mesg =
+                            '<p>'.$salutation.':</p>
+                            '.wpautop($additionalText).wpautop($glmNoticeEmail['before_report_above_target']).$dataTable.wpautop($glmNoticeEmail['after_report_above_target']).'
                             <p>Sincerely,</p>
                             <p>
                                 Gaslight Media<br>
@@ -821,20 +814,9 @@ class glmServerStatsBandwidthSupport
                         // Otherwise use this message when stats are not exceeded
                     } else {
 
-                        $mesg = '
-                            <p>Dear Gaslight Media Website Owner:</p>
-                            <p>Your Website is within the agreed-upon traffic and disk usage level for '.$month.'.</p>
-                            '.$dataTable.'
-                            <p>
-                                This is a monthly notice to let you know that your Website has not exceeded the agreed-upon service level for the previous month.
-                                You can review and print details of your Website usage as well as short-term and long-term graphs by going to the "GLM Data Usage"
-                                menu in the administrative area of your Website.
-                            </p>
-                            <p>
-                                This is a regular monthly notice.
-                                If you wish we can have these notices directed to a different E-Mail address.
-                                Please contact us if you wouold like to discuss options for creating more interest and in your Website.
-                            </p>
+                        $mesg =
+                            '<p>'.$salutation.':</p>
+                            '.wpautop($additionalText).wpautop($glmNoticeEmail['before_report']).$dataTable.wpautop($glmNoticeEmail['after_report']).'
                             <p>Sincerely,</p>
                             <p>
                                 Gaslight Media<br>
@@ -860,7 +842,11 @@ class glmServerStatsBandwidthSupport
             $glmMesg = '
                 <p>Gaslight Media:</p>
                 <p>The following is a summary of usage report(s) sent for '.$month.'.</p>
-                <table>'.$glmMesg.'</table>';
+                <table>
+                    <tr><th>&nbsp;</th><th colspan="3" style="border-bottom: 1px solid black;">Traffic Usage</th><th>&nbsp;</th><th colspan="3" style="border-bottom: 1px solid black;">Disk Space</th></th>
+                    <tr><th>Website</th><th>Target</th><th>Usage</th><th>% of Target</th><th>&nbsp;</th><th>Target</th><th>Max Used</th><th>% of Target</th></tr>
+                    '.$glmMesg.'
+                </table>';
             $this->sendHtmlEmail($this->glm_billing_contact, $glmFromContact['name'].' <'.$glmFromContact['email'].'>', $glmFromContact['subject'], $glmMesg, $forceDisplay);
         }
 
index adb7aa4..579e453 100755 (executable)
@@ -6,7 +6,7 @@
  */
 
 // Set to true to add more debug messages to the error log
-define('GLM_SERVERSTATS_PLUGIN_DEBUG', true);
+define('GLM_SERVERSTATS_PLUGIN_DEBUG', false);
 
 // Database Connection
 define('GLM_SERVERSTATS_DATABASE_NAME',     'bandwidth');
@@ -117,3 +117,5 @@ define('GLM_SERVERSTATS_PLUGIN_THRESHOLD_OPTION', 'glmServerStatsThreshold');
 define('GLM_SERVERSTATS_PLUGIN_SEND_OPTION', 'glmServerStatsSend');
 define('GLM_SERVERSTATS_PLUGIN_CONFIG_OPTION', 'glmServerStatsConfigData');
 define('GLM_SERVERSTATS_PLUGIN_REPORT_CONTACT', 'glmServerStatsReportContact');
+define('GLM_SERVERSTATS_PLUGIN_REPORT_CONTENT', 'glmServerStatsReportContent');
+
index d924212..a60c153 100755 (executable)
@@ -135,6 +135,7 @@ class adminServerStats extends glmServerStatsBandwidthSupport
                         'selected_site'         => FILTER_SANITIZE_STRING,
                         'target'                => FILTER_VALIDATE_FLOAT,
                         'disk_target'           => FILTER_VALIDATE_FLOAT,
+                        'cust_contact_name'     => FILTER_SANITIZE_STRING,
                         'cust_contact'          => FILTER_SANITIZE_STRING,
                         'cookie_popup_timeout'  => FILTER_VALIDATE_INT,
                         'cookie_message'        => FILTER_SANITIZE_STRING,
@@ -163,6 +164,7 @@ class adminServerStats extends glmServerStatsBandwidthSupport
                             disk_target             = ".$vals['disk_target'].",
                             show_usage              = ".(isset($_POST['show_usage'])?1:0).",
                             send_enabled            = ".(isset($_POST['send_enabled'])?1:0).",
+                            cust_contact_name       = '".$vals['cust_contact_name']."',
                             cust_contact            = '".$vals['cust_contact']."',
                             show_cookie_popup       = ".(isset($_POST['show_cookie_popup'])?1:0).",
                             cookie_popup_timeout    = ".$vals['cookie_popup_timeout'].",
@@ -196,6 +198,15 @@ class adminServerStats extends glmServerStatsBandwidthSupport
                 ];
                 update_option(GLM_SERVERSTATS_PLUGIN_REPORT_CONTACT, $glmFromContact);
 
+                // Update Reporting Content
+                $glmNoticeEmail = [
+                    'before_report' => filter_input( INPUT_POST, 'before_report', FILTER_UNSAFE_RAW),
+                    'after_report'  => filter_input( INPUT_POST, 'after_report', FILTER_UNSAFE_RAW),
+                    'before_report_above_target' => filter_input( INPUT_POST, 'before_report_above_target', FILTER_UNSAFE_RAW),
+                    'after_report_above_target'  => filter_input( INPUT_POST, 'after_report_above_target', FILTER_UNSAFE_RAW)
+                ];
+                update_option(GLM_SERVERSTATS_PLUGIN_REPORT_CONTENT, $glmNoticeEmail);
+
                 // Update Reporting Threshold
                 $threshold = $_REQUEST['threshold'] - 0;
                 update_option(GLM_SERVERSTATS_PLUGIN_THRESHOLD_OPTION, $threshold);
@@ -235,6 +246,7 @@ class adminServerStats extends glmServerStatsBandwidthSupport
         $policyPageSlug = sanitize_title(GLM_SERVERSTATS_PLUGIN_POLICY_PAGE);
         $moreInfoUrl = 'https://'.$this->website."/".$policyPageSlug;
 
+        // Default text to use if the Cookie Message text is not supplied
         if (trim($currentSite['cookie_message']) == '') {
             $currentSite['cookie_message'] =
                 '<p>This site uses temporary "Cookies" to store limited information that\'s '
@@ -245,12 +257,42 @@ class adminServerStats extends glmServerStatsBandwidthSupport
                 .'be sure to close all Web Browsers when you\'re done!</p>';
         }
 
+        // Default text to use if reporting E-Mail content is not supplied
+        $glmNoticeEmail = get_option(GLM_SERVERSTATS_PLUGIN_REPORT_CONTENT);
+        if (trim($glmNoticeEmail['before_report']) == '') {
+            $glmNoticeEmail['before_report'] =
+                '<p>Your Website was within the agreed-upon traffic and disk usage level last month.</p>';
+        }
+        if (trim($glmNoticeEmail['after_report']) == '') {
+            $glmNoticeEmail['after_report'] =
+                ' <p>This is a monthly notice to let you know that your Website has not exceeded the agreed-upon service level '
+                .'for the previous month. You can review and print details of your Website usage as well as short-term and '
+                .'long-term graphs by going to the "GLM Data Usage" menu in the administrative area of your Website.</p>'
+                .'<p>This is a regular monthly notice. If you wish we can have these notices directed to a different E-Mail '
+                .'address. Please contact us if you would like to discuss options for creating more interest and in your Website.</p>';
+        }
+        if (trim($glmNoticeEmail['before_report_above_target']) == '') {
+            $glmNoticeEmail['before_report_above_target'] =
+                '<p>Your Website is close to or has exceeded the agreed-upon traffic or disk usage target for last month.</p>';
+        }
+        if (trim($glmNoticeEmail['after_report_above_target']) == '') {
+            $glmNoticeEmail['after_report_above_target'] =
+                '<p>Unlike other hosting providers, Gaslight Media doesn\'t automatically increase your monthly hosting fees '
+                .'simply because your Website exceeded the agreed-upon service level for one month. Instead, we see this '
+                .'as an opportunity to look at your current and future needs. If you\'re likely to continue exceeding this '
+                .'target, we can talk about a change in your hosting agreement to make sure you continue to serve your Website users effectively.</p>'
+                .'<p>You can review and print details of your Website usage as well as short-term and long-term graphs by going to the '
+                .'"GLM Data Usage" menu in the administrative area of your Website.</p>'
+                .'<p>If you wish we can have these notices directed to a different E-Mail address. Please contact us if you have any '
+                .'questions about this or other concerns. Otherwise, we\'ll contact you soon to talk about the good performance of '
+                .'your Website and discuss plans for the future. </p>';
+        }
+
        // echo "<pre>".print_r($currentSite,1)."</pre>";
-       // echo "<pre>".print_r($stats,1)."</pre>";
 
         // Compile template data
         $templateData = array(
-            'baseURL'               => admin_url(),
+            'baseURL'               => site_url(),
             'reportDate'            => date('m/d/Y'),
             'haveStats'             => $haveStats,
             'serverStats'           => $stats,
@@ -266,7 +308,8 @@ class adminServerStats extends glmServerStatsBandwidthSupport
             'currentSite'           => $currentSite,
             'policyPageSlug'        => $policyPageSlug,
             'moreInfoUrl'           => $moreInfoUrl,
-            'glmFromContact'        => get_option(GLM_SERVERSTATS_PLUGIN_REPORT_CONTACT)
+            'glmFromContact'        => get_option(GLM_SERVERSTATS_PLUGIN_REPORT_CONTACT),
+            'glmReportEmail'        => $glmNoticeEmail
         );
 
         //echo "<pre>".print_r($templateData,1)."</pre>";
index 1c01242..2a9e0de 100755 (executable)
@@ -46,20 +46,25 @@ class ajaxSendUsageReport  extends glmServerStatsBandwidthSupport
      */
     public function model()
     {
+        if (GLM_SERVERSTATS_PLUGIN_DEBUG) {
+            trigger_error('GLM Usage: ajaxSendUsageReport->model()', E_USER_NOTICE);
+        }
 
             // Check input
-        $site = filter_input( INPUT_GET, 'selected_site', FILTER_SANITIZE_STRING);
-        $display = filter_input( INPUT_GET, 'display_only', FILTER_SANITIZE_STRING);
-        $sendOverride = filter_input( INPUT_GET, 'send_override', FILTER_SANITIZE_STRING);
+        $selectedSite = $_REQUEST['selected_site'];
+        $site = filter_var( $selectedSite, FILTER_SANITIZE_STRING);
+        $display = $_REQUEST['display_only'];
+        $sendOverride = $_REQUEST['send_override'];
+        $additionalText = filter_input( INPUT_POST, 'send_usage_report_text', FILTER_UNSAFE_RAW);
 
         $displayOnly = false;
-        if ($display == 'true') {
+        if (!empty($display)) {
            $displayOnly = true;
         }
 
         // If Display is not requested, must be a real send so check if sending is enabled and override not set.
         $send_enabled = get_option(GLM_SERVERSTATS_PLUGIN_SEND_OPTION);
-        if (!$displayOnly && !$send_enabled && !$sendOverride) {
+        if (!$displayOnly && !$send_enabled && empty($sendOverride)) {
             echo "<h3>Sending of notification E-Mail is dissabled!</h3>";
             wp_die();
         };
@@ -71,7 +76,7 @@ class ajaxSendUsageReport  extends glmServerStatsBandwidthSupport
 
             echo "<hr>";
 
-            $res = $this->checkEmailNotifications(true, true, true, $site, $displayOnly);
+            $res = $this->checkEmailNotifications(true, true, true, $site, $displayOnly, $additionalText);
 
         } else {
 
index 0c0496d..687418c 100755 (executable)
@@ -15,7 +15,7 @@ This is the Gaslight Media ServerStats Stand-Alone Plugin that doesn't require t
 
 == Description ==
 
-The Gaslight Media ServerStats Stand Alone plugin provides server bandwidth statistics display for Websites
+The Gaslight Media ServerStats Stand Alone plugin provides server bandwidth statistics display for websites
 that do not include the GLM Associate core plugin. If the GLM Associate core is installed, the ServerStats
 add-on should be used instead.
 
@@ -29,6 +29,15 @@ e.g.
 1. Activate the plugin through the 'Plugins' menu in WordPress
 
 == Changelog ==
+= PENDING =
+* Website selection table for provider now more browner and font compliant
+* Cleaned up appearance of E-Mail summary list sent to billing.
+* Usage Report E-mail now editable
+* Now can add custom text to the beginning of a Usage Report E-Mail - if sending to selected site only
+* Now uses customer name in salutation of E-Mail if available.
+* Added test cookie pop-up in settings summary in admin
+* Fixed problem with changing date for graphs didn't update graphs
+
 = 4.0.2 =
 * Fixed positioning of Cookie Pop-Up for certain types of sites.
 
index 9485cb9..460d0ca 100755 (executable)
@@ -4,16 +4,16 @@
     /* Some styles are set in the print area to make them available in the print window */
     .pickContainer {
         margin-top: 1rem;
-        width: 95%;
-        min-width: 70rem;
+        width:      95%;
+        min-width:  70rem;
     }
     .pseudoPick {
-        height: 150px;
-        width: 98%;
+        height:     150px;
+        width:      98%;
         overflow-y: auto;
         overflow-x: hidden;
-        display: inline-block;
-        border: 1px #ddd solid;
+        display:    inline-block;
+        border:     1px #ddd solid;
     }
     .pseudoPickTitles {
         text-decoration: underline;
     }
     .pseudoPickOption:hover {
         background-color: #0568B3 !important;
-        color: white;
+        color:            white;
     }
     .usage-section {
         font-weight: bold;
-        font-size: 1.4rem;
-        clear: both;
-        padding: 1rem;
-        margin-top: 2rem;
+        font-size:   1.4rem;
+        clear:       both;
+        padding:     1rem;
+        margin-top:  2rem;
     }
     .sortBy {
         display: inline-block;
         margin-left: 1rem;
     }
     .sortByTitle {
-        display: inline-block;
+        display:     inline-block;
         font-weight: bold;
-        font-size: 1.2rem;
+        font-size:   1.2rem;
     }
     .graphContainer {
     }
     .graphContainer .graphTitle {
-        font-size: 1.1rem;
-        font-weight: bold;
+        font-size:     1.1rem;
+        font-weight:   bold;
         margin-bottom: 10px;
     }
     .graph {
         white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
         white-space: -pre-wrapv; /* Opera 4-6 */
         white-space: -o-pre-wrap !important; /* Opera 7 */
-        word-wrap: break-word !important; /* Internet Explorer 5.5+ */
+        word-wrap:   break-word !important; /* Internet Explorer 5.5+ */
     }
     .usage-item {
         margin-top: 1rem;
     }
     .color-key-traffic {
-        color: black !important;
+        color:       black !important;
         font-weight: bold;
     }
     .color-key-target {
-        color: maroon !important;
+        color:       maroon !important;
         font-weight: bold;
     }
     .color-key-storage {
-        color: gray !important;
+        color:       gray !important;
         font-weight: bold;
     }
     .color-key-incoming {
-        color: red !important;
+        color:       red !important;
         font-weight: bold;
     }
     .color-key-outgoing {
-        color: green !important;
+        color:       green !important;
         font-weight: bold;
     }
     .color-key-total {
-        color: blue !important;
+        color:       blue !important;
         font-weight: bold;
     }
 </style>
 
             {* Grid Start *}
             {$ui = [
-                'sectionColor'      => '#ffE',
-                'nowrap'            => true
+                'sectionColor' => '#ffE',
+                'nowrap'       => true
             ]}
             {include file="ui/f6/grid-start.html"}
 
                 {* Section Start *}
                 {$ui = [
-                    'title'     => 'Site Selection'
+                    'title' => 'Site Selection'
                 ]}
                 {include file="ui/f6/section-start.html"}
 
                     {* Misc Container Start *}
                     {include file="ui/f6/miscContainer-start.html"}
 
-                        {* Form Start *}
-                        {$ui = [
-                            'action'    => "{$thisUrl}?page={$thisPage}&selected_site={$currentSite.name}",
-                            'method'    => 'POST'
-                        ]}
-                        {include file="ui/f6/form-start.html"}
-
-                            <div class="grid-x grid-margin-x">
-                                <div style="whitespace: nowrap;">
-                                    <span class="sortBy">Sort By: </span>
-                                    <input type="radio" name="site_sort" value="site_name" {if $site_sort == 'site_name'} checked="checked"{/if} onClick="location.href='{$thisUrl}?page={$thisPage}&site_sort=site_name&selected_site={$currentSite.name}';">Site Name
-                                </div>
-                                <div style="whitespace: nowrap;">
-                                    <span class="sortBy">Traffic: </span>
-                                    <input type="radio" name="site_sort" value="data_total" {if $site_sort == 'data_total'} checked="checked"{/if} onClick="location.href='{$thisUrl}?page={$thisPage}&site_sort=data_total&selected_site={$currentSite.name}';">Total
-                                    <input type="radio" name="site_sort" value="target_percent" {if $site_sort == 'target_percent'} checked="checked"{/if} onClick="location.href='{$thisUrl}?page={$thisPage}&site_sort=target_percent&selected_site={$currentSite.name}';">Percent
-                                </div>
-                                <div style="whitespace: nowrap;">
-                                    <span class="sortBy">Storage: </span>
-                                    <input type="radio" name="site_sort" value="storage" {if $site_sort == 'storage'} checked="checked"{/if} onClick="location.href='{$thisUrl}?page={$thisPage}&site_sort=storage&selected_site={$currentSite.name}';">Maximum
-                                    <input type="radio" name="site_sort" value="disk_target_percent" {if $site_sort == 'disk_target_percent'} checked="checked"{/if} onClick="location.href='{$thisUrl}?page={$thisPage}&site_sort=disk_target_percent&selected_site={$currentSite.name}';">Percent
-                                </div>
+                        <div class="grid-x grid-margin-x">
+                            <div style="whitespace: nowrap;">
+                                <span class="sortBy">Sort By: </span>
+                                <input type="radio" name="site_sort" value="site_name" {if $site_sort == 'site_name'} checked="checked"{/if} onClick="location.href='{$thisUrl}?page={$thisPage}&site_sort=site_name&selected_site={$currentSite.name}';">Site Name
                             </div>
-                            <div style="overflow-x: auto;">
-                                <div class="pickContainer">
-                                    <pre class="">                                                   ----------------- Traffic -------------   --------------- Storage --------------</pre>
-                                    <pre class="pseudoPickTitles">Website                                            Last Month       Target     % of Target   Last Month      Target     % of Target</pre>
-                                    <div class="pseudoPick">
-                                        {foreach $websites as $site}
-                                            <pre class="pseudoPickOption"></span>{if $site.name == $currentSite.name}<a name="selectedSite"></a>{/if}<a href="{$thisUrl}?page={$thisPage}&selected_site={$site.name}&site_id={$site.id}&site_sort={$site_sort}" class="pseudoPickOption" {if $site.name == $currentSite.name}onClick="return false;"{/if}><span{if $site.name == $currentSite.name} style="background-color: LightGray;"{/if}>{$site.name|string_format:"%-50s"} {$site.data_total|string_format:"%6.1f"} GB   {$site.target|string_format:"%8.1f"} GB     <span {if $site.target_percent > $threshold}style="color: red;"{/if}>{$site.target_percent|string_format:"%6.0f"}%</span>      {$site.storage|string_format:"%6.1f"} GB   {$site.disk_target|string_format:"%8.1f"} GB      <span {if $site.disk_target_percent > $threshold}style="color: red;"{/if}>{$site.disk_target_percent|string_format:"%6.0f"}%</span></span></a></pre>
-                                        {/foreach}
-                                    </div>
-                                  </div>
+                            <div style="whitespace: nowrap;">
+                                <span class="sortBy">Traffic: </span>
+                                <input type="radio" name="site_sort" value="data_total" {if $site_sort == 'data_total'} checked="checked"{/if} onClick="location.href='{$thisUrl}?page={$thisPage}&site_sort=data_total&selected_site={$currentSite.name}';">Total
+                                <input type="radio" name="site_sort" value="target_percent" {if $site_sort == 'target_percent'} checked="checked"{/if} onClick="location.href='{$thisUrl}?page={$thisPage}&site_sort=target_percent&selected_site={$currentSite.name}';">Percent
                             </div>
-                            <p>Click on a site above to display settings and charts.</p>
-                            <div class="grid-x grid-margin-x">
-                                <div class="cell small-12 large-5 glm-f6-ui-nowrap">
-                                    <b>Send Usage Report for Selected Site:</b>
-                                    <div><a href="{$ajaxUrl}?action=glm_server_stats&glm_action=ajaxSendUsageReport&selected_site={$currentSite.name}&send_override=1" target="usageEmail" class="button button-secondary button-small button-wrappable">Send for selected site</a></div>
-                                </div>
-                                <div class="cell small-12 large-7 glm-f6-ui-nowrap">
-                                    <b>Preview Usage Report:</b>
-                                    <div>
-                                    <a href="{$ajaxUrl}?action=glm_server_stats&glm_action=ajaxSendUsageReport&selected_site={$currentSite.name}&display_only=true" target="usageEmail" class="button button-secondary button-small button-wrappable">Display for site selected site</a>
-                                    <a href="{$ajaxUrl}?action=glm_server_stats&glm_action=ajaxSendUsageReport&display_only=true" target="usageEmail" class="button button-secondary button-small button-wrappable">Display for all sites above threashold</a>
-                                    </div>
+                            <div style="whitespace: nowrap;">
+                                <span class="sortBy">Storage: </span>
+                                <input type="radio" name="site_sort" value="storage" {if $site_sort == 'storage'} checked="checked"{/if} onClick="location.href='{$thisUrl}?page={$thisPage}&site_sort=storage&selected_site={$currentSite.name}';">Maximum
+                                <input type="radio" name="site_sort" value="disk_target_percent" {if $site_sort == 'disk_target_percent'} checked="checked"{/if} onClick="location.href='{$thisUrl}?page={$thisPage}&site_sort=disk_target_percent&selected_site={$currentSite.name}';">Percent
+                            </div>
+                        </div>
+                        <div style="overflow-x: auto;">
+                            <div class="pickContainer">
+                                <pre class="">                                                   ----------------- Traffic -------------   --------------- Storage --------------</pre>
+                                <pre class="pseudoPickTitles">Website                                            Last Month       Target     % of Target   Last Month      Target     % of Target</pre>
+                                <div class="pseudoPick">
+                                    {foreach $websites as $site}
+                                        <pre class="pseudoPickOption"></span>{if $site.name == $currentSite.name}<a name="selectedSite"></a>{/if}<a href="{$thisUrl}?page={$thisPage}&selected_site={$site.name}&site_id={$site.id}&site_sort={$site_sort}" class="pseudoPickOption" {if $site.name == $currentSite.name}onClick="return false;"{/if}><span{if $site.name == $currentSite.name} style="background-color: LightGray;"{/if}>{$site.name|string_format:"%-50s"} {$site.data_total|string_format:"%6.1f"} GB   {$site.target|string_format:"%8.1f"} GB     <span {if $site.target_percent > $threshold}style="color: red;"{/if}>{$site.target_percent|string_format:"%6.0f"}%</span>      {$site.storage|string_format:"%6.1f"} GB   {$site.disk_target|string_format:"%8.1f"} GB      <span {if $site.disk_target_percent > $threshold}style="color: red;"{/if}>{$site.disk_target_percent|string_format:"%6.0f"}%</span></span></a></pre>
+                                    {/foreach}
                                 </div>
-                                <div class="cell small-12 large-12 glm-f6-ui-nowrap">
-                                    <br>Note that the "Send E-Mail" button above will send the E-Mail even if the global "Enable Sending Usage Reports" setting below is set to off.
+                              </div>
+                        </div>
+                        <p>Click on a site above to display settings and charts.</p>
+                        <div class="grid-x grid-margin-x">
+                            <div class="cell small-12 large-5 glm-f6-ui-nowrap">
+                                <b>Send Usage Report for Selected Site:</b>
+
+                                {* Form Start *}
+                                {$ui = [
+                                    'action'                 => "{$ajaxUrl}?action=glm_server_stats&glm_action=ajaxSendUsageReport",
+                                    'method'                 => 'POST',
+                                    'leaveModifiedFormCheck' => true,
+                                    'target'                 => 'usageEmail'
+                                ]}
+                                {include file="ui/f6/form-start.html"}
+
+                                    <input type="hidden" name="selected_site" value="{$currentSite.name}">
+                                    <input type="hidden" name="send_override" value="1">
+                                    <input type="hidden" name="selected_site" value="{$currentSite.name}">
+
+                                    {* Form Summary Start *}
+                                    {$ui = [
+                                        'id'               => 'usageReport',
+                                        'edit_button_text' => 'Send Report'
+                                    ]}
+                                    {include file="ui/f6/form-summary-start.html"}
+
+                                        {* intentionally nothing here *}
+
+                                    {include file="ui/f6/form-summary-end.html"}
+
+                                    {* Form Edit Start *}
+                                    {$ui = [
+                                        'id'                  => 'usageReport',
+                                        'summary_button_text' => 'Cancel Sending Report'
+                                    ]}
+                                    {include file="ui/f6/form-edit-start.html"}
+
+                                        {* Additional Message *}
+                                        {$ui = [
+                                            'field'    => 'send_usage_report_text',
+                                            'value'    => '',
+                                            'label'    => 'Additional text for top of E-Mail (optional)',
+                                            'teeny'    => true,
+                                            'rows'     => 3
+                                        ]}
+                                        {include file="ui/f6/editor.html"}
+
+                                        {* Force Display *}
+                                        {$ui = [
+                                            'field'    => 'display_only',
+                                            'value'    => false,
+                                            'label'    => 'Do not send, just show sample'
+                                        ]}
+                                        {include file="ui/f6/checkbox.html"}
+
+                                        {* Submit Button *}
+                                        {$ui = [
+                                            'class'  => 'primary',
+                                            'label'  => 'Send Usage Report',
+                                            'submit' => true
+                                        ]}
+                                        {include file="ui/f6/submit.html"}
+
+                                        <br>Note that the "Send Usage Report" button above will send the E-Mail even if the global "Enable Sending Usage Reports" setting below is set to off.
+
+                                    {include file="ui/f6/form-edit-end.html"}
+
+                                {include file="ui/f6/form-end.html"}
+
+                            </div>
+                            <div class="cell small-12 large-7 glm-f6-ui-nowrap">
+                                <b>Preview Usage Report:</b>
+                                <div>
+                                <a href="{$ajaxUrl}?action=glm_server_stats&glm_action=ajaxSendUsageReport&selected_site={$currentSite.name}&display_only=true" target="usageEmail" class="button button-secondary button-small button-wrappable">Display for site selected site</a>
+                                <a href="{$ajaxUrl}?action=glm_server_stats&glm_action=ajaxSendUsageReport&display_only=true" target="usageEmail" class="button button-secondary button-small button-wrappable">Display for all sites above threashold</a>
                                 </div>
                             </div>
+                        </div>
 
-                        {include file="ui/f6/form-end.html"}
 
                     {include file="ui/f6/miscContainer-end.html"}
 
 
             {* Grid End *}
             {$ui = [
-                'noFoundationInit'     => true
+                'noFoundationInit' => true
             ]}
             {include file="ui/f6/grid-end.html"}
 
             {* Form Start *}
             {$ui = [
-                'action'    => "{$thisUrl}?page={$thisPage}&selected_site={$currentSite.name}",
-                'method'    => 'POST',
-                'validate'  => true,
-                'validateFocusMsg' => true,
+                'action'                 => "{$thisUrl}?page={$thisPage}&selected_site={$currentSite.name}",
+                'method'                 => 'POST',
+                'validate'               => true,
+                'validateFocusMsg'       => true,
                 'leaveModifiedFormCheck' => true
             ]}
             {include file="ui/f6/form-start.html"}
 
                 {* Grid Start *}
                 {$ui = [
-                    'sectionColor'      => '#ffE',
-                    'nowrap'            => true
+                    'sectionColor' => '#ffE',
+                    'nowrap'       => true
                 ]}
                 {include file="ui/f6/grid-start.html"}
 
                     {* Form Summary Start *}
                     {$ui = [
-                        'id'                => 'usageSettings',
-                        'title'             => 'Usage Report Settings'
+                        'id'    => 'usageSettings',
+                        'title' => 'Settings Summary'
                     ]}
                     {include file="ui/f6/form-summary-start.html"}
 
 
                                 {* Sub-Section Start *}
                                     {$ui = [
-                                    'title'     => {'Settings For: '|cat:$currentSite.name},
-                                    'wrapSize'  => 6
+                                    'title'    => {'Settings For: '|cat:$currentSite.name},
+                                    'wrapSize' => 6
                                 ]}
                                 {include file="ui/f6/sub-section-start.html"}
 
                                     <div class="cell small-12 large-7">{if $currentSite.show_usage}Yes{else}No{/if}</div>
                                     <div class="cell small-12 large-5 glm-f6-ui-nowrap"><b>Send Usage Reports:</b></div>
                                     <div class="cell small-12 large-7">{if $currentSite.send_enabled}Yes{else}No{/if}</div>
-                                    <div class="cell small-12 large-5 glm-f6-ui-nowrap"><b>Customer Usage/Notify Address:</b></div>
+                                    <div class="cell small-12 large-5 glm-f6-ui-nowrap"><b>Customer Contact Name:</b></div>
+                                    <div class="cell small-12 large-7">{if !empty($currentSite.cust_contact_name)}{$currentSite.cust_contact_name}{else}(Not supplied){/if}</div>
+                                    <div class="cell small-12 large-5 glm-f6-ui-nowrap"><b>Customer Contact E-Mail:</b></div>
                                     <div class="cell small-12 large-7">{if !empty($currentSite.cust_contact)}{$currentSite.cust_contact}{else}(Not supplied){/if}</div>
 
                                     <div class="cell small-12 large-12 glm-f6-ui-nowrap"><br><u>Cookie Pop-Up</u></div>
 
                                     <div class="cell small-12 large-5 glm-f6-ui-nowrap"><b>Show Cookie Pop-Up:</b></div>
-                                    <div class="cell small-12 large-7">{if $currentSite.show_cookie_popup}Yes{else}No{/if}</div>
+                                    <div class="cell small-12 large-7">
+                                        {if $currentSite.show_cookie_popup}Yes{else}No{/if}
+                                        <br><a href="{$baseURL}?force_cookie=1" target="cookieTest">Click me to test Cookie Pop-Up</a>
+                                    </div>
                                     <div class="cell small-12 large-5 glm-f6-ui-nowrap"><b>Cookie Pop-Up Timeout:</b></div>
                                     <div class="cell small-12 large-7">{$currentSite.cookie_popup_timeout} Days</div>
                                     <div class="cell small-12 large-5 glm-f6-ui-nowrap"><b>Cookie Message:</b></div>
 
                                 {* Sub-Section Start *}
                                     {$ui = [
-                                    'title'     => 'Global Settings',
-                                    'wrapSize'  => 6
+                                    'title'    => 'Global Settings',
+                                    'wrapSize' => 6
                                 ]}
                                 {include file="ui/f6/sub-section-start.html"}
 
                                     <div class="cell small-12 large-5 glm-f6-ui-nowrap"><b>Subject:</b></div>
                                     <div class="cell small-12 large-7">{if !empty($glmFromContact.subject)}{$glmFromContact.subject}{else}(Subject not set){/if}</div>
 
+                                    <div class="cell small-12 large-12 glm-f6-ui-nowrap"><br><u>Usage Report E-Mail - Below Target %</u></div>
+
+                                    <div class="cell small-12 large-5 glm-f6-ui-nowrap"><b>Before Report:</b></div>
+                                    <div class="cell small-12 large-7">{wpautop($glmReportEmail.before_report)}</div>
+                                    <div class="cell small-12 large-5 glm-f6-ui-nowrap"><b>After Report:</b></div>
+                                    <div class="cell small-12 large-7">{wpautop($glmReportEmail.after_report)}</div>
+
+                                    <div class="cell small-12 large-12 glm-f6-ui-nowrap"><br><u>Usage Report E-Mail - Above Target %</u></div>
+
+                                    <div class="cell small-12 large-5 glm-f6-ui-nowrap"><b>Before Report:</b></div>
+                                    <div class="cell small-12 large-7">{wpautop($glmReportEmail.before_report_above_target)}</div>
+                                    <div class="cell small-12 large-5 glm-f6-ui-nowrap"><b>After Report:</b></div>
+                                    <div class="cell small-12 large-7">{wpautop($glmReportEmail.after_report_above_target)}</div>
+
                                 {include file="ui/f6/sub-section-end.html"}
                             </div>
                         </div>
 
                     {* Form Edit Start *}
                     {$ui = [
-                        'id'                => 'usageSettings',
-                        'title'             => 'Edit Settings'
+                        'id'    => 'usageSettings',
+                        'title' => 'Edit Settings'
                     ]}
                     {include file="ui/f6/form-edit-start.html"}
 
                         {* Section Start *}
                         {$ui = [
-                            'title'     => {'Settings For: '|cat:$currentSite.name}
+                            'title' => {'Settings For: '|cat:$currentSite.name}
                         ]}
                         {include file="ui/f6/section-start.html"}
 
                             {* Note about site-specific settings *}
                             {$ui = [
-                                'text'         => '<b>NOTE: </b>The settings below affect only the currently selected site!'
+                                'text' => '<b>NOTE: </b>The settings below affect only the currently selected site!'
                             ]}
                             {include file="ui/f6/text-line.html"}
 
                             {* Sub-Section Start *}
                             {$ui = [
-                                'title'     => 'Usage Reporting'
+                                'title' => 'Usage Reporting'
                             ]}
                             {include file="ui/f6/sub-section-start.html"}
 
                                 {* target *}
                                 {$ui = [
-                                    'field'         => 'target',
-                                    'value'         => {$currentSite.target|string_format:"%.1f"},
-                                    'label'         => 'Monthly Traffic Target in Gigabytes',
-                                    'required'      => true,
-                                    'placeholder'   => 'e.g.: 2.000 for 2 Gigabytes'
+                                    'field'       => 'target',
+                                    'value'       => {$currentSite.target|string_format:"%.1f"},
+                                    'label'       => 'Monthly Traffic Target in Gigabytes',
+                                    'required'    => true,
+                                    'placeholder' => 'e.g.: 2.000 for 2 Gigabytes'
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* disk_target *}
                                 {$ui = [
-                                    'field'         => 'disk_target',
-                                    'value'         => {$currentSite.disk_target|string_format:"%.1f"},
-                                    'label'         => 'Disk Space Used Target in Gigabytes',
-                                    'required'      => true,
-                                    'placeholder'   => 'e.g. 2.000 for 2 Gigabytes'
+                                    'field'       => 'disk_target',
+                                    'value'       => {$currentSite.disk_target|string_format:"%.1f"},
+                                    'label'       => 'Disk Space Used Target in Gigabytes',
+                                    'required'    => true,
+                                    'placeholder' => 'e.g. 2.000 for 2 Gigabytes'
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* show_usage *}
                                 {$ui = [
-                                    'field'         => 'show_usage',
-                                    'value'         => {!empty($currentSite.show_usage)},
-                                    'label'         => 'Show Traffic and Disk Usage Information & Graphs',
-                                    'helpText'      => 'Turn this on to show traffic and disk ussage information on this site.'
+                                    'field'    => 'show_usage',
+                                    'value'    => {!empty($currentSite.show_usage)},
+                                    'label'    => 'Show Traffic and Disk Usage Information & Graphs',
+                                    'helpText' => 'Turn this on to show traffic and disk ussage information on this site.'
 
                                 ]}
                                 {include file="ui/f6/checkbox.html"}
 
                                 {* Send Enabled *}
                                 {$ui = [
-                                    'field'         => 'send_enabled',
-                                    'value'         => {$currentSite.send_enabled},
-                                    'label'         => 'Send Usage Reports',
-                                    'helpText'      => '
-                                                        Turn this on to have monthly notices sent to site contacts (below) when
-                                                        close to or above the reporting threashold.
-                                                       '
+                                    'field'    => 'send_enabled',
+                                    'value'    => {$currentSite.send_enabled},
+                                    'label'    => 'Send Usage Reports',
+                                    'helpText' => '
+                                                   Turn this on to have monthly notices sent to site contacts (below) when
+                                                   close to or above the reporting threashold.
+                                                  '
                                 ]}
                                 {include file="ui/f6/checkbox.html"}
 
+                                {* cust_contact_name *}
+                                {$ui = [
+                                    'field'    => 'cust_contact_name',
+                                    'value'    => {$currentSite.cust_contact_name},
+                                    'label'    => 'Customer Contact Name',
+                                    'required' => false,
+                                    'helpText' => 'Used for salutation in reports.'
+                                ]}
+                                {include file="ui/f6/text.html"}
+
                                 {* cust_contact *}
                                 {$ui = [
-                                    'field'         => 'cust_contact',
-                                    'value'         => {$currentSite.cust_contact},
-                                    'label'         => 'Customer Contact E-Mail',
-                                    'required'      => false,
-                                    'helpText'      => 'Leave empty to prevent any E-mail from being sent for this site.'
+                                    'field'    => 'cust_contact',
+                                    'value'    => {$currentSite.cust_contact},
+                                    'label'    => 'Customer Contact E-Mail',
+                                    'required' => false,
+                                    'helpText' => 'Leave empty to prevent any E-mail from being sent for this site.'
                                 ]}
                                 {include file="ui/f6/text.html"}
 
 
                            {* Sub-Section Start *}
                                 {$ui = [
-                                'title'     => 'Cookie Pop-Ups for This Site',
-                                'tip'       => '
-                                                This section enables and sets parameters for the &quot;Cookie Popup&quot; that
-                                                will be displayed to a front-end user until they click to confirm that they
-                                                have read this popup. The popup will redisplay after the sent number of days
-                                                selected below.
-                                                See &quot;Additional Notices&quot; to select other standard
-                                                notices to display based on what is included in Web site.
-                                                '
+                                'title' => 'Cookie Pop-Ups for This Site',
+                                'tip'   => '
+                                            This section enables and sets parameters for the &quot;Cookie Popup&quot; that
+                                            will be displayed to a front-end user until they click to confirm that they
+                                            have read this popup. The popup will redisplay after the sent number of days
+                                            selected below.
+                                            See &quot;Additional Notices&quot; to select other standard
+                                            notices to display based on what is included in Web site.
+                                            '
                             ]}
                             {include file="ui/f6/sub-section-start.html"}
 
                                 {* show_cookie_popup *}
                                 {$ui = [
-                                    'field'         => 'show_cookie_popup',
-                                    'value'         => {!empty($currentSite.show_cookie_popup)},
-                                    'label'         => 'Show Cookie Pop-Up'
+                                    'field' => 'show_cookie_popup',
+                                    'value' => {!empty($currentSite.show_cookie_popup)},
+                                    'label' => 'Show Cookie Pop-Up'
                                 ]}
                                 {include file="ui/f6/checkbox.html"}
 
                                 {* cookie_popup_timeout *}
                                 {$ui = [
-                                    'field'         => 'cookie_popup_timeout',
-                                    'value'         => {$currentSite.cookie_popup_timeout},
-                                    'label'         => 'Cookie Pop-Up Re-Display Days',
-                                    'required'      => true,
-                                    'min'           => 0,
-                                    'max'           => 365,
-                                    '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>',
-                                    'errorText'     => 'Must be between 0 and 365 days!'
+                                    'field'     => 'cookie_popup_timeout',
+                                    'value'     => {$currentSite.cookie_popup_timeout},
+                                    'label'     => 'Cookie Pop-Up Re-Display Days',
+                                    'required'  => true,
+                                    'min'       => 0,
+                                    'max'       => 365,
+                                    '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>',
+                                    'errorText' => 'Must be between 0 and 365 days!'
                                 ]}
                                 {include file="ui/f6/number.html"}
 
                                 {* cookie_message *}
                                 {$ui = [
-                                    'field'         => 'cookie_message',
-                                    'value'         => {$currentSite.cookie_message},
-                                    'label'         => 'Cookies Pop-Up Text',
-                                    'required'      => true,
-                                    'teeny'         => true,
-                                    'rows'          => 10,
-                                    'helpText'      => '
-                                                        This is the text for the Cookie Pop-Up.
-                                                        Additional privacy and policity text is displayed on the Privacy/Policy page that is
-                                                        created automatically when this plugin is activated on a Website. That policy page
-                                                        contains standard text and may be editied using the WordPress page editor on
-                                                        the selected site.
-                                                       '
+                                    'field'    => 'cookie_message',
+                                    'value'    => {$currentSite.cookie_message},
+                                    'label'    => 'Cookies Pop-Up Text',
+                                    'required' => true,
+                                    'teeny'    => true,
+                                    'rows'     => 10,
+                                    'helpText' => '
+                                                   This is the text for the Cookie Pop-Up.
+                                                   Additional privacy and policity text is displayed on the Privacy/Policy page that is
+                                                   created automatically when this plugin is activated on a Website. That policy page
+                                                   contains standard text and may be editied using the WordPress page editor on
+                                                   the selected site.
+                                                  '
                                 ]}
                                 {include file="ui/f6/editor.html"}
 
 
                            {* Sub-Section Start *}
                                 {$ui = [
-                                'title'     => 'Cookie Pop-Up Colors and Positioning'
+                                'title' => 'Cookie Pop-Up Colors and Positioning'
                             ]}
                             {include file="ui/f6/sub-section-start.html"}
 
                                 {* color_backgroud *}
                                 {$ui = [
-                                    'field'         => 'color_background',
-                                    'value'         => {$currentSite.color_background},
-                                    'default'       => '#002b38',
-                                    'label'         => 'Background',
-                                    'placeholder'   => 'Color Code like #002b38',
-                                    'required'      => true,
-                                    'maxWidth'      => '6rem',
-                                    'maxLength'     => 8,
-                                    'wrapSize'      => 3
+                                    'field'       => 'color_background',
+                                    'value'       => {$currentSite.color_background},
+                                    'default'     => '#002b38',
+                                    'label'       => 'Background',
+                                    'placeholder' => 'Color Code like #002b38',
+                                    'required'    => true,
+                                    'maxWidth'    => '6rem',
+                                    'maxLength'   => 8,
+                                    'wrapSize'    => 3
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* color_buttons *}
                                 {$ui = [
-                                    'field'         => 'color_buttons',
-                                    'value'         => {$currentSite.color_buttons},
-                                    'default'       => '#073642',
-                                    'label'         => 'Buttons',
-                                    'placeholder'   => 'Color Code like #002b38',
-                                    'required'      => true,
-                                    'maxWidth'      => '6rem',
-                                    'maxLength'     => 8,
-                                    'wrapSize'      => 3
+                                    'field'       => 'color_buttons',
+                                    'value'       => {$currentSite.color_buttons},
+                                    'default'     => '#073642',
+                                    'label'       => 'Buttons',
+                                    'placeholder' => 'Color Code like #002b38',
+                                    'required'    => true,
+                                    'maxWidth'    => '6rem',
+                                    'maxLength'   => 8,
+                                    'wrapSize'    => 3
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* color_text *}
                                 {$ui = [
-                                    'field'         => 'color_text',
-                                    'value'         => {$currentSite.color_text},
-                                    'default'       => '#839496',
-                                    'label'         => 'Text',
-                                    'placeholder'   => 'Color Code like #002b38',
-                                    'required'      => true,
-                                    'maxWidth'      => '6rem',
-                                    'maxLength'     => 8,
-                                    'wrapSize'      => 3
+                                    'field'       => 'color_text',
+                                    'value'       => {$currentSite.color_text},
+                                    'default'     => '#839496',
+                                    'label'       => 'Text',
+                                    'placeholder' => 'Color Code like #002b38',
+                                    'required'    => true,
+                                    'maxWidth'    => '6rem',
+                                    'maxLength'   => 8,
+                                    'wrapSize'    => 3
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* color_buttontext *}
                                 {$ui = [
-                                    'field'         => 'color_buttontext',
-                                    'value'         => {$currentSite.color_buttontext},
-                                    'default'       => '#ffffff',
-                                    'label'         => 'Button Text',
-                                    'placeholder'   => 'Color Code like #002b38',
-                                    'required'      => true,
-                                    'maxWidth'      => '6rem',
-                                    'maxLength'     => 8,
-                                    'wrapSize'      => 3
+                                    'field'       => 'color_buttontext',
+                                    'value'       => {$currentSite.color_buttontext},
+                                    'default'     => '#ffffff',
+                                    'label'       => 'Button Text',
+                                    'placeholder' => 'Color Code like #002b38',
+                                    'required'    => true,
+                                    'maxWidth'    => '6rem',
+                                    'maxLength'   => 8,
+                                    'wrapSize'    => 3
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* popup_border *}
                                 {$ui = [
-                                    'field'         => 'popup_border',
-                                    'value'         => {$currentSite.popup_border},
-                                    'default'        => '1px solid black',
-                                    'label'         => 'Pop-Up Border',
-                                    'placeholder'   => 'e.g.: 1px black solid',
-                                    'maxWidth'      => '10rem'
+                                    'field'       => 'popup_border',
+                                    'value'       => {$currentSite.popup_border},
+                                    'default'     => '1px solid black',
+                                    'label'       => 'Pop-Up Border',
+                                    'placeholder' => 'e.g.: 1px black solid',
+                                    'maxWidth'    => '10rem'
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* popup_position *}
                                 {$ui = [
-                                    'field'         => 'popup_position',
-                                    'value'         => {$currentSite.popup_position},
-                                    'default'        => 'top',
-                                    'label'         => 'Pop-Up Position',
-                                    'list'          => ['Top' => 'Top', 'Bottom' => 'Bottom'],
-                                    'noWrap'        => true
+                                    'field'   => 'popup_position',
+                                    'value'   => {$currentSite.popup_position},
+                                    'default' => 'top',
+                                    'label'   => 'Pop-Up Position',
+                                    'list'    => ['Top' => 'Top', 'Bottom' => 'Bottom'],
+                                    'noWrap'  => true
                                 ]}
                                 {include file="ui/f6/radioButtons.html"}
 
 
                             {* Sub-Section Start *}
                             {$ui = [
-                                'title'     => 'Privacy/Policy Page Contact Information'
+                                'title' => 'Privacy/Policy Page Contact Information'
                             ]}
                             {include file="ui/f6/sub-section-start.html"}
 
                                 {* contact_name *}
                                 {$ui = [
-                                    'field'         => 'contact_name',
-                                    'value'         => {$currentSite.contact_name},
-                                    'label'         => 'Contact Name',
-                                    'placeholder'   => 'Name of contact person/role for Pivacy/Policy questions'
+                                    'field'       => 'contact_name',
+                                    'value'       => {$currentSite.contact_name},
+                                    'label'       => 'Contact Name',
+                                    'placeholder' => 'Name of contact person/role for Pivacy/Policy questions'
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* contact_org *}
                                 {$ui = [
-                                    'field'         => 'contact_org',
-                                    'value'         => {$currentSite.contact_org},
-                                    'label'         => 'Organization',
-                                    'placeholder'   => 'Name of contact organization for Pivacy/Policy questions'
+                                    'field'       => 'contact_org',
+                                    'value'       => {$currentSite.contact_org},
+                                    'label'       => 'Organization',
+                                    'placeholder' => 'Name of contact organization for Pivacy/Policy questions'
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* contact_address *}
                                 {$ui = [
-                                    'field'         => 'contact_address',
-                                    'value'         => {$currentSite.contact_address},
-                                    'label'         => 'Address'
+                                    'field' => 'contact_address',
+                                    'value' => {$currentSite.contact_address},
+                                    'label' => 'Address'
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* contact_address2 *}
                                 {$ui = [
-                                    'field'         => 'contact_address2',
-                                    'value'         => {$currentSite.contact_address2},
-                                    'label'         => ''
+                                    'field' => 'contact_address2',
+                                    'value' => {$currentSite.contact_address2},
+                                    'label' => ''
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* contact_city *}
                                 {$ui = [
-                                    'field'         => 'contact_city',
-                                    'value'         => {$currentSite.contact_city},
-                                    'label'         => 'City'
+                                    'field' => 'contact_city',
+                                    'value' => {$currentSite.contact_city},
+                                    'label' => 'City'
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* contact_state *}
                                 {$ui = [
-                                    'field'         => 'contact_state',
-                                    'value'         => {$currentSite.contact_state},
-                                    'label'         => 'State'
+                                    'field' => 'contact_state',
+                                    'value' => {$currentSite.contact_state},
+                                    'label' => 'State'
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* contact_zip *}
                                 {$ui = [
-                                    'field'         => 'contact_zip',
-                                    'value'         => {$currentSite.contact_zip},
-                                    'label'         => 'ZIP/Postal Code'
+                                    'field' => 'contact_zip',
+                                    'value' => {$currentSite.contact_zip},
+                                    'label' => 'ZIP/Postal Code'
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* contact_phone *}
                                 {$ui = [
-                                    'field'         => 'contact_phone',
-                                    'value'         => {$currentSite.contact_phone},
-                                    'label'         => 'Phone Number'
+                                    'field' => 'contact_phone',
+                                    'value' => {$currentSite.contact_phone},
+                                    'label' => 'Phone Number'
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* contact_email *}
                                 {$ui = [
-                                    'field'         => 'contact_email',
-                                    'value'         => {$currentSite.contact_email},
-                                    'label'         => 'E-Mail Address'
+                                    'field' => 'contact_email',
+                                    'value' => {$currentSite.contact_email},
+                                    'label' => 'E-Mail Address'
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* Policy Page Reference *}
                                 {$ui = [
-                                    'text'         => {'<a href="'|cat:{$moreInfoUrl}|cat:'" target="policyPage">Link to display Privacy/Policy Page</a>'}
+                                    'text' => {'<a href="'|cat:{$moreInfoUrl}|cat:'" target="policyPage">Link to display Privacy/Policy Page</a>'}
                                 ]}
                                 {include file="ui/f6/text-line.html"}
 
 
                         {* Section Start *}
                         {$ui = [
-                            'title'     => 'Global Settings'
+                            'title' => 'Global Settings'
                         ]}
                         {include file="ui/f6/section-start.html"}
 
                             {* Sub-Section Start *}
                             {$ui = [
-                                'title'         => '<b>NOTE: </b>The settings below affect all sites!'
+                                'title' => '<b>NOTE: </b>The settings below affect all sites!'
                             ]}
                             {include file="ui/f6/sub-section-start.html"}
 
                                 {* Reporting Threshold *}
                                 {$ui = [
-                                    'field'         => 'threshold',
-                                    'value'         => {$threshold|string_format:"%.0f"},
-                                    'label'         => 'Monthly Reporting Threshold %',
-                                    'required'      => true,
-                                    'min'           => -1,
-                                    'max'           => 1000,
-                                    'width'         => 5,
-                                    'helpText'      => '
-                                                        Percentage above which target percentage should be highlighted in red and site contacts will receive E-Mail reports.
-                                                        Set Reporting Threshold to -1% to block all automatic monthly reporting.
-                                                       ',
-                                    'errorText'     => 'Please enter or select a number between -1 and 1000.'
+                                    'field'     => 'threshold',
+                                    'value'     => {$threshold|string_format:"%.0f"},
+                                    'label'     => 'Monthly Reporting Threshold %',
+                                    'required'  => true,
+                                    'min'       => -1,
+                                    'max'       => 1000,
+                                    'width'     => 5,
+                                    'helpText'  => '
+                                                    Percentage above which target percentage should be highlighted in red and site contacts will receive E-Mail reports.
+                                                    Set Reporting Threshold to -1% to block all automatic monthly reporting.
+                                                   ',
+                                    'errorText' => 'Please enter or select a number between -1 and 1000.'
                                 ]}
                                 {include file="ui/f6/number.html"}
 
                                 {* sent_report_enabled *}
                                 {$ui = [
-                                    'field'         => 'send_reports_enabled',
-                                    'value'         => {!empty($sendReportsEnabled)},
-                                    'label'         => 'Enable Sending Usage Reports'
+                                    'field' => 'send_reports_enabled',
+                                    'value' => {!empty($sendReportsEnabled)},
+                                    'label' => 'Enable Sending Usage Reports'
                                 ]}
                                 {include file="ui/f6/checkbox.html"}
 
 
                             {* Sub-Section Start *}
                             {$ui = [
-                                'title'         => 'Usage Report E-mail "From" Information'
+                                'title' => 'Usage Report E-mail "From" Information'
                             ]}
                             {include file="ui/f6/sub-section-start.html"}
 
                                 {* Report From Name *}
                                 {$ui = [
-                                    'field'         => 'report_contact_name',
-                                    'value'         => {$glmFromContact.name},
-                                    'label'         => 'Name or Role of contact',
-                                    'required'      => true
+                                    'field'    => 'report_contact_name',
+                                    'value'    => {$glmFromContact.name},
+                                    'label'    => 'Name or Role of contact',
+                                    'required' => true
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* Report From E-Mail Address *}
                                 {$ui = [
-                                    'field'         => 'report_contact_email',
-                                    'value'         => {$glmFromContact.email},
-                                    'label'         => 'E-Mail Address',
-                                    'required'      => true
+                                    'field'    => 'report_contact_email',
+                                    'value'    => {$glmFromContact.email},
+                                    'label'    => 'E-Mail Address',
+                                    'required' => true
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                                 {* Report E-mail Subject *}
                                 {$ui = [
-                                    'field'         => 'report_subject',
-                                    'value'         => {$glmFromContact.subject},
-                                    'label'         => 'Subject',
-                                    'required'      => true
+                                    'field'    => 'report_subject',
+                                    'value'    => {$glmFromContact.subject},
+                                    'label'    => 'Subject',
+                                    'required' => true
                                 ]}
                                 {include file="ui/f6/text.html"}
 
                             {include file="ui/f6/sub-section-end.html"}
 
+                            {* Sub-Section Start *}
+                            {$ui = [
+                                'title' => 'Usage Report E-mail Text - Below Target %'
+                            ]}
+                            {include file="ui/f6/sub-section-start.html"}
+
+                                {* before_report *}
+                                {$ui = [
+                                    'field'    => 'before_report',
+                                    'value'    => {$glmReportEmail.before_report},
+                                    'label'    => 'Content before reported numbers',
+                                    'required' => true
+                                ]}
+                                {include file="ui/f6/editor.html"}
+
+                                {* after_report *}
+                                {$ui = [
+                                    'field'    => 'after_report',
+                                    'value'    => {$glmReportEmail.after_report},
+                                    'label'    => 'Content after reported numbers',
+                                    'required' => true
+                                ]}
+                                {include file="ui/f6/editor.html"}
+
+                            {include file="ui/f6/sub-section-end.html"}
+
+                            {* Sub-Section Start *}
+                            {$ui = [
+                                'title' => 'Usage Report E-mail Text - Above Target %'
+                            ]}
+                            {include file="ui/f6/sub-section-start.html"}
+
+                                {* before_report *}
+                                {$ui = [
+                                    'field'    => 'before_report_above_target',
+                                    'value'    => {$glmReportEmail.before_report_above_target},
+                                    'label'    => 'Content before reported numbers',
+                                    'required' => true
+                                ]}
+                                {include file="ui/f6/editor.html"}
+
+                                {* after_report *}
+                                {$ui = [
+                                    'field'    => 'after_report_above_target',
+                                    'value'    => {$glmReportEmail.after_report_above_target},
+                                    'label'    => 'Content after reported numbers',
+                                    'required' => true
+                                ]}
+                                {include file="ui/f6/editor.html"}
+
+                            {include file="ui/f6/sub-section-end.html"}
+
                         {include file="ui/f6/section-end.html"}
 
                         {* Submit Button *}
                         {$ui = [
-                            'class'     => 'primary',
-                            'label'     => 'Update All Settings',
-                            'submit'    => true
+                            'class'  => 'primary',
+                            'label'  => 'Update All Settings',
+                            'submit' => true
                         ]}
                         {include file="ui/f6/submit.html"}
 
                         font-size: 1em;
                     }
                     .glmbw-table .glmbw-th-light {
-                        font-weight: bold;
-                        text-align: left;
+                        font-weight:    bold;
+                        text-align:     left;
                         vertical-align: top;
-                        white-space: nowrap;
+                        white-space:    nowrap;
                     }
                     .glmbw-table th {
-                        font-weight: bold;
-                        text-align: left;
+                        font-weight:    bold;
+                        text-align:     left;
                         vertical-align: top;
-                        white-space: nowrap;
-                        padding: 0px;
-                        padding-left: .2rem;
+                        white-space:    nowrap;
+                        padding:        0px;
+                        padding-left:   .2rem;
                     }
                     .glmbw-table td {
-                        font-weight: normal;
-                        font-size: .9em;
-                        text-align: left;
+                        font-weight:    normal;
+                        font-size:      .9em;
+                        text-align:     left;
                         vertical-align: top;
-                        padding: 0px;
-                        padding-left: .2rem;
-                        margin: 0px;
+                        padding:        0px;
+                        padding-left:   .2rem;
+                        margin:         0px;
                     }
                     .glmbw-table tr {
-                        margin-bottom: 0px;
+                        margin-bottom:  0px;
                         padding-bottom: 0px;
                     }
                     .glmbw-image {
                         max-width: 90%;
-                        height: auto;
-                        width: auto\9; /* IE8 */
+                        height:    auto;
+                        width:     auto\9; /* IE8 */
                     }
                     .print-title {
                         font-weight: bold;
-                        font-size: 1em;
-                        text-align: center;
+                        font-size:   1em;
+                        text-align:  center;
                     }
                     #print-date {
                         font-size: 1em;
-                        padding: 0px;
-                        margin: 0px;
+                        padding:   0px;
+                        margin:    0px;
                     }
                     .graphContainer {
                     }
                     .graphContainer .graphTitle {
-                        font-weight: bold;
+                        font-weight:   bold;
                         margin-bottom: 5px;
                     }
                     .graph {
                     }
                     .color-key-traffic {
-                        color: black !important;
+                        color:       black !important;
                         font-weight: bold;
                     }
                     .color-key-target {
-                        color: maroon !important;
+                        color:       maroon !important;
                         font-weight: bold;
                     }
                     .color-key-storage {
-                        color: gray !important;
+                        color:       gray !important;
                         font-weight: bold;
                     }
                     .color-key-incoming {
-                        color: red !important;
+                        color:       red !important;
                         font-weight: bold;
                     }
                     .color-key-outgoing {
-                        color: green !important;
+                        color:       green !important;
                         font-weight: bold;
                     }
                     .color-key-total {
-                        color: blue !important;
+                        color:       blue !important;
                         font-weight: bold;
                     }
                 </style>
 
         // Date Only Pickers
         $('.glm-date-input').datetimepicker({
-            format: 'm/d/Y',
-            lang: 'en',
-            step: 15,
-            opened: false,
+            format:              'm/d/Y',
+            lang:                'en',
+            step:                15,
+            opened:              false,
             closeOnWithoutClick: true,
-            timepicker: false,
-            onChangeDateTime:function(dp,$input){
-                updateGraphs($input.val())
+            timepicker:          false,
+            onChangeDateTime:    function(dp,$input){
+                updateGraphs($input.val());
                 $('#displayThisDate').html($input.val());
             }
         });
             var areaToPrint = $(this).attr('data-areaToPrint');
             var position = $(this).offset();
             $('#' + areaToPrint).printArea({
-                mode:       'popup',        //printable window is either iframe or browser popup
-                popHt:      1400,            // popup window height
-                popWd:      1100,            // popup window width
-                popX:       200,            // popup window screen X position
-                popY:       200,            //popup window screen Y position
-                popTitle:   'Server Usage',   // popup window title element
-                popClose:   true,           // popup window close after printing
-                extraCss:   '',             // Comma separated list of extra css to include
-                extraHead:  '',             // Comma separated list of extra elements to be appended to head tag
-                strict:     false           // strict or loose Transitional html 4.01 document standard or undefined to not include at all only for popup option
+                mode:      'popup',        //printable window is either iframe or browser popup
+                popHt:     1400,            // popup window height
+                popWd:     1100,            // popup window width
+                popX:      200,            // popup window screen X position
+                popY:      200,            //popup window screen Y position
+                popTitle:  'Server Usage',   // popup window title element
+                popClose:  true,           // popup window close after printing
+                extraCss:  '',             // Comma separated list of extra css to include
+                extraHead: '',             // Comma separated list of extra elements to be appended to head tag
+                strict:    false           // strict or loose Transitional html 4.01 document standard or undefined to not include at all only for popup option
             });
             $('.datePrintExclude').show();
             $('.datePrintInclude').hide();
index ef15fca..4ecc176 100644 (file)
@@ -8,14 +8,19 @@
     desired Foundation 6 based HTML that will display actual form.
 
     {$ui = [
-        'id'        => string   required    Form ID - Use the same ID for the form summary and edit sections,
-        title'      => string               Optional title
+        'id'                  => string   required  Form ID - Use the same ID for the form summary and edit sections,
+        'title'               => string             Optional title,
+        'summary_button_text' => string             Optional custom button text - Default is "Summary"
     ]}
 *}
+{$summaryButtonText = 'Summary'}
+{if !empty($ui.summary_button_text)}
+    {$summaryButtonText = $ui.summary_button_text}
+{/if}
 <div id="{$ui.id}_edit" class="cell small-12 large-{$glm_f6_ui_wrapsize}">
     <div class="grid-x">
         <div class="cell small-12 glm-f6-ui-form-edit-start">
-            <button id="{$ui.id}_summary_button" type="button" class="button">Summary Only</button>
+            <button id="{$ui.id}_summary_button" type="button" class="button">{$summaryButtonText}</button>
             {if !empty($ui.title)}<span class="glm-f6-ui-form-edit-title">{$ui.title}</span]>{/if}
         </div>
         <script>
index 8318aef..8a13786 100644 (file)
@@ -8,20 +8,22 @@
     validate message.
 
     {$ui = [
-        'action'                 => string   Required    URL
-        'method'                 => string   Required    Method "post" or "get"
-        'id'                     => string               Form id
-        'file'                   => boolean              If including file upload set to true
-        'validate'               => boolean              If true, include Abide Form Validation
-        'validateFocusMsg'       => boolean              If true focuses on validateMessage on error - May be a problem if there's more than one validated form (may have to ID these messages separately)
-        'validateID'             => string               Unique text that will be added to the validate message container to ensure that it is unique
-        'validateMessage'        => string               Message to show for a validation error, Defaults to "There are some errors in your form."
-        'leaveModifiedFormCheck' => boolean              If set and user tries to leave the page after modifying form input it will warn them and ask if they want to abandon their changes.
+        'action'                 => string   Required   URL
+        'method'                 => string   Required   Method "post" or "get"
+        'id'                     => string              Form id
+        'target'                 => string              Target tab or window ID
+        'file'                   => boolean             If including file upload set to true
+        'validate'               => boolean             If true, include Abide Form Validation
+        'validateFocusMsg'       => boolean             If true focuses on validateMessage on error - May be a problem if there's more than one validated form (may have to ID these messages separately)
+        'validateID'             => string              Unique text that will be added to the validate message container to ensure that it is unique
+        'validateMessage'        => string              Message to show for a validation error, Defaults to "There are some errors in your form."
+        'leaveModifiedFormCheck' => boolean             If set and user tries to leave the page after modifying form input it will warn them and ask if they want to abandon their changes.
     ]}
 *}
 <form
     action="{$ui.action}"
     method="{$ui.method}"
+    {if !empty($ui.target)}target="{$ui.target}"{/if}
     {if !empty($ui.id)}id="{$ui.id}"{/if}
     {if !empty($ui.file)}enctype="multipart/form-data"{/if}
     data-abide novalidate data-validate-on-blur="true">
index 2e4a216..0e64cc2 100644 (file)
@@ -8,14 +8,19 @@
     desired Foundation 6 based HTML that will a text only summary (no form fields) summry of the current form data.
 
     {$ui = [
-        'id'        => string   required    Form id
-        'title'     => string               Optional title
+        'id'               => string   required  Form id,
+        'title'            => string             Optional title,
+        'edit_button_text' => string             Optional custom button text - Default is "Edit"
     ]}
 *}
+{$editButtonText = 'Edit'}
+{if !empty($ui.edit_button_text)}
+    {$editButtonText = $ui.edit_button_text}
+{/if}
 <div id="{$ui.id}_summary" class="cell small-12 large-{$glm_f6_ui_wrapsize}" styl="display: none;">
     <div class="grid-x">
         <div class="cell small-12 glm-f6-ui-form-summary-start">
-            <button id="{$ui.id}_edit_button" type="button" class="button">Edit</button>
+            <button id="{$ui.id}_edit_button" type="button" class="button">{$editButtonText}</button>
             {if !empty($ui.title)}<span class="glm-f6-ui-form-summary-title">{$ui.title}</span]>{/if}
         </div>
         <script>
index 83b26ba..a7c25dc 100644 (file)
 *}
 
 <div class="cell small-12 glm-f6-ui-field">
-    <button
+    <input
         {if !empty($ui.id)}id="{$ui.id}"{/if}
         {if !empty($ui.submit)}type="submit"{/if}
         class="glm-form-submit-button button {$ui.class|default:'primary'}{if !empty($ui.small)} button-small{/if}"
+        value="{$ui.label}"
         >
-        {$ui.label}
-    </button>
     {if !empty($ui.cancel)}<a href="{$ui.cancel}" class="button secondary">Cancel</a>{/if}
 </div>