@@ -30,7 +30,7 @@ |
||
| 30 | 30 | public function __construct(array $attributes = []) |
| 31 | 31 | { |
| 32 | 32 | //parent::construct( $attributes ); |
| 33 | - $this->table = config('menu.table_prefix').config('menu.table_name_items'); |
|
| 33 | + $this->table = config('menu.table_prefix') . config('menu.table_name_items'); |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | public function getsons($id) |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | $templates = $this->where('active', 1)->where('type', 'default')->get(); |
| 34 | 34 | $emailTemplates = []; |
| 35 | 35 | foreach ($templates as $template) { |
| 36 | - if (file_exists(base_path('vendor/'.$template->path.'/src/views/templates/'.$template->slug.'/mails'))) { |
|
| 37 | - $mailDir = array_slice(scandir(base_path('vendor/'.$template->path.'/src/views/templates/'.$template->slug.'/mails')), 2); |
|
| 36 | + if (file_exists(base_path('vendor/' . $template->path . '/src/views/templates/' . $template->slug . '/mails'))) { |
|
| 37 | + $mailDir = array_slice(scandir(base_path('vendor/' . $template->path . '/src/views/templates/' . $template->slug . '/mails')), 2); |
|
| 38 | 38 | if (count($mailDir) > 0) { |
| 39 | 39 | $emailTemplates[$template->slug]['hintpath'] = $template->hintpath; |
| 40 | 40 | foreach ($mailDir as $mdKey => $mdValue) { |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | - if (file_exists(base_path('resources/views/vendor/'.$template->slug.'/templates/'.$template->slug.'/mails'))) { |
|
| 48 | - $mailDirVendor = array_slice(scandir(base_path('resources/views/vendor/'.$template->slug.'/templates/'.$template->slug.'/mails')), 2); |
|
| 47 | + if (file_exists(base_path('resources/views/vendor/' . $template->slug . '/templates/' . $template->slug . '/mails'))) { |
|
| 48 | + $mailDirVendor = array_slice(scandir(base_path('resources/views/vendor/' . $template->slug . '/templates/' . $template->slug . '/mails')), 2); |
|
| 49 | 49 | if (count($mailDirVendor) > 0) { |
| 50 | 50 | $emailTemplates[$template->slug]['hintpath'] = $template->hintpath; |
| 51 | 51 | foreach ($mailDirVendor as $mdKey => $mdValue) { |
@@ -65,8 +65,8 @@ discard block |
||
| 65 | 65 | $templates = $this->where('active', 1)->get(); |
| 66 | 66 | $pageViews = []; |
| 67 | 67 | foreach ($templates as $template) { |
| 68 | - if (file_exists(base_path('packages/'.$template->path.'/src/views/templates/'.$template->slug))) { |
|
| 69 | - $pageDir = array_slice(scandir(base_path('packages/'.$template->path.'/src/views/templates/'.$template->slug)), 2); |
|
| 68 | + if (file_exists(base_path('packages/' . $template->path . '/src/views/templates/' . $template->slug))) { |
|
| 69 | + $pageDir = array_slice(scandir(base_path('packages/' . $template->path . '/src/views/templates/' . $template->slug)), 2); |
|
| 70 | 70 | if (count($pageDir) > 0) { |
| 71 | 71 | $pageViews[$template->slug]['hintpath'] = $template->hintpath; |
| 72 | 72 | foreach ($pageDir as $pdKey => $pdValue) { |
@@ -76,8 +76,8 @@ discard block |
||
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | - if (file_exists(base_path('vendor/'.$template->path.'/src/views/templates/'.$template->slug))) { |
|
| 80 | - $pageDir = array_slice(scandir(base_path('vendor/'.$template->path.'/src/views/templates/'.$template->slug)), 2); |
|
| 79 | + if (file_exists(base_path('vendor/' . $template->path . '/src/views/templates/' . $template->slug))) { |
|
| 80 | + $pageDir = array_slice(scandir(base_path('vendor/' . $template->path . '/src/views/templates/' . $template->slug)), 2); |
|
| 81 | 81 | if (count($pageDir) > 0) { |
| 82 | 82 | $pageViews[$template->slug]['hintpath'] = $template->hintpath; |
| 83 | 83 | foreach ($pageDir as $pdKey => $pdValue) { |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | - if (file_exists(base_path('resources/views/vendor/'.$template->slug.'/templates/'.$template->slug))) { |
|
| 91 | - $pageDir = array_slice(scandir(base_path('resources/views/vendor/'.$template->slug.'/templates/'.$template->slug)), 2); |
|
| 90 | + if (file_exists(base_path('resources/views/vendor/' . $template->slug . '/templates/' . $template->slug))) { |
|
| 91 | + $pageDir = array_slice(scandir(base_path('resources/views/vendor/' . $template->slug . '/templates/' . $template->slug)), 2); |
|
| 92 | 92 | if (count($pageDir) > 0) { |
| 93 | 93 | $pageViews[$template->slug]['hintpath'] = $template->hintpath; |
| 94 | 94 | foreach ($pageDir as $pdKey => $pdValue) { |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | public function register() |
| 29 | 29 | { |
| 30 | - $this->app->singleton('ChuckSite', function () { |
|
| 30 | + $this->app->singleton('ChuckSite', function() { |
|
| 31 | 31 | $site = Site::first(); |
| 32 | 32 | if ($site == null) { |
| 33 | 33 | throw new Exception('Whoops! No Site Defined...'); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function register() |
| 26 | 26 | { |
| 27 | - $this->app->bind('ChuckTemplate', function () { |
|
| 27 | + $this->app->bind('ChuckTemplate', function() { |
|
| 28 | 28 | $template = TemplateModel::first(); |
| 29 | 29 | if ($template == null) { |
| 30 | 30 | throw new Exception('Whoops! No Template Defined...'); |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function register() |
| 27 | 27 | { |
| 28 | - $this->app->bind('ChuckRepeater', function () { |
|
| 28 | + $this->app->bind('ChuckRepeater', function() { |
|
| 29 | 29 | return new \Chuckbe\Chuckcms\Chuck\Accessors\Repeater(\App::make(Repeater::class), \App::make(RepeaterRepository::class)); |
| 30 | 30 | }); |
| 31 | 31 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function register() |
| 25 | 25 | { |
| 26 | - $this->app->bind('ChuckMenu', function () { |
|
| 26 | + $this->app->bind('ChuckMenu', function() { |
|
| 27 | 27 | return new \Chuckbe\Chuckcms\Chuck\Accessors\Menu(); |
| 28 | 28 | }); |
| 29 | 29 | } |
@@ -65,16 +65,16 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | $repeater = $this->repeater->where('url', $slug)->first(); |
| 67 | 67 | if ($repeater !== null) { |
| 68 | - $templateHintpath = explode('::', (string) $repeater->page)[0]; |
|
| 68 | + $templateHintpath = explode('::', (string)$repeater->page)[0]; |
|
| 69 | 69 | $template = $this->template->where('active', 1)->where('hintpath', $templateHintpath)->first(); |
| 70 | 70 | |
| 71 | - return view((string) $repeater->page, compact('template', 'repeater')); |
|
| 71 | + return view((string)$repeater->page, compact('template', 'repeater')); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - $page = $this->page->where('slug->'.app()->getLocale(), $slug)->first(); |
|
| 74 | + $page = $this->page->where('slug->' . app()->getLocale(), $slug)->first(); |
|
| 75 | 75 | if ($page == null) { |
| 76 | 76 | foreach (\LaravelLocalization::getSupportedLocales() as $localeCode => $properties) { |
| 77 | - $page = $this->page->where('slug->'.$localeCode, $slug)->first(); |
|
| 77 | + $page = $this->page->where('slug->' . $localeCode, $slug)->first(); |
|
| 78 | 78 | if ($page !== null && $localeCode == app()->getLocale()) { |
| 79 | 79 | break; |
| 80 | 80 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | app()->setLocale($localeCode); |
| 85 | 85 | \LaravelLocalization::setLocale($localeCode); |
| 86 | 86 | |
| 87 | - return redirect($localeCode.'/'.$slug); |
|
| 87 | + return redirect($localeCode . '/' . $slug); |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -127,6 +127,6 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | $template = $this->template->where('active', 1)->where('id', $page->template_id)->first(); |
| 129 | 129 | |
| 130 | - return view($template->hintpath.'::templates.'.$template->slug.'.page', compact('template', 'page', 'pageblocks')); |
|
| 130 | + return view($template->hintpath . '::templates.' . $template->slug . '.page', compact('template', 'page', 'pageblocks')); |
|
| 131 | 131 | } |
| 132 | 132 | } |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | { |
| 105 | 105 | $menuitem = new MenuItems(); |
| 106 | 106 | $menuitem->label = request()->input('labelmenu'); |
| 107 | - $menuitem->link = 'page:'.request()->input('linkmenu'); |
|
| 107 | + $menuitem->link = 'page:' . request()->input('linkmenu'); |
|
| 108 | 108 | $menuitem->menu = request()->input('idmenu'); |
| 109 | 109 | $menuitem->sort = MenuItems::getNextSortRoot(request()->input('idmenu')); |
| 110 | 110 | $menuitem->save(); |
@@ -206,14 +206,14 @@ discard block |
||
| 206 | 206 | if ($request->has('lang')) { |
| 207 | 207 | app()->setLocale($request->get('lang')); |
| 208 | 208 | } else { |
| 209 | - return redirect()->to(URL::current().'?lang='.app()->getLocale()); |
|
| 209 | + return redirect()->to(URL::current() . '?lang=' . app()->getLocale()); |
|
| 210 | 210 | } |
| 211 | 211 | $page = $this->page->getByIdWithBlocks($page_id); |
| 212 | 212 | $template = $this->template->where('id', $page->template_id)->first(); |
| 213 | 213 | $pageblocks = $this->pageBlockRepository->getRenderedByPageBlocks($this->pageblock->getAllByPageId($page->id)); |
| 214 | 214 | |
| 215 | - $block_dir = array_slice(scandir('chuckbe/'.$template->slug.'/blocks'), 2); |
|
| 216 | - $blocks = $this->dirToArray($template->path.'/blocks'); |
|
| 215 | + $block_dir = array_slice(scandir('chuckbe/' . $template->slug . '/blocks'), 2); |
|
| 216 | + $blocks = $this->dirToArray($template->path . '/blocks'); |
|
| 217 | 217 | |
| 218 | 218 | return view('chuckcms::backend.pages.pagebuilder.index', compact('template', 'page', 'pageblocks', 'blocks')); |
| 219 | 219 | } |
@@ -225,24 +225,24 @@ discard block |
||
| 225 | 225 | $cdir = scandir($dir); |
| 226 | 226 | foreach ($cdir as $key => $value) { |
| 227 | 227 | if (!in_array($value, ['.', '..'])) { |
| 228 | - if (is_dir($dir.DIRECTORY_SEPARATOR.$value)) { |
|
| 229 | - $result[$value] = $this->dirToArray($dir.DIRECTORY_SEPARATOR.$value); |
|
| 228 | + if (is_dir($dir . DIRECTORY_SEPARATOR . $value)) { |
|
| 229 | + $result[$value] = $this->dirToArray($dir . DIRECTORY_SEPARATOR . $value); |
|
| 230 | 230 | } else { |
| 231 | 231 | if ($value !== '.DS_Store' && (strpos($value, '.html') !== false)) { |
| 232 | 232 | $blockKey = str_replace('.html', '', $value); |
| 233 | 233 | $blockName = str_replace('-', ' ', $blockKey); |
| 234 | - if (file_exists($dir.DIRECTORY_SEPARATOR.$blockKey.'.jpg')) { |
|
| 235 | - $blockImage = $dir.DIRECTORY_SEPARATOR.$blockKey.'.jpg'; |
|
| 236 | - } elseif (file_exists($dir.DIRECTORY_SEPARATOR.$blockKey.'.jpeg')) { |
|
| 237 | - $blockImage = $dir.DIRECTORY_SEPARATOR.$blockKey.'.jpeg'; |
|
| 238 | - } elseif (file_exists($dir.DIRECTORY_SEPARATOR.$blockKey.'.png')) { |
|
| 239 | - $blockImage = $dir.DIRECTORY_SEPARATOR.$blockKey.'.png'; |
|
| 234 | + if (file_exists($dir . DIRECTORY_SEPARATOR . $blockKey . '.jpg')) { |
|
| 235 | + $blockImage = $dir . DIRECTORY_SEPARATOR . $blockKey . '.jpg'; |
|
| 236 | + } elseif (file_exists($dir . DIRECTORY_SEPARATOR . $blockKey . '.jpeg')) { |
|
| 237 | + $blockImage = $dir . DIRECTORY_SEPARATOR . $blockKey . '.jpeg'; |
|
| 238 | + } elseif (file_exists($dir . DIRECTORY_SEPARATOR . $blockKey . '.png')) { |
|
| 239 | + $blockImage = $dir . DIRECTORY_SEPARATOR . $blockKey . '.png'; |
|
| 240 | 240 | } else { |
| 241 | 241 | $blockImage = 'https://ui-avatars.com/api/?length=5&size=150&name=BLOCK&background=0D8ABC&color=fff&font-size=0.2'; |
| 242 | 242 | } |
| 243 | 243 | $result[$blockKey] = [ |
| 244 | 244 | 'name' => $blockName, |
| 245 | - 'location' => $dir.DIRECTORY_SEPARATOR.$value, |
|
| 245 | + 'location' => $dir . DIRECTORY_SEPARATOR . $value, |
|
| 246 | 246 | 'img' => $blockImage, |
| 247 | 247 | ]; |
| 248 | 248 | } |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | if ($request->has('lang')) { |
| 264 | 264 | app()->setLocale($request->get('lang')); |
| 265 | 265 | } else { |
| 266 | - return redirect()->to(URL::current().'?lang='.app()->getLocale()); |
|
| 266 | + return redirect()->to(URL::current() . '?lang=' . app()->getLocale()); |
|
| 267 | 267 | } |
| 268 | 268 | $page = $this->page->getByIdWithBlocks($page_id); |
| 269 | 269 | $template = $this->template->where('id', $page->template_id)->first(); |