@@ -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 | } |
@@ -61,7 +61,9 @@ |
||
| 61 | 61 | $scaffold = ""; |
| 62 | 62 | foreach($fields as $field) { |
| 63 | 63 | |
| 64 | - if(in_array($field, $exceptions)) continue; |
|
| 64 | + if(in_array($field, $exceptions)) { |
|
| 65 | + continue; |
|
| 66 | + } |
|
| 65 | 67 | |
| 66 | 68 | $fielLabel = ucwords(str_replace("_"," ",$field)); |
| 67 | 69 | $scaffold .= '$this->addText("'.$fielLabel.'");'."\n\t\t"; |
@@ -29,14 +29,16 @@ |
||
| 29 | 29 | { |
| 30 | 30 | foreach ( $_POST as $key => $value ) |
| 31 | 31 | { |
| 32 | - if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
| 33 | - continue; |
|
| 32 | + if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) { |
|
| 33 | + continue; |
|
| 34 | + } |
|
| 34 | 35 | |
| 35 | - if ( get_magic_quotes_gpc() ) |
|
| 36 | - $value = htmlspecialchars( stripslashes((string)$value) ); |
|
| 37 | - else |
|
| 38 | - $value = htmlspecialchars( (string)$value ); |
|
| 39 | -?> |
|
| 36 | + if ( get_magic_quotes_gpc() ) { |
|
| 37 | + $value = htmlspecialchars( stripslashes((string)$value) ); |
|
| 38 | + } else { |
|
| 39 | + $value = htmlspecialchars( (string)$value ); |
|
| 40 | + } |
|
| 41 | + ?> |
|
| 40 | 42 | <tr> |
| 41 | 43 | <th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th> |
| 42 | 44 | <td><pre class="samples"><?php echo $value; ?></pre></td> |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $this->info("== Generating Seeder =="); |
| 37 | 37 | $this->generateSeeder(); |
| 38 | 38 | $this->info("== Finish =="); |
| 39 | - }else{ |
|
| 39 | + } else{ |
|
| 40 | 40 | $this->info("== Importing the seeder =="); |
| 41 | 41 | $this->call("db:seed",["--class"=>"CbMigrationSeeder"]); |
| 42 | 42 | $this->info("== Finish =="); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $composer_path = ''; |
| 92 | 92 | if (file_exists(getcwd().'/composer.phar')) { |
| 93 | 93 | $composer_path = '"'.PHP_BINARY.'" '.getcwd().'/composer.phar'; |
| 94 | - }else{ |
|
| 94 | + } else{ |
|
| 95 | 95 | $composer_path = 'composer'; |
| 96 | 96 | } |
| 97 | 97 | |
@@ -30,10 +30,10 @@ discard block |
||
| 30 | 30 | $key = $parameters[0]; |
| 31 | 31 | if(isset($this->data[$key])) { |
| 32 | 32 | return $this->data[$key]; |
| 33 | - }else{ |
|
| 33 | + } else{ |
|
| 34 | 34 | return null; |
| 35 | 35 | } |
| 36 | - }else{ |
|
| 36 | + } else{ |
|
| 37 | 37 | return null; |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | if(Schema::hasColumn($this->data['table'], $column->getField())) { |
| 78 | 78 | $query->addSelect($this->data['table'].'.'.$column->getField()); |
| 79 | 79 | } |
| 80 | - }else{ |
|
| 80 | + } else{ |
|
| 81 | 81 | $query->addSelect($column->getField()); |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | if(isset($this->data['hook_search_query'])) { |
| 91 | 91 | $query = call_user_func($this->data['hook_search_query'], $query); |
| 92 | - }else{ |
|
| 92 | + } else{ |
|
| 93 | 93 | $query->where(function ($where) use ($columns) { |
| 94 | 94 | /** |
| 95 | 95 | * @var $where Builder |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | { |
| 99 | 99 | if(strpos($column->getField(),".") === false) { |
| 100 | 100 | $field = $this->data['table'].'.'.$column->getField(); |
| 101 | - }else{ |
|
| 101 | + } else{ |
|
| 102 | 102 | $field = $column->getField(); |
| 103 | 103 | } |
| 104 | 104 | $where->orWhere($field, 'like', '%'.request('q').'%'); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | if(in_array(request('order_by'),columnSingleton()->getColumnNameOnly())) { |
| 118 | 118 | $query->orderBy(request('order_by'), request('order_sort')); |
| 119 | 119 | } |
| 120 | - }else{ |
|
| 120 | + } else{ |
|
| 121 | 121 | $query->orderBy($this->data['table'].'.'.cb()->findPrimaryKey($this->data['table']), "desc"); |
| 122 | 122 | } |
| 123 | 123 | |
@@ -126,7 +126,9 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | public function getIndex() |
| 128 | 128 | { |
| 129 | - if(!module()->canBrowse()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area"); |
|
| 129 | + if(!module()->canBrowse()) { |
|
| 130 | + return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area"); |
|
| 131 | + } |
|
| 130 | 132 | |
| 131 | 133 | $query = $this->repository(); |
| 132 | 134 | $result = $query->paginate(20); |
@@ -153,7 +155,9 @@ discard block |
||
| 153 | 155 | |
| 154 | 156 | public function getAdd() |
| 155 | 157 | { |
| 156 | - if(!module()->canCreate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area"); |
|
| 158 | + if(!module()->canCreate()) { |
|
| 159 | + return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area"); |
|
| 160 | + } |
|
| 157 | 161 | |
| 158 | 162 | $data = []; |
| 159 | 163 | $data['page_title'] = $this->data['page_title'].' : Add'; |
@@ -163,7 +167,9 @@ discard block |
||
| 163 | 167 | |
| 164 | 168 | public function postAddSave() |
| 165 | 169 | { |
| 166 | - if(!module()->canCreate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area"); |
|
| 170 | + if(!module()->canCreate()) { |
|
| 171 | + return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area"); |
|
| 172 | + } |
|
| 167 | 173 | |
| 168 | 174 | try { |
| 169 | 175 | $this->validation(); |
@@ -204,7 +210,9 @@ discard block |
||
| 204 | 210 | |
| 205 | 211 | public function getEdit($id) |
| 206 | 212 | { |
| 207 | - if(!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area"); |
|
| 213 | + if(!module()->canUpdate()) { |
|
| 214 | + return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area"); |
|
| 215 | + } |
|
| 208 | 216 | |
| 209 | 217 | $data = []; |
| 210 | 218 | $data['row'] = $this->repository()->where($this->data['table'].'.'.getPrimaryKey($this->data['table']), $id)->first(); |
@@ -215,7 +223,9 @@ discard block |
||
| 215 | 223 | |
| 216 | 224 | public function postEditSave($id) |
| 217 | 225 | { |
| 218 | - if(!module()->canUpdate()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area"); |
|
| 226 | + if(!module()->canUpdate()) { |
|
| 227 | + return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area"); |
|
| 228 | + } |
|
| 219 | 229 | |
| 220 | 230 | try { |
| 221 | 231 | $this->validation(); |
@@ -259,7 +269,9 @@ discard block |
||
| 259 | 269 | |
| 260 | 270 | public function getDelete($id) |
| 261 | 271 | { |
| 262 | - if(!module()->canDelete()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area"); |
|
| 272 | + if(!module()->canDelete()) { |
|
| 273 | + return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area"); |
|
| 274 | + } |
|
| 263 | 275 | |
| 264 | 276 | if(isset($this->data['hook_before_delete']) && is_callable($this->data['hook_before_delete'])) { |
| 265 | 277 | call_user_func($this->data['hook_before_delete'], $id); |
@@ -286,7 +298,9 @@ discard block |
||
| 286 | 298 | |
| 287 | 299 | public function getDetail($id) |
| 288 | 300 | { |
| 289 | - if(!module()->canRead()) return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area"); |
|
| 301 | + if(!module()->canRead()) { |
|
| 302 | + return cb()->redirect(cb()->getAdminUrl(),"You do not have a privilege access to this area"); |
|
| 303 | + } |
|
| 290 | 304 | |
| 291 | 305 | $data = []; |
| 292 | 306 | $data['row'] = $this->repository()->where($this->data['table'].'.'.getPrimaryKey($this->data['table']), $id)->first(); |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | { |
| 33 | 33 | if($this->option("password") == "AUTO") { |
| 34 | 34 | $password = Str::random(16); |
| 35 | - }else{ |
|
| 35 | + } else{ |
|
| 36 | 36 | $password = $this->option("password"); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | foreach($tables as $table) { |
| 38 | 38 | $this->generate($table); |
| 39 | 39 | } |
| 40 | - }else{ |
|
| 40 | + } else{ |
|
| 41 | 41 | $this->generate($option); |
| 42 | 42 | } |
| 43 | 43 | } |