// Fix admin dispatcher
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@8774 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
255160292a
commit
45eb3a52ad
3 files changed
+21
-27
No files matched your search
+8
-13
@@ -429,19 +429,16 @@ function generateShopList()
|
|||||||
*/
|
*/
|
||||||
function runAdminTab()
|
function runAdminTab()
|
||||||
{
|
{
|
||||||
|
require_once(_PS_ADMIN_DIR_.'/init.php');
|
||||||
require_once(_PS_ADMIN_DIR_.'/../config/config.inc.php');
|
if (empty($tab) and !sizeof($_POST))
|
||||||
require_once(_PS_ADMIN_DIR_.'/functions.php');
|
{
|
||||||
require_once(_PS_ADMIN_DIR_.'/init.php');
|
|
||||||
if (empty($tab) and !sizeof($_POST))
|
|
||||||
{
|
|
||||||
$tab = 'AdminHome';
|
$tab = 'AdminHome';
|
||||||
$_POST['tab'] = 'AdminHome';
|
$_POST['tab'] = 'AdminHome';
|
||||||
$_POST['token'] = Tools::getAdminTokenLite($tab);
|
$_POST['token'] = Tools::getAdminTokenLite($tab);
|
||||||
}
|
}
|
||||||
// $tab = $_REQUEST['tab'];
|
// $tab = $_REQUEST['tab'];
|
||||||
if ($adminObj = checkingTab($tab))
|
if ($adminObj = checkingTab($tab))
|
||||||
{
|
{
|
||||||
// init is different for new tabs (AdminController) and old tabs (AdminTab)
|
// init is different for new tabs (AdminController) and old tabs (AdminTab)
|
||||||
if ($adminObj instanceof AdminController)
|
if ($adminObj instanceof AdminController)
|
||||||
{
|
{
|
||||||
@@ -561,7 +558,5 @@ if ($adminObj = checkingTab($tab))
|
|||||||
}
|
}
|
||||||
include(_PS_ADMIN_DIR_.'/footer.inc.php');
|
include(_PS_ADMIN_DIR_.'/footer.inc.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -29,6 +29,15 @@ define('_PS_ADMIN_DIR_', getcwd());
|
|||||||
require(dirname(__FILE__).'/../config/config.inc.php');
|
require(dirname(__FILE__).'/../config/config.inc.php');
|
||||||
require(dirname(__FILE__).'/functions.php');
|
require(dirname(__FILE__).'/functions.php');
|
||||||
|
|
||||||
|
// For retrocompatibility with "tab" parameter
|
||||||
|
if (!isset($_GET['controller']) && isset($_GET['tab']))
|
||||||
|
$_GET['controller'] = strtolower($_GET['tab']);
|
||||||
|
if (!isset($_POST['controller']) && isset($_POST['tab']))
|
||||||
|
$_POST['controller'] = strtolower($_POST['tab']);
|
||||||
|
if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab']))
|
||||||
|
$_REQUEST['controller'] = strtolower($_REQUEST['tab']);
|
||||||
|
|
||||||
|
// Prepare and trigger admin dispatcher
|
||||||
Dispatcher::getInstance()->setDefaultController('adminhome');
|
Dispatcher::getInstance()->setDefaultController('adminhome');
|
||||||
Dispatcher::getInstance()->setControllerNotFound('adminhome');
|
Dispatcher::getInstance()->setControllerNotFound('adminhome');
|
||||||
Dispatcher::getInstance()->setControllerDirectories(array(_PS_ADMIN_DIR_.'/tabs/', _PS_ADMIN_CONTROLLER_DIR_));
|
Dispatcher::getInstance()->setControllerDirectories(array(_PS_ADMIN_DIR_.'/tabs/', _PS_ADMIN_CONTROLLER_DIR_));
|
||||||
|
|||||||
+4
-14
@@ -28,16 +28,6 @@
|
|||||||
ob_start();
|
ob_start();
|
||||||
$timerStart = microtime(true);
|
$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'];
|
// $_GET['tab'] = $_GET['controller'];
|
||||||
// $_POST['tab'] = $_POST['controller'];
|
// $_POST['tab'] = $_POST['controller'];
|
||||||
// $_REQUEST['tab'] = $_REQUEST['controller'];
|
// $_REQUEST['tab'] = $_REQUEST['controller'];
|
||||||
@@ -51,12 +41,12 @@ if (!isset($context->employee) || !$context->employee->isLoggedBack())
|
|||||||
|
|
||||||
|
|
||||||
// Set current index
|
// Set current index
|
||||||
$currentIndex = $_SERVER['SCRIPT_NAME'].(($tab = Tools::getValue('tab')) ? '?tab='.$tab : '');
|
//$currentIndex = $_SERVER['SCRIPT_NAME'].(($tab = Tools::getValue('tab')) ? '?tab='.$tab : '');
|
||||||
if (empty($tab))
|
//if (empty($tab))
|
||||||
{
|
//{
|
||||||
$currentIndex = $_SERVER['SCRIPT_NAME'].(($controller = Tools::getValue('controller')) ? '?controller='.$controller: '');
|
$currentIndex = $_SERVER['SCRIPT_NAME'].(($controller = Tools::getValue('controller')) ? '?controller='.$controller: '');
|
||||||
$tab = $controller;
|
$tab = $controller;
|
||||||
}
|
//}
|
||||||
if ($back = Tools::getValue('back'))
|
if ($back = Tools::getValue('back'))
|
||||||
$currentIndex .= '&back='.urlencode($back);
|
$currentIndex .= '&back='.urlencode($back);
|
||||||
AdminTab::$currentIndex = $currentIndex;
|
AdminTab::$currentIndex = $currentIndex;
|
||||||
|
|||||||
Reference in new issue
Block a user