diff options
author | 2006-04-17 03:31:29 +0000 | |
---|---|---|
committer | 2006-04-17 03:31:29 +0000 | |
commit | 14ae5a4b6134ec54dea68ba6f3f2e9ebc7cb619c (patch) | |
tree | 2ce00b64374679c042b9c73984fdaa27f080b787 /webgli/configfiles.php | |
parent | adding globaluse screen (diff) | |
download | scire-14ae5a4b6134ec54dea68ba6f3f2e9ebc7cb619c.tar.gz scire-14ae5a4b6134ec54dea68ba6f3f2e9ebc7cb619c.tar.bz2 scire-14ae5a4b6134ec54dea68ba6f3f2e9ebc7cb619c.zip |
configfiles.php cleanup to not need intermediary vars
svn path=/; revision=38
Diffstat (limited to 'webgli/configfiles.php')
-rw-r--r-- | webgli/configfiles.php | 60 |
1 files changed, 13 insertions, 47 deletions
diff --git a/webgli/configfiles.php b/webgli/configfiles.php index c0092ac..00d6c9f 100644 --- a/webgli/configfiles.php +++ b/webgli/configfiles.php @@ -18,71 +18,37 @@ $etc_files = $ip->get("etc_files"); $error_msg = ""; if ($_POST['SaveConfigFiles']) { - $keymap = ""; - $windowkeys = ""; - $ext_keymap = ""; - $font = ""; - $clock = ""; - $editor = ""; - $disp_manager = ""; - $xsession = ""; - if ($_POST['clock']) { - $clock = $_POST['clock']; - } - if ($_POST['editor']) { - $editor = $_POST['editor']; - } - if ($_POST['disp_manager']) { - $disp_manager = $_POST['disp_manager']; - } - if ($_POST['keymap']) { - $keymap = $_POST['keymap']; - } - if ($_POST['windowkeys']) { - $windowkeys = $_POST['windowkeys']; - } - if ($_POST['ext_keymap']) { - $ext_keymap = $_POST['ext_keymap']; - } - if ($_POST['font']) { - $font = $_POST['font']; - } - if ($_POST['xsession']) { - $xsession = $_POST['xsession']; - } - if(!array_key_exists("conf.d/keymaps", $etc_files)) { - if($keymap || $windowkeys || $ext_keymap) { + if($_POST['keymap'] || $_POST['windowkeys'] || $_POST['ext_keymap']) { $etc_files['conf.d/keymaps'] = array(); } } if(!array_key_exists("conf.d/consolefont", $etc_files)) { - if($font) { + if($_POST['font']) { $etc_files['conf.d/consolefont'] = array(); } } if(!array_key_exists("conf.d/clock", $etc_files)) { - if($clock) { + if($_POST['clock']) { $etc_files['conf.d/clock'] = array(); } } if(!array_key_exists("rc.conf", $etc_files)) { - if($editor || $disp_manager || $xsession) { + if($_POST['editor'] || $_POST['disp_manager'] || $_POST['xsession']) { $etc_files['rc.conf'] = array(); } } - if($keymap) {$etc_files['conf.d/keymaps']['KEYMAP'] = $keymap;} - if($windowkeys) $etc_files['conf.d/keymaps']['SET_WINDOWSKEYS'] = $windowkeys; - if($ext_keymap) $etc_files['conf.d/keymaps']['EXTENDED_KEYMAPS'] = $ext_keymap; - if($font) $etc_files['conf.d/consolefont']['CONSOLEFONT'] = $font; - if($clock) $etc_files['conf.d/clock']['CLOCK'] = $clock; - if($editor) $etc_files['rc.conf']['EDITOR'] = $editor; - if($disp_manager) $etc_files['rc.conf']['DISPLAYMANAGER'] = $disp_manager; - if($xsession) $etc_files['rc.conf']['XSESSION'] = $xsession; - var_dump($etc_files); + if($_POST['keymap']) $etc_files['conf.d/keymaps']['KEYMAP'] = $_POST['keymap']; + if($_POST['windowkeys']) $etc_files['conf.d/keymaps']['SET_WINDOWSKEYS'] = $_POST['windowkeys']; + if($_POST['ext_keymap']) $etc_files['conf.d/keymaps']['EXTENDED_KEYMAPS'] = $_POST['ext_keymap']; + if($_POST['font']) $etc_files['conf.d/consolefont']['CONSOLEFONT'] = $_POST['font']; + if($_POST['clock']) $etc_files['conf.d/clock']['CLOCK'] = $_POST['clock']; + if($_POST['editor']) $etc_files['rc.conf']['EDITOR'] = $_POST['editor']; + if($_POST['disp_manager']) $etc_files['rc.conf']['DISPLAYMANAGER'] = $_POST['disp_manager']; + if($_POST['xsession']) $etc_files['rc.conf']['XSESSION'] = $_POST['xsession']; +# var_dump($etc_files); $ip->set("etc_files", $etc_files); file_put_contents('test.xml', $ip->serialize()); #PHP 5 only - if(!$error_msg) { $error_msg = "Values saved successfully"; |