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:
Molkobain
2020-08-21 13:07:07 +02:00
parent 5320f69c44
commit d2bf4de84c
24 changed files with 94 additions and 65 deletions

View File

@@ -46,20 +46,26 @@ class NewsroomMenuFactory
public static function MakeNewsroomMenuForNavigationMenu()
{
$oMenu = new NewsroomMenu('ibo-navigation-menu--notifications-menu');
$oMenu->SetParams(static::PrepareNewsForNewsroomMenu());
$oMenu->SetParams(static::PrepareParametersForNewsroomMenu());
return $oMenu;
}
protected static function PrepareNewsForNewsroomMenu()
/**
* Prepare parameters for the newsroom JS widget
*
* @return array
* @throws \CoreException
* @throws \CoreUnexpectedValue
* @throws \MySQLException
* @throws \OQLException
*/
protected static function PrepareParametersForNewsroomMenu()
{
$aItems = [];
$aProviderParams=[];
$oUser = UserRights::GetUserObject();
/**
* @var iNewsroomProvider[] $aProviders
* @var \iNewsroomProvider[] $aProviders
*/
$aProviders = MetaModel::EnumPlugins('iNewsroomProvider');
foreach($aProviders as $oProvider)