PluginProbe
ShiftController Employee Shift Scheduling / 4.9.24
ShiftController Employee Shift Scheduling v4.9.24
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 / schedule / boot.php

boot.php in ShiftController Employee Shift Scheduling 4.9.24, at sh4/schedule/boot.php

42 lines 1.3 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 class SH4_Schedule_Boot
3 {
4 public function __construct(
5 HC3_Dic $dic,
6 HC3_Hooks $hooks,
7 HC3_Ui_Topmenu $topmenu,
8 HC3_Router $router,
9 HC3_Acl $acl
10 )
11 {
12 $dic->bind( 'SH4_Permission', 'HC3_IPermission' );
13
14 $acl
15 ->register( 'get:myschedule', array('SH4_Schedule_Acl', 'checkMy') )
16 ;
17 $scheduleParams = array('type' => NULL, 'groupby' => NULL, 'start' => NULL, 'end' => NULL);
18
19 $everyoneLabel = '__Schedule__';
20 $toCheck = 'myschedule';
21 if( $acl->check('get:' . $toCheck) ){
22 $everyoneLabel = "__Everyone's Schedule__";
23 }
24
25 $topmenu
26 ->addBefore( NULL, 'myschedule', array( array('myschedule', $scheduleParams), '__My Schedule__') )
27 ->addBefore( NULL, 'schedule', array( array('schedule', $scheduleParams), $everyoneLabel) )
28 ;
29
30 $router
31 ->register( 'get:schedule', array('SH4_Schedule_Html_View_Index', 'render') )
32 ->register( 'get:myschedule', array('SH4_Schedule_Html_View_Index', 'renderMy') )
33
34 ->register( 'post:schedule/dates', array('SH4_Schedule_Html_Controller_Dates', 'execute') )
35 ->register( 'post:schedule/exacttime', array('SH4_Schedule_Html_Controller_ExactTime', 'execute') )
36 ;
37
38 $acl
39 ->register( 'get:myschedule', array('SH4_Schedule_Acl', 'checkMy') )
40 ;
41 }
42 }