From 5dcfe80e71f78bd7e2d555f6bfcec7c8c220dd0d Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sat, 11 Jan 2014 15:12:18 +0000 Subject: [PATCH] Update condition moved to own include file repPosEnd also now to plugins, not previousFiles, as moved position in array Plugins no longer updated here --- lib/settings-update.php | 65 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 lib/settings-update.php diff --git a/lib/settings-update.php b/lib/settings-update.php new file mode 100644 index 0000000..315a473 --- /dev/null +++ b/lib/settings-update.php @@ -0,0 +1,65 @@ + '; + // Wrap certain values in double quotes + $settingWrap = $settingsArray[$i]=="root"||$settingsArray[$i]=="password"||$settingsArray[$i]=="theme"||$settingsArray[$i]=="fontSize"||$settingsArray[$i]=="tagWrapperCommand"||$settingsArray[$i]=="autoComplete" ? '"' : ''; + $settingsNew .= $settingWrap.$ICEcoder[$settingsArray[$i]].$settingWrap.','.PHP_EOL.PHP_EOL; + } + + // Compile our new settings + $settingsContents = substr($settingsContents,0,$repPosStart).$settingsNew.substr($settingsContents,($repPosEnd),strlen($settingsContents)); + + // Now update the config file + if (is_writeable($settingsFile)) { + $fh = fopen($settingsFile, 'w'); + fwrite($fh, $settingsContents); + fclose($fh); + } else { + echo ""; + } + + // OK, now the config file has been updated, update our current session with new arrays + $settingsArray = array("findFilesExclude","bannedFiles","allowedIPs"); + for ($i=0;$itop.ICEcoder.settingsScreen('hide');top.ICEcoder.useNewSettings('".$themeURL."',".$ICEcoder["codeAssist"].",".$ICEcoder["lockedNav"].",'".$ICEcoder["tagWrapperCommand"]."','".$ICEcoder["autoComplete"]."',".$ICEcoder["visibleTabs"].",'".$ICEcoder["fontSize"]."',".$ICEcoder["lineWrapping"].",".$ICEcoder["indentWithTabs"].",".$ICEcoder["indentSize"].",".$refreshFM.");"; +} +?> \ No newline at end of file