From 5096b4634c6e833d94ff23f2bf331727d4769c2e Mon Sep 17 00:00:00 2001 From: Brady Miller Date: Thu, 27 Jul 2017 17:52:19 -0700 Subject: [PATCH] globals convert to responsive bootstrap, step 1 --- interface/super/edit_globals.php | 195 +++++++++++++++++++-------------------- 1 file changed, 93 insertions(+), 102 deletions(-) diff --git a/interface/super/edit_globals.php b/interface/super/edit_globals.php index ac22a9836..65be1baa9 100644 --- a/interface/super/edit_globals.php +++ b/interface/super/edit_globals.php @@ -2,35 +2,23 @@ /** * Script for the globals editor. * - * Copyright (C) 2010 Rod Roark - * Copyright (C) 2016 Brady Miller - * - * LICENSE: This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * You should have received a copy of the GNU General Public License - * along with this program. If not, see ;. - * - * @package OpenEMR - * @author Rod Roark - * @author Brady Miller - * @link http://www.open-emr.org + * @package OpenEMR + * @link http://www.open-emr.org + * @author Rod Roark + * @author Brady Miller + * @copyright Copyright (c) 2010 Rod Roark + * @copyright Copyright (c) 2016-2017 Brady Miller + * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ - - require_once("../globals.php"); require_once("../../custom/code_types.inc.php"); require_once("$srcdir/acl.inc"); require_once("$srcdir/globals.inc.php"); require_once("$srcdir/user.inc"); require_once(dirname(__FILE__)."/../../myportal/soap_service/portal_connectivity.php"); +use OpenEMR\Core\Header; $userMode = (array_key_exists('mode', $_GET) && $_GET['mode'] == 'user'); @@ -57,7 +45,7 @@ function checkCreateCDB() if (!is_dir($GLOBALS['OE_SITE_DIR'] . '/documents/temp/')) { $directory_created = mkdir($GLOBALS['OE_SITE_DIR'] . '/documents/temp/', 0777, true); if (!$directory_created) { - echo htmlspecialchars(xl("Failed to create temporary folder. CouchDB will not work."), ENT_NOQUOTES); + echo xlt("Failed to create temporary folder. CouchDB will not work."); } } @@ -117,7 +105,7 @@ function checkBackgroundServices() } function handleAltServices($this_serviceid, $gln = '', $sinterval = 1) { - $bgservices = sqlStatement("SELECT gl_name, gl_index, gl_value FROM globals WHERE gl_name = '$gln'"); + $bgservices = sqlStatement("SELECT gl_name, gl_index, gl_value FROM globals WHERE gl_name = ?", array($gln)); while ($globalsrow = sqlFetchArray($bgservices)) { $GLOBALS[$globalsrow['gl_name']] = $globalsrow['gl_value']; } @@ -138,8 +126,6 @@ function handleAltServices($this_serviceid, $gln = '', $sinterval = 1) - - + - - - - - - - - - <?php echo xlt('User Settings'); ?> <?php echo xlt('Global Settings'); ?> - + + - - -
+ - +
-

+ -

+ - - - ' /> - ' /> - +

+
+
+
+ +

+ +

+ +
+
+
+
+
+
+ +
+ + + ' /> +
+
+
+
+
    $grparr) { echo "
    \n"; - echo " "; + echo "
    "; if ($userMode) { - echo "
    "; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; + echo "
    "; + echo "
     
    "; + echo "
    " . xlt('User Specific Setting') . "
    "; + echo "
    " . xlt('Default Setting') . "
    "; + echo "
    " . xlt('Default') . "
    "; + echo "
    "; } foreach ($grparr as $fldid => $fldarr) { @@ -444,7 +432,7 @@ foreach ($GLOBALS_METADATA as $grpname => $grparr) { // mdsupport - Check for matches $srch_cl = ''; if (!empty($_POST['srch_desc']) && (stristr(($fldname.$flddesc), $_POST['srch_desc']) !== false)) { - $srch_cl = 'class="srch"'; + $srch_cl = ' srch'; } // Most parameters will have a single value, but some will be arrays. @@ -472,10 +460,14 @@ foreach ($GLOBALS_METADATA as $grpname => $grparr) { } } - echo " \n"; - echo "\n"; - echo ""; - echo "\n"; + echo " \n"; + echo "
    " . attr($globalTitle) . "
    \n"; + echo "
    \n"; echo "\n"; - echo "\n"; + echo "\n"; } else { - echo " \n"; + echo " \n"; } ++$i; } if (trim(strtolower($fldid)) == 'portal_offsite_address_patient_link' && !empty($GLOBALS['portal_offsite_enable']) && !empty($GLOBALS['portal_offsite_providerid'])) { + echo "
    "; + echo "
    "; echo ""; - echo "
    "; + echo ""; + echo "
    "; + echo ""; + echo ""; } } - echo "
     " . htmlspecialchars(xl('User Specific Setting'), ENT_NOQUOTES) . "" . htmlspecialchars(xl('Default Setting'), ENT_NOQUOTES) . " " . htmlspecialchars(xl('Set to Default'), ENT_NOQUOTES) . "
    " . text($fldname) . "\n"; + if ($userMode) { + echo "
    " . text($fldname) . "
    \n"; + } else { + echo "
    " . text($fldname) . "
    \n"; + } if (is_array($fldtype)) { - echo " \n"; foreach ($fldtype as $key => $value) { if ($userMode) { if ($globalValue == $key) { @@ -500,13 +492,13 @@ foreach ($GLOBALS_METADATA as $grpname => $grparr) { } else if ($fldtype == 'bool') { if ($userMode) { if ($globalValue == 1) { - $globalTitle = htmlspecialchars(xl('Checked'), ENT_NOQUOTES); + $globalTitle = xlt('Checked'); } else { - $globalTitle = htmlspecialchars(xl('Not Checked'), ENT_NOQUOTES); + $globalTitle = xlt('Not Checked'); } } - echo " $grparr) { $globalTitle = $globalValue; } - echo " \n"; + echo " \n"; } else if ($fldtype == 'text') { if ($userMode) { $globalTitle = $globalValue; } - echo " \n"; + echo " \n"; } else if ($fldtype == 'pwd') { if ($userMode) { $globalTitle = $globalValue; } - echo " \n"; + echo " \n"; } else if ($fldtype == 'pass') { if ($userMode) { $globalTitle = $globalValue; } - echo " \n"; + echo " \n"; } else if ($fldtype == 'lang') { $res = sqlStatement("SELECT * FROM lang_languages ORDER BY lang_description"); - echo " \n"; while ($row = sqlFetchArray($res)) { echo " "; while ($row = sqlFetchArray($result)) { $catId = $row['pc_catid']; @@ -660,7 +652,7 @@ foreach ($GLOBALS_METADATA as $grpname => $grparr) { // Alphabetize styles asort($styleArray); // Generate style selector - echo "\n"; foreach ($styleArray as $styleKey => $styleValue) { echo "
    " . attr($globalTitle) . " 
    \n"; + echo "
    \n"; echo "
\n"; } } ?> -

- ' /> -

- -
+