@@ -71,7 +71,9 @@ |
||
| 71 | 71 | $user = []; |
| 72 | 72 | $user['name'] = request('name'); |
| 73 | 73 | $user['email'] = request('email'); |
| 74 | - if(request('password')) $user['password'] = Hash::make(request('password')); |
|
| 74 | + if(request('password')) { |
|
| 75 | + $user['password'] = Hash::make(request('password')); |
|
| 76 | + } |
|
| 75 | 77 | $user['cb_roles_id'] = request('cb_roles_id'); |
| 76 | 78 | DB::table('users')->where('id',$id)->update($user); |
| 77 | 79 | |
@@ -54,9 +54,9 @@ discard block |
||
| 54 | 54 | $menu['type'] = request('type'); |
| 55 | 55 | if(request('type') == 'module') { |
| 56 | 56 | $menu['cb_modules_id'] = request('cb_modules_id'); |
| 57 | - }elseif (request('type') == 'url') { |
|
| 57 | + } elseif (request('type') == 'url') { |
|
| 58 | 58 | $menu['path'] = request('url_value'); |
| 59 | - }elseif (request('type') == 'path') { |
|
| 59 | + } elseif (request('type') == 'path') { |
|
| 60 | 60 | $menu['path'] = request('path_value'); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -79,9 +79,9 @@ discard block |
||
| 79 | 79 | $menu['type'] = request('type'); |
| 80 | 80 | if(request('type') == 'module') { |
| 81 | 81 | $menu['cb_modules_id'] = request('cb_modules_id'); |
| 82 | - }elseif (request('type') == 'url') { |
|
| 82 | + } elseif (request('type') == 'url') { |
|
| 83 | 83 | $menu['path'] = request('url_value'); |
| 84 | - }elseif (request('type') == 'path') { |
|
| 84 | + } elseif (request('type') == 'path') { |
|
| 85 | 85 | $menu['path'] = request('path_value'); |
| 86 | 86 | } |
| 87 | 87 | DB::table("cb_menus")->where("id",$id)->update($menu); |
@@ -76,45 +76,60 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | public function canBrowse() { |
| 78 | 78 | if($this->privilege) { |
| 79 | - if($this->privilege->can_browse) return true; |
|
| 80 | - else return false; |
|
| 81 | - }else{ |
|
| 79 | + if($this->privilege->can_browse) { |
|
| 80 | + return true; |
|
| 81 | + } else { |
|
| 82 | + return false; |
|
| 83 | + } |
|
| 84 | + } else{ |
|
| 82 | 85 | return true; |
| 83 | 86 | } |
| 84 | 87 | } |
| 85 | 88 | |
| 86 | 89 | public function canCreate() { |
| 87 | 90 | if($this->privilege) { |
| 88 | - if($this->privilege->can_create) return true; |
|
| 89 | - else return false; |
|
| 90 | - }else{ |
|
| 91 | + if($this->privilege->can_create) { |
|
| 92 | + return true; |
|
| 93 | + } else { |
|
| 94 | + return false; |
|
| 95 | + } |
|
| 96 | + } else{ |
|
| 91 | 97 | return true; |
| 92 | 98 | } |
| 93 | 99 | } |
| 94 | 100 | |
| 95 | 101 | public function canRead() { |
| 96 | 102 | if($this->privilege) { |
| 97 | - if($this->privilege->can_read) return true; |
|
| 98 | - else return false; |
|
| 99 | - }else{ |
|
| 103 | + if($this->privilege->can_read) { |
|
| 104 | + return true; |
|
| 105 | + } else { |
|
| 106 | + return false; |
|
| 107 | + } |
|
| 108 | + } else{ |
|
| 100 | 109 | return true; |
| 101 | 110 | } |
| 102 | 111 | } |
| 103 | 112 | |
| 104 | 113 | public function canUpdate() { |
| 105 | 114 | if($this->privilege) { |
| 106 | - if($this->privilege->can_update) return true; |
|
| 107 | - else return false; |
|
| 108 | - }else{ |
|
| 115 | + if($this->privilege->can_update) { |
|
| 116 | + return true; |
|
| 117 | + } else { |
|
| 118 | + return false; |
|
| 119 | + } |
|
| 120 | + } else{ |
|
| 109 | 121 | return true; |
| 110 | 122 | } |
| 111 | 123 | } |
| 112 | 124 | |
| 113 | 125 | public function canDelete() { |
| 114 | 126 | if($this->privilege) { |
| 115 | - if($this->privilege->can_delete) return true; |
|
| 116 | - else return false; |
|
| 117 | - }else{ |
|
| 127 | + if($this->privilege->can_delete) { |
|
| 128 | + return true; |
|
| 129 | + } else { |
|
| 130 | + return false; |
|
| 131 | + } |
|
| 132 | + } else{ |
|
| 118 | 133 | return true; |
| 119 | 134 | } |
| 120 | 135 | } |
@@ -123,7 +138,7 @@ discard block |
||
| 123 | 138 | { |
| 124 | 139 | if($this->controller_class && method_exists($this->controller_class, 'getAdd')) { |
| 125 | 140 | return action($this->controller.'@getAdd'); |
| 126 | - }else{ |
|
| 141 | + } else{ |
|
| 127 | 142 | return null; |
| 128 | 143 | } |
| 129 | 144 | } |
@@ -132,7 +147,7 @@ discard block |
||
| 132 | 147 | { |
| 133 | 148 | if($this->controller_class && method_exists($this->controller_class, 'postAddSave')) { |
| 134 | 149 | return action($this->controller.'@postAddSave'); |
| 135 | - }else{ |
|
| 150 | + } else{ |
|
| 136 | 151 | return null; |
| 137 | 152 | } |
| 138 | 153 | } |
@@ -141,7 +156,7 @@ discard block |
||
| 141 | 156 | { |
| 142 | 157 | if($this->controller_class && method_exists($this->controller_class, 'getEdit')) { |
| 143 | 158 | return action($this->controller.'@getEdit',['id'=>$id]); |
| 144 | - }else{ |
|
| 159 | + } else{ |
|
| 145 | 160 | return null; |
| 146 | 161 | } |
| 147 | 162 | } |
@@ -150,7 +165,7 @@ discard block |
||
| 150 | 165 | { |
| 151 | 166 | if(method_exists($this->controller_class, 'postEditSave')) { |
| 152 | 167 | return action($this->controller.'@postEditSave',['id'=>$id]); |
| 153 | - }else{ |
|
| 168 | + } else{ |
|
| 154 | 169 | return null; |
| 155 | 170 | } |
| 156 | 171 | } |
@@ -159,7 +174,7 @@ discard block |
||
| 159 | 174 | { |
| 160 | 175 | if($this->controller_class && method_exists($this->controller_class, 'getDetail')) { |
| 161 | 176 | return action($this->controller.'@getDetail',['id'=>$id]); |
| 162 | - }else{ |
|
| 177 | + } else{ |
|
| 163 | 178 | return null; |
| 164 | 179 | } |
| 165 | 180 | } |
@@ -168,7 +183,7 @@ discard block |
||
| 168 | 183 | { |
| 169 | 184 | if($this->controller_class && method_exists($this->controller_class, 'getDelete')) { |
| 170 | 185 | return action($this->controller.'@getDelete',['id'=>$id]); |
| 171 | - }else{ |
|
| 186 | + } else{ |
|
| 172 | 187 | return null; |
| 173 | 188 | } |
| 174 | 189 | } |
@@ -177,7 +192,7 @@ discard block |
||
| 177 | 192 | { |
| 178 | 193 | if($this->controller_class && method_exists($this->controller_class, 'getIndex')) { |
| 179 | 194 | return trim(action($this->controller.'@getIndex').'/'.$path,'/'); |
| 180 | - }else{ |
|
| 195 | + } else{ |
|
| 181 | 196 | return null; |
| 182 | 197 | } |
| 183 | 198 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | { |
| 23 | 23 | if($column->getFormat()) { |
| 24 | 24 | return date($column->getFormat(), strtotime($row->{$column->getField()})); |
| 25 | - }else{ |
|
| 25 | + } else{ |
|
| 26 | 26 | return $row->{$column->getField()}; |
| 27 | 27 | } |
| 28 | 28 | } |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $data = DB::table($table); |
| 37 | 37 | if($SQLCondition && is_callable($SQLCondition)) { |
| 38 | 38 | $data = call_user_func($SQLCondition, $data); |
| 39 | - }elseif ($SQLCondition && is_string($SQLCondition)) { |
|
| 39 | + } elseif ($SQLCondition && is_string($SQLCondition)) { |
|
| 40 | 40 | $data->whereRaw($SQLCondition); |
| 41 | 41 | } |
| 42 | 42 | $data = $data->get(); |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $data = DB::table($table); |
| 37 | 37 | if($SQLCondition && is_callable($SQLCondition)) { |
| 38 | 38 | $data = call_user_func($SQLCondition, $data); |
| 39 | - }elseif ($SQLCondition && is_string($SQLCondition)) { |
|
| 39 | + } elseif ($SQLCondition && is_string($SQLCondition)) { |
|
| 40 | 40 | $data->whereRaw($SQLCondition); |
| 41 | 41 | } |
| 42 | 42 | $data = $data->get(); |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | { |
| 23 | 23 | if($column->getFormat()) { |
| 24 | 24 | return date($column->getFormat(), strtotime($row->{$column->getField()})); |
| 25 | - }else{ |
|
| 25 | + } else{ |
|
| 26 | 26 | return $row->{$column->getField()}; |
| 27 | 27 | } |
| 28 | 28 | } |
@@ -28,8 +28,11 @@ |
||
| 28 | 28 | { |
| 29 | 29 | $user = $this->user(); |
| 30 | 30 | $role = cb()->find("cb_roles", $user->cb_roles_id); |
| 31 | - if($role) return $role->name; |
|
| 32 | - else return null; |
|
| 31 | + if($role) { |
|
| 32 | + return $role->name; |
|
| 33 | + } else { |
|
| 34 | + return null; |
|
| 35 | + } |
|
| 33 | 36 | } |
| 34 | 37 | |
| 35 | 38 | public function roleId() |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | /** @var ColumnModel $column */ |
| 50 | 50 | if($data_row) { |
| 51 | 51 | $value = (isset($data_row->{$column->getField()}))?$data_row->{ $column->getField() }:null; |
| 52 | - }else{ |
|
| 52 | + } else{ |
|
| 53 | 53 | $value = request($column->getName()); |
| 54 | 54 | |
| 55 | 55 | if(!$value && $column->getDefaultValue()) { |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | foreach($column->getValue() as $key=>$val) { |
| 140 | 140 | $data[$key] = $val; |
| 141 | 141 | } |
| 142 | - }else{ |
|
| 142 | + } else{ |
|
| 143 | 143 | $data[$column->getField()] = $column->getValue(); |
| 144 | 144 | } |
| 145 | 145 | } |