[+] Project : Possibility to enable or disable tabs
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11581 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -1229,7 +1229,7 @@ class AdminControllerCore extends Controller
|
||||
$current_id = Tab::getCurrentParentId();
|
||||
foreach ($tabs as $index => $tab)
|
||||
{
|
||||
if (Tab::checkTabRights($tab['id_tab']) === true)
|
||||
if (Tab::checkTabRights($tab['id_tab']) === true AND (bool)$tab['active'])
|
||||
{
|
||||
if ($tab['name'] == 'Stock' && Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') == 0)
|
||||
{
|
||||
@@ -1259,7 +1259,7 @@ class AdminControllerCore extends Controller
|
||||
foreach ($sub_tabs as $index2 => $sub_tab)
|
||||
{
|
||||
// class_name is the name of the class controller
|
||||
if (Tab::checkTabRights($sub_tab) === true)
|
||||
if (Tab::checkTabRights($sub_tab) === true AND (bool)$sub_tab['active'])
|
||||
$sub_tabs[$index2]['href'] = $this->context->link->getAdminLink($sub_tab['class_name']);
|
||||
else
|
||||
unset($sub_tabs[$index2]);
|
||||
|
||||
@@ -41,6 +41,9 @@ class TabCore extends ObjectModel
|
||||
/** @var integer position */
|
||||
public $position;
|
||||
|
||||
/** @var integer active */
|
||||
public $active;
|
||||
|
||||
/**
|
||||
* @see ObjectModel::$definition
|
||||
*/
|
||||
@@ -53,6 +56,7 @@ class TabCore extends ObjectModel
|
||||
'position' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'module' => array('type' => self::TYPE_STRING, 'validate' => 'isTabName', 'size' => 64),
|
||||
'class_name' => array('type' => self::TYPE_STRING, 'required' => true, 'size' => 64),
|
||||
'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
|
||||
// Lang fields
|
||||
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 32),
|
||||
|
||||
Reference in New Issue
Block a user