PluginProbe
ShiftController Employee Shift Scheduling / 4.9.65
ShiftController Employee Shift Scheduling v4.9.65
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.65, at sh4/users/html/user/view/profile.php

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