PluginProbe
ShiftController Employee Shift Scheduling / 4.9.95
ShiftController Employee Shift Scheduling v4.9.95
4.9.97 4.9.96 4.9.95 4.9.74 4.9.75 4.9.76 4.9.77 4.9.78 4.9.84 4.9.85 4.9.87 4.9.91 4.9.92 trunk 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 3.2.4 All 38 releases
shiftcontroller / sh4 / notifications / html / user / view / profile / notifications.php

notifications.php in ShiftController Employee Shift Scheduling 4.9.95, at sh4/notifications/html/user/view/profile/notifications.php

77 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
2 #[AllowDynamicProperties]
3 class SH4_Notifications_Html_User_View_Profile_Notifications
4 {
5 public function __construct(
6 HC3_Hooks $hooks,
7 HC3_Ui $ui,
8 HC3_Ui_Layout1 $layout,
9
10 HC3_Auth $auth,
11 HC3_Notificator $notificator
12 )
13 {
14 $this->self = $hooks->wrap($this);
15
16 $this->ui = $ui;
17 $this->layout = $layout;
18
19 $this->auth = $hooks->wrap( $auth );
20 $this->notificator = $hooks->wrap( $notificator );
21 }
22
23 public function render()
24 {
25 $user = $this->auth->getCurrentUser();
26
27 $form = $this->ui->makeForm(
28 'user/profile/notifications',
29 $this->self->form( $user )
30 );
31
32 $this->layout
33 ->setContent( $form )
34 ->setBreadcrumb( $this->self->breadcrumb() )
35 ->setHeader( $this->self->header() )
36 ;
37
38 $out = $this->layout->render();
39 return $out;
40 }
41
42 public function header()
43 {
44 $out = '__Notifications__';
45 return $out;
46 }
47
48 public function breadcrumb()
49 {
50 $return = array();
51 $return['profile'] = array( 'user/profile', '__Profile__' );
52 return $return;
53 }
54
55 public function form( HC3_Users_Model $user )
56 {
57 $id = $user->getId();
58
59 $on = ! $this->notificator->isOnForUser( $user );
60
61 $inputs = $this->ui->makeList()
62 ->add( $this->ui->makeInputCheckbox( 'turnoff', '__Turn Off Notifications__', 1, $on ) )
63 ;
64
65 $buttons = $this->ui->makeInputSubmit( '__Save__' )
66 ->tag('primary')
67 ;
68
69 $out = $this->ui->makeList()
70 ->add( $inputs )
71 ->add( $buttons )
72 ;
73
74 return $out;
75 }
76
77 }