@@ -26,12 +26,12 @@ |
||
| 26 | 26 | |
| 27 | 27 | public function indexRender($row, $column) |
| 28 | 28 | { |
| 29 | - return (isset($row->{$column->getField()}))?$row->{ $column->getField() }:null; |
|
| 29 | + return (isset($row->{$column->getField()})) ? $row->{ $column->getField() }:null; |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | public function detailRender($row, $column) |
| 33 | 33 | { |
| 34 | - return (isset($row->{$column->getField()}))?$row->{ $column->getField() }:null; |
|
| 34 | + return (isset($row->{$column->getField()})) ? $row->{ $column->getField() }:null; |
|
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | /** |
@@ -14,21 +14,21 @@ |
||
| 14 | 14 | { |
| 15 | 15 | public function postUploadImage() |
| 16 | 16 | { |
| 17 | - if(auth()->guest()) return redirect(cb()->getLoginUrl()); |
|
| 17 | + if (auth()->guest()) return redirect(cb()->getLoginUrl()); |
|
| 18 | 18 | |
| 19 | 19 | $file = null; |
| 20 | 20 | try { |
| 21 | 21 | |
| 22 | 22 | cb()->validation([ |
| 23 | - 'userfile' => 'required|mimes:' . implode(",",config('crudbooster.UPLOAD_IMAGE_EXTENSION_ALLOWED')) |
|
| 23 | + 'userfile' => 'required|mimes:'.implode(",", config('crudbooster.UPLOAD_IMAGE_EXTENSION_ALLOWED')) |
|
| 24 | 24 | ]); |
| 25 | 25 | |
| 26 | - $file = cb()->uploadFile('userfile', request("encrypt")?true:false, request("resize_width"), request("resize_height")); |
|
| 26 | + $file = cb()->uploadFile('userfile', request("encrypt") ?true:false, request("resize_width"), request("resize_height")); |
|
| 27 | 27 | |
| 28 | 28 | } catch (CBValidationException $e) { |
| 29 | - return response()->json(['status'=>false,'message'=>$e->getMessage()]); |
|
| 29 | + return response()->json(['status'=>false, 'message'=>$e->getMessage()]); |
|
| 30 | 30 | } catch (\Exception $e) { |
| 31 | - return response()->json(['status'=>false,'message'=>$e->getMessage()]); |
|
| 31 | + return response()->json(['status'=>false, 'message'=>$e->getMessage()]); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | return response()->json([ |
@@ -149,21 +149,21 @@ |
||
| 149 | 149 | <?php |
| 150 | 150 | $font = new \crocodicstudio\crudbooster\helpers\FontAwesome(); |
| 151 | 151 | $fontData = [ |
| 152 | - ["data"=>$font->text(),"label"=>"Text"], |
|
| 153 | - ["data"=>$font->web(),"label"=>"Web"], |
|
| 154 | - ["data"=>$font->video(),"label"=>"Video"], |
|
| 155 | - ["data"=>$font->transportation(),"label"=>"Transportation"], |
|
| 156 | - ["data"=>$font->payment(),"label"=>"Payment"], |
|
| 157 | - ["data"=>$font->medical(),"label"=>"Medical"], |
|
| 158 | - ["data"=>$font->hand(),"label"=>"Hand"], |
|
| 159 | - ["data"=>$font->fileType(),"label"=>"File Type"], |
|
| 160 | - ["data"=>$font->directional(),"label"=>"Directional"], |
|
| 161 | - ["data"=>$font->currency(),"label"=>"Currency"], |
|
| 162 | - ["data"=>$font->chart(),"label"=>"Chart"], |
|
| 163 | - ["data"=>$font->brands(),"label"=>"Brand"], |
|
| 164 | - ["data"=>$font->gender(),"label"=>"Gender"], |
|
| 165 | - ["data"=>$font->form(),"label"=>"Form"], |
|
| 166 | - ["data"=>$font->spinner(),"label"=>"Spinner"] |
|
| 152 | + ["data"=>$font->text(), "label"=>"Text"], |
|
| 153 | + ["data"=>$font->web(), "label"=>"Web"], |
|
| 154 | + ["data"=>$font->video(), "label"=>"Video"], |
|
| 155 | + ["data"=>$font->transportation(), "label"=>"Transportation"], |
|
| 156 | + ["data"=>$font->payment(), "label"=>"Payment"], |
|
| 157 | + ["data"=>$font->medical(), "label"=>"Medical"], |
|
| 158 | + ["data"=>$font->hand(), "label"=>"Hand"], |
|
| 159 | + ["data"=>$font->fileType(), "label"=>"File Type"], |
|
| 160 | + ["data"=>$font->directional(), "label"=>"Directional"], |
|
| 161 | + ["data"=>$font->currency(), "label"=>"Currency"], |
|
| 162 | + ["data"=>$font->chart(), "label"=>"Chart"], |
|
| 163 | + ["data"=>$font->brands(), "label"=>"Brand"], |
|
| 164 | + ["data"=>$font->gender(), "label"=>"Gender"], |
|
| 165 | + ["data"=>$font->form(), "label"=>"Form"], |
|
| 166 | + ["data"=>$font->spinner(), "label"=>"Spinner"] |
|
| 167 | 167 | ]; |
| 168 | 168 | ?> |
| 169 | 169 | @foreach($fontData as $f) |
@@ -27,18 +27,18 @@ |
||
| 27 | 27 | |
| 28 | 28 | if (!empty($_POST)) |
| 29 | 29 | { |
| 30 | - foreach ( $_POST as $key => $value ) |
|
| 30 | + foreach ($_POST as $key => $value) |
|
| 31 | 31 | { |
| 32 | - if ( ( !is_string($value) && !is_numeric($value) ) || !is_string($key) ) |
|
| 32 | + if ((!is_string($value) && !is_numeric($value)) || !is_string($key)) |
|
| 33 | 33 | continue; |
| 34 | 34 | |
| 35 | - if ( get_magic_quotes_gpc() ) |
|
| 36 | - $value = htmlspecialchars( stripslashes((string)$value) ); |
|
| 35 | + if (get_magic_quotes_gpc()) |
|
| 36 | + $value = htmlspecialchars(stripslashes((string) $value)); |
|
| 37 | 37 | else |
| 38 | - $value = htmlspecialchars( (string)$value ); |
|
| 38 | + $value = htmlspecialchars((string) $value); |
|
| 39 | 39 | ?> |
| 40 | 40 | <tr> |
| 41 | - <th style="vertical-align: top"><?php echo htmlspecialchars( (string)$key ); ?></th> |
|
| 41 | + <th style="vertical-align: top"><?php echo htmlspecialchars((string) $key); ?></th> |
|
| 42 | 42 | <td><pre class="samples"><?php echo $value; ?></pre></td> |
| 43 | 43 | </tr> |
| 44 | 44 | <?php |
@@ -149,21 +149,21 @@ |
||
| 149 | 149 | <?php |
| 150 | 150 | $font = new \crocodicstudio\crudbooster\helpers\FontAwesome(); |
| 151 | 151 | $fontData = [ |
| 152 | - ["data"=>$font->text(),"label"=>"Text"], |
|
| 153 | - ["data"=>$font->web(),"label"=>"Web"], |
|
| 154 | - ["data"=>$font->video(),"label"=>"Video"], |
|
| 155 | - ["data"=>$font->transportation(),"label"=>"Transportation"], |
|
| 156 | - ["data"=>$font->payment(),"label"=>"Payment"], |
|
| 157 | - ["data"=>$font->medical(),"label"=>"Medical"], |
|
| 158 | - ["data"=>$font->hand(),"label"=>"Hand"], |
|
| 159 | - ["data"=>$font->fileType(),"label"=>"File Type"], |
|
| 160 | - ["data"=>$font->directional(),"label"=>"Directional"], |
|
| 161 | - ["data"=>$font->currency(),"label"=>"Currency"], |
|
| 162 | - ["data"=>$font->chart(),"label"=>"Chart"], |
|
| 163 | - ["data"=>$font->brands(),"label"=>"Brand"], |
|
| 164 | - ["data"=>$font->gender(),"label"=>"Gender"], |
|
| 165 | - ["data"=>$font->form(),"label"=>"Form"], |
|
| 166 | - ["data"=>$font->spinner(),"label"=>"Spinner"] |
|
| 152 | + ["data"=>$font->text(), "label"=>"Text"], |
|
| 153 | + ["data"=>$font->web(), "label"=>"Web"], |
|
| 154 | + ["data"=>$font->video(), "label"=>"Video"], |
|
| 155 | + ["data"=>$font->transportation(), "label"=>"Transportation"], |
|
| 156 | + ["data"=>$font->payment(), "label"=>"Payment"], |
|
| 157 | + ["data"=>$font->medical(), "label"=>"Medical"], |
|
| 158 | + ["data"=>$font->hand(), "label"=>"Hand"], |
|
| 159 | + ["data"=>$font->fileType(), "label"=>"File Type"], |
|
| 160 | + ["data"=>$font->directional(), "label"=>"Directional"], |
|
| 161 | + ["data"=>$font->currency(), "label"=>"Currency"], |
|
| 162 | + ["data"=>$font->chart(), "label"=>"Chart"], |
|
| 163 | + ["data"=>$font->brands(), "label"=>"Brand"], |
|
| 164 | + ["data"=>$font->gender(), "label"=>"Gender"], |
|
| 165 | + ["data"=>$font->form(), "label"=>"Form"], |
|
| 166 | + ["data"=>$font->spinner(), "label"=>"Spinner"] |
|
| 167 | 167 | ]; |
| 168 | 168 | ?> |
| 169 | 169 | @foreach($fontData as $f) |
@@ -149,21 +149,21 @@ |
||
| 149 | 149 | <?php |
| 150 | 150 | $font = new \crocodicstudio\crudbooster\helpers\FontAwesome(); |
| 151 | 151 | $fontData = [ |
| 152 | - ["data"=>$font->text(),"label"=>"Text"], |
|
| 153 | - ["data"=>$font->web(),"label"=>"Web"], |
|
| 154 | - ["data"=>$font->video(),"label"=>"Video"], |
|
| 155 | - ["data"=>$font->transportation(),"label"=>"Transportation"], |
|
| 156 | - ["data"=>$font->payment(),"label"=>"Payment"], |
|
| 157 | - ["data"=>$font->medical(),"label"=>"Medical"], |
|
| 158 | - ["data"=>$font->hand(),"label"=>"Hand"], |
|
| 159 | - ["data"=>$font->fileType(),"label"=>"File Type"], |
|
| 160 | - ["data"=>$font->directional(),"label"=>"Directional"], |
|
| 161 | - ["data"=>$font->currency(),"label"=>"Currency"], |
|
| 162 | - ["data"=>$font->chart(),"label"=>"Chart"], |
|
| 163 | - ["data"=>$font->brands(),"label"=>"Brand"], |
|
| 164 | - ["data"=>$font->gender(),"label"=>"Gender"], |
|
| 165 | - ["data"=>$font->form(),"label"=>"Form"], |
|
| 166 | - ["data"=>$font->spinner(),"label"=>"Spinner"] |
|
| 152 | + ["data"=>$font->text(), "label"=>"Text"], |
|
| 153 | + ["data"=>$font->web(), "label"=>"Web"], |
|
| 154 | + ["data"=>$font->video(), "label"=>"Video"], |
|
| 155 | + ["data"=>$font->transportation(), "label"=>"Transportation"], |
|
| 156 | + ["data"=>$font->payment(), "label"=>"Payment"], |
|
| 157 | + ["data"=>$font->medical(), "label"=>"Medical"], |
|
| 158 | + ["data"=>$font->hand(), "label"=>"Hand"], |
|
| 159 | + ["data"=>$font->fileType(), "label"=>"File Type"], |
|
| 160 | + ["data"=>$font->directional(), "label"=>"Directional"], |
|
| 161 | + ["data"=>$font->currency(), "label"=>"Currency"], |
|
| 162 | + ["data"=>$font->chart(), "label"=>"Chart"], |
|
| 163 | + ["data"=>$font->brands(), "label"=>"Brand"], |
|
| 164 | + ["data"=>$font->gender(), "label"=>"Gender"], |
|
| 165 | + ["data"=>$font->form(), "label"=>"Form"], |
|
| 166 | + ["data"=>$font->spinner(), "label"=>"Spinner"] |
|
| 167 | 167 | ]; |
| 168 | 168 | ?> |
| 169 | 169 | @foreach($fontData as $f) |
@@ -32,13 +32,13 @@ discard block |
||
| 32 | 32 | public function handle() |
| 33 | 33 | { |
| 34 | 34 | |
| 35 | - if($this->option("generate")) { |
|
| 35 | + if ($this->option("generate")) { |
|
| 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 | - $this->call("db:seed",["--class"=>"CbMigrationSeeder"]); |
|
| 41 | + $this->call("db:seed", ["--class"=>"CbMigrationSeeder"]); |
|
| 42 | 42 | $this->info("== Finish =="); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -50,18 +50,18 @@ discard block |
||
| 50 | 50 | $php_string = ""; |
| 51 | 51 | $additional_tables = cbConfig("ADDITIONAL_DATA_MIGRATION"); |
| 52 | 52 | |
| 53 | - foreach($tables as $table) { |
|
| 54 | - if(substr($table,0,3) == "cb_" || in_array($table, $additional_tables)) { |
|
| 53 | + foreach ($tables as $table) { |
|
| 54 | + if (substr($table, 0, 3) == "cb_" || in_array($table, $additional_tables)) { |
|
| 55 | 55 | $this->info("Create seeder for table : ".$table); |
| 56 | 56 | $rows = DB::table($table)->get(); |
| 57 | 57 | $data = []; |
| 58 | - foreach($rows as $i=>$row) { |
|
| 58 | + foreach ($rows as $i=>$row) { |
|
| 59 | 59 | $data[$i] = []; |
| 60 | - foreach($row as $key=>$val) { |
|
| 60 | + foreach ($row as $key=>$val) { |
|
| 61 | 61 | $data[$i][$key] = $val; |
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | - if(count($data)!=0) { |
|
| 64 | + if (count($data) != 0) { |
|
| 65 | 65 | $php_string .= 'DB::table(\''.$table.'\')->delete();'."\n\t\t\t"; |
| 66 | 66 | $php_string .= 'DB::table(\''.$table.'\')->insert('.min_var_export($data).');'."\n\t\t\t"; |
| 67 | 67 | } |
@@ -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 | |
@@ -29,11 +29,11 @@ discard block |
||
| 29 | 29 | $this->setButtonDetail(true); |
| 30 | 30 | $this->setButtonSave(true); |
| 31 | 31 | $this->setButtonLimitPage(true); |
| 32 | - $this->hideButtonDeleteWhen(function ($row) { return false; }); |
|
| 33 | - $this->hideButtonDetailWhen(function ($row) { return false; }); |
|
| 34 | - $this->hideButtonEditWhen(function ($row) { return false; }); |
|
| 35 | - $this->style(function () { return null; }); |
|
| 36 | - $this->javascript(function () { return null; }); |
|
| 32 | + $this->hideButtonDeleteWhen(function($row) { return false; }); |
|
| 33 | + $this->hideButtonDetailWhen(function($row) { return false; }); |
|
| 34 | + $this->hideButtonEditWhen(function($row) { return false; }); |
|
| 35 | + $this->style(function() { return null; }); |
|
| 36 | + $this->javascript(function() { return null; }); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function style(callable $style) { |
@@ -137,9 +137,9 @@ discard block |
||
| 137 | 137 | * @param ButtonColor $color |
| 138 | 138 | * @param string $attributes |
| 139 | 139 | */ |
| 140 | - public function addIndexActionButton($label, $actionURL, $fontAwesome_icon=null, $color=null, $attributes = null) |
|
| 140 | + public function addIndexActionButton($label, $actionURL, $fontAwesome_icon = null, $color = null, $attributes = null) |
|
| 141 | 141 | { |
| 142 | - $color = ($color)?:ButtonColor::DARK_BLUE; |
|
| 142 | + $color = ($color) ?: ButtonColor::DARK_BLUE; |
|
| 143 | 143 | |
| 144 | 144 | $model = new IndexActionButtonModel(); |
| 145 | 145 | $model->setLabel($label); |
@@ -194,12 +194,12 @@ discard block |
||
| 194 | 194 | * @param $fontAwesome_icon |
| 195 | 195 | * @param ButtonColor|string $color |
| 196 | 196 | */ |
| 197 | - public function addActionButton($label, $url_target, $condition_callback=null, $fontAwesome_icon=null, $color=null, $confirmation = false) |
|
| 197 | + public function addActionButton($label, $url_target, $condition_callback = null, $fontAwesome_icon = null, $color = null, $confirmation = false) |
|
| 198 | 198 | { |
| 199 | 199 | $new = new AddActionButtonModel(); |
| 200 | 200 | $new->setLabel($label); |
| 201 | - $new->setIcon($fontAwesome_icon?:"fa fa-bars"); |
|
| 202 | - $new->setColor($color?:"primary"); |
|
| 201 | + $new->setIcon($fontAwesome_icon ?: "fa fa-bars"); |
|
| 202 | + $new->setColor($color ?: "primary"); |
|
| 203 | 203 | $new->setUrl($url_target); |
| 204 | 204 | $new->setCondition($condition_callback); |
| 205 | 205 | $new->setConfirmation($confirmation); |
@@ -32,12 +32,12 @@ |
||
| 32 | 32 | { |
| 33 | 33 | $this->info($this->description); |
| 34 | 34 | $option = $this->option("module"); |
| 35 | - if($option == "ALL") { |
|
| 35 | + if ($option == "ALL") { |
|
| 36 | 36 | $tables = DB::connection()->getDoctrineSchemaManager()->listTableNames(); |
| 37 | - foreach($tables as $table) { |
|
| 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 | } |