PluginProbe
ShiftController Employee Shift Scheduling / 3.2.4
ShiftController Employee Shift Scheduling v3.2.4
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 / application / controllers / admin / users.php

users.php in ShiftController Employee Shift Scheduling 3.2.4, at application/controllers/admin/users.php

116 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if (!defined('BASEPATH')) exit('No direct script access allowed');
2
3 class Users_Admin_HC_Controller extends _Backend_HC_controller
4 {
5 function __construct()
6 {
7 parent::__construct( USER_HC_MODEL::LEVEL_ADMIN );
8 }
9
10 function index( $tab = 'list' )
11 {
12 $model = HC_App::model('user');
13
14 $layout = clone $this->layout;
15
16 /* build content */
17 $content = '';
18 $method = '_content_' . $tab;
19 if( method_exists($this, $method) ){
20 $content = $this->{$method}( $model );
21 }
22 else {
23 $extensions = HC_App::extensions();
24 if( $extensions->has(array('admin/users/index', $tab)) ){
25 $calling_parent = 'admin/users/index' . '/' . $tab;
26
27 $content = $extensions->run(
28 array('admin/users/index', $tab, $calling_parent)
29 );
30 }
31 }
32
33 $layout->set_partial(
34 'content',
35 $content
36 );
37
38 /* header */
39 $layout->set_partial(
40 'header',
41 $this->render(
42 'admin/users/index/_header',
43 array(
44 )
45 )
46 );
47
48 /* menubar */
49 $layout->set_partial(
50 'menubar',
51 $this->render(
52 'admin/users/index/_menubar',
53 array(
54 'tab' => $tab,
55 'object' => $model,
56 )
57 )
58 );
59
60 /* final layout */
61 $this->layout->set_partial(
62 'content',
63 $this->render(
64 'admin/users/index/index',
65 array(
66 'layout' => $layout,
67 )
68 )
69 );
70 $this->layout();
71 }
72
73 private function _content_list( $model )
74 {
75 $model = HC_App::model('user');
76 $model->get();
77 return $this->render(
78 'admin/users/index/list',
79 array(
80 'entries' => $model
81 )
82 );
83 }
84
85 private function _content_add( $model )
86 {
87 return Modules::run('admin/users/add/index');
88 }
89
90 function delete( $id )
91 {
92 $model = HC_App::model('user');
93 $model
94 ->where('id', $id)
95 ->get()
96 ;
97 $this->_check_model( $model );
98
99 if( $model->delete() ){
100 $msg = HCM::__('User deleted');
101 $this->session->set_flashdata( 'message', $msg );
102 }
103 else {
104 $errors = $model->errors();
105 $msg = HCM::__('Error') . ': ' . join(' ', $errors);
106 $this->session->set_flashdata( 'error', $msg );
107 }
108
109 $redirect_to = 'admin/users';
110 $this->redirect( $redirect_to );
111 return;
112 }
113 }
114
115 /* End of file customers.php */
116 /* Location: ./application/controllers/admin/categories.php */