mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-29 05:28:44 +02:00
N°2847 - Refactor some early choices
- TWIG: Change calls to object methods from simple notation (eg. oObject.Id) to complete notation (eg. oObject.GetId()) to avoid confusion with use of arrays and variables (eg. aObject.sId) - UIBlock: $sId should not be first parameter as most of the time it can be ignored and generated by the system - NewsroomMenu: Rename method for something more less ambiguous - Html: Embed content in <div /> so we can easily find all such HTML fragments in the UI
This commit is contained in:
@@ -72,17 +72,18 @@ class NavigationMenu extends UIBlock
|
||||
/**
|
||||
* NavigationMenu constructor.
|
||||
*
|
||||
* @param string|null $sId
|
||||
* @param \ApplicationContext $oAppContext
|
||||
* @param \Combodo\iTop\Application\UI\Component\PopoverMenu\PopoverMenu $oUserMenu
|
||||
* @param \Combodo\iTop\Application\UI\Component\PopoverMenu\NewsroomMenu\NewsroomMenu|null $oNewsroomMenu
|
||||
* @param string|null $sId
|
||||
*
|
||||
* @throws \CoreException
|
||||
* @throws \CoreUnexpectedValue
|
||||
* @throws \DictExceptionMissingString
|
||||
* @throws \MySQLException
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function __construct($sId, ApplicationContext $oAppContext, PopoverMenu $oUserMenu, NewsroomMenu $oNewsroomMenu = null)
|
||||
public function __construct(ApplicationContext $oAppContext, PopoverMenu $oUserMenu, NewsroomMenu $oNewsroomMenu = null, $sId = null)
|
||||
{
|
||||
parent::__construct($sId);
|
||||
|
||||
|
||||
@@ -54,10 +54,7 @@ class NavigationMenuFactory
|
||||
}
|
||||
|
||||
return new NavigationMenu(
|
||||
NavigationMenu::BLOCK_CODE,
|
||||
new ApplicationContext(),
|
||||
PopoverMenuFactory::MakeUserMenuForNavigationMenu(),
|
||||
$oNewsroomMenu
|
||||
new ApplicationContext(), PopoverMenuFactory::MakeUserMenuForNavigationMenu(), $oNewsroomMenu, NavigationMenu::BLOCK_CODE
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user