| 1 |
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly |
| 2 |
class SH4_Ical_Boot |
| 3 |
{ |
| 4 |
public function __construct( |
| 5 |
HC3_Acl $acl, |
| 6 |
HC3_Router $router, |
| 7 |
HC3_Hooks $hooks |
| 8 |
) |
| 9 |
{ |
| 10 |
$hooks |
| 11 |
->add( 'sh4/users/html/user/view/profile::menu::after', function( $return ){ |
| 12 |
$return['ical'] = array( 'user/profile/ical', '__iCal Sync__' ); |
| 13 |
return $return; |
| 14 |
}) |
| 15 |
; |
| 16 |
|
| 17 |
$router |
| 18 |
->register( 'get:ical/{token}', array('SH4_Ical_View', 'render') ) |
| 19 |
->register( 'get:ical/{token}/{calendar}', array('SH4_Ical_View', 'render') ) |
| 20 |
->register( 'get:ical/{token}/{calendar}/{employee}', array('SH4_Ical_View', 'render') ) |
| 21 |
|
| 22 |
// v3 compat |
| 23 |
->register( 'get:ical/export/{token}', array('SH4_Ical_View', 'render') ) |
| 24 |
->register( 'get:ical/export/{token}/{calendar}', array('SH4_Ical_View', 'render') ) |
| 25 |
|
| 26 |
->register( 'get:user/profile/ical', array('SH4_Ical_Html_User_View_Profile_Ical', 'render') ) |
| 27 |
->register( 'post:user/profile/ical', array('SH4_Ical_Html_User_View_Profile_Ical', 'post') ) |
| 28 |
; |
| 29 |
|
| 30 |
$acl |
| 31 |
->register( 'get:user/profile/ical', array('SH4_App_Acl', 'checkUserProfile') ) |
| 32 |
; |
| 33 |
} |
| 34 |
} |