From 6e2788b36f8fdb80a89de732cd87b675708f9bdf Mon Sep 17 00:00:00 2001 From: Alexsander Vyshnyvetskyy Date: Thu, 6 Jul 2023 14:11:44 +0300 Subject: [PATCH] Update copyrights, fix menu dashboard --- CHANGELOG.md | 3 ++- LICENSE | 2 +- Module.php | 22 ++++++++++++++++++---- README.md | 9 +-------- composer.json | 2 +- views/fields/index.php | 8 ++++---- views/list/index.php | 8 ++++---- views/submitted/index.php | 2 +- 8 files changed, 32 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e501f88..f366892 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,8 @@ Changelog ========= -## 1.1.* +## 1.2.0 (2023-07-06) + * Update copyrights, fix menu dashboard * Lang attribute for HTML tags and inputs ## 1.1.2 (2020-12-28) diff --git a/LICENSE b/LICENSE index 4ff35d5..92279d7 100755 --- 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 2f16a9e..6f3afa4 100755 --- a/Module.php +++ b/Module.php @@ -6,14 +6,15 @@ * Yii2 Forms * * @category Module - * @version 1.1.2 + * @version 1.2.0 * @author Alexsander Vyshnyvetskyy * @link https://github.com/wdmg/yii2-forms - * @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; @@ -51,7 +52,7 @@ class Module extends BaseModule /** * @var string the module version */ - private $version = "1.1.2"; + private $version = "1.2.0"; /** * @var integer, priority of initialization @@ -101,7 +102,20 @@ public function dashboardNavItems($options = false) ] ] ]; - 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 65c2445..4a44e0a 100755 --- a/README.md +++ b/README.md @@ -101,13 +101,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 menu dashboard * v.1.1.2 - RBAC implementation * v.1.1.1 - Update README.md and setAttributeLabels() fixed -* v.1.1.0 - Multi-language support, submit() method for Form component -* v.1.0.13 - Update dependencies -* v.1.0.12 - Log activity and translations, added forms component -* v.1.0.11 - Added pagination, up to date dependencies -* v.1.0.10 - Rebuild migrations, views -* v.1.0.9 - Fixed deprecated class declaration -* v.1.0.8 - Added extra options to composer.json and navbar menu icon -* v.1.0.7 - Added choice param for non interactive mode diff --git a/composer.json b/composer.json index 81375e8..fe9f79f 100755 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "keywords": ["yii2", "yii2-forms", "forms", "form management", "wdmg"], "type": "yii2-extension", "license": "MIT", - "version": "1.1.2", + "version": "1.2.0", "homepage": "https://github.com/wdmg/yii2-forms", "support": { "source": "https://github.com/wdmg/yii2-forms", diff --git a/views/fields/index.php b/views/fields/index.php index ce77152..475c4a9 100755 --- a/views/fields/index.php +++ b/views/fields/index.php @@ -217,7 +217,7 @@ } - if (is_countable($output)) { + if (is_array($output)) { if (count($output) > 0) { $onMore = false; if (count($output) > 3) @@ -360,7 +360,7 @@ } } - if (is_countable($output)) { + if (is_array($output)) { if (count($output) > 1) { $html = ''; $html .= '
'; @@ -442,7 +442,7 @@ } } - if (is_countable($output)) { + if (is_array($output)) { if (count($output) > 1) { $html = ''; $html .= '
'; @@ -536,7 +536,7 @@ } } - if (is_countable($output)) { + if (is_array($output)) { if (count($output) > 1) { $html = ''; $html .= '
'; diff --git a/views/list/index.php b/views/list/index.php index 72f09c5..1487ae1 100755 --- a/views/list/index.php +++ b/views/list/index.php @@ -141,7 +141,7 @@ } - if (is_countable($output)) { + if (is_array($output)) { if (count($output) > 0) { $onMore = false; if (count($output) > 3) @@ -240,7 +240,7 @@ } } - if (is_countable($output)) { + if (is_array($output)) { if (count($output) > 1) { $html = ''; $html .= '
'; @@ -322,7 +322,7 @@ } } - if (is_countable($output)) { + if (is_array($output)) { if (count($output) > 1) { $html = ''; $html .= '
'; @@ -416,7 +416,7 @@ } } - if (is_countable($output)) { + if (is_array($output)) { if (count($output) > 1) { $html = ''; $html .= '
'; diff --git a/views/submitted/index.php b/views/submitted/index.php index 3372867..b9cbbe1 100755 --- a/views/submitted/index.php +++ b/views/submitted/index.php @@ -66,7 +66,7 @@ 'value' => function($data) { $count = 0; $output = ''; - if (is_countable($data->contents)) { + if (is_array($data->contents)) { foreach ($data->contents as $content) { if ($count >= 6) {