// remove deprecated PS_ADMIN_DIR by _PS_ADMIN_DIR_

This commit is contained in:
tDidierjean committed 2011-09-20 15:53:57 +00:00
1 parent 5f9b669cf9
commit b556966762
79 files changed
+339 -339

No files matched your search

+9 -8
View File
@@ -1,4 +1,5 @@
<?php
class Autoupgrade extends Module
{
function __construct()
@@ -9,11 +10,11 @@ class Autoupgrade extends Module
if (!defined('_PS_ADMIN_DIR_'))
{
if (defined('PS_ADMIN_DIR'))
define('_PS_ADMIN_DIR_',PS_ADMIN_DIR);
if (defined('_PS_ADMIN_DIR_'))
define('_PS_ADMIN_DIR_', _PS_ADMIN_DIR_);
else
{
$this->_errors[] = $this->l('This version of PrestaShop cannot be upgraded : PS_ADMIN_DIR constant is missing');
$this->_errors[] = $this->l('This version of PrestaShop cannot be upgraded :_PS_ADMIN_DIR_ constant is missing');
$autoupgradeCanWork = false;
}
}
@@ -36,7 +37,7 @@ class Autoupgrade extends Module
$tab = new Tab($idTab);
$res &= $tab->delete();
}
$idTab = Tab::getIdFromClassName('AdminSelfUpgrade');
// Then we add AdminSelfUpgrade only if not exists
if (!$idTab)
@@ -58,11 +59,11 @@ class Autoupgrade extends Module
if(file_exists($autoupgradeDir.DIRECTORY_SEPARATOR.'ajax-upgradetab.php'))
$res &= unlink($autoupgradeDir.DIRECTORY_SEPARATOR.'ajax-upgradetab.php');
$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
if (!$res
OR !Tab::getIdFromClassName('AdminSelfUpgrade')
OR !parent::install()
)
@@ -85,7 +86,7 @@ class Autoupgrade extends Module
}
$res &= unlink(_PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'tabs'.'AdminUpgrade.php');
}
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())