@@ -42,9 +42,9 @@ discard block |
||
| 42 | 42 | // PAGEBLOCK CONTAINS A LOOP, LET'S RETRIEVE IT |
| 43 | 43 | if (strpos($findThis[0], 'LOOP') !== false) { |
| 44 | 44 | $repeater_slug = implode(' ', $this->getResources($body, '[LOOP=', ']')); |
| 45 | - $repeater_body = implode(' ', $this->getResources($body, '[LOOP='.$repeater_slug.']', '[/LOOP]')); |
|
| 45 | + $repeater_body = implode(' ', $this->getResources($body, '[LOOP=' . $repeater_slug . ']', '[/LOOP]')); |
|
| 46 | 46 | |
| 47 | - $newbody = str_replace('[LOOP='.$repeater_slug.']'.$repeater_body.'[/LOOP]', $this->getRepeaterContents($repeater_slug, $repeater_body), $body); |
|
| 47 | + $newbody = str_replace('[LOOP=' . $repeater_slug . ']' . $repeater_body . '[/LOOP]', $this->getRepeaterContents($repeater_slug, $repeater_body), $body); |
|
| 48 | 48 | |
| 49 | 49 | // THERE IS NO LOOP, CONTINUE |
| 50 | 50 | } elseif (strpos($findThis[0], 'FORM') !== false) {// PAGEBLOCK CONTAINS A FORM, LET'S RETRIEVE IT |
@@ -92,9 +92,9 @@ discard block |
||
| 92 | 92 | // PAGEBLOCK CONTAINS A LOOP, LET'S RETRIEVE IT |
| 93 | 93 | if (strpos($findThis[0], 'LOOP') !== false) { |
| 94 | 94 | $repeater_slug = implode(' ', $this->getResources($body, '[LOOP=', ']')); |
| 95 | - $repeater_body = implode(' ', $this->getResources($body, '[LOOP='.$repeater_slug.']', '[/LOOP]')); |
|
| 95 | + $repeater_body = implode(' ', $this->getResources($body, '[LOOP=' . $repeater_slug . ']', '[/LOOP]')); |
|
| 96 | 96 | |
| 97 | - $newbody = str_replace('[LOOP='.$repeater_slug.']'.$repeater_body.'[/LOOP]', $this->getRepeaterContents($repeater_slug, $repeater_body), $body); |
|
| 97 | + $newbody = str_replace('[LOOP=' . $repeater_slug . ']' . $repeater_body . '[/LOOP]', $this->getRepeaterContents($repeater_slug, $repeater_body), $body); |
|
| 98 | 98 | |
| 99 | 99 | // THERE IS NO LOOP, CONTINUE |
| 100 | 100 | } elseif (strpos($findThis[0], 'FORM') !== false) {// PAGEBLOCK CONTAINS A FORM, LET'S RETRIEVE IT |
@@ -152,12 +152,12 @@ discard block |
||
| 152 | 152 | $body = $page_block_body; |
| 153 | 153 | foreach ($resources as $resource) { |
| 154 | 154 | $res_arr = explode('+', $resource); |
| 155 | - $res_slug = (string) $res_arr[0]; |
|
| 156 | - $res_json = (string) $res_arr[1]; |
|
| 155 | + $res_slug = (string)$res_arr[0]; |
|
| 156 | + $res_json = (string)$res_arr[1]; |
|
| 157 | 157 | $res_object = Resource::where('slug', $res_slug)->first(); |
| 158 | 158 | $json = $res_object->json[app()->getLocale()]; |
| 159 | 159 | $match = $json[$res_json]; |
| 160 | - $body = str_replace('['.$res_slug.'+'.$res_json.']', $match, $body); |
|
| 160 | + $body = str_replace('[' . $res_slug . '+' . $res_json . ']', $match, $body); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | return $body; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $slug = $form_slug; |
| 169 | 169 | $form = Form::where('slug', $slug)->first(); |
| 170 | 170 | $render = View::make('chuckcms::backend.forms.render', ['form' => $form])->render(); |
| 171 | - $html = str_replace('[FORM='.$slug.']', $render, $page_block_body); |
|
| 171 | + $html = str_replace('[FORM=' . $slug . ']', $render, $page_block_body); |
|
| 172 | 172 | |
| 173 | 173 | return $html; |
| 174 | 174 | } |
@@ -179,12 +179,12 @@ discard block |
||
| 179 | 179 | if (strpos($repeater_slug, ' LIMIT=') !== false) { |
| 180 | 180 | $explode = explode(' LIMIT=', $repeater_slug); |
| 181 | 181 | $slug = $explode[0]; |
| 182 | - $limit = (int) $explode[1]; |
|
| 182 | + $limit = (int)$explode[1]; |
|
| 183 | 183 | $contents = Repeater::where('slug', $slug)->take($limit)->get(); |
| 184 | 184 | } else { |
| 185 | 185 | $contents = Repeater::where('slug', $slug)->get(); |
| 186 | 186 | } |
| 187 | - $resources = $this->getResources($page_block_body, '['.$slug.'+', ']'); |
|
| 187 | + $resources = $this->getResources($page_block_body, '[' . $slug . '+', ']'); |
|
| 188 | 188 | $new_body = []; |
| 189 | 189 | $i = 0; |
| 190 | 190 | foreach ($contents as $content) { |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | foreach ($resources as $resource) { |
| 193 | 193 | $json = $content->json; |
| 194 | 194 | $match = $json[$resource]; |
| 195 | - $body = str_replace('['.$slug.'+'.$resource.']', $match, $body); |
|
| 195 | + $body = str_replace('[' . $slug . '+' . $resource . ']', $match, $body); |
|
| 196 | 196 | } |
| 197 | 197 | $new_body[] = $body; |
| 198 | 198 | $i++; |
@@ -109,7 +109,7 @@ |
||
| 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 | } |
@@ -121,7 +121,7 @@ |
||
| 121 | 121 | $this->info('.. ..'); |
| 122 | 122 | $this->info('. .'); |
| 123 | 123 | $this->info(' '); |
| 124 | - $this->info('New site: '.$name.' ('.$domain.') generated successfully'); |
|
| 124 | + $this->info('New site: ' . $name . ' (' . $domain . ') generated successfully'); |
|
| 125 | 125 | $this->info(' '); |
| 126 | 126 | } |
| 127 | 127 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create(config('menu.table_prefix').config('menu.table_name_items'), function (Blueprint $table) { |
|
| 16 | + Schema::create(config('menu.table_prefix') . config('menu.table_name_items'), function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('label'); |
| 19 | 19 | $table->string('link'); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $table->integer('depth')->default(0); |
| 25 | 25 | $table->timestamps(); |
| 26 | 26 | |
| 27 | - $table->foreign('menu')->references('id')->on(config('menu.table_prefix').config('menu.table_name_menus')) |
|
| 27 | + $table->foreign('menu')->references('id')->on(config('menu.table_prefix') . config('menu.table_name_menus')) |
|
| 28 | 28 | ->onDelete('cascade') |
| 29 | 29 | ->onUpdate('cascade'); |
| 30 | 30 | }); |
@@ -37,6 +37,6 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function down() |
| 39 | 39 | { |
| 40 | - Schema::dropIfExists(config('menu.table_prefix').config('menu.table_name_items')); |
|
| 40 | + Schema::dropIfExists(config('menu.table_prefix') . config('menu.table_name_items')); |
|
| 41 | 41 | } |
| 42 | 42 | } |
@@ -14,13 +14,13 @@ discard block |
||
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | 16 | if (!Schema::hasColumn('users', 'token')) { |
| 17 | - Schema::table('users', function (Blueprint $table) { |
|
| 17 | + Schema::table('users', function(Blueprint $table) { |
|
| 18 | 18 | $table->string('token', 24)->unique()->after('remember_token'); |
| 19 | 19 | }); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | if (!Schema::hasColumn('users', 'active')) { |
| 23 | - Schema::table('users', function (Blueprint $table) { |
|
| 23 | + Schema::table('users', function(Blueprint $table) { |
|
| 24 | 24 | $table->tinyInteger('active')->default(0)->after('token'); |
| 25 | 25 | }); |
| 26 | 26 | } |
@@ -34,13 +34,13 @@ discard block |
||
| 34 | 34 | public function down() |
| 35 | 35 | { |
| 36 | 36 | if (Schema::hasColumn('users', 'token')) { |
| 37 | - Schema::table('users', function (Blueprint $table) { |
|
| 37 | + Schema::table('users', function(Blueprint $table) { |
|
| 38 | 38 | $table->dropColumn('token'); |
| 39 | 39 | }); |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | if (Schema::hasColumn('users', 'active')) { |
| 43 | - Schema::table('users', function (Blueprint $table) { |
|
| 43 | + Schema::table('users', function(Blueprint $table) { |
|
| 44 | 44 | $table->dropColumn('active'); |
| 45 | 45 | }); |
| 46 | 46 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create(config('menu.table_prefix').config('menu.table_name_menus'), function (Blueprint $table) { |
|
| 16 | + Schema::create(config('menu.table_prefix') . config('menu.table_name_menus'), function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('name'); |
| 19 | 19 | $table->timestamps(); |
@@ -27,6 +27,6 @@ discard block |
||
| 27 | 27 | */ |
| 28 | 28 | public function down() |
| 29 | 29 | { |
| 30 | - Schema::dropIfExists(config('menu.table_prefix').config('menu.table_name_menus')); |
|
| 30 | + Schema::dropIfExists(config('menu.table_prefix') . config('menu.table_name_menus')); |
|
| 31 | 31 | } |
| 32 | 32 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | |
| 39 | 39 | protected function redirectTo() |
| 40 | 40 | { |
| 41 | - return '/'.Auth::user()->roles()->first()->redirect; |
|
| 41 | + return '/' . Auth::user()->roles()->first()->redirect; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function register() |
| 25 | 25 | { |
| 26 | - $this->app->bind('Chuck', function () { |
|
| 26 | + $this->app->bind('Chuck', function() { |
|
| 27 | 27 | return new \Chuckbe\Chuckcms\Chuck\Accessors\Chuck(); |
| 28 | 28 | }); |
| 29 | 29 | } |
@@ -126,18 +126,18 @@ discard block |
||
| 126 | 126 | case 'month': |
| 127 | 127 | $value = $request->all()['value']; |
| 128 | 128 | $range = [ |
| 129 | - 'start' => $value['y2'].'-'.$value['m2'].'-'.$value['d2'], |
|
| 130 | - 'end' => $value['y1'].'-'.$value['m1'].'-'.$value['d1'], |
|
| 129 | + 'start' => $value['y2'] . '-' . $value['m2'] . '-' . $value['d2'], |
|
| 130 | + 'end' => $value['y1'] . '-' . $value['m1'] . '-' . $value['d1'], |
|
| 131 | 131 | ]; |
| 132 | - $imgDate = $range['start'].','.$range['end']; |
|
| 132 | + $imgDate = $range['start'] . ',' . $range['end']; |
|
| 133 | 133 | break; |
| 134 | 134 | |
| 135 | 135 | case 'day': |
| 136 | 136 | if ($date == 'today') { |
| 137 | - $imgDate = date('Y-m-d').','.date('Y-m-d', strtotime(date('Y-m-d').' 2 day')); |
|
| 137 | + $imgDate = date('Y-m-d') . ',' . date('Y-m-d', strtotime(date('Y-m-d') . ' 2 day')); |
|
| 138 | 138 | } |
| 139 | 139 | if ($date == 'yesterday') { |
| 140 | - $imgDate = date('Y-m-d').','.date('Y-m-d', strtotime(date('Y-m-d').' 2 day')); |
|
| 140 | + $imgDate = date('Y-m-d') . ',' . date('Y-m-d', strtotime(date('Y-m-d') . ' 2 day')); |
|
| 141 | 141 | } |
| 142 | 142 | break; |
| 143 | 143 | } |
@@ -157,15 +157,15 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | return response()->json( |
| 159 | 159 | [ |
| 160 | - 'visitimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&segment=&showtitle=1&random=6179&columns=nb_visits%2Cnb_uniq_visitors&token_auth='.$this->authToken, |
|
| 161 | - 'avgvisitimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&showtitle=1&random=6179&columns=avg_time_on_site&token_auth='.$this->authToken, |
|
| 162 | - 'bouncerateimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&columns=bounce_rate&token_auth='.$this->authToken, |
|
| 163 | - 'actions_per_visit_img' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&columns=nb_actions_per_visit&token_auth='.$this->authToken, |
|
| 164 | - 'pageviewimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&columns=nb_pageviews%2Cnb_uniq_pageviews&token_auth='.$this->authToken, |
|
| 165 | - 'searchesandkeywordsimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&columns=nb_searches%2Cnb_keywords&token_auth='.$this->authToken, |
|
| 166 | - 'downloadsimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&columns=nb_downloads%2Cnb_uniq_downloads&token_auth='.$this->authToken, |
|
| 167 | - 'outlinksimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&columns=nb_outlinks%2Cnb_uniq_outlinks&token_auth='.$this->authToken, |
|
| 168 | - 'maxactionsimg' => $matomoUrl.'/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite='.$this->siteId.'&period='.$period.'&date='.$imgDate.'&columns=max_actions&token_auth='.$this->authToken, |
|
| 160 | + 'visitimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&segment=&showtitle=1&random=6179&columns=nb_visits%2Cnb_uniq_visitors&token_auth=' . $this->authToken, |
|
| 161 | + 'avgvisitimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&showtitle=1&random=6179&columns=avg_time_on_site&token_auth=' . $this->authToken, |
|
| 162 | + 'bouncerateimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&columns=bounce_rate&token_auth=' . $this->authToken, |
|
| 163 | + 'actions_per_visit_img' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&columns=nb_actions_per_visit&token_auth=' . $this->authToken, |
|
| 164 | + 'pageviewimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&columns=nb_pageviews%2Cnb_uniq_pageviews&token_auth=' . $this->authToken, |
|
| 165 | + 'searchesandkeywordsimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&columns=nb_searches%2Cnb_keywords&token_auth=' . $this->authToken, |
|
| 166 | + 'downloadsimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&columns=nb_downloads%2Cnb_uniq_downloads&token_auth=' . $this->authToken, |
|
| 167 | + 'outlinksimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&columns=nb_outlinks%2Cnb_uniq_outlinks&token_auth=' . $this->authToken, |
|
| 168 | + 'maxactionsimg' => $matomoUrl . '/index.php?forceView=1&viewDataTable=sparkline&module=API&action=get&idSite=' . $this->siteId . '&period=' . $period . '&date=' . $imgDate . '&columns=max_actions&token_auth=' . $this->authToken, |
|
| 169 | 169 | 'data' => $data, |
| 170 | 170 | ] |
| 171 | 171 | ); |
@@ -206,8 +206,8 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | $range = [ |
| 209 | - 'start' => $data['y2'].'-'.$data['m2'].'-'.$data['d2'], |
|
| 210 | - 'end' => $data['y1'].'-'.$data['m1'].'-'.$data['d1'], |
|
| 209 | + 'start' => $data['y2'] . '-' . $data['m2'] . '-' . $data['d2'], |
|
| 210 | + 'end' => $data['y1'] . '-' . $data['m1'] . '-' . $data['d1'], |
|
| 211 | 211 | ]; |
| 212 | 212 | |
| 213 | 213 | $now = Carbon::now(); |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | if ($difference > 0) { |
| 231 | 231 | $period = 'range'; |
| 232 | - $date = $range['start'].','.$range['end']; |
|
| 232 | + $date = $range['start'] . ',' . $range['end']; |
|
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | return $periodCheck ? $period : $date; |