Odyssey
siteSetColor.prg
1 <?php
2 
3 /*
4  * siteSetColor
5  *
6  * Configuration script for allowing easy changes to the colors specific to the
7  * credit union
8  *
9  * This will ONLY make changes to the credit union brand.css
10  * Changes to the cuSettings is a different scirpt
11  *
12  */
13 
14  // ** Include these scripts, mostly to ensure that the Monitor security is maintained
15 
16  $monLibrary = dirname(__FILE__) . "/../library";
17  require_once("$monLibrary/cu_top.i");
18  require_once("$monLibrary/ck_hticket.i");
19  require_once("$sharedLibrary/hcuTranslate.i");
20  require_once("$sharedLibrary/cu_flagconst.i");
21  require_once("$sharedLibrary/cu_data.i");
22 
23  if (!CheckPerm($link, $Hu, basename($_SERVER['SCRIPT_NAME']), $_SERVER['REMOTE_ADDR'])) {
24  // ** Permissions failed
25  // ** redirect to new page
26  header("Location: /hcuadm/hcu_noperm.prg");
27  exit;
28  }
29 
30  $loadedFromTemplate = false; // Set this here to prevent an E_NOTICE error.
31  $loadedFromProduction = false;
32  // Need to distinguish when preview is loaded from production (loadedFromTemplate is true in this case) and when it is fully loaded from template.
33 
34  /*
35  * Local Variables
36  *
37  */
38  /*
39  * The status of the settings file
40  * loaded from default or CU specific
41  */
42  $settingsFileStatus = '';
43  try {
44  // ** Import the necessary fields
45  $string = array("filter" => FILTER_SANITIZE_STRING);
46  $parameters = array();
47  HCU_ImportVars($parameters, "", array('user_name' => $string, 'loadSettings' => $string));
48  $username = HCU_array_key_value("user_name", $parameters);
49  $username = $username === false ? "" : trim($username);
50  $loadSettings = HCU_array_key_value("loadSettings", $parameters);
51  $loadSettings = $loadSettings === false ? "" : trim($loadSettings);
52  $loadSettings = $loadSettings == "" ? "production" : $loadSettings;
53 
54  $cuStyleFileName = "brand.css";
55  $cuStyleFileProdName = "brand.$username.css";
56  $cuStyleFileTemplateName = $cuStyleFileName;
57  // ** Configure location of the hcuSettings file for the Credit Union
58  $cuSettingsDir = "/home/{$username}/public_html/bankingIncludes/";
59  $cuPublicDir = "/home/{$username}/public_html/";
60 
61  // ** Configure location of the default hcuSettings
62  $templateSettingsDir = "/home/homecu/public_html/bankingIncludes/css/";
63 
64  if ($loadSettings == 'production') {
65  $cuSaveSettingsFilePath = $loadSettings . '/css/' . $cuStyleFileProdName;
66  $cuLoadSettingsFilePath = $loadSettings . '/css/' . $cuStyleFileProdName;
67  } elseif ($loadSettings == 'preview' || $loadSettings == 'previewreload') {
68  // ** ALWAYS save to the preview folder in this instance
69  $cuSaveSettingsFilePath = 'preview/css/' . $cuStyleFileName;
70  if ($loadSettings == 'preview' && is_readable($cuSettingsDir . $loadSettings . '/css/' . $cuStyleFileName)) {
71  $cuLoadSettingsFilePath = $loadSettings . '/css/' . $cuStyleFileName;
72  } else {
73  // ** Load the preview FROM the production file if it exists
74  $cuLoadSettingsFilePath = 'production/css/' . $cuStyleFileProdName;
75  $loadedFromTemplate = true;
76  }
77  } else {
78  // ** ERROR -- invalid parameter
79  throw new Exception('Invalid parameter setting', 903);
80  }
81  $cuSaveSettingsFilePath = $loadSettings == "production" ? $loadSettings . '/' . $cuStyleFileProdName : $loadSettings . '/' . $cuStyleFileName;
82  $templateFilePath = $templateSettingsDir . '/' . $cuStyleFileName;
83 
84 
85  /* Determine if the settings file exists */
86  $fileIsReadable = is_readable($cuSettingsDir . $cuLoadSettingsFilePath);
87  if (is_readable($cuSettingsDir . $cuSaveSettingsFilePath) && !is_writable($cuSettingsDir . $cuSaveSettingsFilePath)) {
88  // ** UNABLE to write to the desired file
89  throw new Exception('Credit Union settings file not configured with correct permission. Unable to save brand.css file in $loadSettings.', 903);
90 
91  } elseif (is_writable($templateSettingsDir)) {
92  // ** They have a Settings file, we will want load from there
93  // ** LOAD FILE
94  if ($fileIsReadable) {
95  $settingsFileStatus = "<strong>Colors Found</strong><br/>Loaded From {$cuStyleFileName}";
96  } elseif (is_readable($templateSettingsDir . $cuStyleFileName)) {
97  // ** Load from the template directory if it is readable
98  $settingsFileStatus = '<strong>Settings Not Found</strong><br/>Loaded From Template';
99  $loadedFromTemplate = true;
100  } else {
101  // ** RAISE ERROR -- NOT SURE WHAT WE ARE DOING HERE
102  throw new Exception('Credit Union configuration error', 901);
103  }
104 
105  } elseif (!is_dir($cuSettingsDir) && is_writable($cuPublicDir)) {
106  // ** MILD ERROR -- Unable to Find directory, BUT we can offer to create it
107  // * for the user
108  throw new Exception("Credit Union not configured with correct permission or directory. {$cuSettingsDir}", 900);
109  } elseif (is_writable($cuSettingsDir) && $templateIsReadable) {
110  // ** SETTINGS Directory exists AND we can write
111  // ** NO Credit Union Settings file, Load from Default
112  // ** LOAD FILE
113  $settingsFileStatus = '<strong>Settings Not Found</strong><br/>Loaded From Template';
114  } else {
115  // ** RAISE ERROR -- NOT SURE WHAT WE ARE DOING HERE
116  throw new Exception('Credit Union configuration error', 901);
117  }
118  // ** I want to remove the possibility of previewreload at this point. It does not matter
119  // * where the file was from now. What we want to do is always save to the preview directory
120  $loadSettings = ($loadSettings == 'previewreload' ? 'preview' : $loadSettings);
121 
122 
123  /* Extracting values from the brand.$cu.css file. There are three possibilities:
124  * 1) The file doesn't exist or is blank. In this case, load the template with defaults.
125  * 2) The file does exist and is in the correct format. In this case, extract the values for the CU and on save, replace template with values.
126  * 3) The file exists prior to #226. In this case, brand file will be manually conformed to the template.
127  */
128 
129  $styleDefaults = array(
130  "fontFamily" => "Helvetica, \"Helvetica Neue\", Arial, sans-serif",
131  "headerBackground" => "#24417A",
132  "headerForeground" => "#FFFFFF",
133  "headerBorder" => "#2A2D33",
134  "footerBackground" => "#E7E8EA",
135  "footerForeground" => "#777777",
136  "menuGroupBackground" => "#1B8DD6",
137  "menuGroupBackgroundLighter" => "#2198E3",
138  "menuGroupForeground" => "#FFFFFF",
139  "menuForeground" => "#337AB7",
140  "menuForegroundHover" => "#23527C",
141  "menuBackgroundHover" => "#EEEEEE",
142  "menuBackground" => "#F8F8F8",
143  "slideinBackground" => "#808080",
144  "slideinForeground" => "#FFFFFF",
145  "contentBackground" => "#FFFFFF",
146  "contentForeground" => "#333333",
147  "logoHeightDesktop" => "75px",
148  "logoHeightMobile" => "35px",
149  "logoBackground" => "transparent",
150  "contentBorderWidth" => "0px",
151  "contentBorderStyle" => "solid",
152  "contentBorderColor" => "#000000",
153  "navBadgeColor" => "#777777",
154  "navIconColor" => "#9D9D9D",
155  "navIconColorHover" => "#FFFFFF",
156  "navBackground" => "transparent",
157  "navForeground" => "#FFFFFF",
158  "navActiveBorder" => "#FF0000",
159  "bannerBackground" => "#161620",
160  "bannerHeight" => "60px",
161  "bannerWidth" => "100%"
162  );
163 
164  $styleType = array("fontFamily" => "other", "logoHeightDesktop" => "number", "logoHeightMobile" => "number",
165  "contentBorderStyle" => "other", "contentBorderWidth" => "number", "bannerHeight" => "number",
166  "bannerHeight" => "number", "bannerWidth" => "number");
167 
168  $styleValues = array();
169 
170  if ($fileIsReadable) {
171  $styleContent = file_get_contents($cuSettingsDir . $cuLoadSettingsFilePath);
172 
173  $styleValues = array();
174 
175  // E.g. " #E7E8EA; /* FOOTER-BACKGROUND */" or " transparent !important; /* SLIDEIN-FOREGROUND */"
176  $pattern = '/\s*((transparent)|(#[0-9A-Fa-f]{6})|(\d+px)|(100%)|([^:;\!]+))(\s+\!important)?;\s*\/\*\s*([A-Za-z]+)\s*\*\//';
177  $matches = array();
178  $result = preg_match_all($pattern, $styleContent, $matches, PREG_SET_ORDER);
179 
180  // Gets the first match of the key to set the value.
181  foreach($matches as $matchSet) {
182  $key = $matchSet[8]; // E.g. FONT-FAMILY
183  $value = $matchSet[1]; // E.g. #24417A
184  $type = HCU_array_key_value($key, $styleType);
185  $type = $type === false ? $type = "color" : $type;
186 
187  $valid = false;
188  switch($type) {
189  case "color":
190  $valid = !empty($matchSet[2]) || !empty($matchSet[3]);
191  break;
192  case "number":
193  $valid = !empty($matchSet[4]) || !empty($matchSet[5]);
194  break;
195  case "other":
196  $valid = !empty($matchSet[6]);
197  break;
198  }
199  if (!$valid) {
200  continue;
201  }
202 
203  $styleValues[$key] = $value;
204  }
205 
206  // If key is not found, then use default value for it.
207  foreach($styleDefaults as $key => $value) {
208  if (!HCU_array_key_exists($key, $styleValues)) {
209  $styleValues[$key] = $value;
210  }
211  }
212  } else {
213  $styleContent = file_get_contents($templateSettingsDir . $cuStyleFileTemplateName);
214  $styleValues = $styleDefaults;
215  }
216 
217  $customContent = explode('/* customBranding */', $styleContent, 2);
218  $customContent = count($customContent) > 1 ? trim($customContent[1]) : "";
219 
220  $styleContent = file_get_contents($templateSettingsDir . $cuStyleFileTemplateName);
221 
222  foreach($styleValues as $key => $value) {
223  $styleContent = str_replace('{{' . $key . '}}', $value, $styleContent);
224  $type = HCU_array_key_value($key, $styleType);
225 
226  // Value when color picker or number input is null.
227  if ($value == "100%" || $value == "transparent") {
228  $styleValues[$key] = null;
229  // To get into the number control, remove the px on the end of it.
230  } else if (strpos($value, "px") !== false) {
231  if ($type == "number") {
232  $value = floatval(explode("px", $value)[0]);
233  $styleValues[$key] = $value;
234  }
235  }
236  }
237 
238  // Add customContent back
239  $styleContent = explode('/* customBranding */', $styleContent, 2);
240  $styleContent = trim($styleContent[0]); // Remove and readd.
241  if ($customContent != "") {
242  $styleContent .= "\n\n" . '/* customBranding */' . "\n" . $customContent;
243  $styleValues["customBranding"] = $customContent;
244  } else {
245  $styleValues["customBranding"] = "";
246  }
247 
248  // ** Look ONCE for credit union settings file -- If I find it and
249  // ** Parse it, then set the kendo theme
250  $cuLoadSettingsFile = "/home/{$username}/public_html/bankingIncludes/{$loadSettings}/hcuSettings.i";
251  $cuSettings = "";
252  if (!is_readable($cuLoadSettingsFile)) {
253  $cuLoadSettingsFile = "/home/{$username}/public_html/bankingIncludes/production/hcuSettings.i";
254  }
255  if (is_readable($cuLoadSettingsFile)) {
256 
257  $settingsContent = file_get_contents($cuLoadSettingsFile);
258  $isEmpty = trim($settingsContent) == "";
259 
260  // ** Now decode it and hope for the best
261  $cuSettings = HCU_JsonDecode($settingsContent);
262  if (!$isEmpty && count($cuSettings) == 0) {
263  // ** Something went wrong with the menu decode
264  throw new Exception('Unable to parse settings file', '902');
265  }
266  }
267 
268  $contentTheme = HCU_array_key_value("contentTheme", $cuSettings);
269  $contentTheme = $contentTheme === false ? "" : trim($contentTheme);
270  if ($contentTheme == '') {
271  $contentTheme = GetMonitorDefaultKendoStyle();
272  }
273  $logoURL = HCU_array_key_value("imageLocations", $cuSettings);
274  $logoURL = $logoURL === false ? "" : HCU_array_key_value("desktopCULogoLocation", $logoURL);
275  $logoURL = $logoURL === false ? "" : trim($logoURL);
276 
277  // Set up banner
278  // ** Determine if we show the banner.
279  $bannerDiv = '';
280  $SYSENV["Cu"] = strtoupper($username);
281  $SYSENV["Cn"] = "nouser";
282  $MC = new hcu_talk_base( "en_US" );
283 
284  $sql = "select flagset2 from cuadmin where lower(cu) = '" . prep_save($username, 10) . "'";
285  $sth = db_query($sql, $dbh);
286  if (!$sth) {
287  throw new exception ("Flagset query failed.", 903);
288  }
289  $SYSENV["Fset2"] = db_num_rows($sth) > 0 ? intval(db_fetch_row($sth, 0) [0]) : 0;
290 
291  // ** if we do we will also need to add a class to the body tag
292  if ((HCU_array_key_value('Fset2', $SYSENV) & GetFlagsetValue("CU2_SHOWBANNER"))) {
293  // ** Banners are on and not suppressed at the script level
294  $aryBanner = Get_BannerText($dbh, $SYSENV, $MC, 'D');
295  if ($aryBanner['status']['code'] != '000') {
296  $txtBannerData = '';
297  } else {
298  $aryBannerData = Translate_BannerText($SYSENV,$aryBanner['banner']['bannertext']);
299  if ($aryBannerData['status']['code'] != '000') {
300  $txtBannerData = '';
301  } else {
302  $txtBannerData = $aryBannerData['banner']['bannertext'];
303  }
304  }
305  if ($txtBannerData != '') {
306  $bannerBodyClass = 'showHomecuBanner';
307  $bannerDiv = "
308  <div id='homecuBannerArea'>
309  {$txtBannerData}
310  </div>
311  ";
312  }
313  }
314 
315  PrintOdysseyHTMLContainer($styleValues, $styleContent, $loadSettings, $loadedFromTemplate, $username, $settingsFileStatus,
316  $contentTheme, $logoURL, $SYSENV['devmode'], $bannerDiv);
317 
318  } catch (Exception $e) {
319  // ERROR CAUGHT
320  /*
321  * ERRORS FOR THE SCRIPT
322  *
323  * 900 - Unable to Create the Needed directories. This may be caused by permmissions
324  * or public_html not existing
325  * 901 - Unable to continue - This is a catch all, not exactly sure why we could be here
326  *
327  * 902 - Unable to continue - Found the settings file, but failed on parsing
328  *
329  * 800 - Unable to find the Credit Union Settings directory.. BUT we can offer
330  * to create it.
331  */
332  PrintErrorMessage($SYSENV['devmode']);
333  }
334 
335 /**
336  * PrintErrorMessage($devmode)
337  * This function prints out: "This is an unexpected error for this script" on an error.
338  *
339  * @param $devmode -- if devmode, if use the "dev" class for the monitor banner, otherwise use the "prod" class.
340  */
341 function PrintErrorMessage($devmode) {
342  $cloudFrontDomainName = GetCloudFrontDomainName ();
343  $homecuKendoVersion = GetHomecuKendoVersion ();
344  $bootstrapVersion = GetHomecuBootstrapVersion ();
345  $fontAwesomeVersion = GetFontawesomeVersion (); ?>
346 <!DOCTYPE html>
347 <html>
348  <head>
349  <title>Sample Credit Union Name</title>
350  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
351  <meta name="robots" content="noindex,nofollow" />
352  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
353 
354  <meta name="viewport" content="width=device-width, initial-scale=1" />
355 
356  <link rel='stylesheet' media='all' type='text/css' href='https://<?php echo $cloudFrontDomainName; ?>/homecu/css/reset.css' />
357 
358  <!-- BASE BOOTSTRAP -->
359  <link href='https://<?php echo $cloudFrontDomainName; ?>/homecu/css/bootstrap/<?php echo $bootstrapVersion; ?>/css/bootstrap.css' rel='stylesheet'/>
360 
361  <!-- KENDO BOOTSTRAP COMMON STYLES - REPLACES kendo.common.css -->
362  <link href='https://<?php echo $cloudFrontDomainName; ?>/homecu/css/KendoUI/<?php echo $homecuKendoVersion; ?>/kendo.common-bootstrap.min.css' rel='stylesheet'/>
363 
364  <!-- METIS MENU -->
365  <link href='/banking/static/css/metisMenu.css' rel='stylesheet'/>
366 
367  <!-- /* CUSTOM KENDO BOOTSTRAP STYLING */ -->
368  <link rel='stylesheet' media='all' type='text/css' href='/shared/static/css/homecu-custom-kendo-boot.css' />
369 
370  <!-- /* HOMECU BASE LAYOUT */ -->
371  <link rel='stylesheet' media='all' type='text/css' href='/shared/static/css/hcuLayout.css' />
372  <link rel='stylesheet' media='all' type='text/css' href='/banking/static/css/layout.css' />
373 
374  <!-- /* FONT AWESOME */ -->
375  <link href='https://<?php echo $cloudFrontDomainName; ?>/homecu/css/font-awesome/<?php echo $fontAwesomeVersion; ?>/css/font-awesome.css' rel='stylesheet'/>
376 
377  <link rel='stylesheet' media='all' type='text/css' href='/monitor/css/monitor-core.css' />
378  <!-- /**
379  * JAVASCRIPT INCLUDES
380  */
381  /* JQUERY BASE */ -->
382  <script type='text/javascript' src='https://<?php echo $cloudFrontDomainName; ?>/jquery/js/jquery-1.10.2.js'></script>
383 
384  <!-- /* KENDO FULL WIDGET INCLUDE - CREATE CUSTOM FOR PRODUCTION */ -->
385  <script src='https://<?php echo $cloudFrontDomainName; ?>/homecu/js/KendoUI/<?php echo $homecuKendoVersion; ?>/kendo.web.js'></script>
386  <!-- /* BOOTSTRAP JAVASCRIPT */ -->
387  <script src='https://<?php echo $cloudFrontDomainName; ?>/homecu/js/bootstrap/<?php echo $bootstrapVersion; ?>/js/bootstrap.js'></script>
388 
389  <!-- /* CUSTOM JQUERY TIMEOUT DIALOG SCRIPT */ -->
390  <script type='text/javascript' src='/static/js/jquery-timeout-dialog.js'></script>
391 
392  <!-- /* JQUERY COOKIE */ -->
393  <script type='text/javascript' src='https://<?php echo $cloudFrontDomainName; ?>/homecu/js/jquery.cookie.js'></script>
394 
395  <!-- /* HOMECU CUSTOM ERRORS FOR FORMS */ -->
396  <script type='text/javascript' src='/shared/static/js/hcuFormError.js'></script>
397 
398  <!-- /* HOMECU CUSTOM NOTICES FOR FORMS - PROVIDES CHAINING*/ -->
399  <script type='text/javascript' src='/banking/static/js/hcuFormNotice.js'></script>
400 
401  <!-- /* HOMECU CUSTOM KENDO SETTINGS */ -->
402  <script type='text/javascript' src='/shared/static/js/kendo.homecu.custom.js'></script>
403 
404  <!-- /* metisMenu */ -->
405  <script type='text/javascript' src='/banking/static/js/metisMenu.js'></script>
406 
407  </head>
408  <body>
409  <header id="commonMonitorHeader" class="<?php echo $devmode ? 'dev' : 'prod'; ?>">
410  <div class="header-title">Home Banking CU Branding</div>
411  <?php if (!$devmode) { ?><div id="environmentMsg">(Production)</div><?php } ?>
412  </header>
413  <div class="container-fluid">
414  <div class="row">&nbsp;</div>
415  <div class="row">
416  <div class="col-xs-12">
417  <div class='k-block k-error-colored'>
418  Please see a programmer<br/>
419  This is an unexpected error for this script.
420  </div>
421  </div>
422  </div>
423  </div>
424  </body>
425  </html>
426 <?php }
427 
428 /**
429  * function PrintSiteBranding($styleValues, $username, $loadSettings, $settingsFileStatus, $loadedFromTemplate)
430  * This function prints out the style, javascript, and HTML for the branding itself.
431  *
432  * @param $styleValues -- This is all the changeable attributes for the brand file.
433  * @param $username -- The lowercase code of the credit union
434  * @param $loadSettings -- "preview" or "production"
435  * @param $settingsFileStatus -- the status message
436  * @param $loadedFromTemplate -- if loaded from template then need to save
437  */
438 function PrintSiteBranding($styleValues, $username, $loadSettings, $settingsFileStatus, $loadedFromTemplate) {
439  ?>
440  <style>
441  .section-dirty,
442  .section-clean,
443  .section-response {
444  display: none;
445  }
446 
447  .settingStatus {
448  min-height: 50px;
449  padding-top: 10px;
450  }
451  .settingStatus .section,
452  .settingStatus .section-clean,
453  .settingStatus .section-dirty {
454  margin-bottom: 20px;
455  }
456  #currentStatus.dirty .section-dirty {
457  display: block;
458  }
459  #currentStatus.clean .section-clean {
460  display: block;
461  }
462 
463  #currentStatus {
464  margin-bottom: 40px;
465  }
466 
467  #panelBrand {
468  margin-bottom: 40px;
469  }
470  #panelBrand label {
471  display: block;
472  }
473  #panelBrand span.k-link {
474  padding-bottom: 5px;
475  }
476  #panelBrand li:nth-child(even) {
477  background-color: #FAFAFA;
478  color: #333;
479  }
480  #panelBrand li:nth-child(odd) {
481  background-color: #EFEFEF;
482  color: #333;
483  }
484  #panelBrand .k-numeric-wrap {
485  width: 50px;
486  }
487  #editBrandWindow {
488  font-family: helvetica, verdana, sans-serif;
489  }
490 
491  .panelBrandContainer {
492  max-height: 450px; <?php /* Solve dual problems of not being able to scroll when header is open and difficulty opening color pickers. */ ?>
493  overflow-x: hidden;
494  overflow-y: auto;
495  }
496 
497  /* Pushed down the page further by the monitor banner. */
498  #homecuBannerArea + #body-wrapper .desk-lang-select {
499  top: 152px;
500  }
501 
502  .imageNote, .imageNote .k-link {
503  font-weight: bold;
504  color: red;
505  }
506 
507  [name='customBranding'] {
508  width: 370px;
509  height: 150px;
510  line-height: initial;
511  }
512  </style>
513 
514  <style>
515  .contentText {
516  position: absolute;
517  left: 540px;
518  top: 200px;
519  }
520  </style>
521  <script type="text/javascript">
522 
523 
524  var brandData = <?php echo HCU_JsonEncode($styleValues); ?>,
525  formDirty,
526  brandObservable;
527  var activeWindows = [];
528  $(document).ready(function() {
529  $("body").on("click", ".k-overlay", function() { if (activeWindows.length > 0) activeWindows[activeWindows.length-1].close(); return false; });
530  $("<div id='editBrandWindow'></div>").appendTo("body").kendoWindow({
531  width: '515px',
532  position: {
533  left: 327,
534  top: 188
535  },
536  title: 'Credit Union Brand Settings',
537  actions:[],
538  content: {
539  template: $("#editBrandWindowTemplate").html()
540  },
541  scrollable: false,
542  pinned: true,
543  resizable: false
544  });
545 
546  brandObservable = new kendo.data.ObservableObject(brandData);
547  kendo.bind($('#panelBrand'), brandObservable);
548  brandObservable.bind('change', function(e) {
549  AdjustScreenStyles(e.field);
550  formDirtyFlag(true);
551  });
552 
553  $(".brandColorPick[data-role='colorpicker']").each(function() {
554  var picker = $(this).data("kendoColorPicker");
555  $(picker.wrapper).click(function() {
556  OpenColorPicker(this);
557  });
558  picker.destroy();
559  });
560 
561 
562  $('#selectFileSettings').kendoDropDownList({
563  change: selectSettings
564  });
565  var selFileSettings = $('#selectFileSettings').data('kendoDropDownList');
566  selFileSettings.value('<?php echo $loadSettings; ?>');
567 
568  $('#panelBrand').kendoPanelBar({
569  expandMode: "single"
570 
571  });
572  $('.brandSizePick').each(function() {
573  $(this).kendoNumericTextBox({
574  min: 0,
575  max: 300,
576  format: '0',
577  spinners:false
578  });
579  });
580  $('#brandContentBorderStyle').kendoDropDownList({
581  dataSource: [
582  {value: "none"},
583  {value: "solid"},
584  {value: "dotted"},
585  {value: "dashed"},
586  {value: "groove"},
587  {value: "inset"},
588  {value: "outset"}
589  ],
590  dataTextField: "value",
591  dataValueField: "value"
592  });
593 
594  homecuTooltip.reset();
595  $(".detailsTip").kendoTooltip(homecuTooltip.custom);
596 
597  $('#btnUpdate').click(function(e) {
598  e.preventDefault();
599  PostChanges();
600  });
601 
602  $('#btnSaveToProd').click(function(e) {
603  e.preventDefault();
604  $('#loadSettings').val('savetoproduction');
605  PostChanges();
606  });
607  <?php
608  // * If we loaded the Settings From template ,then I want to set
609  // * the form to be dirty
610  if ($loadedFromTemplate): ?>
611  formDirtyFlag(true);
612  <?php endif; ?>
613 
614  });
615 
616  <?php
617  /**
618  * function OpenColorPicker(control)
619  * Opens a kendoWindow with a kendoFlatColorPicker inside. This replaces a kendoColorPicker control. The problem with that was it was sometimes half-hidden.
620  *
621  * @param control -- this refers to the wrapper of the previous kendoColorPicker control. It contains all that I need.
622  * The kendoColorPicker is destroyed before this.
623  */
624  ?>
625  function OpenColorPicker(control) {
626  var cpWindow = $("#cpWindow").data("kendoWindow");
627  var flatColorPicker = null;
628 
629  if (cpWindow == null) {
630  cpWindow = $("<div id='cpWindow'></div>").appendTo("body").kendoWindow({
631  resizable: false,
632  pinned: true,
633  visible: false,
634  autoFocus: false,
635  title: false,
636  modal: true,
637  content: {
638  template: $("#colorPickerWindowTemplate").html()
639  },
640  activate: function() {
641  flatColorPicker.focus();
642  },
643  open: function () {
644  if (window.activeWindows != null) {
645  window.activeWindows.push(this);
646  }
647  $("#cpWindow").data("cancelled", true);
648  var startingColor = $("#cpWindow").data("startingColor");
649  if (startingColor == "transparent") {
650  $("#flatColorDiv").hide();
651  $("#transparentCheckbox").prop("checked", true);
652  } else {
653  $("#flatColorDiv").show();
654  $("#transparentCheckbox").prop("checked", false);
655  $("#flatColorPicker").data("kendoFlatColorPicker").value(startingColor);
656  }
657  },
658  close: function() {
659  if (window.activeWindows != null) {
660  window.activeWindows.pop();
661  }
662  var cancelled = $("#cpWindow").data("cancelled");
663  if (cancelled) {
664  var control = $($("#cpWindow").data("control"));
665  var name = $(control).find(".brandColorPick").attr("name");
666  var startingColor = $("#cpWindow").data("startingColor");
667 
668  if (startingColor == "transparent") {
669  $(control).find(".k-selected-color").css("backgroundColor", "#ffffff").append("<span class='k-icon k-i-line'></span>");
670  brandObservable[name] = null;
671  AdjustScreenStyles(name);
672  } else {
673  $(control).find(".k-selected-color").css("backgroundColor", startingColor).empty();
674  brandObservable[name] = startingColor;
675  AdjustScreenStyles(name);
676  }
677 
678  } else {
679  formDirtyFlag(true);
680  }
681 
682  }
683  }).data("kendoWindow");
684 
685  flatColorPicker = $("#flatColorPicker").kendoFlatColorPicker({
686  preview: true,
687  buttons: false,
688  change: function(e) {
689  var isOpening = $("#cpWindow").data("isOpening");
690  var control = $($("#cpWindow").data("control"));
691  var name = $(control).find(".brandColorPick").attr("name");
692  if (!isOpening) { <?php // Prevent color changing when the control is being opened. ?>
693  $(control).find(".k-selected-color").css("backgroundColor", e.value);
694  brandObservable[name] = e.value;
695  AdjustScreenStyles(name);
696  } else {
697  $("#cpWindow").data("isOpening", false);
698  }
699  }
700  }).data("kendoFlatColorPicker");
701 
702  $("#transparentDiv").click(function() {
703  var control = $($("#cpWindow").data("control"));
704  var name = $(control).find(".brandColorPick").attr("name");
705  if ($("#transparentCheckbox").prop("checked")) {
706  $("#flatColorDiv").hide();
707  $(control).find(".k-selected-color").css("backgroundColor", "#ffffff").append("<span class='k-icon k-i-line'></span>");
708  brandObservable[name] = null;
709  AdjustScreenStyles(name);
710  } else {
711  var color = $("#flatColorPicker").data("kendoFlatColorPicker").value();
712  $(control).find(".k-selected-color").css("backgroundColor", color).empty();
713  brandObservable[name] = color;
714  AdjustScreenStyles(name);
715  $("#flatColorDiv").show();
716  }
717  });
718 
719  $("#cpWindow").on("click", ".applyBtn", function() {
720  $("#cpWindow").data("cancelled", false);
721  cpWindow.close();
722  });
723 
724  $("#cpWindow").on("click", ".cancelBtn", function() {
725  $("#cpWindow").data("cancelled", true);
726  cpWindow.close();
727  });
728 
729  $("#cpWindow").data("isOpening", true);
730  } else {
731  $("#cpWindow").data("isOpening", false);
732  }
733 
734  flatColorPicker = $("#flatColorPicker").data("kendoFlatColorPicker");
735  $("#cpWindow").data("isOpening", false);
736  $("#cpWindow").data("control", $(control));
737 
738  var isTransparent = $(control).find(".k-selected-color .k-icon.k-i-line:visible").length > 0;
739  if (isTransparent) {
740  $("#cpWindow").data("startingColor", "transparent");
741  } else {
742  $("#cpWindow").data("startingColor", $(control).find(".k-selected-color").css("backgroundColor"));
743  }
744 
745  cpWindow.open().center();
746  }
747 
748  <?php
749  /**
750  * function AdjustScreenStyles(field)
751  * This function changes the style sheet on the brand page to be able to see the change.
752  *
753  * @param field -- the name of the control.
754  */
755  ?>
756  function AdjustScreenStyles(field) {
757  var fullCss = $("#brandCssStyle").html();
758 
759  if (field != "customBranding") {
760  <?php // LIKE: height: calc(100% - ({{bannerHeight}} + 65px)); /* CALC bannerHeight */ ?>
761  var pattern1 = '\\s*[^:;!]*\\s*calc\\s*\\(\\s*100%\\s*-\\s*\\(\\s*\\S+\\s*\\+\\s*(\\S+)\\s*\\)\\s*\\)\\s*;\\s*\\/\\*\\s*CALC\\s*' + field + '\\s*\\*\\/';
762  var regex1 = new RegExp (pattern1, 'g');
763  var pattern2 = '\\s*[^:;!]*(\\s+\\!important)?;\\s*\\/\\*\\s*' + field + '\\s*\\*\\/';
764  var regex2 = new RegExp (pattern2, 'g');
765  var value = brandObservable[field];
766  var isNumberField = $("[name='" + field + "']").hasClass("brandSizePick");
767  value = value == null ? (isNumberField ? "100%" : "transparent") : (isNumberField ? Number(value) + "px" : value);
768  fullCss = fullCss.replace(regex1, " calc(100% - (" + value + " + $1)); /* CALC " + field + " */");
769  fullCss = fullCss.replace(regex2, " " + value + "$1; /* " + field + " */");
770  } else { <?php // Custom Branding is ALWAYS at the end of the CSS so remove it and add it. ?>
771  fullCss = fullCss.split('/* customBranding */')[0];
772  fullCss = fullCss + '/* customBranding */\n' + brandObservable[field];
773  }
774 
775  $("#brandCssStyle").html(fullCss);
776  }
777 
778  <?php
779  /**
780  * function formDirtyFlag(dirtyAction)
781  * This will set up the dirty flag.
782  *
783  * @param dirtyAction -- either true or false.
784  */
785  ?>
786  function formDirtyFlag(dirtyAction) {
787  // ** dirtyAction can be {true/false}
788  // true - something on the form has changed
789  // false - a successful save was completed
790 
791  if (!formDirty && dirtyAction) {
792  // * Need to set the dirty information
793  // ** Remove the clean attribute
794  $('#currentStatus').removeClass('clean');
795  $('#currentStatus').addClass('dirty');
796  $('#currentStatus').removeClass('k-error-colored');
797  $('#currentStatus').removeClass('k-success-colored');
798  $('#currentStatus').addClass('k-info-colored');
799  $('.section-response').hide();
800  } else if(dirtyAction === false) {
801  $('#currentStatus').removeClass('dirty');
802  $('#currentStatus').addClass('clean');
803  $('#currentStatus').removeClass('k-info-colored');
804  $('#currentStatus').removeClass('k-info-colored');
805  $('#currentStatus').removeClass('k-error-colored');
806  $('#currentStatus').removeClass('k-success-colored');
807  formDirty = false;
808  }
809  }
810 
811  function selectSettings(e) {
812  e.preventDefault();
813  var value = $('#selectFileSettings').data('kendoDropDownList').value()
814  document.location = '<?php echo $_SERVER['PHP_SELF']; ?>?user_name=<?php echo $username; ?>&loadSettings=' + value;
815  }
816 
817  <?php
818  /**
819  * function PostChanges()
820  * Calls the data call.
821  */
822  ?>
823  function PostChanges() {
824  // ** SHOW SPINNER
825  kendo.ui.progress($("#serverResponseSpinner"), true);
826  // ** Create Post Data
827 
828  <?php // Need to set value to transparent when null; with a px if it is a number. ?>
829  var json = brandObservable.toJSON();
830  for (var field in json) {
831  var value = json[field];
832  var isNumberField = $("[name='" + field + "']").hasClass("brandSizePick");
833  value = value == null ? (isNumberField ? "100%" : "transparent") : (isNumberField ? Number(value) + "px" : value);
834  json[field] = value;
835  }
836 
837  $('#postStyleSettings').val(JSON.stringify(json));
838 
839  // ** Create a random number to prevent cache
840  var randUrl = Math.floor((Math.random()*10000)+1);
841  postUrl = 'siteSetColor.data?randUrl=' + randUrl;
842  postData = $('#formSettings').serialize();
843 
844  $.post(postUrl, postData, function(result) {
845  try {
846 
847  var responseResult = result.Results[0];
848  if (responseResult.homecuErrors) {
849  if (responseResult.homecuErrors.length > 0) {
850  // ** ERRROR
851  throw responseResult.homecuErrors;
852  } else {
853  // ** SUCCESS
854  // ** Check for the homecu Info
855  formDirtyFlag(false);
856  var serverResponse = 'Credit union branding updated';
857  if (responseResult.homecuInfo) {
858  if (responseResult.homecuInfo.length > 0) {
859  serverResponse = responseResult.homecuInfo;
860  }
861  }
862 
863  $('#currentStatusResponse').text(serverResponse);
864  $('#currentStatus').addClass('k-success-colored');
865  $('.section-response').show();
866  }
867  } else {
868  // * *THis should exist --
869  // ** if not throw a new error
870  throw "While attempting to save, the server responded with an unexpected result. Please reload the screen and start over.";
871  }
872  } catch (err) {
873  // ** Show the Error Status --
874  // ** Change the status div to be 'error'
875  $('#currentStatusResponse').text(err);
876  $('#currentStatus').addClass('k-error-colored');
877  $('.section-response').show();
878  }
879 
880  }).fail(function() {
881  // * malformed response..Close Window
882  var errMsg = "While attempting to save, the server responded with an unexpected result. Please reload the screen and start over.";
883  $('#currentStatusResponse').text(errMsg);
884  $('#currentStatus').addClass('k-error-colored');
885  $('.section-response').show();
886 
887  }).always(function() {
888  kendo.ui.progress($("#serverResponseSpinner"), false);
889  });
890  }
891  </script>
892  <script type="text/x-kendo-template" id="editBrandWindowTemplate">
893  <div class="panelBrandContainer">
894  <div class="container-fluid">
895  <div class="row">
896  <div id="currentStatus" class='k-block settingStatus clean col-xs-12'>
897  <div class="section">
898  <select id="selectFileSettings">
899  <option value="production">Production</option>
900  <option value="preview">Preview</option>
901  <option value="previewreload">Reload preview</option>
902  </select>
903  <span class="fa fa-question-circle-o detailsTip" title='Which settings file to modify.
904  Choose "Reload preview" to start preview with production settings.'></span>
905  </div>
906  <div class='section'>
907  <?php echo $settingsFileStatus; ?>
908  </div>
909  <div class='section-clean'>
910  <strong>No Changes made</strong>
911  <?php if ($loadSettings == 'preview'): ?>
912  <button name='btnSaveToProd' id='btnSaveToProd' class='k-button'>Save to Production</button>
913  <?php endif; ?>
914  </div>
915  <div class='section-dirty'>
916  <strong>Changes Have been made</strong><Br/>
917  <button name="btnUpdate" id="btnUpdate" class='k-button'>Save Changes</button>
918  </div>
919  <div class='section-response'>
920  <strong>Response from the server:</strong><Br/>
921  <div id='currentStatusResponse'></div>
922  </div>
923  <div id='serverResponseSpinner'></div>
924  </div>
925  </div>
926 
927  <div class="row">
928  <div class="col-xs-12">
929  <ul id="panelBrand">
930  <li>
931  FONT
932  <ul>
933  <li>
934  <label>Font Text</label>
935  <input type="text" name="fontFamily" data-bind="value: fontFamily" class="k-textbox" style='width:300px;'/>
936  </li>
937  </ul>
938  </li>
939  <li>
940  BANNER
941  <ul>
942  <li>
943  <label>background color</label>
944  <input type="color" class='brandColorPick' name="bannerBackground" data-bind="value: bannerBackground"
945  data-role="colorpicker" data-clear-button="true" />
946  </li>
947  <li>
948  <label>banner height</label>
949  <input type='text' class='brandSizePick' name='bannerHeight' data-bind='value: bannerHeight'/>
950  </li>
951  <li>
952  <label>banner width</label>
953  <input type='text' class='brandSizePick' name='bannerWidth' data-bind='value: bannerWidth'/>
954  </li>
955  </ul>
956  </li>
957  <li>
958  HEADER
959  <ul>
960  <li>
961  <label>background color</label>
962  <input type="color" class='brandColorPick' name="headerBackground" data-bind="value: headerBackground"
963  data-role="colorpicker" data-clear-button="true" />
964  </li>
965  <li>
966  <label>font color</label>
967  <input type="color" class='brandColorPick' name="headerForeground" data-bind="value: headerForeground" data-role="colorpicker" />
968  </li>
969  <li>
970  <label>border color</label>
971  <input type="color" class='brandColorPick' name="headerBorder" data-bind="value: headerBorder" data-role="colorpicker" />
972  </li>
973  </ul>
974  </li>
975  <li>
976  NAV BAR ICONS
977  <ul>
978  <li>
979  <label>background color</label>
980  <input type="color" class='brandColorPick' name="navBackground" data-bind="value: navBackground" data-role="colorpicker" data-clear-button="true" />
981  </li>
982  <li>
983  <label>font color</label>
984  <input type="color" class='brandColorPick' name="navForeground" data-bind="value: navForeground" data-role="colorpicker" />
985  </li>
986  <li>
987  <label>icon color</label>
988  <input type="color" class='brandColorPick' name="navIconColor" data-bind="value: navIconColor" data-role="colorpicker" />
989  </li>
990  <li>
991  <label>hover icon color</label>
992  <input type="color" class='brandColorPick' name="navIconColorHover" data-bind="value: navIconColorHover" data-role="colorpicker" />
993  </li>
994  <li>
995  <label>badge color</label>
996  <input type="color" class='brandColorPick' name="navBadgeColor" data-bind="value: navBadgeColor" data-role="colorpicker" />
997  </li>
998  <li>
999  <label>badge alert color</label>
1000  <input type="color" class='brandColorPick' name="navActiveBorder" data-bind="value: navActiveBorder" data-role="colorpicker" />
1001  </li>
1002  </ul>
1003  </li>
1004  <li>
1005  SLIDE OUT MESSAGE
1006  <ul>
1007  <li>
1008  <label>background color</label>
1009  <input type="color" class='brandColorPick' name="slideinBackground" data-bind="value: slideinBackground"
1010  data-role="colorpicker" data-clear-button="true" />
1011  </li>
1012  <li>
1013  <label>font color</label>
1014  <input type="color" class='brandColorPick' name="slideinForeground" data-bind="value: slideinForeground" data-role="colorpicker" />
1015  </li>
1016  </ul>
1017  </li>
1018  <li>
1019  MENU
1020  <ul>
1021  <li>
1022  <label>background color</label>
1023  <input type="color" class='brandColorPick' name="menuBackground" data-bind="value: menuBackground" data-role="colorpicker"
1024  data-clear-button="true" />
1025  </li>
1026  <li>
1027  <label>font color</label>
1028  <input type="color" class='brandColorPick' name="menuForeground" data-bind="value: menuForeground" data-role="colorpicker" />
1029  </li>
1030  <li>
1031  <label>hover background color</label>
1032  <input type="color" class='brandColorPick' name="menuBackgroundHover" data-bind="value: menuBackgroundHover" data-role="colorpicker" />
1033  </li>
1034  <li>
1035  <label>hover font color</label>
1036  <input type="color" class='brandColorPick' name="menuForegroundHover" data-bind="value: menuForegroundHover" data-role="colorpicker" />
1037  </li>
1038  <li>
1039  <label>selected group background color</label>
1040  <input type="color" class='brandColorPick' name="menuGroupBackground" data-bind="value: menuGroupBackground" data-role="colorpicker" />
1041  </li>
1042  <li>
1043  <label>selected font color</label>
1044  <input type="color" class='brandColorPick' name="menuGroupForeground" data-bind="value: menuGroupForeground" data-role="colorpicker" />
1045  </li>
1046  <li>
1047  <label>selected item background color</label>
1048  <input type="color" class='brandColorPick' name="menuGroupBackgroundLighter" data-bind="value: menuGroupBackgroundLighter"
1049  data-role="colorpicker" />
1050  </li>
1051  </ul>
1052  </li>
1053  <li>
1054  CONTENT
1055  <ul>
1056  <li>
1057  <label>background color</label>
1058  <input type="color" class='brandColorPick' name="contentBackground" data-bind="value: contentBackground"
1059  data-role="colorpicker" data-clear-button="true" />
1060  </li>
1061  <li>
1062  <label>font color</label>
1063  <input type="color" class='brandColorPick' name="contentForeground" data-bind="value: contentForeground" data-role="colorpicker" />
1064  </li>
1065  <li>
1066  <label>border width</label>
1067  <input type='text' class='brandSizePick' name='contentBorderWidth' data-bind='value: contentBorderWidth' />
1068  </li>
1069  <li>
1070  <label>border style</label>
1071  <input id='brandContentBorderStyle' name='contentBorderStyle' data-bind="value: contentBorderStyle" />
1072  </li>
1073  <li>
1074  <label>border color</label>
1075  <input type="color" class='brandColorPick' name="contentBorderColor" data-bind="value: contentBorderColor" data-role="colorpicker" />
1076  </li>
1077  </ul>
1078  </li>
1079  <li>
1080  LOGO IMAGE
1081  <ul>
1082  <li>
1083  <label>background color</label>
1084  <input type="color" class='brandColorPick' name="logoBackground" data-bind="value: logoBackground" data-role="colorpicker"
1085  data-clear-button="true" />
1086  </li>
1087  <li>
1088  <label>mobile-sized height</label>
1089  <input type='text' class='brandSizePick' name='logoHeightMobile' data-bind='value: logoHeightMobile' />
1090  </li>
1091  <li>
1092  <label>tablet- or desktop-sized height</label>
1093  <input type='text' class='brandSizePick' name='logoHeightDesktop' data-bind='value: logoHeightDesktop' />
1094  </li>
1095  <li class="imageNote">NOTE: widths are proportional.</li>
1096  </ul>
1097  </li>
1098  <li>
1099  FOOTER
1100  <ul>
1101  <li>
1102  <label>background color</label>
1103  <input type="color" class='brandColorPick' name="footerBackground" data-bind="value: footerBackground"
1104  data-role="colorpicker" data-clear-button="true" /></li>
1105  <li>
1106  <label>font color</label>
1107  <input type="color" class='brandColorPick' name="footerForeground" data-bind="value: footerForeground" data-role="colorpicker" /></li>
1108  </ul>
1109  </li>
1110  <li>
1111  CUSTOM STYLES
1112  <ul>
1113  <li>
1114  <label>Enter Custom Styles</label>
1115  <textarea type="text" name="customBranding" data-bind="value: customBranding" rows="12" class="k-textbox" /></textarea>
1116  </li>
1117  </ul>
1118  </li>
1119  </ul>
1120  </div>
1121  </div>
1122  </div>
1123  </div>
1124  </script>
1125  <script type="text/x-kendo-template" id="colorPickerWindowTemplate">
1126  <div class="container-fluid hcu-template">
1127  <div id="transparentDiv" class="row">
1128  <div class="col-xs-12">
1129  <input class="form-check-input" type="checkbox" id="transparentCheckbox">
1130  <label class="form-check-label" for="transparentCheckbox">Transparent</label>
1131  </div>
1132  </div>
1133  <div id="flatColorDiv" class="row">
1134  <div class="col-xs-12">
1135  <div id="flatColorPicker"></div>
1136  </div>
1137  </div>
1138  <div class="hcu-edit-buttons k-state-default">
1139  <a class="cancelBtn" href="\\#">Cancel</a>
1140  &nbsp;&nbsp;&nbsp;
1141  <a class="applyBtn k-button k-primary" href="\\#"><i class="fa fa-check"></i>Apply</a>
1142  </div>
1143  </div>
1144 
1145  </script>
1146  <form id='formSettings'>
1147  <input type='hidden' name='user_name' value='<?php echo $username; ?>'/>
1148  <input type='hidden' id='loadSettings' name='loadSettings' value='<?php echo $loadSettings; ?>'/>
1149  <input type='hidden' id='postStyleSettings' name='postStyleSettings' value=''/>
1150  </form>
1151 <?php }
1152 
1153 /**
1154  * function PrintOdysseyHTMLContainer($styleValues, $styleContent, $loadSettings, $loadedFromTemplate, $username, $settingsFileStatus, $contentTheme, $logoURL)
1155  * This function prints out the entire shell for Odyssey banking. If anything changes in preContent or postContent after May 25th, 2018, it will not show up here.
1156  *
1157  * @param $styleValues -- This is all the changeable attributes for the brand file.
1158  * @param $styleContent -- This is the whole brand.css file to be put on the page.
1159  * @param $loadSettings -- "preview" or "production"
1160  * @param $loadedFromTemplate -- if loaded from template then need to save
1161  * @param $username -- The lowercase code of the credit union
1162  * @param $settingsFileStatus -- the status message
1163  * @param $contentTheme -- the content theme from the settings file. If the file doesn't exist, then this is an empty string.
1164  * @param $logoURL -- the URL of the logo from the settings file. If the file doesn't exist, then this is an empty string.
1165  * @param $devmode -- if devmode, if use the "dev" class for the monitor banner, otherwise use the "prod" class.
1166  */
1167 function PrintOdysseyHTMLContainer($styleValues, $styleContent, $loadSettings, $loadedFromTemplate, $username, $settingsFileStatus, $contentTheme, $logoURL, $devmode,
1168  $bannerDiv) {
1169  $cloudFrontDomainName = GetCloudFrontDomainName ();
1170  $homecuKendoVersion = GetHomecuKendoVersion ();
1171  $bootstrapVersion = GetHomecuBootstrapVersion ();
1172  $fontAwesomeVersion = GetFontawesomeVersion ();
1173  ?>
1174 
1175 <!DOCTYPE html>
1176 <html>
1177  <head>
1178  <title>Sample Credit Union Name</title>
1179  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
1180  <meta name="robots" content="noindex,nofollow" />
1181  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
1182 
1183  <meta name="viewport" content="width=device-width, initial-scale=1" />
1184 
1185  <link rel='stylesheet' media='all' type='text/css' href='https://<?php echo $cloudFrontDomainName; ?>/homecu/css/reset.css' />
1186 
1187  <!-- BASE BOOTSTRAP -->
1188  <link href='https://<?php echo $cloudFrontDomainName; ?>/homecu/css/bootstrap/<?php echo $bootstrapVersion; ?>/css/bootstrap.css' rel='stylesheet'/>
1189 
1190  <!-- KENDO BOOTSTRAP COMMON STYLES - REPLACES kendo.common.css -->
1191  <link href='https://<?php echo $cloudFrontDomainName; ?>/homecu/css/KendoUI/<?php echo $homecuKendoVersion; ?>/kendo.common-bootstrap.min.css' rel='stylesheet'/>
1192 
1193  <!-- KENDO BOOTSTRAP THEME -->
1194  <link href='https://<?php echo $cloudFrontDomainName; ?>/homecu/css/KendoUI/<?php echo $homecuKendoVersion; ?>/kendo.<?php echo $contentTheme; ?>.min.css'
1195  rel='stylesheet'/>
1196 
1197  <!-- METIS MENU -->
1198  <link href='/banking/static/css/metisMenu.css' rel='stylesheet'/>
1199 
1200  <!-- /* CUSTOM KENDO BOOTSTRAP STYLING */ -->
1201  <link rel='stylesheet' media='all' type='text/css' href='/shared/static/css/homecu-custom-kendo-boot.css' />
1202 
1203  <!-- /* HOMECU BASE LAYOUT */ -->
1204  <link rel='stylesheet' media='all' type='text/css' href='/shared/static/css/hcuLayout.css' />
1205  <link rel='stylesheet' media='all' type='text/css' href='/banking/static/css/layout.css' />
1206 
1207  <!-- /* FONT AWESOME */ -->
1208  <link href='https://<?php echo $cloudFrontDomainName; ?>/homecu/css/font-awesome/<?php echo $fontAwesomeVersion; ?>/css/font-awesome.css' rel='stylesheet'/>
1209  <!-- /**
1210  * JAVASCRIPT INCLUDES
1211  */
1212  /* JQUERY BASE */ -->
1213  <script type='text/javascript' src='https://<?php echo $cloudFrontDomainName; ?>/jquery/js/jquery-1.10.2.js'></script>
1214 
1215  <!-- /* KENDO FULL WIDGET INCLUDE - CREATE CUSTOM FOR PRODUCTION */ -->
1216  <script src='https://<?php echo $cloudFrontDomainName; ?>/homecu/js/KendoUI/<?php echo $homecuKendoVersion; ?>/kendo.web.js'></script>
1217  <!-- /* BOOTSTRAP JAVASCRIPT */ -->
1218  <script src='https://<?php echo $cloudFrontDomainName; ?>/homecu/js/bootstrap/<?php echo $bootstrapVersion; ?>/js/bootstrap.js'></script>
1219 
1220  <!-- /* CUSTOM JQUERY TIMEOUT DIALOG SCRIPT */ -->
1221  <script type='text/javascript' src='/static/js/jquery-timeout-dialog.js'></script>
1222 
1223  <!-- /* JQUERY COOKIE */ -->
1224  <script type='text/javascript' src='https://<?php echo $cloudFrontDomainName; ?>/homecu/js/jquery.cookie.js'></script>
1225 
1226  <!-- /* HOMECU CUSTOM ERRORS FOR FORMS */ -->
1227  <script type='text/javascript' src='/shared/static/js/hcuFormError.js'></script>
1228 
1229  <!-- /* HOMECU CUSTOM NOTICES FOR FORMS - PROVIDES CHAINING*/ -->
1230  <script type='text/javascript' src='/banking/static/js/hcuFormNotice.js'></script>
1231 
1232  <!-- /* HOMECU CUSTOM KENDO SETTINGS */ -->
1233  <script type='text/javascript' src='/shared/static/js/kendo.homecu.custom.js'></script>
1234 
1235  <!-- /* metisMenu */ -->
1236  <script type='text/javascript' src='/banking/static/js/metisMenu.js'></script>
1237 
1238  <script>
1239 
1240  /* Set the width of the side navigation to 250px and the left margin of the page content to 250px and add a black background color to body */
1241  function openNav() {
1242  $('#body-wrapper').addClass('collapse');
1243  $('#body-wrapper').addClass('in');
1244  }
1245 
1246  /* Set the width of the side navigation to 0 and the left margin of the page content to 0, and the background color of body to white */
1247  function closeNav() {
1248  $('#body-wrapper').removeClass('collapse');
1249  $('#body-wrapper').removeClass('in');
1250  }
1251 
1252  function toggleNav() {
1253  var menuVisible = ($('#sidebar-nav:visible').length > 0);
1254  if (menuVisible) {
1255  closeNav();
1256  } else {
1257  openNav();
1258  }
1259  }
1260  </script>
1261 
1262  <style id="brandCssStyle">
1263  <?php echo $styleContent; ?>
1264  </style>
1265 
1266  </head>
1267  <body>
1268  <?php echo $bannerDiv; ?>
1269  <div id="body-wrapper" class=" ">
1270  <!-- top navbar -->
1271  <nav id="header" class="navbar navbar-inverse navbar-static-top" role="navigation" style="margin-bottom: 0px">
1272  <div>
1273  <div class="navbar-header">
1274  <button id="hcu-nav-toggle" onclick="toggleNav()" type="button" class="navbar-toggle collapsed" aria-expanded="false">
1275  <span class="sr-only">Toggle navigation</span>
1276  <span class="icon-bar"></span>
1277  <span class="icon-bar"></span>
1278  <span class="icon-bar"></span>
1279  </button>
1280 
1281  <div id="logo-bar">
1282  <a class="navbar-brand" href="#">
1283  <img alt="Home Banking Logo" class="logo" src="<?php echo $logoURL; ?>"/>
1284  <p class="navbar-title">Sample Credit Union Name</p>
1285  </a>
1286  </div>
1287  <div class="desk-lang-select hidden-xs">
1288  <a href="#" title="Select Spanish"><div class="flag_icons flag_icons_es_US"></div></a>
1289  <a href="#" title="Select Polish"><div class="flag_icons flag_icons_pl_US"></div></a>
1290  </div>
1291  </div>
1292  <ul class="hcu-quick-nav-links navbar-nav nav navbar-top-links navbar-right" id="hcu-navbar-collapse">
1293  <li class="hcu-quick-nav-activity hcu-navbar-alert">
1294  <a href="#"><i class="fa fa-bell fa-fw"></i><span class="badge">5</span></a>
1295  </li>
1296  <li class="hcu-quick-nav-secure-mail " >
1297  <a href="#"><i class="fa fa-comments fa-fw"></i></a>
1298  </li>
1299  <li class="dropdown hcu-quick-nav-status ">
1300  <a class="dropdown-toggle" data-toggle="dropdown" href="#">
1301  <i class="fa fa-tasks fa-fw"></i>
1302  <i class="fa fa-caret-down"></i>
1303  </a>
1304  <ul class="dropdown-menu dropdown-status">
1305  <li>
1306  <div class="col-xs-12">
1307  <!-- FORM DATA -->
1308  <div class="form-group ">
1309  <div class=" k-block ">
1310  <div class="hcu-summary-block">
1311  <div class="summary-row">
1312  <div class="summary-desc">
1313  <label class="control-label">Last Failed Login</label>
1314  </div>
1315  <div class="summary-value">
1316  <p class="form-control-static">07/06/16 11:11</p>
1317  </div>
1318  </div>
1319  </div>
1320  </div>
1321  </div>
1322  <div class="form-group ">
1323  <div class="k-block ">
1324  <div class="hcu-summary-block">
1325  <div class="summary-row">
1326  <div class="summary-desc">
1327  <label class="control-label">Last Successful Login</label>
1328  </div>
1329  <div class="summary-value">
1330  <p class="form-control-static">07/08/16 11:29</p>
1331  </div>
1332  </div>
1333  </div>
1334  </div>
1335  </div>
1336  <div class="form-group ">
1337  <div class=" k-block ">
1338  <div class="hcu-summary-block">
1339  <div class="summary-row">
1340  <div class="summary-desc">
1341  <label class="control-label">Account Status as of</label>
1342  </div>
1343  <div class="summary-value">
1344  <p class="form-control-static">Fri May 23 04:32 PM 2008</p>
1345  </div>
1346  </div>
1347  </div>
1348  </div>
1349  </div>
1350  </div>
1351  </li>
1352  </ul>
1353  </li>
1354  <li class="dropdown hcu-quick-nav-user ">
1355  <a class="dropdown-toggle" data-toggle="dropdown" href="#">
1356  <i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
1357  </a>
1358  <ul class="dropdown-menu dropdown-user">
1359  <li>
1360  <div class="col-xs-12">
1361  <div class="hcu-alert-block k-block ">
1362  <div class="hcu-alert-block-icon">
1363  <i class="fa fa-envelope fa-2x"></i>
1364  </div>&nbsp;
1365  <div class='hcu-alert-block-text'>
1366  Current Email<br />
1367  <label >
1368  <p>nobody@homecu.net</p>
1369  </label>
1370  </div>
1371  <hr />
1372  <a href='#'>Update Now</a>
1373  </div>
1374  </div>
1375  </li>
1376  </ul>
1377  </li>
1378  <li class="hcu-quick-nav-logout">
1379  <a href="#">
1380  <i class="fa fa-power-off fa-fw"></i>
1381  </a>
1382  </li>
1383  </ul>
1384  </div>
1385  </nav>
1386 
1387  <aside id="side-menu" class="navbar-default sidebar sidenav" role="navigation">
1388  <div id="sidebar-nav" class="sidebar-nav navbar-collapse ">
1389  <ul id='list-menu' class='nav root-nav-categories'>
1390  <li class='active hcu-selected-menu-group' data-rowid='6'>
1391  <a class='' href='#' target=''>
1392  <i class='fa fa-bank fa-fw'></i> Account <span class='fa arrow'></span>
1393  </a>
1394  <ul class='nav nav-second-level collapse in'>
1395  <li class='hcu-selected-menu-item'>
1396  <a class='' href='#' target=''>Balances</a>
1397  </li>
1398  <li class=''>
1399  <a class='' href='#' target=''>History</a>
1400  </li>
1401  <li class=''>
1402  <a class='' href='#' target=''>e-Statements</a>
1403  </li>
1404  <li class=''>
1405  <a class='' href='#' target=''>Download Transactions</a>
1406  </li>
1407  <li class=''>
1408  <a class='' href='#' target=''>Alerts</a>
1409  </li>
1410  <li class=''>
1411  <a class='' href='#'>My MoneyDesktop</a>
1412  </li>
1413  </ul>
1414  </li>
1415  <li class='active ' data-rowid='12'>
1416  <a class='' href='#' target=''>
1417  <i class='fa fa-exchange fa-fw'></i> Transfers <span class='fa arrow'></span>
1418  </a>
1419  <ul class='nav nav-second-level collapse in'>
1420  <li class=''>
1421  <a class='' href='#' target=''>User Activity</a>
1422  </li>
1423  <li class=''>
1424  <a class='' href='#' target=''>Transfer</a>
1425  </li>
1426  <li class=''>
1427  <a class='' href='#' target=''>Scheduled Transactions</a>
1428  </li>
1429  <li class=''>
1430  <a class='' href='#' target=''>External Accounts</a>
1431  </li>
1432  <li class=''>
1433  <a class='' href='#' target=''>M2M Accounts</a>
1434  </li>
1435  </ul>
1436  </li>
1437  <li class='active ' data-rowid='16'>
1438  <a class='' href='#' target=''>
1439  <i class='fa fa-sitemap fa-fw'></i> Commercial<span class='fa arrow'></span>
1440  </a>
1441  <ul class='nav nav-second-level collapse in'>
1442  <li class=''>
1443  <a class='' href='#' target=''>ACH Collections</a>
1444  </li>
1445  <li class=''>
1446  <a class='' href='#' target=''>ACH Payments</a>
1447  </li>
1448  <li class=''>
1449  <a class='' href='#' target=''>ACH Partners</a>
1450  </li>
1451  </ul>
1452  </li>
1453  <li class=''>
1454  <a class=' hidden-xs ' href='#' target='_blank'><i class='fa fa-money fa-fw'></i> Pay Bills</a>
1455  </li>
1456  <li class=''>
1457  <a class=' visible-xs-block ' href='#' target=''><i class='fa fa-money fa-fw'></i> Mobile PayBills</a>
1458  </li>
1459  <li class=' ' data-rowid='25'>
1460  <a class='' href='#' target=''>
1461  <i class='fa fa-cogs fa-fw'></i> Profile<span class='fa arrow'></span>
1462  </a>
1463  <ul class='nav nav-second-level collapse '>
1464  <li class=''>
1465  <a class='' href='#' target=''>Address Change</a>
1466  </li>
1467  <li class=''>
1468  <a class='' href='#' target=''>User Name</a>
1469  </li>
1470  <li class=''>
1471  <a class='' href='#' target=''>Email</a>
1472  </li>
1473  <li class=''>
1474  <a class='' href='#' target=''>Password</a>
1475  </li>
1476  <li class=''>
1477  <a class='' href='#' target=''>Security</a>
1478  </li>
1479  <li class=''>
1480  <a class='' href='#' target=''>Descriptions</a>
1481  </li>
1482  </ul>
1483  </li>
1484  <li class=' ' data-rowid='28'>
1485  <a class='' href='#' target=''>
1486  <i class='fa fa-sliders fa-fw'></i> Communications<span class='fa arrow'></span>
1487  </a>
1488  <ul class='nav nav-second-level collapse '>
1489  <li class=''>
1490  <a class='' href='#' target=''>Notices</a>
1491  </li>
1492  <li class=''>
1493  <a class='' href='#' target=''>Txt Banking</a>
1494  </li>
1495  </ul>
1496  </li>
1497  <li class=' ' data-rowid='30'>
1498  <a class='' href='#' target=''>
1499  <i class='fa fa-file-text-o fa-fw'></i> Disclosures<span class='fa arrow'></span>
1500  </a>
1501  <ul class='nav nav-second-level collapse '>
1502  <li class=''>
1503  <a class='' href='#' target=''>Home Banking Terms</a>
1504  </li>
1505  </ul>
1506  </li>
1507  <li class=''>
1508  <a class='' href='#' target=''>
1509  <i class='fa fa-power-off fa-fw'></i> Sign Off
1510  </a>
1511  </li>
1512  </ul>
1513  </div>
1514  </aside>
1515  <div id="content-wrapper" class="nothere">
1516  <div id="formStatus" class="homecu-formStatus k-block k-error-colored" style='display:none; margin-bottom:10px;max-width:800px;'></div>
1517  <div id='hideSubmitWait' style='position:relative; left:-2000px;top:-2000px;'>
1518  <div id='homecuSubmitWait' class='k-block' >
1519  <div class='k-loading-image'></div>
1520  </div>
1521  </div>
1522  <a href="javascript:void(0)" onclick="closeNav()" x-href="#content-wrapper" class="overlay-close" x-data-toggle="collapse" >&nbsp;</a>
1523  <div id="main-container">
1524  <div id="homecu-wrapper">
1525  <div id="homecu-container">
1526  <div id="homecu-padding-top" class="col-xs-12"></div> <!-- homecu-padding -->
1527  <a id='slide-in-handle' class='hcu-slide-in-handle-custom' href='#'>&nbsp;<span id='slide-in-handle-content'>Message</span>&nbsp;</a>
1528  <div id='slide-in-share' style='display:none;'>
1529  <div id='slide-in-content'>
1530  <div id='slide-in-scroll'></div>
1531  <div id='slide-in-content-close'>
1532  <a href=''>Close</a>
1533  </div>
1534  </div>
1535  </div>
1536 
1537 
1538 <style>
1539 
1540  [id^="hcuTable"] .k-grid-header .k-header {
1541  text-align: center;
1542  }
1543  #slide-in-scroll {
1544  overflow: scroll;
1545  }
1546  #slide-in-content {
1547  display: table-cell;
1548  vertical-align: middle;
1549  padding: 10px;
1550  }
1551  #slide-in-content-close {
1552  text-align: left;
1553  display: table-row;
1554  height:20px;
1555  }
1556  #slide-in-content-close a {
1557  margin: 0 10px 10px 0;
1558  text-decoration: underline;
1559  font-weight: bold;
1560  color: #333;
1561  padding-left: 10px;
1562  }
1563  #slide-in-content-close a:visited,
1564  #slide-in-content-close a:hover {
1565  text-decoration: none;
1566  }
1567  #slide-in-share {
1568  position: absolute;
1569  top: 0px;
1570  width: 100%;
1571  z-index: 99;
1572  background-color: #FAFAFA;
1573  display: table;
1574  box-shadow: 0px 0px 2px 0px #999 inset;
1575  -webkit-box-shadow: 0px 0px 2px 0px #999 inset;
1576  }
1577  .slide-in-handle-icon {
1578  color: #FFF;
1579  }
1580  #slide-in-handle {
1581  position: absolute;
1582  width: calc(100% - 10px);
1583  display: block;
1584  height: 25px;
1585  border-top: 0;
1586  padding: 5px;
1587  top:0px;
1588  text-align:center;
1589  text-decoration: none;
1590  z-index: 90;
1591 
1592  }
1593 
1594  #slide-in-handle-content {
1595  font-size: 1.2em;
1596  margin: 0px 1px 1px 1px;
1597  height:19px;
1598  padding-top: 4px;
1599  text-decoration: underline;
1600  }
1601  #slide-in-share + #formStatus + #acctList {
1602  /* IF there is a embedded mkt message, then adjust by using the css sibling selector */
1603  margin-top: 15px;
1604  }
1605  .local-homecu-info {
1606  color: rgba(0, 0, 0, .54);
1607  }
1608  .local-notify-spacer {
1609  height: 35px;
1610  }
1611 
1612  #transparentDiv .form-check-input {
1613  vertical-align: baseline; /* reset.css removes Bootstrap's specification here. */
1614  }
1615  @media (max-width: 767px) {
1616  #slide-in-handle {
1617  top: 51px;
1618  }
1619  #slide-in-share {
1620  top: 51px;
1621  }
1622 
1623  #body-wrapper.no-show-info #slide-in-handle, #body-wrapper.no-show-info #slide-in-share {
1624  top: 135px;
1625  }
1626 
1627  #homecuBannerArea + #body-wrapper #slide-in-handle, #homecuBannerArea + #body-wrapper #slide-in-share {
1628  top: 51px;
1629  }
1630 
1631  #homecuBannerArea + #body-wrapper.no-show-info #slide-in-handle, #homecuBannerArea + #body-wrapper.no-show-info #slide-in-share {
1632  top: 135px;
1633  }
1634  }
1635 </style>
1636 
1637 <script type="text/javascript">
1638 $(document).ready(function(){
1639 
1640  // CLICK TO CLOSE POPUP, MUST CANCEL CHANGES BEFORE CLOSE
1641  $(document).on('click', '.k-overlay', function() {
1642  var wnd = $("#detailsPopUp").data("kendoWindow");
1643  if (wnd !== undefined) {
1644  wnd.close();
1645  }
1646  });
1647 
1648  var showEmbedContent = "<div align=\"center\">"
1649  showEmbedContent += "<img src=\"\/IMAGES\/vacation2.jpg\" alt=\"\" border=\"0\" style=\"width:100%;max-width:600px\"\/><\/div>";
1650  $('#slide-in-scroll').html(showEmbedContent);
1651  $('#formStatus').insertAfter($('#slide-in-share'));
1652 
1653  showMsgInset();
1654 
1655  var userInterrupt = false;
1656 
1657  function showMsgInset() {
1658 
1659  setTimeout(function() {
1660  if (!userInterrupt) {
1661  $('#slide-in-share').slideUp("slow");
1662  }
1663  }, 8000);
1664  }
1665 
1666  $("#slide-in-handle").click(function(e) {
1667 
1668  userInterrupt = true;
1669  e.preventDefault();
1670 
1671  if ($('#slide-in-share').is(':hidden')) {
1672 
1673  $('#slide-in-share').slideDown('slow');
1674  } else {
1675 
1676  $('#slide-in-share').slideUp("slow");
1677 
1678  }
1679  });
1680  $('#slide-in-content-close').click(function(e) {
1681  e.preventDefault();
1682  userInterrupt = true;
1683  $('#slide-in-share').slideUp('slow');
1684  });
1685 });
1686 
1687 $('#list-menu').metisMenu({toggle: false});
1688 </script>
1689 
1690 <?php PrintSiteBranding($styleValues, $username, $loadSettings, $settingsFileStatus, $loadedFromTemplate); ?>
1691 
1692 <p class="contentText">Here is some text to see content font color.</p>
1693 
1694  <div id="homecu-padding-bottom" class="col-xs-12"></div> <!-- homecu-padding -->
1695  </div><!-- homecu-container -->
1696  </div><!-- homecu-wrapper -->
1697  </div><!-- main-container -->
1698  <footer class="footer">
1699  <div class="mbl-lang-select visible-xs-block">
1700  <a href="#" title="Select Spanish">
1701  <div class="flag_icons flag_icons_es_US"></div>
1702  </a>
1703  <a href="#" title="Select Polish">
1704  <div class="flag_icons flag_icons_pl_US"></div>
1705  </a>
1706  </div>
1707  <div class="footer-container">
1708  <p class="text-muted">&copy; 2018 HomeCU, LLC. All Rights Reserved</p>
1709  </div>
1710  </footer>
1711  </div><!-- content-wrapper -->
1712  </div><!-- body-wrapper-->
1713  </body>
1714 </html>
1715 
1716 <?php }
Definition: User.php:7
def main(certificate_path, secret_id, region=None)