From 332b0e47808fe406fc280d196d116e3882d3e1a9 Mon Sep 17 00:00:00 2001 From: Luke Towers Date: Fri, 3 Jan 2025 23:41:21 -0600 Subject: [PATCH] Apply Winter Coding Standards Rel: https://github.com/wintercms/winter/pull/1188 --- Plugin.php | 51 ++++++------ assets/js/page-preview.js | 2 +- classes/Content.php | 6 +- classes/Controller.php | 15 ++-- classes/Menu.php | 32 ++++---- classes/MenuItem.php | 17 ++-- classes/MenuItemReference.php | 4 +- classes/ObjectHelper.php | 12 +-- classes/Page.php | 79 +++++++++---------- classes/PageList.php | 22 +++--- classes/Router.php | 15 ++-- classes/Snippet.php | 79 +++++++++---------- classes/SnippetManager.php | 26 +++--- components/ChildPages.php | 9 ++- components/StaticBreadcrumbs.php | 6 +- components/StaticMenu.php | 12 +-- components/StaticPage.php | 20 ++--- controllers/Index.php | 74 +++++++++-------- formwidgets/MenuItemSearch.php | 14 ++-- formwidgets/MenuItems.php | 29 ++++--- formwidgets/MenuPicker.php | 4 +- formwidgets/PagePicker.php | 10 ++- lang/cs/lang.php | 16 ++-- lang/de/lang.php | 18 ++--- lang/el/lang.php | 4 +- lang/en/lang.php | 4 +- lang/es/lang.php | 16 ++-- lang/fa/lang.php | 6 +- lang/fi/lang.php | 4 +- lang/fr/lang.php | 14 ++-- lang/hu/lang.php | 20 ++--- lang/it/lang.php | 16 ++-- lang/lv/lang.php | 3 +- lang/nb-no/lang.php | 16 ++-- lang/nl/lang.php | 2 +- lang/pl/lang.php | 4 +- lang/pt-br/lang.php | 16 ++-- lang/ru/lang.php | 4 +- lang/sk/lang.php | 4 +- lang/sv/lang.php | 16 ++-- lang/uk/lang.php | 4 +- lang/vn/lang.php | 4 +- lang/zh-cn/lang.php | 5 +- tests/classes/ObjectHelperTest.php | 2 +- .../snippets_rename_viewbag_properties.php | 18 +++-- widgets/MenuList.php | 16 ++-- widgets/PageList.php | 26 +++--- widgets/SnippetList.php | 20 ++--- 48 files changed, 426 insertions(+), 390 deletions(-) diff --git a/Plugin.php b/Plugin.php index a52356f..292a683 100644 --- a/Plugin.php +++ b/Plugin.php @@ -1,11 +1,11 @@ - 'childPages', \Winter\Pages\Components\StaticPage::class => 'staticPage', \Winter\Pages\Components\StaticMenu::class => 'staticMenu', - \Winter\Pages\Components\StaticBreadcrumbs::class => 'staticBreadcrumbs' + \Winter\Pages\Components\StaticBreadcrumbs::class => 'staticBreadcrumbs', ]; } @@ -58,7 +59,7 @@ public function registerPermissions(): array 'order' => 200, 'roles' => [UserRole::CODE_DEVELOPER, UserRole::CODE_PUBLISHER], 'label' => 'winter.pages::lang.page.manage_menus', - ], + ], 'winter.pages.manage_content' => [ 'tab' => 'winter.pages::lang.page.tab', 'order' => 200, @@ -99,28 +100,28 @@ public function registerNavigation(): array 'label' => 'winter.pages::lang.page.menu_label', 'icon' => 'icon-files-o', 'url' => 'javascript:;', - 'attributes' => ['data-menu-item'=>'pages'], + 'attributes' => ['data-menu-item' => 'pages'], 'permissions' => ['winter.pages.manage_pages'], ], 'menus' => [ 'label' => 'winter.pages::lang.menu.menu_label', 'icon' => 'icon-sitemap', 'url' => 'javascript:;', - 'attributes' => ['data-menu-item'=>'menus'], + 'attributes' => ['data-menu-item' => 'menus'], 'permissions' => ['winter.pages.manage_menus'], ], 'content' => [ 'label' => 'winter.pages::lang.content.menu_label', 'icon' => 'icon-file-text-o', 'url' => 'javascript:;', - 'attributes' => ['data-menu-item'=>'content'], + 'attributes' => ['data-menu-item' => 'content'], 'permissions' => ['winter.pages.manage_content'], ], 'snippets' => [ 'label' => 'winter.pages::lang.snippet.menu_label', 'icon' => 'icon-newspaper-o', 'url' => 'javascript:;', - 'attributes' => ['data-menu-item'=>'snippets'], + 'attributes' => ['data-menu-item' => 'snippets'], 'permissions' => ['winter.pages.access_snippets'], ], ], @@ -146,8 +147,8 @@ public function registerMarkupTags(): array { return [ 'filters' => [ - 'staticPage' => ['Winter\Pages\Classes\Page', 'url'] - ] + 'staticPage' => ['Winter\Pages\Classes\Page', 'url'], + ], ]; } @@ -239,19 +240,19 @@ protected function extendBackendForms(): void */ protected function extendCmsTemplates(): void { - Event::listen('cms.template.save', function($controller, $template, $type) { + Event::listen('cms.template.save', function ($controller, $template, $type) { Plugin::clearCache(); }); - Event::listen('cms.template.processSettingsBeforeSave', function($controller, $dataHolder) { + Event::listen('cms.template.processSettingsBeforeSave', function ($controller, $dataHolder) { $dataHolder->settings = Snippet::processTemplateSettingsArray($dataHolder->settings); }); - Event::listen('cms.template.processSettingsAfterLoad', function($controller, $template) { + Event::listen('cms.template.processSettingsAfterLoad', function ($controller, $template) { Snippet::processTemplateSettings($template); }); - Event::listen('cms.template.processTwigContent', function($template, $dataHolder) { + Event::listen('cms.template.processTwigContent', function ($template, $dataHolder) { if ($template instanceof \Cms\Classes\Layout) { $dataHolder->content = Controller::instance()->parseSyntaxFields($dataHolder->content); } @@ -263,7 +264,7 @@ protected function extendCmsTemplates(): void */ protected function extendCmsRouter(): void { - Event::listen('cms.router.beforeRoute', function($url) { + Event::listen('cms.router.beforeRoute', function ($url) { return Controller::instance()->initCmsPage($url); }); } @@ -273,7 +274,7 @@ protected function extendCmsRouter(): void */ protected function extendCmsRenderer(): void { - Event::listen('cms.page.beforeRenderPage', function($controller, $page) { + Event::listen('cms.page.beforeRenderPage', function ($controller, $page) { /* * Before twig renders */ @@ -290,11 +291,11 @@ protected function extendCmsRenderer(): void } }); - Event::listen('cms.page.initComponents', function($controller, $page) { + Event::listen('cms.page.initComponents', function ($controller, $page) { Controller::instance()->initPageComponents($controller, $page); }); - Event::listen('cms.block.render', function($blockName, $blockContents) { + Event::listen('cms.block.render', function ($blockName, $blockContents) { $page = CmsController::getController()->getPage(); if (!isset($page->apiBag['staticPage'])) { @@ -313,24 +314,24 @@ protected function extendCmsRenderer(): void */ protected function registerMenuItemTypes(): void { - Event::listen('pages.menuitem.listTypes', function() { + Event::listen('pages.menuitem.listTypes', function () { return [ 'static-page' => 'winter.pages::lang.menuitem.static_page', - 'all-static-pages' => 'winter.pages::lang.menuitem.all_static_pages' + 'all-static-pages' => 'winter.pages::lang.menuitem.all_static_pages', ]; }); - Event::listen('pages.menuitem.getTypeInfo', function($type) { + Event::listen('pages.menuitem.getTypeInfo', function ($type) { if ($type == 'url') { return []; } - if ($type == 'static-page'|| $type == 'all-static-pages') { + if ($type == 'static-page' || $type == 'all-static-pages') { return StaticPage::getMenuTypeInfo($type); } }); - Event::listen('pages.menuitem.resolveItem', function($type, $item, $url, $theme) { + Event::listen('pages.menuitem.resolveItem', function ($type, $item, $url, $theme) { if ($type == 'static-page' || $type == 'all-static-pages') { return StaticPage::resolveMenuItem($item, $url, $theme); } diff --git a/assets/js/page-preview.js b/assets/js/page-preview.js index ceeb211..0799089 100644 --- a/assets/js/page-preview.js +++ b/assets/js/page-preview.js @@ -63,7 +63,7 @@ * @param {Event} event */ PagePreview.prototype.onDeviceClick = function (event) { - const $clicked = $(event.currentTarget) + public const $clicked = $(event.currentTarget) // Remove active class from other options this.$deviceSelector.find('a').removeClass('active') diff --git a/classes/Content.php b/classes/Content.php index 4530a6e..1f6c95a 100644 --- a/classes/Content.php +++ b/classes/Content.php @@ -1,4 +1,6 @@ - 'extraData.', - 'tagPrefix' => 'page:' + 'tagPrefix' => 'page:', ])->toTwig(); - } - catch (Exception $ex) { + } catch (Exception $ex) { return $content; } } diff --git a/classes/Menu.php b/classes/Menu.php index e015820..d29d70e 100644 --- a/classes/Menu.php +++ b/classes/Menu.php @@ -1,10 +1,12 @@ -fileName = $code.'.yaml'; + $this->fileName = $code . '.yaml'; $this->attributes = array_merge($this->attributes, ['code' => $code]); } @@ -148,11 +150,11 @@ public function generateReferences($page) $currentUrl = Str::lower(Url::to($currentUrl)); $activeMenuItem = $page->activeMenuItem ?: false; - $iterator = function($items) use ($currentUrl, &$iterator, $activeMenuItem) { + $iterator = function ($items) use ($currentUrl, &$iterator, $activeMenuItem) { $result = []; foreach ($items as $item) { - $parentReference = new MenuItemReference; + $parentReference = new MenuItemReference(); $parentReference->type = $item->type; $parentReference->title = $item->title; $parentReference->code = $item->code; @@ -165,8 +167,7 @@ public function generateReferences($page) if ($item->type == 'url') { $parentReference->url = $item->url; $parentReference->isActive = $currentUrl == Str::lower(Url::to($item->url)) || $activeMenuItem === $item->code; - } - else { + } else { /* * If the item type is not URL, use the API to request the item type's provider to * return the item URL, subitems and determine whether the item is active. @@ -179,11 +180,11 @@ public function generateReferences($page) } if (isset($itemInfo['items'])) { - $itemIterator = function($items) use (&$itemIterator, $parentReference) { + $itemIterator = function ($items) use (&$itemIterator, $parentReference) { $result = []; foreach ($items as $item) { - $reference = new MenuItemReference; + $reference = new MenuItemReference(); $reference->type = isset($item['type']) ? $item['type'] : null; $reference->title = isset($item['title']) ? $item['title'] : '--no title--'; $reference->url = isset($item['url']) ? $item['url'] : '#'; @@ -216,8 +217,7 @@ public function generateReferences($page) if (!$item->replace) { $result[] = $parentReference; - } - else { + } else { foreach ($parentReference->items as $subItem) { $result[] = $subItem; } @@ -232,7 +232,7 @@ public function generateReferences($page) /* * Populate the isChildActive property */ - $hasActiveChild = function($items) use (&$hasActiveChild) { + $hasActiveChild = function ($items) use (&$hasActiveChild) { foreach ($items as $item) { if ($item->isActive) { return true; @@ -245,7 +245,7 @@ public function generateReferences($page) } }; - $iterator = function($items) use (&$iterator, &$hasActiveChild) { + $iterator = function ($items) use (&$iterator, &$hasActiveChild) { foreach ($items as $item) { $item->isChildActive = $hasActiveChild($item->items); diff --git a/classes/MenuItem.php b/classes/MenuItem.php index d5cc949..acd137b 100644 --- a/classes/MenuItem.php +++ b/classes/MenuItem.php @@ -1,6 +1,8 @@ - $value) { if ($name != 'items') { if (property_exists($obj, $name)) { $obj->$name = $value; } - } - else { + } else { $obj->items = self::initFromArray($value); } } @@ -174,9 +175,9 @@ public static function getTypeInfo($type): array $baseName = $page->getBaseFileName(); $pos = strrpos($baseName, '/'); - $dir = $pos !== false ? substr($baseName, 0, $pos).' / ' : null; + $dir = $pos !== false ? substr($baseName, 0, $pos) . ' / ' : null; $cmsPages[$baseName] = strlen($page->title) - ? $dir.$page->title + ? $dir . $page->title : $baseName; } diff --git a/classes/MenuItemReference.php b/classes/MenuItemReference.php index 4658d3a..9fd4c81 100644 --- a/classes/MenuItemReference.php +++ b/classes/MenuItemReference.php @@ -1,4 +1,6 @@ - 'required', - 'url' => ['required', 'regex:/^\/[a-z0-9\/_\-\.]*$/i', 'uniqueUrl'] + 'url' => ['required', 'regex:/^\/[a-z0-9\/_\-\.]*$/i', 'uniqueUrl'], ]; /** @@ -162,7 +162,7 @@ public function beforeValidate() { $pages = Page::listInTheme($this->theme, true); - Validator::extend('uniqueUrl', function($attribute, $value, $parameters) use ($pages) { + Validator::extend('uniqueUrl', function ($attribute, $value, $parameters) use ($pages) { $value = trim(strtolower($value)); foreach ($pages as $existingPage) { @@ -219,11 +219,11 @@ protected function generateFilenameFromCode() $fileName = 'index'; } - $curName = trim($fileName).'.htm'; + $curName = trim($fileName) . '.htm'; $counter = 2; - while (File::exists($dir.'/'.$curName)) { - $curName = $fileName.'-'.$counter.'.htm'; + while (File::exists($dir . '/' . $curName)) { + $curName = $fileName . '-' . $counter . '.htm'; $counter++; } @@ -483,7 +483,7 @@ public function listLayoutPlaceholders() $placeholderInfo = [ 'title' => $title, 'type' => $type ?: 'html', - 'ignore' => $ignore + 'ignore' => $ignore, ]; $result[$node->getAttribute('name')] = $placeholderInfo; @@ -569,9 +569,9 @@ public function setPlaceholdersAttribute($value) continue; } - $result .= '{% put '.$code.' %}'.PHP_EOL; - $result .= $content.PHP_EOL; - $result .= '{% endput %}'.PHP_EOL; + $result .= '{% put ' . $code . ' %}' . PHP_EOL; + $result .= $content . PHP_EOL; + $result .= '{% endput %}' . PHP_EOL; $result .= PHP_EOL; } @@ -615,7 +615,7 @@ public function getProcessedPlaceholderMarkup($placeholderName, $placeholderCont * Process snippets */ $markup = Snippet::processPageMarkup( - $this->getFileName().md5($placeholderName), + $this->getFileName() . md5($placeholderName), $this->theme, $placeholderContents ); @@ -643,7 +643,7 @@ public function initCmsComponents($cmsController) $snippetComponents = Snippet::listPageComponents( $this->getFileName(), $this->theme, - $this->markup.$this->code + $this->markup . $this->code ); $componentManager = ComponentManager::instance(); @@ -674,7 +674,7 @@ public function initCmsComponents($cmsController) */ protected static function getMenuCacheKey($theme) { - $key = crc32($theme->getPath()).'static-page-menu'; + $key = crc32($theme->getPath()) . 'static-page-menu'; /** * @event pages.page.getMenuCacheKey * Enables modifying the key used to reference cached Winter.Pages menu trees @@ -730,14 +730,14 @@ public static function getMenuTypeInfo(string $type): ?array switch ($type) { case 'all-static-pages': $result = [ - 'dynamicItems' => true + 'dynamicItems' => true, ]; break; case 'static-page': $result = [ 'references' => self::listStaticPageMenuOptions(), 'nesting' => true, - 'dynamicItems' => true + 'dynamicItems' => true, ]; break; } @@ -810,7 +810,7 @@ public static function resolveMenuItem(object $item, string $url, Theme $theme): 'items' => [], ]; - $iterator = function($items) use (&$iterator, &$tree, $url, $getLocalizedUrls) { + $iterator = function ($items) use (&$iterator, &$tree, $url, $getLocalizedUrls) { $branch = []; foreach ($items as $itemName) { @@ -860,7 +860,7 @@ protected static function getLocalizedUrl(string $url, string $locale): ?string $url = $translator->getPathInLocale($url, $locale); - return (new Router)->urlFromPattern($url); + return (new Router())->urlFromPattern($url); } /** @@ -873,10 +873,9 @@ protected static function getLocalizedUrl(string $url, string $locale): ?string public static function getRichEditorTypeInfo($type) { if ($type == 'static-page') { - $pages = self::listStaticPageMenuOptions(); - $iterator = function($pages) use (&$iterator) { + $iterator = function ($pages) use (&$iterator) { $result = []; foreach ($pages as $pageFile => $page) { $url = self::url($pageFile); @@ -884,10 +883,9 @@ public static function getRichEditorTypeInfo($type) if (is_array($page)) { $result[$url] = [ 'title' => array_get($page, 'title', []), - 'links' => $iterator(array_get($page, 'items', [])) + 'links' => $iterator(array_get($page, 'items', [])), ]; - } - else { + } else { $result[$url] = $page; } } @@ -923,10 +921,10 @@ public static function buildMenuTree($theme) } $menuTree = [ - '--root-pages--' => [] + '--root-pages--' => [], ]; - $iterator = function($items, $parent, $level) use (&$menuTree, &$iterator) { + $iterator = function ($items, $parent, $level) use (&$menuTree, &$iterator) { $result = []; foreach ($items as $item) { @@ -939,10 +937,10 @@ public static function buildMenuTree($theme) 'url' => $pageUrl, 'title' => array_get($viewBag, 'title'), 'mtime' => $item->page->mtime, - 'items' => $iterator($item->subpages, $pageCode, $level+1), + 'items' => $iterator($item->subpages, $pageCode, $level + 1), 'parent' => $parent, 'localeUrls' => array_get($viewBag, 'localeUrl', []), - 'navigation_hidden' => array_get($viewBag, 'navigation_hidden') + 'navigation_hidden' => array_get($viewBag, 'navigation_hidden'), ]; if ($level == 0) { @@ -978,7 +976,7 @@ protected static function listStaticPageMenuOptions() $pageList = new PageList($theme); $pageTree = $pageList->getPageTree(true); - $iterator = function($pages) use (&$iterator) { + $iterator = function ($pages) use (&$iterator) { $result = []; foreach ($pages as $pageInfo) { @@ -987,11 +985,10 @@ protected static function listStaticPageMenuOptions() if (!$pageInfo->subpages) { $result[$fileName] = $pageName; - } - else { + } else { $result[$fileName] = [ 'title' => $pageName, - 'items' => $iterator($pageInfo->subpages) + 'items' => $iterator($pageInfo->subpages), ]; } } diff --git a/classes/PageList.php b/classes/PageList.php index efb5869..c6fc864 100644 --- a/classes/PageList.php +++ b/classes/PageList.php @@ -1,7 +1,8 @@ -getBaseFileName(); })->all(); - $iterator = function($configPages) use (&$iterator, $pagesArray) { + $iterator = function ($configPages) use (&$iterator, $pagesArray) { $result = []; foreach ($configPages as $fileName => $subpages) { @@ -83,14 +84,13 @@ public function getPageParent($page) $parent = null; - $iterator = function($configPages) use (&$iterator, &$parent, $requestedFileName) { + $iterator = function ($configPages) use (&$iterator, &$parent, $requestedFileName) { foreach ($configPages as $fileName => $subpages) { if ($fileName == $requestedFileName) { return true; } if ($iterator($subpages) == true && is_null($parent)) { - $parent = $fileName; return true; @@ -115,7 +115,7 @@ public function getPageSubTree($page) $subTree = []; - $iterator = function($configPages) use (&$iterator, &$subTree, $requestedFileName) { + $iterator = function ($configPages) use (&$iterator, &$subTree, $requestedFileName) { if (is_array($configPages)) { foreach ($configPages as $fileName => $subpages) { if ($fileName == $requestedFileName) { @@ -149,9 +149,8 @@ public function appendPage($page) if (!strlen($parent)) { $structure[$page->getBaseFileName()] = []; - } - else { - $iterator = function(&$configPages) use (&$iterator, $parent, $page) { + } else { + $iterator = function (&$configPages) use (&$iterator, $parent, $page) { foreach ($configPages as $fileName => &$subpages) { if ($fileName == $parent) { $subpages[$page->getBaseFileName()] = []; @@ -159,8 +158,9 @@ public function appendPage($page) return true; } - if ($iterator($subpages) == true) + if ($iterator($subpages) == true) { return true; + } } }; @@ -181,7 +181,7 @@ public function removeSubtree($page) $tree = []; - $iterator = function($configPages) use (&$iterator, &$pages, $requestedFileName) { + $iterator = function ($configPages) use (&$iterator, &$pages, $requestedFileName) { $result = []; foreach ($configPages as $fileName => $subpages) { diff --git a/classes/Router.php b/classes/Router.php index 83c9f9a..564c7f7 100644 --- a/classes/Router.php +++ b/classes/Router.php @@ -1,11 +1,12 @@ - [], 'files' => [], - 'titles' => [] + 'titles' => [], ]; foreach ($pages as $page) { $viewBag = $page->getViewBag(); @@ -151,7 +152,7 @@ protected function loadUrlMap() */ protected function getCacheKey($keyName) { - $key = crc32($this->theme->getPath()).$keyName; + $key = crc32($this->theme->getPath()) . $keyName; /** * @event pages.router.getCacheKey * Enables modifying the key used to reference cached Winter.Pages routes diff --git a/classes/Snippet.php b/classes/Snippet.php index cf16778..9698bb2 100644 --- a/classes/Snippet.php +++ b/classes/Snippet.php @@ -1,13 +1,15 @@ -componentClass) { return self::parseIniProperties($this->properties); - } - else { + } else { return ComponentHelpers::getComponentsPropertyConfig($this->getComponent(), false, true); } } @@ -164,7 +165,7 @@ public static function listPageComponents($pageName, $theme, $markup) $result[] = [ 'class' => $snippetInfo['component'], 'alias' => $snippetInfo['code'], - 'properties' => $snippetInfo['properties'] + 'properties' => $snippetInfo['properties'], ]; } @@ -185,7 +186,7 @@ public static function extendPartialForm($formWidget) 'type' => 'text', 'label' => 'winter.pages::lang.snippet.code', 'comment' => 'winter.pages::lang.snippet.code_comment', - 'span' => 'left' + 'span' => 'left', ]; $formWidget->tabs['fields']['viewBag[snippetCode]'] = $fieldConfig; @@ -199,7 +200,7 @@ public static function extendPartialForm($formWidget) 'type' => 'text', 'label' => 'winter.pages::lang.snippet.name', 'comment' => 'winter.pages::lang.snippet.name_comment', - 'span' => 'right' + 'span' => 'right', ]; $formWidget->tabs['fields']['viewBag[snippetName]'] = $fieldConfig; @@ -219,23 +220,23 @@ public static function extendPartialForm($formWidget) 'validation' => [ 'required' => [ 'message' => 'Please provide the property title', - 'requiredWith' => 'property' - ] - ] + 'requiredWith' => 'property', + ], + ], ], 'property' => [ 'title' => 'winter.pages::lang.snippet.column_code', 'validation' => [ 'required' => [ 'message' => 'Please provide the property code', - 'requiredWith' => 'title' + 'requiredWith' => 'title', ], 'regex' => [ 'pattern' => '^[a-z][a-z0-9]*$', 'modifiers' => 'i', - 'message' => Lang::get('winter.pages::lang.snippet.property_format_error') - ] - ] + 'message' => Lang::get('winter.pages::lang.snippet.property_format_error'), + ], + ], ], 'type' => [ 'title' => 'winter.pages::lang.snippet.column_type', @@ -243,24 +244,24 @@ public static function extendPartialForm($formWidget) 'options' => [ 'string' => 'winter.pages::lang.snippet.column_type_string', 'checkbox' => 'winter.pages::lang.snippet.column_type_checkbox', - 'dropdown' => 'winter.pages::lang.snippet.column_type_dropdown' + 'dropdown' => 'winter.pages::lang.snippet.column_type_dropdown', ], 'validation' => [ 'required' => [ - 'requiredWith' => 'title' - ] - ] + 'requiredWith' => 'title', + ], + ], ], 'default' => [ - 'title' => 'winter.pages::lang.snippet.column_default' + 'title' => 'winter.pages::lang.snippet.column_default', ], 'options' => [ - 'title' => 'winter.pages::lang.snippet.column_options' - ] - ] + 'title' => 'winter.pages::lang.snippet.column_options', + ], + ], ]; - $formWidget->tabs['fields']['viewBag[snippetProperties]'] = $fieldConfig; + $formWidget->tabs['fields']['viewBag[snippetProperties]'] = $fieldConfig; } /** @@ -311,8 +312,7 @@ public static function processPageMarkup($pageName, $theme, $markup) $partialName = $partialSnippetMap[$snippetCode]; $generatedMarkup = $controller->renderPartial($partialName, $snippetInfo['properties']); - } - else { + } else { $generatedMarkup = $controller->renderComponent($snippetCode); } @@ -396,8 +396,7 @@ protected static function preprocessPropertyValues($theme, $snippetCode, $compon if (array_key_exists('default', $propertyInfo)) { $properties[$propertyCode] = $propertyInfo['default']; } - } - else { + } else { $markupPropertyInfo = $properties[$lowercaseCode]; unset($properties[$lowercaseCode]); $properties[$propertyCode] = $markupPropertyInfo; @@ -428,21 +427,19 @@ protected static function dropDownOptionsToArray($optionsString) foreach ($options as $index => $optionStr) { $parts = explode(':', $optionStr, 2); - if (count($parts) > 1 ) { + if (count($parts) > 1) { $key = trim($parts[0]); if (strlen($key)) { if (!preg_match('/^[0-9a-z-_]+$/i', $key)) { - throw new ValidationException(['snippetProperties' => Lang::get('winter.pages::lang.snippet.invalid_option_key', ['key'=>$key])]); + throw new ValidationException(['snippetProperties' => Lang::get('winter.pages::lang.snippet.invalid_option_key', ['key' => $key])]); } $result[$key] = trim($parts[1]); - } - else { + } else { $result[$index] = trim($optionStr); } - } - else { + } else { $result[$index] = trim($optionStr); } } @@ -457,7 +454,7 @@ protected static function dropDownOptionsToString($optionsArray) foreach ($optionsArray as $optionIndex => $optionValue) { $result[] = $isAssoc - ? $optionIndex.':'.$optionValue + ? $optionIndex . ':' . $optionValue : $optionValue; } @@ -502,7 +499,7 @@ protected static function extractSnippetsFromMarkup($markup, $theme) $map[$snippetDeclaration] = [ 'code' => $snippetCode, 'component' => $componentClass, - 'properties' => $properties + 'properties' => $properties, ]; } } @@ -549,7 +546,7 @@ protected static function extractSnippetsFromMarkupCached($theme, $pageName, $ma */ protected static function getMapCacheKey($theme) { - $key = crc32($theme->getPath()).'snippet-map'; + $key = crc32($theme->getPath()) . 'snippet-map'; /** * @event pages.snippet.getMapCacheKey * Enables modifying the key used to reference cached Winter.Pages snippet maps diff --git a/classes/SnippetManager.php b/classes/SnippetManager.php index 97a8596..1fa9a59 100644 --- a/classes/SnippetManager.php +++ b/classes/SnippetManager.php @@ -1,12 +1,13 @@ -initFromPartial($partial); return $snippet; - } - else { + } else { // If the snippet is a component snippet, initialize it // from the component @@ -143,7 +143,7 @@ public function findByCodeOrComponent($theme, $code, $componentClass, $allowCach throw new SystemException(sprintf('The snippet component class %s is not found.', $componentClass)); } - $snippet = new Snippet; + $snippet = new Snippet(); $snippet->initFromComponentInfo($componentClass, $code); return $snippet; @@ -166,7 +166,7 @@ public static function clearCache($theme) */ protected static function getPartialMapCacheKey($theme) { - $key = crc32($theme->getPath()).'snippet-partial-map'; + $key = crc32($theme->getPath()) . 'snippet-partial-map'; /** * @event pages.snippet.getPartialMapCacheKey * Enables modifying the key used to reference cached Winter.Pages partial maps @@ -232,7 +232,7 @@ protected function listThemeSnippets($theme) $viewBag = $partial->getViewBag(); if (strlen($viewBag->property('snippetCode'))) { - $snippet = new Snippet; + $snippet = new Snippet(); $snippet->initFromPartial($partial); $result[] = $snippet; } @@ -265,7 +265,7 @@ protected function listComponentSnippets() foreach ($snippets as $componentClass => $componentCode) { // TODO: register snippet components later, during // the page life cycle. - $snippet = new Snippet; + $snippet = new Snippet(); $snippet->initFromComponentInfo($componentClass, $componentCode); $result[] = $snippet; } diff --git a/components/ChildPages.php b/components/ChildPages.php index 3a0829c..7585393 100644 --- a/components/ChildPages.php +++ b/components/ChildPages.php @@ -1,4 +1,6 @@ - 'winter.pages::lang.component.child_pages_name', - 'description' => 'winter.pages::lang.component.child_pages_description' + 'description' => 'winter.pages::lang.component.child_pages_description', ]; } @@ -52,7 +54,8 @@ public function onRun() 'viewBag' => $viewBag, 'is_hidden' => @$viewBag['is_hidden'], 'navigation_hidden' => @$viewBag['navigation_hidden'], - ]]); + ], + ]); } } } diff --git a/components/StaticBreadcrumbs.php b/components/StaticBreadcrumbs.php index 34d6529..542f740 100644 --- a/components/StaticBreadcrumbs.php +++ b/components/StaticBreadcrumbs.php @@ -1,4 +1,6 @@ - 'winter.pages::lang.component.static_breadcrumbs_name', - 'description' => 'winter.pages::lang.component.static_breadcrumbs_description' + 'description' => 'winter.pages::lang.component.static_breadcrumbs_description', ]; } diff --git a/components/StaticMenu.php b/components/StaticMenu.php index 42acf1a..e094fc0 100644 --- a/components/StaticMenu.php +++ b/components/StaticMenu.php @@ -1,4 +1,6 @@ - 'winter.pages::lang.component.static_menu_name', - 'description' => 'winter.pages::lang.component.static_menu_description' + 'description' => 'winter.pages::lang.component.static_menu_description', ]; } @@ -37,8 +39,8 @@ public function defineProperties() 'code' => [ 'title' => 'winter.pages::lang.component.static_menu_code_name', 'description' => 'winter.pages::lang.component.static_menu_code_description', - 'type' => 'dropdown' - ] + 'type' => 'dropdown', + ], ]; } @@ -87,7 +89,7 @@ public function menuItems() */ public function totalItems() { - $countAll = function($items) use (&$countAll) { + $countAll = function ($items) use (&$countAll) { $count = count($items); foreach ($items as $item) { diff --git a/components/StaticPage.php b/components/StaticPage.php index ea31abf..f073c97 100644 --- a/components/StaticPage.php +++ b/components/StaticPage.php @@ -1,10 +1,12 @@ - 'winter.pages::lang.component.static_page_name', - 'description' => 'winter.pages::lang.component.static_page_description' + 'description' => 'winter.pages::lang.component.static_page_description', ]; } @@ -51,21 +53,21 @@ public function defineProperties() 'description' => 'winter.pages::lang.component.static_page_use_content_description', 'default' => 1, 'type' => 'checkbox', - 'showExternalParam' => false + 'showExternalParam' => false, ], 'default' => [ 'title' => 'winter.pages::lang.component.static_page_default_name', 'description' => 'winter.pages::lang.component.static_page_default_description', 'default' => 0, 'type' => 'checkbox', - 'showExternalParam' => false + 'showExternalParam' => false, ], 'childLayout' => [ 'title' => 'winter.pages::lang.component.static_page_child_layout_name', 'description' => 'winter.pages::lang.component.static_page_child_layout_description', 'type' => 'string', - 'showExternalParam' => false - ] + 'showExternalParam' => false, + ], ]; } @@ -140,7 +142,7 @@ protected function defineExtraData() 'is_hidden', 'navigation_hidden', 'meta_title', - 'meta_description' + 'meta_description', ]; $extraData = array_diff_key( diff --git a/controllers/Index.php b/controllers/Index.php index 0648cb5..ddb0d0e 100644 --- a/controllers/Index.php +++ b/controllers/Index.php @@ -2,23 +2,18 @@ namespace Winter\Pages\Controllers; -use ApplicationException; use Backend\Classes\Controller; +use Backend\Facades\BackendMenu; use Backend\Widgets\Form; -use BackendMenu; -use Cache; use Cms\Classes\CmsObject; use Cms\Classes\CmsObjectCollection; use Cms\Classes\Theme; use Cms\Widgets\TemplateList; -use Config; -use Event; use Exception; -use Flash; -use Lang; -use Request; +use Illuminate\Support\Facades\Cache; +use Illuminate\Support\Facades\Lang; +use Illuminate\Support\Facades\Request; use System\Helpers\DateTime; -use Url; use Winter\Pages\Classes\Content; use Winter\Pages\Classes\MenuItem; use Winter\Pages\Classes\ObjectHelper; @@ -29,7 +24,12 @@ use Winter\Pages\Widgets\MenuList; use Winter\Pages\Widgets\PageList; use Winter\Pages\Widgets\SnippetList; +use Winter\Storm\Exception\ApplicationException; use Winter\Storm\Halcyon\Datasource\DatasourceInterface; +use Winter\Storm\Support\Facades\Config; +use Winter\Storm\Support\Facades\Event; +use Winter\Storm\Support\Facades\Flash; +use Winter\Storm\Support\Facades\URL; /** * Pages and Menus index @@ -69,7 +69,7 @@ public function __construct() } if ($this->user->hasAccess('winter.pages.manage_content')) { - new TemplateList($this, 'contentList', function() { + new TemplateList($this, 'contentList', function () { return $this->getContentTemplateList(); }); $this->vars['activeWidgets'][] = 'contentList'; @@ -80,8 +80,7 @@ public function __construct() $this->vars['activeWidgets'][] = 'snippetList'; } } - } - catch (Exception $ex) { + } catch (Exception $ex) { $this->handleError($ex); } @@ -274,8 +273,8 @@ public function onCreateObject(): array 'objectTheme' => $this->theme->getDirName(), 'objectMtime' => null, 'objectParent' => $parent, - 'parentPage' => $parentPage - ]) + 'parentPage' => $parentPage, + ]), ]; return $result; @@ -297,7 +296,9 @@ public function onDuplicateObject(): array $fileName = $parentPage->fileName; $ext = pathinfo($fileName, PATHINFO_EXTENSION); $parent = substr( - $fileName, 0, -strlen('.' . $ext) + $fileName, + 0, + -strlen('.' . $ext) ); } } @@ -322,8 +323,8 @@ public function onDuplicateObject(): array 'objectTheme' => $this->theme->getDirName(), 'objectMtime' => null, 'objectParent' => $parent, - 'parentPage' => $parentPage - ]) + 'parentPage' => $parentPage, + ]), ]; return $result; @@ -341,7 +342,7 @@ public function onDelete(): array $result = [ 'deletedObjects' => $deletedObjects, - 'theme' => $this->theme->getDirName() + 'theme' => $this->theme->getDirName(), ]; return $result; @@ -374,20 +375,18 @@ public function onDeleteObjects(): array $deletedObjects = $object->delete(); if (is_array($deletedObjects)) { $deleted = array_merge($deleted, $deletedObjects); - } - else { + } else { $deleted[] = $path; } } - } - catch (Exception $ex) { + } catch (Exception $ex) { $error = $ex->getMessage(); } return [ 'deleted' => $deleted, 'error' => $error, - 'theme' => Request::input('theme') + 'theme' => Request::input('theme'), ]; } @@ -401,7 +400,7 @@ public function onGetMenuItemTypeInfo(): array $type = Request::input('type'); return [ - 'menuItemTypeInfo' => MenuItem::getTypeInfo($type) + 'menuItemTypeInfo' => MenuItem::getTypeInfo($type), ]; } @@ -458,9 +457,8 @@ public function onGetSnippetNames(): array if (!$snippet) { $result[$snippetCode] = Lang::get('winter.pages::lang.snippet.not_found', ['code' => $snippetCode]); - } - else { - $result[$snippetCode] =$snippet->getName(); + } else { + $result[$snippetCode] = $snippet->getName(); } } @@ -535,7 +533,7 @@ protected function getUpdateResponse(CmsObject $object, string $type): array $result = [ 'objectPath' => $type != 'content' ? $object->getBaseFileName() : $object->fileName, 'objectMtime' => $object->mtime, - 'tabTitle' => $this->getTabTitle($type, $object) + 'tabTitle' => $this->getTabTitle($type, $object), ]; if ($type == 'page') { @@ -565,7 +563,8 @@ protected function canCommitObject(CmsObject $object): bool { $result = false; - if (Config::get('app.debug', false) && + if ( + Config::get('app.debug', false) && Theme::databaseLayerEnabled() && $this->getThemeDatasource()->sourceHasModel('database', $object) ) { @@ -607,7 +606,7 @@ protected function makeObjectFormWidget($type, $object, $alias = null): Form $formConfigs = [ 'page' => '~/plugins/winter/pages/classes/page/fields.yaml', 'menu' => '~/plugins/winter/pages/classes/menu/fields.yaml', - 'content' => '~/plugins/winter/pages/classes/content/fields.yaml' + 'content' => '~/plugins/winter/pages/classes/content/fields.yaml', ]; if (!array_key_exists($type, $formConfigs)) { @@ -689,7 +688,7 @@ protected function addPageSyntaxFields($formWidget, $page): void */ $translatableTypes = ['text', 'textarea', 'richeditor', 'repeater', 'markdown', 'mediafinder']; if (in_array($fieldConfig['type'], $translatableTypes) && array_get($fieldConfig, 'translatable', true)) { - $page->translatable[] = 'viewBag['.$fieldCode.']'; + $page->translatable[] = 'viewBag[' . $fieldCode . ']'; } } } @@ -712,8 +711,7 @@ protected function addPagePlaceholders($formWidget, $page): void if ($info['type'] != 'text') { $fieldConfig['type'] = 'richeditor'; - } - else { + } else { $fieldConfig['type'] = 'codeeditor'; $fieldConfig['language'] = 'text'; $fieldConfig['theme'] = 'chrome'; @@ -725,12 +723,12 @@ protected function addPagePlaceholders($formWidget, $page): void $fieldConfig['margin'] = '20'; } - $formWidget->secondaryTabs['fields']['placeholders['.$placeholderCode.']'] = $fieldConfig; + $formWidget->secondaryTabs['fields']['placeholders[' . $placeholderCode . ']'] = $fieldConfig; /* * Translation support */ - $page->translatable[] = 'placeholders['.$placeholderCode.']'; + $page->translatable[] = 'placeholders[' . $placeholderCode . ']'; } } @@ -762,7 +760,7 @@ protected function getTabTitle(string $type, CmsObject $object): string : $object->getBaseFileName(); if (!$result) { - $result = Lang::get('cms::lang.'.$type.'.new'); + $result = Lang::get('cms::lang.' . $type . '.new'); } break; @@ -795,8 +793,8 @@ protected function pushObjectForm($type, $object, $alias = null): array 'objectType' => $type, 'objectTheme' => $this->theme->getDirName(), 'objectMtime' => $object->mtime, - 'objectParent' => Request::input('parentFileName') - ]) + 'objectParent' => Request::input('parentFileName'), + ]), ]; } diff --git a/formwidgets/MenuItemSearch.php b/formwidgets/MenuItemSearch.php index 292ba45..7dc5550 100644 --- a/formwidgets/MenuItemSearch.php +++ b/formwidgets/MenuItemSearch.php @@ -1,9 +1,11 @@ - $this->getMatches() + 'results' => $this->getMatches(), ]; } @@ -66,7 +68,7 @@ protected function getMatches() if ($this->textMatchesSearch($words, $title)) { $typeMatches[] = [ 'id' => "$type::$key", - 'text' => $title + 'text' => $title, ]; } @@ -91,7 +93,7 @@ protected function getMatches() if (!empty($typeMatches)) { $types[] = [ 'text' => trans($typeTitle), - 'children' => $typeMatches + 'children' => $typeMatches, ]; } } diff --git a/formwidgets/MenuItems.php b/formwidgets/MenuItems.php index f29c0c4..01ff0a5 100644 --- a/formwidgets/MenuItems.php +++ b/formwidgets/MenuItems.php @@ -1,4 +1,6 @@ -vars['itemProperties'] = json_encode($menuItem->fillable); $this->vars['items'] = $this->model->{$this->fieldName}; - $emptyItem = new MenuItem; + $emptyItem = new MenuItem(); $emptyItem->title = trans($this->newItemTitle); $emptyItem->type = 'url'; $emptyItem->url = '/'; @@ -69,7 +71,7 @@ public function prepareVars() $widgetConfig = $this->makeConfig('~/plugins/winter/pages/classes/menuitem/fields.yaml'); $widgetConfig->model = $menuItem; - $widgetConfig->alias = $this->alias.'MenuItem'; + $widgetConfig->alias = $this->alias . 'MenuItem'; $this->vars['itemFormWidget'] = $this->makeWidget('Backend\Widgets\Form', $widgetConfig); } @@ -114,15 +116,12 @@ protected function getReferenceDescription($item) if ($item->type !== 'url') { if (isset($this->typeInfoCache[$item->type]['references'])) { - $result .= ': '.$this->findReferenceName($item->reference, $this->typeInfoCache[$item->type]['references']); + $result .= ': ' . $this->findReferenceName($item->reference, $this->typeInfoCache[$item->type]['references']); } + } else { + $result .= ': ' . $item->url; } - else { - $result .= ': '.$item->url; - } - - } - else { + } else { $result = trans('winter.pages::lang.menuitem.unknown_type'); } @@ -131,19 +130,19 @@ protected function getReferenceDescription($item) protected function findReferenceName($search, $typeOptionList) { - $iterator = function($optionList, $path) use ($search, &$iterator) { + $iterator = function ($optionList, $path) use ($search, &$iterator) { foreach ($optionList as $reference => $info) { if ($reference == $search) { $result = $this->getMenuItemTitle($info); - return strlen($path) ? $path.' / ' .$result : $result; + return strlen($path) ? $path . ' / ' . $result : $result; } if (is_array($info) && isset($info['items'])) { - $result = $iterator($info['items'], $path.' / '.$this->getMenuItemTitle($info)); + $result = $iterator($info['items'], $path . ' / ' . $this->getMenuItemTitle($info)); if (strlen($result)) { - return strlen($path) ? $path.' / '.$result : $result; + return strlen($path) ? $path . ' / ' . $result : $result; } } } diff --git a/formwidgets/MenuPicker.php b/formwidgets/MenuPicker.php index 51a428c..78bc0d4 100644 --- a/formwidgets/MenuPicker.php +++ b/formwidgets/MenuPicker.php @@ -1,4 +1,6 @@ - 'Spravovat stránky', 'manage_menus' => 'Spravovat menu', 'access_snippets' => 'Používat snippety', - 'manage_content' => 'Spravovat obsah' + 'manage_content' => 'Spravovat obsah', ], 'menu' => [ 'menu_label' => 'Menu', @@ -38,7 +38,7 @@ 'items' => 'Položky menu', 'add_subitem' => 'Přidat položku', 'code_required' => 'Pole kód je povinné.', - 'invalid_code' => 'Pole kód obsahuje neplatné znaky. Může obsahovat pouze číslice, písmena a znaky: _-' + 'invalid_code' => 'Pole kód obsahuje neplatné znaky. Může obsahovat pouze číslice, písmena a znaky: _-', ], 'menuitem' => [ 'title' => 'Titulek', @@ -72,19 +72,19 @@ 'external_link' => 'Externí odkaz', 'external_link_comment' => 'Otevřít odkaz této položky v novém okně.', 'static_page' => 'Statická stránka', - 'all_static_pages' => 'Všechny statické stránky' + 'all_static_pages' => 'Všechny statické stránky', ], 'content' => [ 'menu_label' => 'Obsah', - 'cant_save_to_dir' => 'Ukládat obsah do složky statických stránek není povoleno.' + 'cant_save_to_dir' => 'Ukládat obsah do složky statických stránek není povoleno.', ], 'sidebar' => [ 'add' => 'Přidat', - 'search' => 'Hledat...' + 'search' => 'Hledat...', ], 'object' => [ 'invalid_type' => 'Neznámý typ objektu', - 'not_found' => 'Požadovaný objekt nebyl nalezen.' + 'not_found' => 'Požadovaný objekt nebyl nalezen.', ], 'editor' => [ 'title' => 'Titulek', @@ -120,6 +120,6 @@ 'column_type_dropdown' => 'Seznam', 'not_found' => 'Snippet s kódem :code nebyl nalezen v rámci tématu.', 'property_format_error' => 'Kód vlastnosti by měl začínat písmenem a může obsahovat pouze písmena nebo číslice.', - 'invalid_option_key' => 'Neplatný klíč položky seznamu: %s. Klíč položky seznamu může obsahovat pouze písmena, číslice a znaky: _-' - ] + 'invalid_option_key' => 'Neplatný klíč položky seznamu: %s. Klíč položky seznamu může obsahovat pouze písmena, číslice a znaky: _-', + ], ]; diff --git a/lang/de/lang.php b/lang/de/lang.php index 770efa1..448ce2a 100644 --- a/lang/de/lang.php +++ b/lang/de/lang.php @@ -21,7 +21,7 @@ 'manage_pages' => 'Verwalte statische Seiten', 'manage_menus' => 'Verwalte statische Menüs', 'access_snippets' => 'Verwalte Snippets', - 'manage_content' => 'Verwalte den Inhalt' + 'manage_content' => 'Verwalte den Inhalt', ], 'menu' => [ 'menu_label' => 'Menüs', @@ -38,7 +38,7 @@ 'add_subitem' => 'Neuer Menüpunkt', 'no_records' => 'Keine Menüpunkte gefunden', 'code_required' => 'Ein Code ist erforderlich', - 'invalid_code' => 'Ungültiges Code Format. Der Code darf Ziffern, Buchstaben und folgenden Symbole enthalten: _-/' + 'invalid_code' => 'Ungültiges Code Format. Der Code darf Ziffern, Buchstaben und folgenden Symbole enthalten: _-/', ], 'menuitem' => [ 'title' => 'Titel', @@ -61,19 +61,19 @@ 'url_required' => 'Eine URL ist erforderlich', 'cms_page_required' => 'Bitten wählen Sie eine CMS Seite', 'code' => 'Code', - 'code_comment' => 'Geben Sie einen Menüpunkt-Code ein, wenn Sie diesen mit der API ansprechen möchten.' + 'code_comment' => 'Geben Sie einen Menüpunkt-Code ein, wenn Sie diesen mit der API ansprechen möchten.', ], 'content' => [ 'menu_label' => 'Inhalte', - 'cant_save_to_dir' => 'Das Speichern von Inhaltsdateien in den Statische-Seiten Ordner ist nicht erlaubt.' + 'cant_save_to_dir' => 'Das Speichern von Inhaltsdateien in den Statische-Seiten Ordner ist nicht erlaubt.', ], 'sidebar' => [ 'add' => 'Neu', - 'search' => 'Suche...' + 'search' => 'Suche...', ], 'object' => [ 'invalid_type' => 'Unbekannter Objekttyp', - 'not_found' => 'Das angeforderte Objekt wurde nicht gefunden.' + 'not_found' => 'Das angeforderte Objekt wurde nicht gefunden.', ], 'editor' => [ 'title' => 'Titel', @@ -110,6 +110,6 @@ 'column_type_dropdown' => 'Dropdown', 'not_found' => 'Das Snippet mit dem angeforderten code :code wurde nicht im Theme gefunden.', 'property_format_error' => 'Der Code für die Eigenschaft muss mit einem Buchstaben anfangen, und darf nur Buchstaben und Zahlen enthalten', - 'invalid_option_key' => 'Ungültiger Dropdown Optionsschlüssel: %s. Optionsschlüssel dürfen nur Zahlen, Buchstaben und die Zeichen _ und - enthalten' - ] - ]; + 'invalid_option_key' => 'Ungültiger Dropdown Optionsschlüssel: %s. Optionsschlüssel dürfen nur Zahlen, Buchstaben und die Zeichen _ und - enthalten', + ], +]; diff --git a/lang/el/lang.php b/lang/el/lang.php index 724ce88..0f51d64 100644 --- a/lang/el/lang.php +++ b/lang/el/lang.php @@ -64,7 +64,7 @@ 'code' => 'Κωδικός', 'code_comment' => 'Εισάγετε το κωδικό του μενού εάν θέλετε να έχετε πρόσβαση μέσω του API.', 'static_page' => 'Στατική σελίδα', - 'all_static_pages' => 'Όλες οι Στατικές Σελίδες' + 'all_static_pages' => 'Όλες οι Στατικές Σελίδες', ], 'content' => [ 'menu_label' => 'Περιεχόμενο', @@ -129,5 +129,5 @@ 'static_menu_code_description' => 'Ορίστε ένα κωδικό του μενού που το Δομικό Στοιχείο θα πρέπει να εξάγει.', 'static_breadcrumbs_name' => 'Στατικά breadcrumbs', 'static_breadcrumbs_description' => 'Παράγει breadcrumbs για μία στατική σελίδα.', - ] + ], ]; diff --git a/lang/en/lang.php b/lang/en/lang.php index d50a250..d396bc6 100644 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -73,7 +73,7 @@ 'external_link' => 'External link', 'external_link_comment' => 'Open links for this menu item in a new window.', 'static_page' => 'Static Page', - 'all_static_pages' => 'All Static Pages' + 'all_static_pages' => 'All Static Pages', ], 'content' => [ 'menu_label' => 'Content', @@ -143,5 +143,5 @@ 'static_breadcrumbs_description' => 'Outputs breadcrumbs for a static page.', 'child_pages_name' => 'Child pages', 'child_pages_description' => 'Displays a list of child pages for the current page', - ] + ], ]; diff --git a/lang/es/lang.php b/lang/es/lang.php index 1cf8dcc..43d663a 100644 --- a/lang/es/lang.php +++ b/lang/es/lang.php @@ -22,7 +22,7 @@ 'manage_pages' => 'Administrar páginas', 'manage_menus' => 'Administrar menús', 'access_snippets' => 'Acceder a fragmentos', - 'manage_content' => 'Administrar contenidos' + 'manage_content' => 'Administrar contenidos', ], 'menu' => [ 'menu_label' => 'Menus', @@ -39,7 +39,7 @@ 'add_subitem' => 'Añadir sub-elemento', 'no_records' => 'No se han encontrado elementos.', 'code_required' => 'El código es obligatorio', - 'invalid_code' => 'El formato del código no es válido. Puede contener letras, números y los siguientes símbolos: _ - ' + 'invalid_code' => 'El formato del código no es válido. Puede contener letras, números y los siguientes símbolos: _ - ', ], 'menuitem' => [ 'title' => 'Título', @@ -62,19 +62,19 @@ 'url_required' => 'La URL es obligatoria', 'cms_page_required' => 'Selecciona una página del CMS', 'code' => 'Código', - 'code_comment' => 'Introduce el código del elemento para acceder mediante la API.' + 'code_comment' => 'Introduce el código del elemento para acceder mediante la API.', ], 'content' => [ 'menu_label' => 'Contenido', - 'cant_save_to_dir' => 'No está permitido guardar archivos de contenido en el directorio de las páginas.' + 'cant_save_to_dir' => 'No está permitido guardar archivos de contenido en el directorio de las páginas.', ], 'sidebar' => [ 'add' => 'Añadir', - 'search' => 'Buscar...' + 'search' => 'Buscar...', ], 'object' => [ 'invalid_type' => 'Tipo de objeto desconocido', - 'not_found' => 'No se ha encontrado el objeto solicitado.' + 'not_found' => 'No se ha encontrado el objeto solicitado.', ], 'editor' => [ 'title' => 'Título', @@ -110,6 +110,6 @@ 'column_type_dropdown' => 'Desplegable', 'not_found' => 'No se ha encontrado ningún fragmento con el código :code en este tema.', 'property_format_error' => 'El código de propiedad debería comenzar por una letra. Sólo puede contener letras y números.', - 'invalid_option_key' => 'La clave de opción del desplegable no es válida : %s. Estas claves sólo pueden contener números, letras y los símbolos _ y -' - ] + 'invalid_option_key' => 'La clave de opción del desplegable no es válida : %s. Estas claves sólo pueden contener números, letras y los símbolos _ y -', + ], ]; diff --git a/lang/fa/lang.php b/lang/fa/lang.php index 22ed045..a868f3b 100644 --- a/lang/fa/lang.php +++ b/lang/fa/lang.php @@ -1,4 +1,6 @@ - [ 'name' => 'صفحات', 'description' => 'مدیریت صفحات و فهرست ها', @@ -127,5 +129,5 @@ 'static_menu_code_description' => 'کد فهرستی را که میخواهید به نمایش درآید انتخاب نمایید.', 'static_breadcrumbs_name' => 'نشان گرها', 'static_breadcrumbs_description' => 'نمایش نشان گرهای صفحه.', - ] + ], ]; diff --git a/lang/fi/lang.php b/lang/fi/lang.php index f4d2616..85c0881 100644 --- a/lang/fi/lang.php +++ b/lang/fi/lang.php @@ -72,7 +72,7 @@ 'external_link' => 'Ulkoinen linkki', 'external_link_comment' => 'Avaa linkki tämän valikon kohteesta uudessa ikkunassa.', 'static_page' => 'Staattinen sivu', - 'all_static_pages' => 'Kaikki staattiset sivut' + 'all_static_pages' => 'Kaikki staattiset sivut', ], 'content' => [ 'menu_label' => 'Sisältö', @@ -149,5 +149,5 @@ 'static_breadcrumbs_description' => 'Näyttää murupolun staattisella sivulla.', 'child_pages_name' => 'Alasivut', 'child_pages_description' => 'Näyttää listan nykyisen sivun alasivuista', - ] + ], ]; diff --git a/lang/fr/lang.php b/lang/fr/lang.php index 1093be2..6e8e8af 100644 --- a/lang/fr/lang.php +++ b/lang/fr/lang.php @@ -23,7 +23,7 @@ 'manage_menus' => 'Gérer les menus statiques', 'access_snippets' => 'Accès aux fragments', 'access_preview' => 'Accès à l’aperçu', - 'manage_content' => 'Gérer le contenu statique' + 'manage_content' => 'Gérer le contenu statique', ], 'menu' => [ 'menu_label' => 'Menus', @@ -39,7 +39,7 @@ 'items' => 'Éléments du menu', 'add_subitem' => 'Ajouter un élément', 'code_required' => 'Le Code est requis', - 'invalid_code' => 'Le format du Code est invalide. Le Code peut contenir des chiffres, des lettres et les symboles suivants : _-' + 'invalid_code' => 'Le format du Code est invalide. Le Code peut contenir des chiffres, des lettres et les symboles suivants : _-', ], 'menuitem' => [ 'title' => 'Titre', @@ -73,21 +73,21 @@ 'external_link' => 'Lien externe', 'external_link_comment' => 'Ouvrir les liens pour ce menu dans une nouvelle fenêtre.', 'static_page' => 'Page Statique', - 'all_static_pages' => 'Toutes les pages' + 'all_static_pages' => 'Toutes les pages', ], 'content' => [ 'menu_label' => 'Contenu', 'saved' => 'Le contenu a été sauvegardé avec succès.', - 'cant_save_to_dir' => 'L’enregistrement des fichiers de contenu dans le répertoire des pages statiques n’est pas autorisé.' + 'cant_save_to_dir' => 'L’enregistrement des fichiers de contenu dans le répertoire des pages statiques n’est pas autorisé.', ], 'sidebar' => [ 'add' => 'Ajouter', - 'search' => 'Rechercher...' + 'search' => 'Rechercher...', ], 'object' => [ 'invalid_type' => 'Type d’objet inconnu', 'unauthorized_type' => 'Vous n’êtes pas autorisé à gérer les objets de type :type', - 'not_found' => 'L’objet demandé n’a pas été trouvé.' + 'not_found' => 'L’objet demandé n’a pas été trouvé.', ], 'editor' => [ 'title' => 'Titre', @@ -124,7 +124,7 @@ 'column_type_dropdown' => 'Menu déroulant', 'not_found' => 'Le fragment demandé avec le code :code n’a pas été trouvé dans le thème.', 'property_format_error' => 'Le code de la propriété devrait commencer par une lettre et ne peut contenir que des lettres et des chiffres', - 'invalid_option_key' => 'Clé de l’option de la liste déroulante invalide. Les clés des options ne peuvent contenir que des chiffres, des lettres et les symboles _ et -' + 'invalid_option_key' => 'Clé de l’option de la liste déroulante invalide. Les clés des options ne peuvent contenir que des chiffres, des lettres et les symboles _ et -', ], 'component' => [ 'static_page_name' => 'Page Statique', diff --git a/lang/hu/lang.php b/lang/hu/lang.php index 6c4238c..b63f0b7 100644 --- a/lang/hu/lang.php +++ b/lang/hu/lang.php @@ -3,7 +3,7 @@ return [ 'plugin' => [ 'name' => 'Oldalak', - 'description' => 'Oldalak, menük, tartalmak és kódrészletek menedzselése.' + 'description' => 'Oldalak, menük, tartalmak és kódrészletek menedzselése.', ], 'page' => [ 'menu_label' => 'Oldalak', @@ -22,7 +22,7 @@ 'manage_pages' => 'Oldalak kezelése', 'manage_menus' => 'Menük kezelése', 'access_snippets' => 'Kódrészletek kezelése', - 'manage_content' => 'Tartalom kezelése' + 'manage_content' => 'Tartalom kezelése', ], 'menu' => [ 'menu_label' => 'Menük', @@ -38,7 +38,7 @@ 'items' => 'Menüpont', 'add_subitem' => 'Almenü hozzáadása', 'code_required' => 'A Kód kötelező', - 'invalid_code' => 'Érvénytelen a kód formátuma. Csak számokat, latin betűket és a következő szimbólumokat tartalmazhatja: _-' + 'invalid_code' => 'Érvénytelen a kód formátuma. Csak számokat, latin betűket és a következő szimbólumokat tartalmazhatja: _-', ], 'menuitem' => [ 'title' => 'Cím', @@ -72,21 +72,21 @@ 'external_link' => 'Külső hivatkozás', 'external_link_comment' => 'A link új ablakban fog megjelenni.', 'static_page' => 'Oldalak', - 'all_static_pages' => 'Összes oldal' + 'all_static_pages' => 'Összes oldal', ], 'content' => [ 'menu_label' => 'Tartalom', 'saved' => 'A tartalom mentése sikerült.', - 'cant_save_to_dir' => 'A fájlok mentése a "static-pages" könyvtárba nem engedélyezett.' + 'cant_save_to_dir' => 'A fájlok mentése a "static-pages" könyvtárba nem engedélyezett.', ], 'sidebar' => [ 'add' => 'Hozzáadás', - 'search' => 'Keresés...' + 'search' => 'Keresés...', ], 'object' => [ 'invalid_type' => 'Ismeretlen objektumtípus', 'unauthorized_type' => 'Nem jogosult a következő objektum(ok) kezelésére: :type', - 'not_found' => 'A kért objektum nem található.' + 'not_found' => 'A kért objektum nem található.', ], 'editor' => [ 'title' => 'Cím', @@ -102,7 +102,7 @@ 'hidden' => 'Rejtett', 'hidden_comment' => 'A rejtett oldalakhoz csak a bejelentkezett kiszolgáló oldali felhasználók férhetnek hozzá.', 'navigation_hidden' => 'Elrejtés a navigációban', - 'navigation_hidden_comment' => 'Jelölje be ezt a jelölőnégyzetet ennek a oldalnak az automatikusan generált menükből és útkövetésekből való elrejtéséhez.' + 'navigation_hidden_comment' => 'Jelölje be ezt a jelölőnégyzetet ennek a oldalnak az automatikusan generált menükből és útkövetésekből való elrejtéséhez.', ], 'snippet' => [ 'partialtab' => 'Kódrészlet', @@ -122,7 +122,7 @@ 'column_type_dropdown' => 'Lenyíló lista', 'not_found' => 'A(z) :code nevű kódrészlet nem található a témában.', 'property_format_error' => 'A kód latin karakterrel kezdődhet és csak latin karaktereket és számokat tartalmazhat.', - 'invalid_option_key' => 'Érvénytelen formátum: :key. Csak számokat, latin betűket és a következő szimbólumokat tartalmazhatja: _-' + 'invalid_option_key' => 'Érvénytelen formátum: :key. Csak számokat, latin betűket és a következő szimbólumokat tartalmazhatja: _-', ], 'component' => [ 'static_page_name' => 'Statikus oldal', @@ -141,5 +141,5 @@ 'static_breadcrumbs_description' => 'Kenyérmorzsa megjelenítése.', 'child_pages_name' => 'Aloldalak', 'child_pages_description' => 'Megjeleníti az aktuális oldal aloldalainak listáját.', - ] + ], ]; diff --git a/lang/it/lang.php b/lang/it/lang.php index f987877..a9b5197 100644 --- a/lang/it/lang.php +++ b/lang/it/lang.php @@ -22,7 +22,7 @@ 'manage_pages' => 'Gestisci pagine', 'manage_menus' => 'Gestisci menu', 'access_snippets' => 'Accedi agli snippet', - 'manage_content' => 'Gestisci contenuti' + 'manage_content' => 'Gestisci contenuti', ], 'menu' => [ 'menu_label' => 'Menu', @@ -38,7 +38,7 @@ 'items' => 'Voci di menu', 'add_subitem' => 'Aggiungi sottomenu', 'code_required' => 'Il Codice è obbligatorio', - 'invalid_code' => 'Formato del Codice non valido. Il Codice può contenere numeri, lettere latine e i seguenti simboli: _-' + 'invalid_code' => 'Formato del Codice non valido. Il Codice può contenere numeri, lettere latine e i seguenti simboli: _-', ], 'menuitem' => [ 'title' => 'Titolo', @@ -63,19 +63,19 @@ 'code' => 'Codice', 'code_comment' => 'Inserisci il codice della voce di menu se vuoi accedervi con l\'API.', 'static_page' => 'Pagine', - 'all_static_pages' => 'Tutte le pagine' + 'all_static_pages' => 'Tutte le pagine', ], 'content' => [ 'menu_label' => 'Contenuti', - 'cant_save_to_dir' => 'Salvataggio dei file di contenuto nella directory static-pages non consentito.' + 'cant_save_to_dir' => 'Salvataggio dei file di contenuto nella directory static-pages non consentito.', ], 'sidebar' => [ 'add' => 'Aggiungi', - 'search' => 'Cerca...' + 'search' => 'Cerca...', ], 'object' => [ 'invalid_type' => 'Tipo di oggetto sconosciuto', - 'not_found' => 'Oggetto richiesto non trovato.' + 'not_found' => 'Oggetto richiesto non trovato.', ], 'editor' => [ 'title' => 'Titolo', @@ -111,6 +111,6 @@ 'column_type_dropdown' => 'Menu a cascata', 'not_found' => 'Snippet con codice :code non trovato nel tema.', 'property_format_error' => 'Il codice della proprietà deve iniziare con una lettera latina e può contenere solo lettere latine e numeri', - 'invalid_option_key' => 'Opzione del menu a cascata non valida: %s. Le opzioni possono contenere solo numeri, lettere latine e i caratteri _ e -' - ] + 'invalid_option_key' => 'Opzione del menu a cascata non valida: %s. Le opzioni possono contenere solo numeri, lettere latine e i caratteri _ e -', + ], ]; diff --git a/lang/lv/lang.php b/lang/lv/lang.php index 350554b..19423ef 100644 --- a/lang/lv/lang.php +++ b/lang/lv/lang.php @@ -1,4 +1,5 @@ [ 'name' => 'Lapas', @@ -61,7 +62,7 @@ 'code' => 'Kods', 'code_comment' => 'Ievadi izvēlnes priekšmeta kodu, ja tam vēlies piekļūt izmantojot API.', 'static_page' => 'Statiska lapa', - 'all_static_pages' => 'Visas statiskās lapas' + 'all_static_pages' => 'Visas statiskās lapas', ], 'content' => [ 'menu_label' => 'Saturs', diff --git a/lang/nb-no/lang.php b/lang/nb-no/lang.php index 797db80..511a9db 100644 --- a/lang/nb-no/lang.php +++ b/lang/nb-no/lang.php @@ -21,7 +21,7 @@ 'manage_pages' => 'Administrer statiske sider', 'manage_menus' => 'Administrer statiske menyer', 'access_snippets' => 'Tilgang til snippets', - 'manage_content' => 'Administrer statisk innhold' + 'manage_content' => 'Administrer statisk innhold', ], 'menu' => [ 'menu_label' => 'Menyer', @@ -38,7 +38,7 @@ 'add_subitem' => 'Nytt underelement', 'no_records' => 'Ingen elementer funnet', 'code_required' => 'En kode kreves.', - 'invalid_code' => 'Ugyldig kode-format. Koden kan inneholde tall, latinske bokstaver og følgende symboler: _-' + 'invalid_code' => 'Ugyldig kode-format. Koden kan inneholde tall, latinske bokstaver og følgende symboler: _-', ], 'menuitem' => [ 'title' => 'Tittel', @@ -61,19 +61,19 @@ 'url_required' => 'En URL kreves.', 'cms_page_required' => 'Vennligst velg en CMS-side', 'code' => 'Kode', - 'code_comment' => 'Velg en elementkode hvis du trenger tilgang via API-en. (valgfritt)' + 'code_comment' => 'Velg en elementkode hvis du trenger tilgang via API-en. (valgfritt)', ], 'content' => [ 'menu_label' => 'Innhold', - 'cant_save_to_dir' => 'Å lagre innhold til files i static-pages-mappen er ikke tillatt.' + 'cant_save_to_dir' => 'Å lagre innhold til files i static-pages-mappen er ikke tillatt.', ], 'sidebar' => [ 'add' => 'Legg til', - 'search' => 'Søk...' + 'search' => 'Søk...', ], 'object' => [ 'invalid_type' => 'Ukjent objekttype', - 'not_found' => 'Det forespurte objektet ble ikke funnet.' + 'not_found' => 'Det forespurte objektet ble ikke funnet.', ], 'editor' => [ 'title' => 'Tittel', @@ -109,6 +109,6 @@ 'column_type_dropdown' => 'Dropdown', 'not_found' => 'En snippet med koden :code ble ikke funnet.', 'property_format_error' => 'Egenskapkoden skal starte med en latinsk bokstav og kan kun inneholde bokstver og tall.', - 'invalid_option_key' => 'Ugyldig dropdown-alternativ kode: %s. Alternativkoder kan bare inneholde tall, latinske bokstaver, _ og -' - ] + 'invalid_option_key' => 'Ugyldig dropdown-alternativ kode: %s. Alternativkoder kan bare inneholde tall, latinske bokstaver, _ og -', + ], ]; diff --git a/lang/nl/lang.php b/lang/nl/lang.php index c8e5bb9..9e81bc7 100644 --- a/lang/nl/lang.php +++ b/lang/nl/lang.php @@ -63,7 +63,7 @@ 'code' => 'Code', 'code_comment' => 'Geef de menu item code op indien u deze wilt benaderen via de API.', 'static_page' => 'Statische pagina', - 'all_static_pages' => 'Alle statische pagina\'s' + 'all_static_pages' => 'Alle statische pagina\'s', ], 'content' => [ 'menu_label' => 'Inhoud', diff --git a/lang/pl/lang.php b/lang/pl/lang.php index 1ce4379..82056da 100644 --- a/lang/pl/lang.php +++ b/lang/pl/lang.php @@ -1,4 +1,6 @@ - [ 'name' => 'Strony', 'description' => 'Strony statyczne oraz menu.', diff --git a/lang/pt-br/lang.php b/lang/pt-br/lang.php index 03b20d1..9496ad4 100644 --- a/lang/pt-br/lang.php +++ b/lang/pt-br/lang.php @@ -22,7 +22,7 @@ 'manage_pages' => 'Gerenciar páginas estáticas', 'manage_menus' => 'Gerenciar menus estáticos', 'access_snippets' => 'Acessar fragmentos', - 'manage_content' => 'Gerenciar conteúdos estáticos' + 'manage_content' => 'Gerenciar conteúdos estáticos', ], 'menu' => [ 'menu_label' => 'Menus', @@ -39,7 +39,7 @@ 'add_subitem' => 'Adicionar subitem', 'no_records' => 'Nenhum item encontrado', 'code_required' => 'O código é necessário', - 'invalid_code' => 'Formato inválido de código. O código pode conter dígitos, letras latinas e os seguintes símbolos: _-' + 'invalid_code' => 'Formato inválido de código. O código pode conter dígitos, letras latinas e os seguintes símbolos: _-', ], 'menuitem' => [ 'title' => 'Título', @@ -62,19 +62,19 @@ 'url_required' => 'A URL é necessária', 'cms_page_required' => 'Por favor, selecione uma página CMS', 'code' => 'Código', - 'code_comment' => 'Entre com o código do item se deseja acessar com a API.' + 'code_comment' => 'Entre com o código do item se deseja acessar com a API.', ], 'content' => [ 'menu_label' => 'Conteúdo', - 'cant_save_to_dir' => 'Não é permitido salvar arquivos de conteúdo no diretório de páginas estáticas.' + 'cant_save_to_dir' => 'Não é permitido salvar arquivos de conteúdo no diretório de páginas estáticas.', ], 'sidebar' => [ 'add' => 'Adicionar', - 'search' => 'Buscar...' + 'search' => 'Buscar...', ], 'object' => [ 'invalid_type' => 'Tipo de objeto desconhecido', - 'not_found' => 'O objeto requisitado não foi encontrado.' + 'not_found' => 'O objeto requisitado não foi encontrado.', ], 'editor' => [ 'title' => 'Título', @@ -110,6 +110,6 @@ 'column_type_dropdown' => 'Caixa de seleção suspensa', 'not_found' => 'Fragmento com o código :code não foi encontrado.', 'property_format_error' => 'Código da propriedade deve iniciar com uma letra latina e pode conter apenas letras latinas e dígitos', - 'invalid_option_key' => 'Chave de opção inválida: %s. Chaves de opção podem conter apenas dígitos, letras latinas e os caracteres _ e -' - ] + 'invalid_option_key' => 'Chave de opção inválida: %s. Chaves de opção podem conter apenas dígitos, letras latinas e os caracteres _ e -', + ], ]; diff --git a/lang/ru/lang.php b/lang/ru/lang.php index e3e9871..6954948 100644 --- a/lang/ru/lang.php +++ b/lang/ru/lang.php @@ -1,4 +1,6 @@ - [ 'name' => 'Страницы', 'description' => 'Страницы и меню.', diff --git a/lang/sk/lang.php b/lang/sk/lang.php index 2d3a2d0..19cc50f 100644 --- a/lang/sk/lang.php +++ b/lang/sk/lang.php @@ -72,7 +72,7 @@ 'external_link' => 'Externý odkaz', 'external_link_comment' => 'Otvoriť odkaz tejto položky menu v novom okne.', 'static_page' => 'Statická stránka', - 'all_static_pages' => 'Všetky statické stránky' + 'all_static_pages' => 'Všetky statické stránky', ], 'content' => [ 'menu_label' => 'Obsah', @@ -138,5 +138,5 @@ 'static_menu_code_description' => 'Zadajte kód menu, ktoré má komponent zobraziť.', 'static_breadcrumbs_name' => 'Statická navigačná cesta', 'static_breadcrumbs_description' => 'Zobrazí navigačnú cestu na stránke.', - ] + ], ]; diff --git a/lang/sv/lang.php b/lang/sv/lang.php index 0ac52ef..099a016 100644 --- a/lang/sv/lang.php +++ b/lang/sv/lang.php @@ -22,7 +22,7 @@ 'manage_pages' => 'Hantera statiska sidor', 'manage_menus' => 'Hantera statiska menyer', 'access_snippets' => 'Hantera stumpar', - 'manage_content' => 'Hantera statiskt innehåll' + 'manage_content' => 'Hantera statiskt innehåll', ], 'menu' => [ 'menu_label' => 'Menyer', @@ -39,7 +39,7 @@ 'add_subitem' => 'Lägg till undermeny', 'no_records' => 'Inga föremål kunde hittas', 'code_required' => 'Koden är obligatorisk', - 'invalid_code' => 'Ogiltigt kodformat. Koden kan innehålla siffror, latinska bokstäver och följande symboler: _-' + 'invalid_code' => 'Ogiltigt kodformat. Koden kan innehålla siffror, latinska bokstäver och följande symboler: _-', ], 'menuitem' => [ 'title' => 'Titel', @@ -62,19 +62,19 @@ 'url_required' => 'URL:en är obligatorisk', 'cms_page_required' => 'Vänligen välj en CMS-sida', 'code' => 'Kod', - 'code_comment' => 'Ange kod om du vill få tillgång till menyobjektet i API:t.' + 'code_comment' => 'Ange kod om du vill få tillgång till menyobjektet i API:t.', ], 'content' => [ 'menu_label' => 'Innehåll', - 'cant_save_to_dir' => 'Att spara innehållsfiler till mappen för statiska sidor är inte tillåtet.' + 'cant_save_to_dir' => 'Att spara innehållsfiler till mappen för statiska sidor är inte tillåtet.', ], 'sidebar' => [ 'add' => 'Lägg till', - 'search' => 'Sök...' + 'search' => 'Sök...', ], 'object' => [ 'invalid_type' => 'Ogiltig objekttyp', - 'not_found' => 'Det begärda objektet kunde inte finnas.' + 'not_found' => 'Det begärda objektet kunde inte finnas.', ], 'editor' => [ 'title' => 'Titel', @@ -110,6 +110,6 @@ 'column_type_dropdown' => 'Rullgardinsmeny', 'not_found' => 'En stump med den begärda koden :code kunde inte hittas i temat.', 'property_format_error' => 'Egenskapskoden ska börja med en latisk bokstav kan bara innehålla latinska bokstäver samt siffror', - 'invalid_option_key' => 'Nyckeln: %s, i Rullgardinsmenyn är ogiltig. Alternativnycklarna kan bara innehålla siffror, latinska bokstäver och karaktärerna _ samt -' - ] + 'invalid_option_key' => 'Nyckeln: %s, i Rullgardinsmenyn är ogiltig. Alternativnycklarna kan bara innehålla siffror, latinska bokstäver och karaktärerna _ samt -', + ], ]; diff --git a/lang/uk/lang.php b/lang/uk/lang.php index 3434229..12a5d04 100644 --- a/lang/uk/lang.php +++ b/lang/uk/lang.php @@ -1,4 +1,6 @@ - [ 'name' => 'Сторінки', 'description' => 'Сторінки і меню.', diff --git a/lang/vn/lang.php b/lang/vn/lang.php index 1f7a645..433568f 100644 --- a/lang/vn/lang.php +++ b/lang/vn/lang.php @@ -72,7 +72,7 @@ 'external_link' => 'Liên kết bên ngoài', 'external_link_comment' => 'Mở liên kết cho menu này trong một cửa sổ mới.', 'static_page' => 'Trang nội dung tĩnh', - 'all_static_pages' => 'Tất cả các trang nội dung tĩnh' + 'all_static_pages' => 'Tất cả các trang nội dung tĩnh', ], 'content' => [ 'menu_label' => 'Nội dung', @@ -141,5 +141,5 @@ 'static_breadcrumbs_description' => 'Hiển thị đường dẫn của trang.', 'child_pages_name' => 'Trang con', 'child_pages_description' => 'Hiển thị danh sách các trang con cho trang hiện tại', - ] + ], ]; diff --git a/lang/zh-cn/lang.php b/lang/zh-cn/lang.php index 0caa473..e33c9a8 100644 --- a/lang/zh-cn/lang.php +++ b/lang/zh-cn/lang.php @@ -1,4 +1,5 @@ [ 'name' => '页面', @@ -63,7 +64,7 @@ 'code' => '编码', 'code_comment' => '如果要使用 API 访问菜单项代码,请输入。', 'static_page' => '静态页面', - 'all_static_pages' => '所有静态页' + 'all_static_pages' => '所有静态页', ], 'content' => [ 'menu_label' => '内容', @@ -128,5 +129,5 @@ 'static_menu_code_description' => '指定组件应输出的菜单代码。', 'static_breadcrumbs_name' => '静态面包屑导航', 'static_breadcrumbs_description' => '输出静态页面的面包屑导航。', - ] + ], ]; diff --git a/tests/classes/ObjectHelperTest.php b/tests/classes/ObjectHelperTest.php index b08bfb6..24b1312 100644 --- a/tests/classes/ObjectHelperTest.php +++ b/tests/classes/ObjectHelperTest.php @@ -3,10 +3,10 @@ namespace Winter\Pages\Tests\Classes; use Cms\Classes\Theme; -use Config; use PluginTestCase; use Winter\Pages\Classes\ObjectHelper; use Winter\Storm\Exception\ApplicationException; +use Winter\Storm\Support\Facades\Config; class ObjectHelperTest extends PluginTestCase { diff --git a/updates/v1.1.0/snippets_rename_viewbag_properties.php b/updates/v1.1.0/snippets_rename_viewbag_properties.php index 0b69c90..6a1ea14 100644 --- a/updates/v1.1.0/snippets_rename_viewbag_properties.php +++ b/updates/v1.1.0/snippets_rename_viewbag_properties.php @@ -1,10 +1,11 @@ -getFilePath(); $contents = File::get($path); - if (strpos($contents, 'staticPageSnippetCode') === false) continue; + if (strpos($contents, 'staticPageSnippetCode') === false) { + continue; + } $contents = str_replace('staticPageSnippetName', 'snippetName', $contents); $contents = str_replace('staticPageSnippetCode', 'snippetCode', $contents); $contents = str_replace('staticPageSnippetProperties', 'snippetProperties', $contents); File::put($path, $contents); + } catch (\Exception $ex) { + continue; } - catch (\Exception $ex) { continue; } } } } diff --git a/widgets/MenuList.php b/widgets/MenuList.php index 4d875da..13369b5 100644 --- a/widgets/MenuList.php +++ b/widgets/MenuList.php @@ -1,10 +1,12 @@ -alias = $alias; $this->theme = Theme::getEditTheme(); - $this->dataIdPrefix = 'page-'.$this->theme->getDirName(); + $this->dataIdPrefix = 'page-' . $this->theme->getDirName(); parent::__construct($controller, []); $this->bindToController(); @@ -45,7 +47,7 @@ public function __construct($controller, $alias) public function render() { return $this->makePartial('body', [ - 'data' => $this->getData() + 'data' => $this->getData(), ]); } @@ -83,7 +85,7 @@ protected function getData() $filteredMenus = []; foreach ($menus as $menu) { - if ($this->textMatchesSearch($words, $menu->name.' '.$menu->fileName)) { + if ($this->textMatchesSearch($words, $menu->name . ' ' . $menu->fileName)) { $filteredMenus[] = $menu; } } @@ -97,7 +99,7 @@ protected function getData() protected function updateList() { $vars = ['items' => $this->getData()]; - return ['#'.$this->getId('menu-list') => $this->makePartial('items', $vars)]; + return ['#' . $this->getId('menu-list') => $this->makePartial('items', $vars)]; } protected function getThemeSessionKey($prefix) diff --git a/widgets/PageList.php b/widgets/PageList.php index 521e08e..1e6ae41 100644 --- a/widgets/PageList.php +++ b/widgets/PageList.php @@ -1,10 +1,12 @@ -alias = $alias; $this->theme = Theme::getEditTheme(); - $this->dataIdPrefix = 'page-'.$this->theme->getDirName(); + $this->dataIdPrefix = 'page-' . $this->theme->getDirName(); parent::__construct($controller, []); $this->bindToController(); @@ -49,7 +51,7 @@ public function __construct($controller, $alias) public function render() { return $this->makePartial('body', [ - 'data' => $this->getData() + 'data' => $this->getData(), ]); } @@ -97,14 +99,14 @@ protected function getData() if (strlen($searchTerm)) { $words = explode(' ', $searchTerm); - $iterator = function($pages) use (&$iterator, $words) { + $iterator = function ($pages) use (&$iterator, $words) { $result = []; foreach ($pages as $page) { if ($this->textMatchesSearch($words, $this->subtreeToText($page))) { $result[] = (object) [ 'page' => $page->page, - 'subpages' => $iterator($page->subpages) + 'subpages' => $iterator($page->subpages), ]; } } @@ -120,21 +122,21 @@ protected function getData() protected function getThemeSessionKey($prefix) { - return $prefix.$this->theme->getDirName(); + return $prefix . $this->theme->getDirName(); } protected function updateList() { - return ['#'.$this->getId('page-list') => $this->makePartial('items', ['items' => $this->getData()])]; + return ['#' . $this->getId('page-list') => $this->makePartial('items', ['items' => $this->getData()])]; } protected function subtreeToText($page) { $result = $this->pageToText($page->page); - $iterator = function($pages) use (&$iterator, &$result) { + $iterator = function ($pages) use (&$iterator, &$result) { foreach ($pages as $page) { - $result .= ' '.$this->pageToText($page->page); + $result .= ' ' . $this->pageToText($page->page); $iterator($page->subpages); } }; @@ -148,7 +150,7 @@ protected function pageToText($page) { $viewBag = $page->getViewBag(); - return $page->getViewBag()->property('title').' '.$page->getViewBag()->property('url'); + return $page->getViewBag()->property('title') . ' ' . $page->getViewBag()->property('url'); } protected function getSession($key = null, $default = null) diff --git a/widgets/SnippetList.php b/widgets/SnippetList.php index 7862a59..bf88089 100644 --- a/widgets/SnippetList.php +++ b/widgets/SnippetList.php @@ -1,10 +1,12 @@ -alias = $alias; $this->theme = Theme::getEditTheme(); - $this->dataIdPrefix = 'snippet-'.$this->theme->getDirName(); + $this->dataIdPrefix = 'snippet-' . $this->theme->getDirName(); parent::__construct($controller, []); $this->bindToController(); @@ -39,7 +41,7 @@ public function __construct($controller, $alias) public function render() { return $this->makePartial('body', [ - 'data' => $this->getData() + 'data' => $this->getData(), ]); } @@ -70,7 +72,7 @@ protected function getData() $filteredSnippets = []; foreach ($snippets as $snippet) { - if ($this->textMatchesSearch($words, $snippet->getName().' '.$snippet->code.' '.$snippet->getDescription())) { + if ($this->textMatchesSearch($words, $snippet->getName() . ' ' . $snippet->code . ' ' . $snippet->getDescription())) { $filteredSnippets[] = $snippet; } } @@ -78,7 +80,7 @@ protected function getData() $snippets = $filteredSnippets; } - usort($snippets, function($a, $b) { + usort($snippets, function ($a, $b) { return strcmp($a->getName(), $b->getName()); }); @@ -87,12 +89,12 @@ protected function getData() protected function updateList() { - return ['#'.$this->getId('snippet-list') => $this->makePartial('items', ['items' => $this->getData()])]; + return ['#' . $this->getId('snippet-list') => $this->makePartial('items', ['items' => $this->getData()])]; } protected function getThemeSessionKey($prefix) { - return $prefix.$this->theme->getDirName(); + return $prefix . $this->theme->getDirName(); } protected function getSession($key = null, $default = null)