N°7565 - Polishing Newsroom - Add subtitle and user icon

This commit is contained in:
vdumas
2024-06-06 17:40:59 +02:00
parent 9d1c66296b
commit 02a5630f62
4 changed files with 56 additions and 37 deletions

View File

@@ -35,6 +35,7 @@ use SecurityException;
use URLPopupMenuItem;
use UserRights;
use utils;
use appUserPreferences;
/**
@@ -61,6 +62,13 @@ class iTopNewsroomController extends Controller
// Add title block
// Make bulk actions block
$oBulkActionsBlock = PanelUIBlockFactory::MakeForInformation(Dict::S('UI:Newsroom:iTopNotification:ViewAllPage:Title'));
$oBulkActionsBlock->AddSubTitleBlock(new Html(Dict::S('UI:Newsroom:iTopNotification:ViewAllPage:SubTitle')));
$sPictureUrl = UserRights::GetUserPictureAbsUrl();
if (empty($sPictureUrl)) {
$sPictureUrl = utils::GetAbsoluteUrlAppRoot().'images/user-pictures/'.appUserPreferences::GetPref('user_picture_placeholder', 'user-profile-default-256px.png');
}
$oBulkActionsBlock->SetIcon($sPictureUrl,Panel::ENUM_ICON_COVER_METHOD_CONTAIN, true);
$oNotificationsCenterButton = ButtonUIBlockFactory::MakeIconLink(
'fas fa-cogs',
Dict::S('UI:NotificationsCenter:Panel:Title'),

View File

@@ -19,6 +19,8 @@ use Dict;
use Exception;
use MetaModel;
use utils;
use UserRights;
use appUserPreferences;
/**
@@ -58,7 +60,14 @@ class NotificationsCenterController extends Controller
// Create a panel that will contain the table
$oNotificationsPanel = new Panel(Dict::S('UI:NotificationsCenter:Panel:Title'), array(), 'grey', 'ibo-notifications-center');
$oNotificationsPanel->AddCSSClass('ibo-datatable-panel');
$oSubtitleBlock = new UIContentBlock(null, ['ibo-notifications-center--sub-title']);
$oNotificationsPanel->AddSubTitleBlock(new Html(Dict::S('UI:NotificationsCenter:Panel:SubTitle')));
$sPictureUrl = UserRights::GetUserPictureAbsUrl();
if (empty($sPictureUrl)) {
$sPictureUrl = utils::GetAbsoluteUrlAppRoot().'images/user-pictures/'.appUserPreferences::GetPref('user_picture_placeholder', 'user-profile-default-256px.png');
}
$oNotificationsPanel->SetIcon($sPictureUrl,Panel::ENUM_ICON_COVER_METHOD_CONTAIN, true);
$oNotificationsCenterTableColumns = [
'trigger' => array('label' => MetaModel::GetName('Trigger')),
'trigger_class' => array('label' => MetaModel::GetAttributeDef('Trigger', 'finalclass')->GetLabel()),