From 775da603826be27d186d6d65aa19722662782592 Mon Sep 17 00:00:00 2001 From: Emmanuel Papin Date: Thu, 14 May 2015 20:49:36 +0200 Subject: [PATCH] Remove any call to ['Name'] --- web/skins/classic/views/plugin.php | 44 +++++++++++++++--------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/web/skins/classic/views/plugin.php b/web/skins/classic/views/plugin.php index 9bcf53a98..c96f6511b 100644 --- a/web/skins/classic/views/plugin.php +++ b/web/skins/classic/views/plugin.php @@ -170,30 +170,30 @@ foreach( dbFetchAll( $sql, NULL, array( $mid, $zid, $plugin ) ) as $popt ) } } -foreach($pOptions as $name => $values) +// Add option in database if missing +foreach($pOptions as $key => $popt) { - if(!in_array($name, $optionNames)) + if(!in_array($key, $optionNames)) { - $popt=$pOptions[$name]; switch($popt['Type']) { case "select": $sql="INSERT INTO PluginsConfig VALUES ('',?,?,?,?,'','',?,?,?)"; - dbQuery($sql, array( $popt['Name'], $popt['Value'], $popt['Type'], $popt['Choices'], $mid, $zid, $plugin ) ); + dbQuery($sql, array( $key, $popt['Value'], $popt['Type'], $popt['Choices'], $mid, $zid, $plugin ) ); break; case "integer": $sql="INSERT INTO PluginsConfig VALUES ('',?,?,?,'',?,?,?,?,?)"; - dbQuery($sql, array( $popt['Name'], $popt['Value'], $popt['Type'], $popt['Min'], $popt['Max'], $mid, $zid, $plugin ) ); + dbQuery($sql, array( $key, $popt['Value'], $popt['Type'], $popt['Min'], $popt['Max'], $mid, $zid, $plugin ) ); break; case "list": $sql="INSERT INTO PluginsConfig VALUES ('',?,'',?,'','','',?,?,?)"; - dbQuery($sql, array( $popt['Name'], $popt['Type'], $mid, $zid, $plugin ) ); + dbQuery($sql, array( $key, $popt['Type'], $mid, $zid, $plugin ) ); break; case "checkbox": case "text": default: $sql="INSERT INTO PluginsConfig VALUES ('',?,?,?,'','','',?,?,?)"; - dbQuery($sql, array( $popt['Name'], $popt['Value'], $popt['Type'], $mid, $zid, $plugin ) ); + dbQuery($sql, array( $key, $popt['Value'], $popt['Type'], $mid, $zid, $plugin ) ); } } } @@ -263,18 +263,18 @@ xhtmlHeaders(__FILE__, $SLANG['Plugin'] ); $popt) +foreach($pOptions as $key => $popt) { ?> - + $popt) $pchoices=explode(',',$popt['Choices']); ?> $popt)
- onchange="applyChanges();"> - "> + onchange="applyChanges();"> + "> - onchange="applyChanges();"> $popt) } ?> - + - onchange="applyChanges();"> - + onchange="applyChanges();"> + - > - + > +
- onkeyup="updateAddBtn('');" /> + onkeyup="updateAddBtn('');" /> - +
- > $popt) } ?> - + - /> + />