WidgetLatestNotifications Class Reference
Shows latest notifications. More...
Inheritance diagram for
WidgetLatestNotifications:
Public Member Functions |
|
__construct ($page_data, $user, $num) | |
render ($policy=self::NONE) | |
Renders. |
|
Static Public Member Functions |
|
static | output ($page_data, $user, $num=5, $policy=self::NONE) |
Output latest notifications. |
|
Public Attributes |
|
$num | |
$page_data | |
$user |
Detailed Description
Shows latest notifications.
Definition at line 5 of file notifications.latest.widget.php.
Constructor & Destructor Documentation
WidgetLatestNotifications::__construct | ( | $ | page_data, | |
$ | user, | |||
$ | num | |||
) |
Definition at line 32 of file notifications.latest.widget.php.
00032 { 00033 $this->page_data = $page_data; 00034 $this->user = $user; 00035 $this->num = $num; 00036 }
Member Function Documentation
static WidgetLatestNotifications::output | ( | $ | page_data, | |
$ | user, | |||
$ | num = 5 , |
|||
$ | policy =
self::NONE |
|||
) | [static] |
Output latest notifications.
- Parameters:
-
DAOUsers $user int $policy
- Returns:
- string
Definition at line 27 of file notifications.latest.widget.php.
00027 { 00028 $w = new WidgetLatestNotifications($page_data, $user, $num); 00029 return $w->render($policy); 00030 }
WidgetLatestNotifications::render | ( | $ | policy =
self::NONE |
) |
Renders.
- Parameters:
-
int $policy
- Returns:
- string
Implements IRenderer.
Definition at line 44 of file notifications.latest.widget.php.
00044 { 00045 Load::models('notifications'); 00046 $notifications = Notifications::create_unread_user_adapter($this->user->id); 00047 $total = $notifications->count(); 00048 $notifications->limit(0, $this->num); 00049 00050 $view = ViewFactory::create_view(IViewFactory::MESSAGE, 'widgets/notifications.latest', false); 00051 $view->assign('notifications', $notifications->execute()); 00052 $view->assign('total', $total); 00053 $view->assign('page_data', $this->page_data); 00054 return $view->render(); 00055 }
Member Data Documentation
WidgetLatestNotifications::$num |
Definition at line 18 of file notifications.latest.widget.php.
WidgetLatestNotifications::$page_data |
Definition at line 11 of file notifications.latest.widget.php.
WidgetLatestNotifications::$user |
Definition at line 17 of file notifications.latest.widget.php.
The documentation for this class was generated from the following file:
- contributions/usermanagement.notifications/view/widgets/notifications.latest.widget.php