simplify decrypt to return blank value when a empty value is sent (#2115)
[openemr.git] / interface / expand_contract_js.php
blobf4b1f3cd95886d341956e1dfe068f3d940f13d25
1 <?php
2 /**
3 * expand contract jquery script
5 * @package OpenEMR
6 * @link http://www.open-emr.org
7 * @author Ranganath Pathak <pathak@scrs1.org>
8 * @author Brady Miller <brady.g.miller@gmail.com>
9 * @copyright Copyright (c) 2018 Ranganath Pathak <pathak@scrs1.org>
10 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
11 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 // ensure that $user_settings_php_path, $arr_files_php variables are set in the script calling this script
15 $( document ).ready(function() {
16 $('.expand_contract').click(function() {
17 var elementTitle = $(this).prop('title');
18 var contractTitle = <?php echo xlj('Click to Contract and set to henceforth open in Centered mode'); ?>;
19 var expandTitle = <?php echo xlj('Click to Expand and set to henceforth open in Expanded mode'); ?>;
20 var arrFiles = <?php echo json_encode($arr_files_php) ?>;
22 if (elementTitle == contractTitle) {
23 elementTitle = expandTitle;
24 $(this).toggleClass('fa-expand fa-compress');
25 $('.expandable').toggleClass('container container-fluid');
26 if ($(arrFiles).length) {
27 $.each(arrFiles, function (index, value) {
28 $.post( "<?php echo $GLOBALS['webroot'] ?>/library/ajax/user_settings.php",
30 target: arrFiles[index].trim(),
31 setting: 0,
32 csrf_token_form: <?php echo js_escape(collectCsrfToken()); ?>
35 });
37 } else if (elementTitle == expandTitle) {
38 elementTitle = contractTitle;
39 $(this).toggleClass('fa-compress fa-expand');
40 $('.expandable').toggleClass('container-fluid container');
41 if ($(arrFiles).length) {
42 $.each(arrFiles, function (index, value) {
43 $.post( "<?php echo $GLOBALS['webroot'] ?>/library/ajax/user_settings.php",
45 target: arrFiles[index].trim(),
46 setting: 1,
47 csrf_token_form: <?php echo js_escape(collectCsrfToken()); ?>
50 });
53 $(this).prop('title', elementTitle);
54 });
55 });