consolidate attr_url function (#2143)
[openemr.git] / interface / main / main_info.php
blobdac844194d0a52069ec9a29e424f65523a157db4
1 <?php
2 /**
3 * Main info frame.
5 * @package OpenEMR
6 * @link http://www.open-emr.org
7 * @author Brady Miller <brady.g.miller@gmail.com>
8 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
9 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once("../globals.php");
15 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
16 <HTML>
17 <HEAD>
18 <TITLE><?php echo xlt('Calendar'); ?></TITLE>
19 <!-- (CHEMED) -->
20 <!-- The DOCTYPE is set above to XHTML to put IE into Sttrict Mode so we can get a viewport width -->
21 <script type='text/javascript' language='JavaScript'>
22 function GetInnerX () {
23 var x;
24 if (self.innerHeight) // all except Explorer
26 x = self.innerWidth;
28 else if (document.documentElement && document.documentElement.clientHeight)
29 // Explorer 6 Strict Mode
31 x = document.documentElement.clientWidth;
33 else if (document.body) // other Explorers
35 x = document.body.clientWidth;
37 return x;
40 var x = GetInnerX();
41 var framesrc = '<frame ';
43 <?php
45 // this allows us to keep our viewtype between screens -- JRM calendar_view_type
46 $viewtype = $GLOBALS['calendar_view_type'];
47 if (isset($_SESSION['viewtype'])) {
48 $viewtype = $_SESSION['viewtype'];
51 // this allows us to keep our selected providers between screens -- JRM
52 $pcuStr = "pc_username=" . attr_url($_SESSION['authUser']);
53 if (isset($_SESSION['pc_username'])) {
54 $pcuStr = "";
55 if (!empty($_SESSION['pc_username']) && is_array($_SESSION['pc_username']) && count($_SESSION['pc_username']) > 1) {
56 // loop over the array of values in pc_username to build
57 // a list of pc_username HTTP vars
58 foreach ($_SESSION['pc_username'] as $pcu) {
59 $pcuStr .= "&pc_username[]=" . attr_url($pcu);
61 } else {
62 // two possibilities here
63 // 1) pc_username is an array with a single element
64 // 2) pc_username is just a string, not an array
65 if (is_string($_SESSION['pc_username'])) {
66 $pcuStr .= "&pc_username[]=" . attr_url($_SESSION['pc_username']);
67 } else {
68 $pcuStr .= "&pc_username[]=" . attr_url($_SESSION['pc_username'][0]);
73 // different frame source page depending on session vars
74 if ($_SESSION['userauthorized'] && $GLOBALS['docs_see_entire_calendar']) {
75 $framesrc = "calendar/index.php?module=PostCalendar&viewtype=" . attr_url($viewtype) . "&func=view";
76 } else if ($_SESSION['userauthorized']) {
77 $framesrc = "calendar/index.php?module=PostCalendar&viewtype=" . attr_url($viewtype) . "&func=view&" . $pcuStr;
78 } else {
79 $framesrc = "calendar/index.php?module=PostCalendar&func=view&viewtype=" . attr_url($viewtype);
83 framesrc += ' src="<?php echo $framesrc; ?>';
84 framesrc += '&framewidth=' + encodeURIComponent(x) + '" name="Calendar" scrolling="auto" frameborder="YES">';
86 </script>
87 <!-- END (CHEMED) -->
88 </HEAD>
90 <!-- (CHEMED) -->
91 <script type='text/javascript' language='JavaScript'>
92 document.write('<frameset rows="*" cols="*" name="Main" frameborder="NO" border="0" framespacing="0" >');
93 document.write(framesrc);
94 document.write('</frameset>');
95 document.close();
97 </script>
98 <!-- END (CHEMED) -->
101 <noframes><body bgcolor="#FFFFFF">
102 <?php echo xlt('Frame support required'); ?>
103 </body></noframes>
105 </HTML>