ongoing new datepicker project
[openemr.git] / interface / super / edit_layout_props.php
blob8a768a869c74341b972eee88dda4f44b500776c1
1 <?php
2 /**
3 * Edit Layout Properties.
5 * Copyright (C) 2016-2017 Rod Roark <rod@sunsetsystems.com>
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
18 * @package OpenEMR
19 * @author Rod Roark <rod@sunsetsystems.com>
20 * @link http://www.open-emr.org
23 $sanitize_all_escapes = true;
24 $fake_register_globals = false;
26 require_once("../globals.php");
27 require_once("$srcdir/acl.inc");
28 require_once("$phpgacl_location/gacl_api.class.php");
30 $info_msg = "";
32 // Check authorization.
33 $thisauth = acl_check('admin', 'super');
34 if (!$thisauth) die(xlt('Not authorized'));
36 $opt_line_no = intval($_GET['lineno']);
38 <html>
39 <head>
40 <?php html_header_show();?>
41 <title><?php echo xlt("Edit Layout Properties"); ?></title>
42 <link rel="stylesheet" href='<?php echo $css_header ?>' type='text/css'>
44 <style>
45 td { font-size:10pt; }
46 </style>
48 <script type="text/javascript" src="<?php echo $webroot ?>/interface/main/tabs/js/include_opener.js?v=<?php echo $v_js_includes; ?>"></script>
49 <script type="text/javascript" src="../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script>
50 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script>
51 <script type="text/javascript" src="../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script>
53 <script language="JavaScript">
55 <?php require($GLOBALS['srcdir'] . "/restoreSession.php"); ?>
57 var mypcc = '<?php echo $GLOBALS['phone_country_code'] ?>';
58 var target = opener.document.forms[0]['opt[<?php echo $opt_line_no; ?>][notes]'];
60 $(document).ready(function () {
61 var f = document.forms[0];
62 var jobj = {};
63 if (target.value.length) {
64 try {
65 jobj = JSON.parse(target.value);
67 catch (e) {
68 alert('<?php echo xls('Invalid data, will be ignored and replaced.'); ?>');
71 if (jobj['size' ]) f.form_size.value = jobj['size'];
72 if (jobj['columns' ]) f.form_columns.value = jobj['columns'];
73 if (jobj['aco' ]) f.form_aco.value = jobj['aco'];
74 });
76 // Onclick handler for Submit button.
77 function submitProps() {
78 var f = document.forms[0];
79 var jobj = {};
80 if (f.form_size.value ) jobj['size' ] = f.form_size.value;
81 if (f.form_columns.value != '4') jobj['columns' ] = f.form_columns.value;
82 if (f.form_aco.value ) jobj['aco' ] = f.form_aco.value;
83 target.value = JSON.stringify(jobj);
84 window.close();
87 </script>
89 </head>
91 <body class="body_top">
93 <form method='post'>
94 <center>
96 <table border='0' width='100%'>
98 <tr>
99 <td valign='top' nowrap>
100 <?php echo xlt('Layout Columns'); ?>
101 </td>
102 <td>
103 <select name='form_columns'>
104 <?php
105 for ($cols = 2; $cols <= 10; ++$cols) {
106 echo "<option value='$cols'";
107 if ($cols == 4) echo " selected";
108 echo ">$cols</option>\n";
111 </select>
112 </td>
113 </tr>
115 <tr>
116 <td valign='top' nowrap>
117 <?php echo xlt('Font Size'); ?>
118 </td>
119 <td>
120 <select name='form_size'>
121 <?php
122 echo "<option value=''>" . xlt('Default') . "</option>\n";
123 for ($size = 5; $size <= 15; ++$size) {
124 echo "<option value='$size'";
125 echo ">$size</option>\n";
128 </select>
129 </td>
130 </tr>
132 <tr>
133 <td valign='top' nowrap>
134 <?php echo xlt('Access Control'); ?>
135 </td>
136 <td>
137 <select name='form_aco'>
138 <option value=''></option>
139 <?php echo gen_aco_html_options(); ?>
140 </select>
141 </td>
142 </tr>
144 </table>
147 <input type='button' value='<?php echo xla('Submit'); ?>' onclick='submitProps()' />
149 &nbsp;
150 <input type='button' value='<?php echo xla('Cancel'); ?>' onclick='window.close()' />
151 </p>
153 </center>
154 </form>
155 <script language='JavaScript'>
156 <?php
157 if ($info_msg) {
158 echo " alert('".addslashes($info_msg)."');\n";
159 echo " window.close();\n";
162 </script>
163 </body>
164 </html>