mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Fixed active='false' so it removes the pref on upgrade.
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
|
||||||
| $Revision: 1.94 $
|
| $Revision: 1.95 $
|
||||||
| $Date: 2009-09-21 23:07:27 $
|
| $Date: 2009-09-22 21:12:12 $
|
||||||
| $Author: e107coders $
|
| $Author: e107coders $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -1318,7 +1318,10 @@ class e107plugin
|
|||||||
$txt .= $plug_vars['installDone'];
|
$txt .= $plug_vars['installDone'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $txt;
|
|
||||||
|
$emessage = eMessage::getInstance();
|
||||||
|
$emessage->add($txt, E_MESSAGE_SUCCESS);
|
||||||
|
// return $txt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1332,6 +1335,8 @@ class e107plugin
|
|||||||
{
|
{
|
||||||
|
|
||||||
//XXX Could also be used for theme prefs.. perhaps this function should be moved elsewhere?
|
//XXX Could also be used for theme prefs.. perhaps this function should be moved elsewhere?
|
||||||
|
//TODO array support for prefs. <key>? or array() as used in xml site export?
|
||||||
|
|
||||||
$emessage = &eMessage::getInstance();
|
$emessage = &eMessage::getInstance();
|
||||||
|
|
||||||
if(!varset($prefArray) || !varset($prefArray))
|
if(!varset($prefArray) || !varset($prefArray))
|
||||||
@@ -1344,7 +1349,8 @@ class e107plugin
|
|||||||
foreach($prefArray['pref'] as $tag)
|
foreach($prefArray['pref'] as $tag)
|
||||||
{
|
{
|
||||||
$key = varset($tag['@attributes']['name']);
|
$key = varset($tag['@attributes']['name']);
|
||||||
$value = vartrue($tag['@value']);
|
$value = vartrue($tag['@value']);
|
||||||
|
$remove = (varset($tag['@attributes']['active'])=='false') ? TRUE : FALSE;
|
||||||
|
|
||||||
if(varset($tag['@attributes']['value']))
|
if(varset($tag['@attributes']['value']))
|
||||||
{
|
{
|
||||||
@@ -1360,8 +1366,17 @@ class e107plugin
|
|||||||
|
|
||||||
case 'upgrade' :
|
case 'upgrade' :
|
||||||
case 'refresh' :
|
case 'refresh' :
|
||||||
$config->update($key,$value);
|
if($remove) // remove active='false' prefs.
|
||||||
$emessage->add("Updating Pref: ".$key, E_MESSAGE_SUCCESS);
|
{
|
||||||
|
$config->remove($key,$value);
|
||||||
|
$emessage->add("Removing Pref: ".$key, E_MESSAGE_SUCCESS);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$config->update($key,$value);
|
||||||
|
$emessage->add("Updating Pref: ".$key, E_MESSAGE_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'uninstall':
|
case 'uninstall':
|
||||||
|
Reference in New Issue
Block a user