Author: Lars Michelsen <[email protected]>
Date: Mon Mar 28 23:57:59 2011 +0200
Committer: Lars Michelsen <[email protected]>
Commit-Date: Mon Mar 28 23:57:59 2011 +0200
Now really fixed adding of new attributes using the WUI
---
share/server/core/classes/CoreModMap.php | 2 +-
share/server/core/classes/GlobalMapCfg.php | 15 +++++++--------
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/share/server/core/classes/CoreModMap.php
b/share/server/core/classes/CoreModMap.php
index eff29bf..e2a1858 100644
--- a/share/server/core/classes/CoreModMap.php
+++ b/share/server/core/classes/CoreModMap.php
@@ -645,7 +645,7 @@ class CoreModMap extends CoreModule {
if(!$MAPCFG->objExists($a['id']))
new GlobalMessage('ERROR',
$this->CORE->getLang()->getText('The object does not exist.'));
-
+
// set options in the array
foreach($a['opts'] AS $key => $val) {
$MAPCFG->setValue($a['id'], $key, $val);
diff --git a/share/server/core/classes/GlobalMapCfg.php
b/share/server/core/classes/GlobalMapCfg.php
index 9420889..5681631 100644
--- a/share/server/core/classes/GlobalMapCfg.php
+++ b/share/server/core/classes/GlobalMapCfg.php
@@ -2281,14 +2281,13 @@ class GlobalMapCfg {
continue;
$lineNum = $i;
+ }
- if(is_array($val))
- $val = implode(',', $val);
+ if(is_array($val))
+ $val = implode(',', $val);
- if($val !== '')
- $newLine = $key.'='.$val."\n";
- break;
- }
+ if($val !== '')
+ $newLine = $key.'='.$val."\n";
if($lineNum !== null && $newLine !== '')
// if a parameter was found in file and value
is not empty, replace line
@@ -2298,9 +2297,9 @@ class GlobalMapCfg {
array_splice($f, $lineNum, 1);
elseif($lineNum === null && $newLine !== '')
// if a parameter is was not found in array and
a value is not empty, create line
- array_splice($f, $end, Array($f[$end],
$newLine));
+ array_splice($f, $end, 1, Array($newLine,
$f[$end]));
}
-
+
$this->writeConfig($f);
return true;
}
------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself;
WebMatrix provides all the features you need to develop and publish
your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins