// Merge -> revision 8507

This commit is contained in:
rMalie
2011-09-12 16:17:37 +00:00
parent b404900911
commit a1bdb7b35e
67 changed files with 1938 additions and 1509 deletions
+2 -8
View File
@@ -26,14 +26,9 @@ class Autoupgrade extends Module
}
function install()
{
$autoupgradeCanWork = true;
if (!$autoupgradeCanWork)
return false;
$res = true;
// before adding AdminSelfUpgrade, we should remove AdminUpgrade
if (version_compare(_PS_VERSION_,'1.4.4.0','==') OR version_compare(_PS_VERSION_,'1.4.4.1','=='))
{
$idTab = Tab::getIdFromClassName('AdminUpgrade');
if ($idTab)
@@ -41,7 +36,6 @@ class Autoupgrade extends Module
$tab = new Tab($idTab);
$res &= $tab->delete();
}
}
$idTab = Tab::getIdFromClassName('AdminSelfUpgrade');
// Then we add AdminSelfUpgrade only if not exists
@@ -55,9 +49,7 @@ class Autoupgrade extends Module
$res &= $tab->save();
}
else
{
$tab = new Tab($idTab);
}
Configuration::updateValue('PS_AUTOUPDATE_MODULE_IDTAB',$tab->id);
$autoupgradeDir = _PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'autoupgrade';
@@ -68,6 +60,7 @@ class Autoupgrade extends Module
$path = dirname(__FILE__).'/';
$res &= copy($path.'ajax-upgradetab.php',$autoupgradeDir . DIRECTORY_SEPARATOR . 'ajax-upgradetab.php');
$res &= copy($path.'logo.gif',_PS_ROOT_DIR_. DIRECTORY_SEPARATOR . 'img/t/AdminSelfUpgrade.gif');
if (!$res
OR !Tab::getIdFromClassName('AdminSelfUpgrade')
@@ -94,6 +87,7 @@ class Autoupgrade extends Module
$res = $tab->save();
}
if (file_exists(_PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'autoupgrade'.DIRECTORY_SEPARATOR.'ajax-upgradetab.php'))
$res &= @unlink(_PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'autoupgrade'.DIRECTORY_SEPARATOR.'ajax-upgradetab.php');
if($res OR !parent::uninstall())
return false;