From fc82641948ecc79eb6278a42080f302f055a955e Mon Sep 17 00:00:00 2001 From: Alexsander Vyshnyvetskyy Date: Sun, 25 Jun 2023 12:05:41 +0300 Subject: [PATCH] Update copyrights, fix nav menu --- CHANGELOG.md | 3 ++- LICENSE | 2 +- Module.php | 21 +++++++++++++++++---- README.md | 12 ++---------- commands/InitController.php | 2 +- composer.json | 2 +- views/pages/index.php | 8 ++++---- 7 files changed, 28 insertions(+), 22 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 039df19..a658eb1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ Changelog ========= -## 1.2.* +## 1.3.0 (2023-06-25) + * Update copyrights, fix nav menu * Lang attribute for HTML tags and inputs ## 1.2.5 (2020-12-29) diff --git a/LICENSE b/LICENSE index 4ff35d5..92279d7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 - 2020 W.D.M.Group, Ukraine +Copyright (c) 2019 - 2023 W.D.M.Group, Ukraine Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Module.php b/Module.php index d359da6..90e63b6 100644 --- a/Module.php +++ b/Module.php @@ -6,10 +6,10 @@ * Yii2 Pages * * @category Module - * @version 1.2.5 + * @version 1.3.0 * @author Alexsander Vyshnyvetskyy * @link https://github.com/wdmg/yii2-pages - * @copyright Copyright (c) 2019 - 2021 W.D.M.Group, Ukraine + * @copyright Copyright (c) 2019 - 2023 W.D.M.Group, Ukraine * @license https://opensource.org/licenses/MIT Massachusetts Institute of Technology (MIT) License * */ @@ -48,7 +48,7 @@ class Module extends BaseModule /** * @var string the module version */ - private $version = "1.2.5"; + private $version = "1.3.0"; /** * @var integer, priority of initialization @@ -136,7 +136,20 @@ public function dashboardNavItems($options = false) 'icon' => 'fa fa-fw fa-layer-group', 'active' => in_array(\Yii::$app->controller->module->id, [$this->id]) ]; - return $items; + + if (!is_null($options)) { + + if (isset($options['count'])) { + $items['label'] .= '' . $options['count'] . ''; + unset($options['count']); + } + + if (is_array($options)) + $items = \wdmg\helpers\ArrayHelper::merge($items, $options); + + } + + return $items; } /** diff --git a/README.md b/README.md index 4c6543e..c3622fb 100644 --- a/README.md +++ b/README.md @@ -70,15 +70,7 @@ Use the `Module::dashboardNavItems()` method of the module to generate a navigat ?> # Status and version [ready to use] +* v.1.3.0 - Update copyrights, fix nav menu * v.1.2.5 - RBAC implementation * v.1.2.4 - URL redirect notify, defaultController property, update dependencies and README.md -* v.1.2.3 - Update README.md and dependencies -* v.1.2.2 - Added AliasInput::widget() -* v.1.2.1 - Rebased to ActiveRecordML model -* v.1.2.0 - Multi-language implementation -* v.1.1.12 - Log activity -* v.1.1.11 - Added pagination, up to date dependencies -* v.1.1.10 - Refactoring. Migrations bugfix -* v.1.1.9 - Added multiple nesting for pages -* v.1.1.8 - Added support for Yandex.Turbo and Google AMP modules -* v.1.1.7 - Added support for Sitemap module \ No newline at end of file +* v.1.2.3 - Update README.md and dependencies \ No newline at end of file diff --git a/commands/InitController.php b/commands/InitController.php index 718036e..2c9fe0f 100644 --- a/commands/InitController.php +++ b/commands/InitController.php @@ -33,7 +33,7 @@ public function actionIndex($params = null) '║ ║'. "\n" . '║ PAGES MODULE, v.'.$version.' ║'. "\n" . '║ by Alexsander Vyshnyvetskyy ║'. "\n" . - '║ (c) 2019-2021 W.D.M.Group, Ukraine ║'. "\n" . + '║ (c) 2019-2023 W.D.M.Group, Ukraine ║'. "\n" . '║ ║'. "\n" . '╚════════════════════════════════════════════════╝'; echo $name = $this->ansiFormat($welcome . "\n\n", Console::FG_GREEN); diff --git a/composer.json b/composer.json index 00cd479..a2d87e4 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "keywords": ["yii2", "yii2-pages", "static", "pages", "wdmg"], "type": "yii2-extension", "license": "MIT", - "version": "1.2.5", + "version": "1.3.0", "homepage": "https://github.com/wdmg/yii2-pages", "support": { "source": "https://github.com/wdmg/yii2-pages", diff --git a/views/pages/index.php b/views/pages/index.php index a9ebea7..554a482 100644 --- a/views/pages/index.php +++ b/views/pages/index.php @@ -247,7 +247,7 @@ } - if (is_countable($output)) { + if (is_array($output)) { if (count($output) > 0) { $onMore = false; if (count($output) > 3) @@ -344,7 +344,7 @@ } } - if (is_countable($output)) { + if (is_array($output)) { if (count($output) > 1) { $html = ''; $html .= '
'; @@ -426,7 +426,7 @@ } } - if (is_countable($output)) { + if (is_array($output)) { if (count($output) > 1) { $html = ''; $html .= '
'; @@ -520,7 +520,7 @@ } } - if (is_countable($output)) { + if (is_array($output)) { if (count($output) > 1) { $html = ''; $html .= '
';