mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-30 14:08:46 +02:00
Migrates banner, header, footer in blocks for iTopWebPage
This commit is contained in:
@@ -28,6 +28,7 @@ use Combodo\iTop\Application\UI\Layout\PageContent\PageContent;
|
||||
use Combodo\iTop\Application\UI\Layout\PageContent\PageContentFactory;
|
||||
use Combodo\iTop\Application\UI\Layout\TopBar\TopBar;
|
||||
use Combodo\iTop\Application\UI\Layout\TopBar\TopBarFactory;
|
||||
use Combodo\iTop\Application\UI\Layout\UIContentBlock;
|
||||
use Combodo\iTop\Application\UI\UIBlock;
|
||||
use Combodo\iTop\Renderer\BlockRenderer;
|
||||
|
||||
@@ -657,6 +658,31 @@ JS
|
||||
return $sBannerHtml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the banner UIBlock which can come from both iTop itself and from extensions
|
||||
*
|
||||
* @see \iPageUIExtension::GetBannerHtml()
|
||||
* @internal
|
||||
*
|
||||
* @return iUIBlock
|
||||
* @since 3.0.0
|
||||
*/
|
||||
protected function RenderBannerBlock()
|
||||
{
|
||||
$oBanner = new UIContentBlock();
|
||||
|
||||
// Call the extensions to add content to the page, warning they can also add styles or scripts through as they have access to the \iTopWebPage
|
||||
foreach (MetaModel::EnumPlugins('iPageUIBlockExtension') as $oExtensionInstance)
|
||||
{
|
||||
$oBlock = $oExtensionInstance->GetBannerBlock();
|
||||
if ($oBlock) {
|
||||
$oBanner->AddSubBlock($oBlock);
|
||||
}
|
||||
}
|
||||
|
||||
return $oBanner;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the header HTML which can come from both iTop itself and from extensions
|
||||
*
|
||||
@@ -735,6 +761,21 @@ EOF;
|
||||
return $sHeaderHtml;
|
||||
}
|
||||
|
||||
protected function RenderHeaderBlock()
|
||||
{
|
||||
$oHeader = new UIContentBlock();
|
||||
// Call the extensions to add content to the page, warning they can also add styles or scripts through as they have access to the \iTopWebPage
|
||||
foreach (MetaModel::EnumPlugins('iPageUIBlockExtension') as $oExtensionInstance)
|
||||
{
|
||||
$oBlock = $oExtensionInstance->GetNorthPaneBlock();
|
||||
if ($oBlock) {
|
||||
$oHeader->AddSubBlock($oBlock);
|
||||
}
|
||||
}
|
||||
|
||||
return $oHeader;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the footer HTML which can come from both iTop itself and from extensions
|
||||
*
|
||||
@@ -756,6 +797,30 @@ EOF;
|
||||
return $sFooterHtml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the footer UIBlock which can come from both iTop itself and from extensions
|
||||
*
|
||||
* @see \iPageUIExtension::GetSouthPaneHtml()
|
||||
* @internal
|
||||
*
|
||||
* @return iUIBlock
|
||||
* @since 3.0.0
|
||||
*/
|
||||
protected function RenderFooterBlock()
|
||||
{
|
||||
$oFooter = new UIContentBlock();
|
||||
|
||||
// Call the extensions to add content to the page, warning they can also add styles or scripts through as they have access to the \iTopWebPage
|
||||
foreach (MetaModel::EnumPlugins('iPageUIBlockExtension') as $oExtensionInstance) {
|
||||
$oBlock = $oExtensionInstance->GetSouthPaneBlock();
|
||||
if ($oBlock) {
|
||||
$oFooter->AddSubBlock($oBlock);
|
||||
}
|
||||
}
|
||||
|
||||
return $oFooter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Combodo\iTop\Application\UI\iUIBlock $oBlock
|
||||
*
|
||||
@@ -824,8 +889,11 @@ EOF;
|
||||
// Layouts
|
||||
$aData['aLayouts'] = [
|
||||
'sBanner' => $this->RenderBannerHtml(),
|
||||
'oBanner' => $this->RenderBannerBlock(),
|
||||
'sHeader' => $this->RenderHeaderHtml(),
|
||||
'oHeader' => $this->RenderHeaderBlock(),
|
||||
'sFooter' => $this->RenderFooterHtml(),
|
||||
'oFooter' => $this->RenderFooterBlock(),
|
||||
];
|
||||
// - Prepare navigation menu
|
||||
$aData['aLayouts']['oNavigationMenu'] = $this->GetNavigationMenuLayout();
|
||||
|
||||
Reference in New Issue
Block a user