mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-02 15:08:45 +02:00
N°2847 - Separate inline scripts and css from html in the rendering of pages
This commit is contained in:
@@ -113,5 +113,13 @@ class AjaxTab extends Tab
|
||||
return $this->bCache ? 'true' : 'false';
|
||||
}
|
||||
|
||||
public function GetParameters(): array
|
||||
{
|
||||
$aParams = parent::GetParameters();
|
||||
|
||||
$aParams['sURL'] = $this->GetURL();
|
||||
$aParams['sCache'] = $this->GetCache() ? 'true' : 'false';
|
||||
|
||||
return $aParams;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,4 +54,14 @@ class Tab extends UIContentBlock
|
||||
{
|
||||
return $this->sTitle;
|
||||
}
|
||||
|
||||
public function GetParameters(): array
|
||||
{
|
||||
return [
|
||||
'sBlockId' => $this->GetId(),
|
||||
'sTitle' => $this->GetTitle(),
|
||||
'sType' => $this->GetType(),
|
||||
'oBlock' => $this,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,9 @@ class TabContainer extends UIContentBlock
|
||||
public const BLOCK_CODE = 'ibo-tabcontainer';
|
||||
public const HTML_TEMPLATE_REL_PATH = 'layouts/tabcontainer/layout';
|
||||
public const JS_TEMPLATE_REL_PATH = 'layouts/tabcontainer/layout';
|
||||
public const JS_FILES_REL_PATH = [
|
||||
'js/layouts/tab-container.js'
|
||||
];
|
||||
|
||||
private $sName;
|
||||
private $sPrefix;
|
||||
@@ -122,4 +125,24 @@ class TabContainer extends UIContentBlock
|
||||
}
|
||||
return parent::AddSubBlock($oSubBlock);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return tab list
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function Get(): array
|
||||
{
|
||||
$aTabs = [];
|
||||
|
||||
foreach ($this->GetSubBlocks() as $oTab) {
|
||||
$aTabs[] = $oTab->GetParameters();
|
||||
}
|
||||
|
||||
return [
|
||||
'sBlockId' => $this->GetId(),
|
||||
'aTabs' => $aTabs
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user