diff --git a/sources/application/WebPage/iTopWebPage.php b/sources/application/WebPage/iTopWebPage.php index f941d9c14b..6e6e49a9a6 100644 --- a/sources/application/WebPage/iTopWebPage.php +++ b/sources/application/WebPage/iTopWebPage.php @@ -19,6 +19,7 @@ use Combodo\iTop\Application\TwigBase\Twig\TwigHelper; +use Combodo\iTop\Application\UI\Base\Component\Alert\AlertFactory; use Combodo\iTop\Application\UI\Base\Component\Breadcrumbs\Breadcrumbs; use Combodo\iTop\Application\UI\Base\Component\Panel\PanelFactory; use Combodo\iTop\Application\UI\Base\iUIBlock; @@ -671,6 +672,7 @@ JS $sBannerHtml = ''; // 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 + /** @var \iPageUIExtension $oExtensionInstance */ foreach (MetaModel::EnumPlugins('iPageUIExtension') as $oExtensionInstance) { $sBannerHtml .= $oExtensionInstance->GetBannerHtml($this); @@ -693,6 +695,7 @@ JS $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 + /** @var \iPageUIBlockExtension $oExtensionInstance */ foreach (MetaModel::EnumPlugins('iPageUIBlockExtension') as $oExtensionInstance) { $oBlock = $oExtensionInstance->GetBannerBlock(); @@ -717,63 +720,8 @@ JS { $sHeaderHtml = ''; - //TODO: NB the whole section needs to be refactored - - if (UserRights::IsAdministrator() && ExecutionKPI::IsEnabled()) - { - // TODO 3.0.0: Don't forget this dude! - $sHeaderHtml .= '
'; - } - - // TODO 3.0.0: Don't forget this! - if (utils::IsArchiveMode()) - { - $sIcon = ''; - $this->AddApplicationMessage(Dict::S('UI:ArchiveMode:Banner'), $sIcon, Dict::S('UI:ArchiveMode:Banner+')); - } - - // TODO 3.0.0: Move this in the Header method - $sRestrictions = ''; - if (!MetaModel::DBHasAccess(ACCESS_ADMIN_WRITE)) - { - if (!MetaModel::DBHasAccess(ACCESS_ADMIN_WRITE)) - { - $sRestrictions = Dict::S('UI:AccessRO-All'); - } - } - elseif (!MetaModel::DBHasAccess(ACCESS_USER_WRITE)) - { - $sRestrictions = Dict::S('UI:AccessRO-Users'); - } - if (strlen($sRestrictions) > 0) - { - $sIcon = - <<