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

This commit is contained in:
Eric
2020-01-16 09:56:22 +01:00
parent 026b7e1836
commit b370deaac9
5 changed files with 17 additions and 11 deletions

View File

@@ -466,15 +466,21 @@ abstract class Controller
/**
* Add an AJAX tab to the current page
*
* @api
*
* @param string $sLabel Label of the tab
* @param string $sCode Code of the tab
* @param string $sURL URL to call when the tab is activated
* @param bool $bCache If true, cache the result for the current web page
* @param string $sLabel Label of the tab (if null the code is translated)
*
* @api
*
*/
public function AddAjaxTab($sLabel, $sURL, $bCache = true)
public function AddAjaxTab($sCode, $sURL, $bCache = true, $sLabel = null)
{
$this->m_aAjaxTabs[] = array('label' => $sLabel, 'url' => $sURL, 'cache' => $bCache);
if (is_null($sLabel))
{
$sLabel = Dict::S($sCode);
}
$this->m_aAjaxTabs[$sCode] = array('label' => $sLabel, 'url' => $sURL, 'cache' => $bCache);
}
/**