1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 02:39:47 +02:00

updated system page, with new config writing code, not working...

This commit is contained in:
Karl 'vollmerk' Vollmer 2007-04-23 07:31:40 +00:00
parent a31560aec4
commit 37607a70f4

View file

@ -66,27 +66,38 @@ switch ($action) {
/* Check to see if Key on source side is an array */ /* Check to see if Key on source side is an array */
if (is_array($current[$key])) { if (is_array($current[$key])) {
/* We need to add all values of this key to the new config file */ /* We need to add all values of this key to the new config file */
$line = ''; $line = $key . ' = "';
$array_value[$key] = true; $array_value[$key] = true;
foreach ($current[$key] as $sub_value) { foreach ($current[$key] as $sub_value) {
$line .= $key . " = \"" . $sub_value . "\"\n"; $line .= "$sub_value,";
} }
$line = rtrim($line,',');
$line .= '"';
unset($current[$key]); unset($current[$key]);
} // is array } // is array
/* Put in the current value */ /* Put in the current value */
elseif (isset($current[$key]) AND $key != 'config_version') { elseif (isset($current[$key]) AND $key != 'config_version') {
$line = $key . " = \"" . $current[$key] . "\""; $line = $key . ' = "' . $current[$key] . '"';
unset($current[$key]); unset($current[$key]);
} // if set } // if set
elseif (isset($array_value[$key])) { elseif (isset($array_value[$key])) {
$line = ''; $line = '';
} }
if (substr($line,0,1) == "#") {
$line = ltrim($line,"#");
$line = ";" . $line;
}
} // if key } // if key
else {
// Replace # with ;
$line = str_replace("#",";",$line);
}
$final .= $line . "\n"; $final .= $line . "\n";