Skip to content

Commit

Permalink
Merge pull request #4896 from kelu95/fix-bo-sf2-layout-menu-active
Browse files Browse the repository at this point in the history
// fix wrong controller name check
  • Loading branch information
xGouley committed Feb 5, 2016
2 parents 1181556 + 11c4cc4 commit 0f90a7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions classes/controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -385,15 +385,15 @@ class AdminControllerCore extends Controller
/** @var bool if logged employee has access to AdminImport */
protected $can_import = false;

public function __construct()
public function __construct($forceControllerName = '')
{
global $timer_start;
$this->timer_start = $timer_start;
// Has to be remove for the next Prestashop version
global $token;

$this->controller_type = 'admin';
$this->controller_name = get_class($this);
$this->controller_name = !empty($forceControllerName) ? $forceControllerName : get_class($this);
if (strpos($this->controller_name, 'Controller')) {
$this->controller_name = substr($this->controller_name, 0, -10);
}
Expand Down Expand Up @@ -1923,7 +1923,7 @@ private function getTabs($parentId = 0, $level = 0)
$img = str_replace('png', 'gif', $img);
}
// tab[class_name] does not contains the "Controller" suffix
if (($tab['class_name'].'Controller' == get_class($this)) || ($current_id == $tab['id_tab'])) {
if (($tab['class_name'].'Controller' == get_class($this)) || ($current_id == $tab['id_tab']) || $tab['class_name'] == $this->controller_name) {
$tabs[$index]['current'] = true;
$tabs[$index]['current_level'] = $level;
} else {
Expand Down
2 changes: 1 addition & 1 deletion controllers/admin/AdminLegacyLayoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AdminLegacyLayoutControllerCore extends AdminController

public function __construct($controllerName = '', $title = '', $headerToolbarBtn = array(), $displayType = '', $showContentHeader = true)
{
parent::__construct();
parent::__construct($controllerName);

$this->title = $title;
$this->display = $displayType;
Expand Down

0 comments on commit 0f90a7c

Please sign in to comment.