Browse Source

Dashboard : wip

idleman 2 years ago
parent
commit
cc71751332
1 changed files with 6 additions and 4 deletions
  1. 6 4
      plugin/notification/notification.plugin.php

+ 6 - 4
plugin/notification/notification.plugin.php

@@ -229,9 +229,10 @@ Plugin::addHook('widget',function(&$models){
 			require_once(__DIR__.SLASH.'Notification.class.php');
 			require_once(__DIR__.SLASH.'UserNotification.class.php');
 
-			$types = isset($widget->meta['types'])? $widget->meta['types'] :array('announcement');
+			$types = isset($widget->meta['types'])? explode(',',$widget->meta['types']) :array('announcement');
 			$max = isset($widget->meta['notification-number'])?$widget->meta['notification-number']:5;
 			$maxlength = isset($widget->meta['notification-length'])?$widget->meta['notification-length']:250 ;
+			
 			$userNotifications = UserNotification::byUser($myUser,array(
 				'limit' => $max,
 				'unread' => false,
@@ -239,8 +240,8 @@ Plugin::addHook('widget',function(&$models){
 			));
 
 			?>
-			<div class="notification-container">
-				<h5 class="text-uppercase w-100 text-center"><i class="far fa-bell"></i> Alertes</h5>
+			<div class="notification-container w-100">
+				<h5 class="text-uppercase text-center"><i class="far fa-bell"></i> Alertes</h5>
 				<ul class="notification-widget-list">
 				<?php foreach($userNotifications  as $infos):
 					$infos['created-relative'] = isset($_['synthesis']) ? relative_time($infos['created'], null, 7) : relative_time($infos['created'], null, 7, true);
@@ -270,7 +271,8 @@ Plugin::addHook('widget',function(&$models){
 			require_once(__DIR__.SLASH.'Notification.class.php');
 			ob_start();
 
-			$selectedTypes =  isset($widget->meta['types'])? $widget->meta['types'] :array('announcement');
+	
+			$selectedTypes =  isset($widget->meta['types'])? explode(',',$widget->meta['types']) :array('announcement');
 			$max =  isset($widget->meta['notification-number'])?$widget->meta['notification-number']:5;
 			$maxlength =  isset($widget->meta['notification-length'])?$widget->meta['notification-length']:250 ;
 			?>