N°2313 - Markup extensibility: Add support for both code AND title in admin. console tabs

This commit is contained in:
Molkobain
2020-01-14 20:04:07 +01:00
parent 4eab0e6450
commit 5a39581c60
4 changed files with 184 additions and 122 deletions

View File

@@ -1,7 +1,20 @@
<?php
/**
* @copyright Copyright (C) 2010-2019 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
* Copyright (C) 2013-2020 Combodo SARL
*
* This file is part of iTop.
*
* iTop is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* iTop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
*/
namespace Combodo\iTop\Application\TwigBase\Controller;
@@ -305,9 +318,9 @@ abstract class Controller
$this->m_oPage->AddTabContainer('');
$this->m_oPage->SetCurrentTabContainer('');
}
foreach ($this->m_aAjaxTabs as $aTab)
foreach ($this->m_aAjaxTabs as $sTabCode => $aTabData)
{
$this->AddAjaxTabToPage($aTab['label'], $aTab['url'], $aTab['cache']);
$this->AddAjaxTabToPage($sTabCode, $aTabData['label'], $aTabData['url'], $aTabData['cache']);
}
foreach ($this->m_aLinkedScripts as $sLinkedScript)
{
@@ -553,9 +566,9 @@ abstract class Controller
$this->m_oPage->add_linked_stylesheet($sLinkedStylesheet);
}
private function AddAjaxTabToPage($sLabel, $sURL, $bCache)
private function AddAjaxTabToPage($sCode, $sTitle, $sURL, $bCache)
{
$this->m_oPage->AddAjaxTab($sLabel, $sURL, $bCache);
$this->m_oPage->AddAjaxTab($sCode, $sURL, $bCache, $sTitle);
}
/**