From 56fca376116ab83e30c1773c6ed9cff12a5839a6 Mon Sep 17 00:00:00 2001 From: Alexsander Vyshnyvetskyy Date: Thu, 29 Jun 2023 10:58:39 +0300 Subject: [PATCH] Update copyrights, fix nav menu --- CHANGELOG.md | 3 +++ LICENSE | 2 +- Module.php | 24 +++++++++++++++++++----- README.md | 8 ++------ commands/InitController.php | 2 +- composer.json | 2 +- 6 files changed, 27 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1cb123..0bb7b43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ Changelog ========= +## 1.2.0 (2023-06-29) + * Update copyrights, fix nav menu + ## 1.1.4 (2020-06-28) * Update dependencies, README.md 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 4e317a3..cdb8895 100644 --- a/Module.php +++ b/Module.php @@ -6,14 +6,15 @@ * Yii2 Sitemap manager * * @category Module - * @version 1.1.4 + * @version 1.2.0 * @author Alexsander Vyshnyvetskyy * @link https://github.com/wdmg/yii2-sitemap - * @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 * */ +use wdmg\helpers\ArrayHelper; use Yii; use wdmg\base\BaseModule; use yii\base\InvalidConfigException; @@ -78,7 +79,7 @@ class Module extends BaseModule /** * @var string the module version */ - private $version = "1.1.4"; + private $version = "1.2.0"; /** * @var integer, priority of initialization @@ -106,7 +107,7 @@ public function init() /** * {@inheritdoc} */ - public function dashboardNavItems($options = false) + public function dashboardNavItems($options = null) { $items = [ 'label' => $this->name, @@ -114,7 +115,20 @@ public function dashboardNavItems($options = false) 'url' => [$this->routePrefix . '/'. $this->id], 'active' => (in_array(\Yii::$app->controller->module->id, [$this->id]) && Yii::$app->controller->id == 'list'), ]; - return $items; + + if (!is_null($options)) { + + if (isset($options['count'])) { + $items['label'] .= '' . $options['count'] . ''; + unset($options['count']); + } + + if (is_array($options)) + $items = ArrayHelper::merge($items, $options); + + } + + return $items; } /** diff --git a/README.md b/README.md index 2985f28..2cf4c6b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ In addition, you can add/edit and delete the URL of sitemap in manual mode. This module is an integral part of the [Butterfly.СMS](https://butterflycms.com/) content management system, but can also be used as an standalone extension. -Copyrights (c) 2019-2021 [W.D.M.Group, Ukraine](https://wdmg.com.ua/) +Copyrights (c) 2019-2023 [W.D.M.Group, Ukraine](https://wdmg.com.ua/) # Requirements * PHP 5.6 or higher @@ -88,10 +88,6 @@ Use the `Module::dashboardNavItems()` method of the module to generate a navigat ?> # Status and version [ready to use] +* v.1.2.0 - Update copyrights, fix nav menu * v.1.1.4 - Update dependencies, README.md * v.1.1.3 - Update README.md and dependencies -* v.1.1.2 - Added support for Blog module, fixed models items retrieved -* v.1.1.1 - Added pagination -* v.1.1.0 - Added CRUD for edit sitemap URL`s -* v.1.0.0 - Added support for Pages and News models -* v.0.0.1 - Initial commit. Added console, migrations and controller diff --git a/commands/InitController.php b/commands/InitController.php index 92aa049..aa86378 100644 --- a/commands/InitController.php +++ b/commands/InitController.php @@ -33,7 +33,7 @@ public function actionIndex($params = null) '║ ║'. "\n" . '║ SITEMAP 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 836f0d6..dd8f43b 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "keywords": ["yii2", "yii2-sitemap", "sitemap", "manager", "wdmg"], "type": "yii2-extension", "license": "MIT", - "version": "1.1.4", + "version": "1.2.0", "homepage": "https://github.com/wdmg/yii2-sitemap", "support": { "source": "https://github.com/wdmg/yii2-sitemap",