@@ -29,19 +29,19 @@ discard block |
||
| 29 | 29 | // parameter represents the DataTables column identifier. In this case simple |
| 30 | 30 | // indexes |
| 31 | 31 | $columns = array( |
| 32 | - array( 'db' => 'id', 'dt' => 0 ), |
|
| 33 | - array( 'db' => 'firstname', 'dt' => 1 ), |
|
| 34 | - array( 'db' => 'surname', 'dt' => 2 ), |
|
| 35 | - array( 'db' => 'zip', 'dt' => 3 ), |
|
| 36 | - array( 'db' => 'country', 'dt' => 4 ) |
|
| 32 | + array( 'db' => 'id', 'dt' => 0 ), |
|
| 33 | + array( 'db' => 'firstname', 'dt' => 1 ), |
|
| 34 | + array( 'db' => 'surname', 'dt' => 2 ), |
|
| 35 | + array( 'db' => 'zip', 'dt' => 3 ), |
|
| 36 | + array( 'db' => 'country', 'dt' => 4 ) |
|
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | // SQL server connection information |
| 40 | 40 | $sql_details = array( |
| 41 | - 'user' => '', |
|
| 42 | - 'pass' => '', |
|
| 43 | - 'db' => '', |
|
| 44 | - 'host' => '' |
|
| 41 | + 'user' => '', |
|
| 42 | + 'pass' => '', |
|
| 43 | + 'db' => '', |
|
| 44 | + 'host' => '' |
|
| 45 | 45 | ); |
| 46 | 46 | |
| 47 | 47 | |
@@ -53,6 +53,6 @@ discard block |
||
| 53 | 53 | require( '../../../../examples/server_side/scripts/ssp.class.php' ); |
| 54 | 54 | |
| 55 | 55 | echo json_encode( |
| 56 | - SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns ) |
|
| 56 | + SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns ) |
|
| 57 | 57 | ); |
| 58 | 58 | |
@@ -29,11 +29,11 @@ discard block |
||
| 29 | 29 | // parameter represents the DataTables column identifier. In this case simple |
| 30 | 30 | // indexes |
| 31 | 31 | $columns = array( |
| 32 | - array( 'db' => 'id', 'dt' => 0 ), |
|
| 33 | - array( 'db' => 'firstname', 'dt' => 1 ), |
|
| 34 | - array( 'db' => 'surname', 'dt' => 2 ), |
|
| 35 | - array( 'db' => 'zip', 'dt' => 3 ), |
|
| 36 | - array( 'db' => 'country', 'dt' => 4 ) |
|
| 32 | + array('db' => 'id', 'dt' => 0), |
|
| 33 | + array('db' => 'firstname', 'dt' => 1), |
|
| 34 | + array('db' => 'surname', 'dt' => 2), |
|
| 35 | + array('db' => 'zip', 'dt' => 3), |
|
| 36 | + array('db' => 'country', 'dt' => 4) |
|
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | 39 | // SQL server connection information |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | * server-side, there is no need to edit below this line. |
| 51 | 51 | */ |
| 52 | 52 | |
| 53 | -require( '../../../../examples/server_side/scripts/ssp.class.php' ); |
|
| 53 | +require('../../../../examples/server_side/scripts/ssp.class.php'); |
|
| 54 | 54 | |
| 55 | 55 | echo json_encode( |
| 56 | - SSP::simple( $_GET, $sql_details, $table, $primaryKey, $columns ) |
|
| 56 | + SSP::simple($_GET, $sql_details, $table, $primaryKey, $columns) |
|
| 57 | 57 | ); |
| 58 | 58 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | if ($validator->fails()) { |
| 82 | 82 | $messages = $validator->errors(); |
| 83 | - foreach($messages->all() as $message) { |
|
| 83 | + foreach ($messages->all() as $message) { |
|
| 84 | 84 | $this->error($message); |
| 85 | 85 | } |
| 86 | 86 | } else { |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | $this->info('.. ..'); |
| 110 | 110 | $this->info('. .'); |
| 111 | 111 | $this->info(' '); |
| 112 | - $this->info('New super admin: '.$name.' ('.$email.') generated successfully'); |
|
| 112 | + $this->info('New super admin: ' . $name . ' (' . $email . ') generated successfully'); |
|
| 113 | 113 | $this->info(' '); |
| 114 | 114 | } |
| 115 | 115 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | if ($validator->fails()) { |
| 72 | 72 | $messages = $validator->errors(); |
| 73 | - foreach($messages->all() as $message) { |
|
| 73 | + foreach ($messages->all() as $message) { |
|
| 74 | 74 | $this->error($message); |
| 75 | 75 | } |
| 76 | 76 | } else { |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $this->info('.. ..'); |
| 113 | 113 | $this->info('. .'); |
| 114 | 114 | $this->info(' '); |
| 115 | - $this->info('New site: '.$name.' ('.$domain.') generated successfully'); |
|
| 115 | + $this->info('New site: ' . $name . ' (' . $domain . ') generated successfully'); |
|
| 116 | 116 | $this->info(' '); |
| 117 | 117 | } |
| 118 | 118 | |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | $contentStart += $startDelimiterLength; |
| 143 | 143 | $contentEnd = strpos($str, $endDelimiter, $contentStart); |
| 144 | 144 | if (false === $contentEnd) { |
| 145 | - break; |
|
| 145 | + break; |
|
| 146 | 146 | } |
| 147 | 147 | $contents[] = substr($str, $contentStart, $contentEnd - $contentStart); |
| 148 | 148 | $startFrom = $contentEnd + $endDelimiterLength; |
@@ -27,13 +27,13 @@ discard block |
||
| 27 | 27 | public function getRenderedByPageBlocks($ogpageblocks) |
| 28 | 28 | { |
| 29 | 29 | $pageblocks = []; |
| 30 | - foreach($ogpageblocks as $pageblock){ |
|
| 30 | + foreach ($ogpageblocks as $pageblock) { |
|
| 31 | 31 | $body = $pageblock->body; |
| 32 | 32 | $findUrlTags = $this->getResources($body, '[%', '%]'); |
| 33 | 33 | $url = env('APP_URL', ChuckSite::getSetting('domain')); |
| 34 | - if(count($findUrlTags) > 0) { |
|
| 35 | - foreach($findUrlTags as $foundUrlTag) { |
|
| 36 | - if(strpos($foundUrlTag, 'URL') !== false) { |
|
| 34 | + if (count($findUrlTags) > 0) { |
|
| 35 | + foreach ($findUrlTags as $foundUrlTag) { |
|
| 36 | + if (strpos($foundUrlTag, 'URL') !== false) { |
|
| 37 | 37 | $body = str_replace('[%URL%]', $url, $body); |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -43,23 +43,23 @@ discard block |
||
| 43 | 43 | $findThis = $this->getResources($body, '[', ']'); |
| 44 | 44 | |
| 45 | 45 | // THERE ARE DYNAMICS IN THIS PAGEBLOCK, LET'S RETRIEVE IT |
| 46 | - if(count($findThis) > 0){ |
|
| 46 | + if (count($findThis) > 0) { |
|
| 47 | 47 | //@todo LOOP OVER findThis variable and resolve order for rendering |
| 48 | 48 | |
| 49 | 49 | // PAGEBLOCK CONTAINS A LOOP, LET'S RETRIEVE IT |
| 50 | 50 | if (strpos($findThis[0], 'LOOP') !== false) { |
| 51 | - $repeater_slug = implode(" ",$this->getResources($body, '[LOOP=', ']')); |
|
| 52 | - $repeater_body = implode(" ",$this->getResources($body, '[LOOP='.$repeater_slug.']', '[/LOOP]')); |
|
| 51 | + $repeater_slug = implode(" ", $this->getResources($body, '[LOOP=', ']')); |
|
| 52 | + $repeater_body = implode(" ", $this->getResources($body, '[LOOP=' . $repeater_slug . ']', '[/LOOP]')); |
|
| 53 | 53 | |
| 54 | - $newbody = str_replace('[LOOP='.$repeater_slug.']'.$repeater_body.'[/LOOP]',$this->getRepeaterContents($repeater_slug, $repeater_body),$body); |
|
| 54 | + $newbody = str_replace('[LOOP=' . $repeater_slug . ']' . $repeater_body . '[/LOOP]', $this->getRepeaterContents($repeater_slug, $repeater_body), $body); |
|
| 55 | 55 | |
| 56 | 56 | // THERE IS NO LOOP, CONTINUE |
| 57 | - }elseif(strpos($findThis[0], 'FORM') !== false) {// PAGEBLOCK CONTAINS A FORM, LET'S RETRIEVE IT |
|
| 58 | - $form_slug = implode(" ",$this->getResources($body, '[FORM=', ']')); |
|
| 57 | + }elseif (strpos($findThis[0], 'FORM') !== false) {// PAGEBLOCK CONTAINS A FORM, LET'S RETRIEVE IT |
|
| 58 | + $form_slug = implode(" ", $this->getResources($body, '[FORM=', ']')); |
|
| 59 | 59 | |
| 60 | - $newbody = $this->getFormHtml($form_slug,$body); |
|
| 61 | - }else{// THERE IS NO FORM, SO JUST RETRIEVE THE DYNAMIC CONTENT |
|
| 62 | - $newbody = $this->getResourceContent($findThis, $pageblock->id, $body);//Maybe write a function in the model? |
|
| 60 | + $newbody = $this->getFormHtml($form_slug, $body); |
|
| 61 | + } else {// THERE IS NO FORM, SO JUST RETRIEVE THE DYNAMIC CONTENT |
|
| 62 | + $newbody = $this->getResourceContent($findThis, $pageblock->id, $body); //Maybe write a function in the model? |
|
| 63 | 63 | } |
| 64 | 64 | } else { |
| 65 | 65 | $newbody = $body; |
@@ -82,9 +82,9 @@ discard block |
||
| 82 | 82 | $body = $pageblock->body; |
| 83 | 83 | $findUrlTags = $this->getResources($body, '[%', '%]'); |
| 84 | 84 | $url = env('APP_URL', ChuckSite::getSetting('domain')); |
| 85 | - if(count($findUrlTags) > 0) { |
|
| 86 | - foreach($findUrlTags as $foundUrlTag) { |
|
| 87 | - if(strpos($foundUrlTag, 'URL') !== false) { |
|
| 85 | + if (count($findUrlTags) > 0) { |
|
| 86 | + foreach ($findUrlTags as $foundUrlTag) { |
|
| 87 | + if (strpos($foundUrlTag, 'URL') !== false) { |
|
| 88 | 88 | $body = str_replace('[%URL%]', $url, $body); |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -92,23 +92,23 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | $findThis = $this->getResources($body, '[', ']'); |
| 94 | 94 | // THERE ARE DYNAMICS IN THIS PAGEBLOCK, LET'S RETRIEVE IT |
| 95 | - if(count($findThis) > 0){ |
|
| 95 | + if (count($findThis) > 0) { |
|
| 96 | 96 | //@todo LOOP OVER findThis variable and resolve order for rendering |
| 97 | 97 | |
| 98 | 98 | // PAGEBLOCK CONTAINS A LOOP, LET'S RETRIEVE IT |
| 99 | 99 | if (strpos($findThis[0], 'LOOP') !== false) { |
| 100 | - $repeater_slug = implode(" ",$this->getResources($body, '[LOOP=', ']')); |
|
| 101 | - $repeater_body = implode(" ",$this->getResources($body, '[LOOP='.$repeater_slug.']', '[/LOOP]')); |
|
| 100 | + $repeater_slug = implode(" ", $this->getResources($body, '[LOOP=', ']')); |
|
| 101 | + $repeater_body = implode(" ", $this->getResources($body, '[LOOP=' . $repeater_slug . ']', '[/LOOP]')); |
|
| 102 | 102 | |
| 103 | - $newbody = str_replace('[LOOP='.$repeater_slug.']'.$repeater_body.'[/LOOP]',$this->getRepeaterContents($repeater_slug, $repeater_body),$body); |
|
| 103 | + $newbody = str_replace('[LOOP=' . $repeater_slug . ']' . $repeater_body . '[/LOOP]', $this->getRepeaterContents($repeater_slug, $repeater_body), $body); |
|
| 104 | 104 | |
| 105 | 105 | // THERE IS NO LOOP, CONTINUE |
| 106 | - }elseif(strpos($findThis[0], 'FORM') !== false) {// PAGEBLOCK CONTAINS A FORM, LET'S RETRIEVE IT |
|
| 107 | - $form_slug = implode(" ",$this->getResources($body, '[FORM=', ']')); |
|
| 106 | + }elseif (strpos($findThis[0], 'FORM') !== false) {// PAGEBLOCK CONTAINS A FORM, LET'S RETRIEVE IT |
|
| 107 | + $form_slug = implode(" ", $this->getResources($body, '[FORM=', ']')); |
|
| 108 | 108 | |
| 109 | - $newbody = $this->getFormHtml($form_slug,$body); |
|
| 110 | - } else{// THERE IS NO FORM, SO JUST RETRIEVE THE DYNAMIC CONTENT |
|
| 111 | - $newbody = $this->getResourceContent($findThis, $pageblock->id, $body);//Maybe write a function in the model? |
|
| 109 | + $newbody = $this->getFormHtml($form_slug, $body); |
|
| 110 | + } else {// THERE IS NO FORM, SO JUST RETRIEVE THE DYNAMIC CONTENT |
|
| 111 | + $newbody = $this->getResourceContent($findThis, $pageblock->id, $body); //Maybe write a function in the model? |
|
| 112 | 112 | } |
| 113 | 113 | } else { |
| 114 | 114 | $newbody = $body; |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | public function getResourceContent($resources, $page_block_id, $page_block_body) |
| 155 | 155 | { |
| 156 | 156 | $body = $page_block_body; |
| 157 | - foreach($resources as $resource){ |
|
| 157 | + foreach ($resources as $resource) { |
|
| 158 | 158 | $res_arr = explode('+', $resource); |
| 159 | 159 | $res_slug = (string)$res_arr[0]; |
| 160 | 160 | $res_json = (string)$res_arr[1]; |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $resources = $this->getResources($page_block_body, '[' . $slug . '+', ']'); |
| 191 | 191 | $new_body = []; |
| 192 | 192 | $i = 0; |
| 193 | - foreach($contents as $content){ |
|
| 193 | + foreach ($contents as $content) { |
|
| 194 | 194 | $body = $page_block_body; |
| 195 | 195 | foreach ($resources as $resource) { |
| 196 | 196 | $json = $content->json; |
@@ -245,12 +245,12 @@ discard block |
||
| 245 | 245 | public function deleteById($id) |
| 246 | 246 | { |
| 247 | 247 | $pageblock = $this->pageblock->find($id); |
| 248 | - if($pageblock){ |
|
| 248 | + if ($pageblock) { |
|
| 249 | 249 | $og_order = $pageblock->order; |
| 250 | 250 | //Decrement order of following pageblocks |
| 251 | 251 | $pageblocks = $this->pageblock->where('page_id', $pageblock->page_id)->where('order', '>', $og_order)->decrement('order'); |
| 252 | 252 | //Delete pageblock |
| 253 | - if($pageblock->delete()){ |
|
| 253 | + if ($pageblock->delete()) { |
|
| 254 | 254 | return 'success'; |
| 255 | 255 | } else { |
| 256 | 256 | return 'error'; |
@@ -54,11 +54,11 @@ discard block |
||
| 54 | 54 | $newbody = str_replace('[LOOP='.$repeater_slug.']'.$repeater_body.'[/LOOP]',$this->getRepeaterContents($repeater_slug, $repeater_body),$body); |
| 55 | 55 | |
| 56 | 56 | // THERE IS NO LOOP, CONTINUE |
| 57 | - }elseif(strpos($findThis[0], 'FORM') !== false) {// PAGEBLOCK CONTAINS A FORM, LET'S RETRIEVE IT |
|
| 57 | + } elseif(strpos($findThis[0], 'FORM') !== false) {// PAGEBLOCK CONTAINS A FORM, LET'S RETRIEVE IT |
|
| 58 | 58 | $form_slug = implode(" ",$this->getResources($body, '[FORM=', ']')); |
| 59 | 59 | |
| 60 | 60 | $newbody = $this->getFormHtml($form_slug,$body); |
| 61 | - }else{// THERE IS NO FORM, SO JUST RETRIEVE THE DYNAMIC CONTENT |
|
| 61 | + } else{// THERE IS NO FORM, SO JUST RETRIEVE THE DYNAMIC CONTENT |
|
| 62 | 62 | $newbody = $this->getResourceContent($findThis, $pageblock->id, $body);//Maybe write a function in the model? |
| 63 | 63 | } |
| 64 | 64 | } else { |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $newbody = str_replace('[LOOP='.$repeater_slug.']'.$repeater_body.'[/LOOP]',$this->getRepeaterContents($repeater_slug, $repeater_body),$body); |
| 104 | 104 | |
| 105 | 105 | // THERE IS NO LOOP, CONTINUE |
| 106 | - }elseif(strpos($findThis[0], 'FORM') !== false) {// PAGEBLOCK CONTAINS A FORM, LET'S RETRIEVE IT |
|
| 106 | + } elseif(strpos($findThis[0], 'FORM') !== false) {// PAGEBLOCK CONTAINS A FORM, LET'S RETRIEVE IT |
|
| 107 | 107 | $form_slug = implode(" ",$this->getResources($body, '[FORM=', ']')); |
| 108 | 108 | |
| 109 | 109 | $newbody = $this->getFormHtml($form_slug,$body); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | class UserRepository |
| 10 | 10 | { |
| 11 | - public function __construct(User $user) |
|
| 11 | + public function __construct(User $user) |
|
| 12 | 12 | { |
| 13 | 13 | $this->user = $user; |
| 14 | 14 | } |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | |
| 10 | 10 | public static function updateOrCreateFromRequest($req) |
| 11 | 11 | { |
| 12 | - $settings = []; |
|
| 12 | + $settings = []; |
|
| 13 | 13 | foreach ($req->get('socialmedia') as $smKey => $smValue) { |
| 14 | 14 | $settings['socialmedia'][$smKey] = $smValue; |
| 15 | 15 | } |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | foreach ($req->get('integrations') as $igsKey => $igsValue) { |
| 20 | 20 | $settings['integrations'][$igsKey] = $igsValue; |
| 21 | 21 | } |
| 22 | - $settings['lang'] = implode(",",$req->get('lang')); |
|
| 22 | + $settings['lang'] = implode(",", $req->get('lang')); |
|
| 23 | 23 | $settings['domain'] = $req->get('site_domain'); //@todo remove domain from table only keep json |
| 24 | 24 | |
| 25 | 25 | // updateOrCreate the site |
@@ -45,8 +45,8 @@ discard block |
||
| 45 | 45 | $settings = $site->settings; |
| 46 | 46 | $locales = []; |
| 47 | 47 | if ($settings !== null) { |
| 48 | - foreach(config('lang.allLocales') as $langKey => $langValue){ |
|
| 49 | - if( in_array($langKey, explode(',',$settings['lang']) ) ){ |
|
| 48 | + foreach (config('lang.allLocales') as $langKey => $langValue) { |
|
| 49 | + if (in_array($langKey, explode(',', $settings['lang']))) { |
|
| 50 | 50 | $locales[$langKey] = $langValue; |
| 51 | 51 | } |
| 52 | 52 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | { |
| 93 | 93 | $split = explode('.', $var); |
| 94 | 94 | foreach ($split as $value) { |
| 95 | - if(array_key_exists($value, $settings)) { |
|
| 95 | + if (array_key_exists($value, $settings)) { |
|
| 96 | 96 | $settings = $settings[$value]; |
| 97 | 97 | } else { |
| 98 | 98 | return null; |
@@ -104,13 +104,13 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | private function resolveSiteAttribute($var, $currentSite) |
| 106 | 106 | { |
| 107 | - if($var == 'domain') { |
|
| 107 | + if ($var == 'domain') { |
|
| 108 | 108 | return $currentSite->domain; |
| 109 | 109 | } |
| 110 | - if($var == 'name') { |
|
| 110 | + if ($var == 'name') { |
|
| 111 | 111 | return $currentSite->name; |
| 112 | 112 | } |
| 113 | - if($var == 'slug') { |
|
| 113 | + if ($var == 'slug') { |
|
| 114 | 114 | return $currentSite->slug; |
| 115 | 115 | } |
| 116 | 116 | } |
@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | $menus = $menuitems->getall(1); |
| 36 | 36 | |
| 37 | 37 | $data = ['menus' => $menus, 'indmenu' => $menu]; |
| 38 | - if($tslug == null) { |
|
| 38 | + if ($tslug == null) { |
|
| 39 | 39 | return view('chuckcms::vendor.chuck-menu.menu-front-end', $data); |
| 40 | 40 | } |
| 41 | - if($fileslug == null){ |
|
| 42 | - return view($tslug.'::vendor.chuck-menu.menu-front-end', $data); |
|
| 41 | + if ($fileslug == null) { |
|
| 42 | + return view($tslug . '::vendor.chuck-menu.menu-front-end', $data); |
|
| 43 | 43 | } |
| 44 | - return view($tslug.'::vendor.chuck-menu.' . $fileslug, $data); |
|
| 44 | + return view($tslug . '::vendor.chuck-menu.' . $fileslug, $data); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function scripts() |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $menuItem = new MenuItems; |
| 76 | 76 | $menu_list = $menuItem->getall($menu_id); |
| 77 | 77 | |
| 78 | - $roots = $menu_list->where('menu', (integer) $menu_id)->where('parent', 0); |
|
| 78 | + $roots = $menu_list->where('menu', (integer)$menu_id)->where('parent', 0); |
|
| 79 | 79 | |
| 80 | 80 | $items = self::tree($roots, $menu_list); |
| 81 | 81 | return $items; |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | { |
| 36 | 36 | return $this->from($this->mailData['from'], $this->mailData['from_name']) |
| 37 | 37 | ->to($this->mailData['to'], $this->mailData['to_name']) |
| 38 | - ->subject('Activeer je account op '.$this->settings['domain']) |
|
| 38 | + ->subject('Activeer je account op ' . $this->settings['domain']) |
|
| 39 | 39 | ->view('chuckcms::backend.mails.userActivationMail'); |
| 40 | 40 | } |
| 41 | 41 | } |