Odyssey
monitorView.hide.i
1 <?php
2 /*
3  * Include File: monitorView
4  *
5  * Purpose: This include will have functions used for generating 'view' code.
6  *
7  *
8  */
9 
10 
11 
12 /*
13  * Function: MonitorHtmlTitleDesktop
14  *
15  * This function will print the common 'Title' section for the screen.
16  *
17  * @param string pPageTitle This is the title of the page
18  *
19  * @return string This will return a string of html code to be printed to the client
20  *
21  */
22 function MonitorHtmlTitleDesktop($pPageTitle) {
23 
24  $monitorGlobalEnv = GetEnvDesktop();
25 
26  $retValue = '';
27 
28 
29  $retValue = <<< print_html
30 <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
31  <head>
32  <title>Credit Union Home Banking Settings</title>
33  <meta http-equiv="X-UA-Compatible" content="IE=8" />
34 
35  <link rel="stylesheet" media="all" type="text/css" href="https://{$monitorGlobalEnv['cloudfrontDomainName']}/homecu/css/reset.css" />
36 
37  <!-- KENDO UI CSS Includes -->
38  <link href="https://{$monitorGlobalEnv['cloudfrontDomainName']}/homecu/css/KendoUI/{$monitorGlobalEnv['homecuKendoVersion']}/kendo.common.min.css" rel="stylesheet">
39  <link href="https://{$monitorGlobalEnv['cloudfrontDomainName']}/homecu/css/KendoUI/{$monitorGlobalEnv['homecuKendoVersion']}/kendo.default.min.css" rel="stylesheet">
40  <link href="/monitor/css/monitor-core.css" rel="stylesheet">
41  <script type="text/javascript" src="https://{$monitorGlobalEnv['cloudfrontDomainName']}/jquery/js/jquery-1.10.2.min.js.gz"></script>
42 
43  <!-- KENDO UI JS scripts -->
44  <script src="https://{$monitorGlobalEnv['cloudfrontDomainName']}/homecu/js/KendoUI/{$monitorGlobalEnv['homecuKendoVersion']}/kendo.web.min.js"></script>
45  <!--[if IE]>
46  <script type="text/javascript" src="https://{$monitorGlobalEnv['cloudfrontDomainName']}/homecu/js/modernizr.min.js"></script>
47  <![endif]--><!-- ANY INTERNET EXPLORER -->
48 
49  </head>
50 
51  <body class=''>
52  <header>
53  <div class='header-title'>$pPageTitle</div>
54  </header>
55 
56 print_html;
57 
58 
59  return $retValue;
60 }
61 
62 /*
63  * Function: MonitorHtmlFooterDesktop
64  *
65  * This function will print the common 'Footer' section for the screen.
66  *
67  *
68  * return string This will return a string of html code to be printed to the client
69  *
70  */
71 function MonitorHtmlFooterDesktop() {
72 
73  $monitorGlobalEnv = GetEnvDesktop();
74  $retValue = '';
75 
76  $retValue = <<< print_html
77 
78  </body>
79  </html>
80 print_html;
81 
82  return $retValue;
83 }
84 
85 /*
86  * Function: GetEnvDesktop
87  *
88  * This function will gather the current global values for the current monitor script.
89  * It will return the desired values in an array, much like HB_ENV
90  *
91  * returns array array of values for the current monitor session
92  *
93  */
94 function GetEnvDesktop () {
95 
96  $retEnvAry = Array();
97 
98 
99  // * simple list of values that are wanted in the current monitor session
100  // * at this time it will simply get them from the GLOBALS array
101  // * These should be set somewhere in the global scope
102  $listNeededValues = Array(
103  "homecuKendoVersion",
104  "cloudfrontDomainName"
105  );
106 
107  if (is_array($listNeededValues)) {
108  foreach ($listNeededValues as $globalKey) {
109  if (isset($GLOBALS[$globalKey])) {
110  // * We found in the global namespace -- so set
111  $retEnvAry[$globalKey] = $GLOBALS[$globalKey];
112  }
113  }
114  }
115 
116 
117  return $retEnvAry;
118 }
119 
120 /* This will return the HTML of the menu bar from an array of options. It is called from printMonitorPageMiddle.
121  * The function recursively goes through an associate array. Each key in the array needs to have an array with configuration options.
122  * PARAMETERS:
123  * $options= associate array attached to arrays for configuration options.
124  * CONFIGURATION OPTIONS:
125  * id= id of the list item. You can then reference the id in code just like you would for any other HTML element with an id.
126  * url= The url that the list item will redirect to with a click.
127  * target= This corresponds to the target option in HTML a tags.
128  * text= The text of the list item. This is optional. If it is not present, then it uses the key.
129  * disabled= boolean option that when set will disable the item.
130  * noA= boolean option that when set will output the li only. (If there is no list, then a tag is created underneath li. Otherwise, kendo will falsely add an arrow to the item.)
131  * list= list of sub menu items. If this is set, then this function will be called for the subset. Therefore, all options are available to the submenu item.
132  * OUTPUT:
133  * Unordered list of the menu items. The outermost ul is not included. I.E. "<li>Redirect<ul><li><a href='url1' id='id1' target='target1'>Redirect1</a></li></ul></li>"
134  */
135 function getMenuBar($options)
136 {
137  $menuBar= "";
138  if (is_array($options))
139  {
140  foreach($options as $key => $config)
141  {
142  $id= isset($config["id"]) ? "id='" . $config["id"] . "'" : "";
143  $url= isset($config["url"]) ? "href='" . $config["url"] . "'" : "href='#'";
144  $target= isset($config["target"]) ? "target='" . $config["target"] . "'" : "";
145  $text= isset($config["text"]) ? $config["text"] : $key;
146  $disabled= isset($config["disabled"]) && $config["disabled"] ? "disabled='disabled'" : "";
147 
148  if (isset($config["list"]) && is_array($config["list"]))
149  {
150  $thisMenuBar= getMenuBar($config["list"]);
151  $menuBar.= "<li $id $disabled>$text<ul>$thisMenuBar</ul></li>";
152  }
153  else
154  {
155  $menuBar.= isset($config["noA"]) && $config["noA"] ? "<li $id $disabled>$text</li>" : "<li $disabled><a $id $url $target>$text</a></li>";
156  }
157  }
158  }
159 
160  return $menuBar;
161 }
162 
163 /* This prints out the middle portion of the monitor page. This includes the HTML of the menu bar, the closing of the header tag, and the opening of the body tag.
164  * The menu bar has the "Return to Monitor" link and the user can add additional menu options.
165  * PARAMETERS:
166  * $titleText= This text will show up in the header, $additionalMenuOptions= optional menu options see getMenuBar function above.
167  */
168 function printMonitorPageMiddle($titleText, $additionalMenuOptions= array(), $hideRedirect= false)
169 {
170  global $produrl; // From cu_top
171  global $dev_mode; // From cu_top
172 
173  $menuOptions= $hideRedirect ? array() : array("REDIRECT" => array("text" => "Redirect to: ", "list" => array("Monitor" => array("url" => "$produrl/monitor/mindex.html", "target" => "_top"))));
174 
175  if (is_array($additionalMenuOptions))
176  {
177  foreach($additionalMenuOptions as $topLevel => $config)
178  {
179  if (!isset($menuOptions[$topLevel]))
180  $menuOptions[$topLevel]= array();
181  foreach($config as $key => $value)
182  {
183  if ($key == "list")
184  {
185  $list= isset($menuOptions[$topLevel]["list"]) ? $menuOptions[$topLevel]["list"] : array();
186  $menuOptions[$topLevel]["list"]= array_merge($list, $value);
187  }
188  else
189  $menuOptions[$topLevel][$key]= $value;
190  }
191  }
192  }
193 
194  if (count($menuOptions) > 0)
195  {
196  $menuBar= "<ul id='topMenuBar'>";
197  $menuBar.= getMenuBar($menuOptions);
198  $menuBar.= "</ul>";
199  }
200 
201  if ($dev_mode) {
202  $environmentMsg= "(Development)";
203  $environmentClass= "dev";
204  } else {
205  $environmentMsg= "(Production)";
206  $environmentClass= "prod";
207  }
208  ?>
209 
210  </head>
211 
212  <body id="fixedBody">
213  <header id="commonMonitorHeader" class="<?php echo $environmentClass; ?>">
214  <div class="header-title"><?php echo $titleText ?></div>
215  <div id="environmentMsg"><?php echo $environmentMsg; ?></div>
216  <?php echo $menuBar; ?>
217  </header>
218  <div id="pageContents">
219 <?php }
220 
221 /* This prints out the top portion of the monitor page. This includes the meta tags, links to stylesheets and javascripts, and kendo initialization of the menu bar.
222  * PARAMETERS:
223  * $title= this text will show up at the top of the browser tab, $homecuKendoVersion= the version to pull in the right stylesheets, $cloudfrontDomainName= the link to where kendo files are located.
224  */
225 function printMonitorPageTop($title, $homecuKendoVersion, $cloudfrontDomainName, $use_kendo=false) {
226  print "found it!"; exit;
227 if ($use_kendo) { ?>
228  <!DOCTYPE html>
229  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
230  <head>
231  <title><?php echo $title; ?></title>
232  <meta http-equiv="X-UA-Compatible" content="IE=8" />
233 
234  <link rel="stylesheet" media="all" type="text/css" href="https://<?php echo $cloudfrontDomainName; ?>/homecu/css/reset.css" />
235 
236  <?php //KENDO UI CSS Includes ?>
237  <link href="https://<?php echo $cloudfrontDomainName; ?>/homecu/css/KendoUI/<?php echo $homecuKendoVersion; ?>/kendo.common.min.css" rel="stylesheet">
238  <link href="https://<?php echo $cloudfrontDomainName; ?>/homecu/css/KendoUI/<?php echo $homecuKendoVersion; ?>/kendo.default.min.css" rel="stylesheet">
239  <link rel='stylesheet' media='all' type='text/css' href='https://<?php echo $cloudfrontDomainName; ?>/homecu/css/grid.css'>
240  <link href="https://<?php echo $cloudfrontDomainName; ?>/homecu/css/kendo.homecucustom.4648.min.css" type="text/css" rel="stylesheet">
241  <link href="/monitor/css/monitor-core.css" rel="stylesheet">
242  <script type="text/javascript" src="https://<?php echo $cloudfrontDomainName; ?>/jquery/js/jquery-1.10.2.min.js.gz"></script>
243 
244  <?php //KENDO UI JS scripts ?>
245  <script src="https://<?php echo $cloudfrontDomainName; ?>/homecu/js/KendoUI/<?php echo $homecuKendoVersion; ?>/kendo.web.min.js"></script>
246  <script type="text/javascript" src="https://<?php echo $cloudfrontDomainName; ?>/homecu/js/hcuFormError.4091.min.js"></script>
247  <!--[if IE]>
248  <script type="text/javascript" src="https://<?php echo $cloudfrontDomainName; ?>/homecu/js/modernizr.min.js"></script>
249  <![endif]--><!-- ANY INTERNET EXPLORER -->
250 
251  <script type="text/javascript">
252  $(document).ready(function () {
253  var topMenuBar= $("#topMenuBar").kendoMenu({
254 
255  }).data("kendoMenu");
256  });
257  </script>
258  <?php
259 } else {
260  ?>
261 
262  <!DOCTYPE html>
263  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
264  <head>
265  <title><?php echo $title; ?></title>
266  <meta http-equiv="X-UA-Compatible" content="IE=8" />
267 
268  <link rel="stylesheet" media="all" type="text/css" href="https://<?php echo $cloudfrontDomainName; ?>/homecu/css/reset.css" />
269 
270  <?php //KENDO UI CSS Includes ?>
271  <link href="https://<?php echo $cloudfrontDomainName; ?>/homecu/css/KendoUI/<?php echo $homecuKendoVersion; ?>/kendo.common.min.css" rel="stylesheet">
272  <link href="https://<?php echo $cloudfrontDomainName; ?>/homecu/css/KendoUI/<?php echo $homecuKendoVersion; ?>/kendo.default.min.css" rel="stylesheet">
273  <link rel='stylesheet' media='all' type='text/css' href='https://<?php echo $cloudfrontDomainName; ?>/homecu/css/grid.css'>
274  <link href="https://<?php echo $cloudfrontDomainName; ?>/homecu/css/kendo.homecucustom.4648.min.css" type="text/css" rel="stylesheet">
275  <link href="/monitor/css/monitor-core.css" rel="stylesheet">
276  <script type="text/javascript" src="https://<?php echo $cloudfrontDomainName; ?>/jquery/js/jquery-1.10.2.min.js.gz"></script>
277 
278  <?php //KENDO UI JS scripts ?>
279  <script src="https://<?php echo $cloudfrontDomainName; ?>/homecu/js/KendoUI/<?php echo $homecuKendoVersion; ?>/kendo.web.min.js"></script>
280  <script type="text/javascript" src="https://<?php echo $cloudfrontDomainName; ?>/homecu/js/hcuFormError.4091.min.js"></script>
281  <!--[if IE]>
282  <script type="text/javascript" src="https://<?php echo $cloudfrontDomainName; ?>/homecu/js/modernizr.min.js"></script>
283  <![endif]--><!-- ANY INTERNET EXPLORER -->
284 
285  <script type="text/javascript">
286  $(document).ready(function () {
287  var topMenuBar= $("#topMenuBar").kendoMenu({
288 
289  }).data("kendoMenu");
290  });
291  </script>
292 
293  <?php
294  }
295 }
296 
297 /* This prints out the bottom portion of the monitor page. There is nothing there now but that could change.
298  */
299 function printMonitorPageBottom() { ?>
300  </div>
301  </body>
302 </html>
303 
304 <?php
305 }