PluginProbe
ShiftController Employee Shift Scheduling / 4.9.26
ShiftController Employee Shift Scheduling v4.9.26
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 / users / html / user / view / profile.php

profile.php in ShiftController Employee Shift Scheduling 4.9.26, at sh4/users/html/user/view/profile.php

84 lines 1.8 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_Users_Html_User_View_Profile
3 {
4 public function __construct(
5 SH4_App_Acl $appAcl,
6
7 HC3_Auth $auth,
8 HC3_IPermission $permission,
9 SH4_App_Query $appQuery,
10
11 HC3_Ui $ui,
12 HC3_Ui_Layout1 $layout,
13
14 HC3_Hooks $hooks
15 )
16 {
17 $this->ui = $ui;
18 $this->layout = $layout;
19
20 $this->auth = $hooks->wrap( $auth );
21 $this->permission = $hooks->wrap( $permission );
22 $this->appQuery = $hooks->wrap( $appQuery );
23 $this->appAcl = $hooks->wrap( $appAcl );
24
25 $this->self = $hooks->wrap($this);
26 }
27
28 public function render()
29 {
30 $options = $this->self->menu();
31 $out = array();
32 foreach( $options as $item ){
33 list( $href, $label ) = $item;
34 $this_menu = $this->ui->makeAhref( $href, $label )
35 ->tag('tab-link')
36 ;
37 $out[] = $this_menu;
38 }
39 $out = $this->ui->makeList( $out );
40
41 $this->layout
42 ->setContent( $out )
43 ->setBreadcrumb( $this->self->breadcrumb() )
44 ->setHeader( $this->self->header() )
45 // ->setMenu( $this->self->menu() )
46 ;
47
48 $out = $this->layout->render();
49 return $out;
50 }
51
52 public function menu()
53 {
54 $ret = array();
55
56 // if have roles
57 if( $this->appAcl->checkUserProfile() ){
58 $ret['roles'] = array( 'user/profile/roles', '__My Roles__' );
59 }
60
61 if( ! defined('WPINC') ){
62 $ret['profile'] = array( 'user/profile/edit', '__Edit My Details__' );
63 }
64
65 return $ret;
66 }
67
68 public function header()
69 {
70 $out = '__Profile__';
71 return $out;
72 }
73
74 public function breadcrumb()
75 {
76 $return = array();
77 // $return['admin'] = array( 'admin', '__Administration__' );
78 if( defined('WPINC') && (! is_admin()) ){
79 $return['schedule'] = array( '', '&larr; ' . '__Schedule__' );
80 }
81
82 return $return;
83 }
84 }