[+] BO : New AdminController system, including smarty backoffice, thanks to Raphael and Thomas

This commit is contained in:
mMarinetti
2011-09-23 15:01:49 +00:00
parent 230ed9d5ee
commit 6191e868f1
13 changed files with 833 additions and 220 deletions
+21 -3
View File
@@ -28,6 +28,20 @@
ob_start();
$timerStart = microtime(true);
{
if (!isset($_GET['controller']) && isset($_GET['tab'])){
$_GET['controller'] = $_GET['tab'];
}
if (!isset($_POST['controller']) && isset($_POST['tab']))
$_POST['controller'] = $_POST['tab'];
if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab']))
$_REQUEST['controller'] = $_REQUEST['tab'];
}
// $_GET['tab'] = $_GET['controller'];
// $_POST['tab'] = $_POST['controller'];
// $_REQUEST['tab'] = $_REQUEST['controller'];
$context = Context::getContext();
if (isset($_GET['logout']))
$context->employee->logout();
@@ -38,6 +52,11 @@ if (!isset($context->employee) || !$context->employee->isLoggedBack())
// Set current index
$currentIndex = $_SERVER['SCRIPT_NAME'].(($tab = Tools::getValue('tab')) ? '?tab='.$tab : '');
if (empty($tab))
{
$currentIndex = $_SERVER['SCRIPT_NAME'].(($controller = Tools::getValue('controller')) ? '?controller='.$controller: '');
$tab = $controller;
}
if ($back = Tools::getValue('back'))
$currentIndex .= '&back='.urlencode($back);
AdminTab::$currentIndex = $currentIndex;
@@ -56,7 +75,7 @@ define('_PS_BASE_URL_', Tools::getShopDomain(true));
define('_PS_BASE_URL_SSL_', Tools::getShopDomainSsl(true));
$path = dirname(__FILE__).'/themes/';
if (empty($context->employee->bo_theme) OR !file_exists($path.$employee->bo_theme.'/admin.css'))
if (empty($context->employee->bo_theme) OR !file_exists($path.$context->employee->bo_theme.'/admin.css'))
{
if (file_exists($path.'oldschool/admin.css'))
$context->employee->bo_theme = 'oldschool';
@@ -84,7 +103,6 @@ if (Shop::isMultiShopActivated() && Tools::getValue('setShopContext') !== false)
}
$context->currency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT'));
$context->country = $defaultCountry;
$shopID = '';
if ($context->cookie->shopContext)
@@ -93,4 +111,4 @@ if ($context->cookie->shopContext)
if (count($split) == 2 && $split[0] == 's')
$shopID = (int)$split[1];
}
$context->shop = new Shop($shopID);
$context->shop = new Shop($shopID);