Skip to content

Commit

Permalink
Some fix, update copyrights
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-wdmg committed Jun 24, 2023
1 parent 552ad98 commit 8713bd4
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 24 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Changelog
=========

## 1.7.0 (2023-06-24)
* Some fix, update copyrights

## 1.6.0 (2020-10-21)
* Fixed string type detection for option value
* Added metadata to options export file
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 19 additions & 4 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
* Yii2 Options
*
* @category Module
* @version 1.6.0
* @version 1.7.0
* @author Alexsander Vyshnyvetskyy <[email protected]>
* @link https://github.com/wdmg/yii2-options
* @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;

Expand Down Expand Up @@ -45,7 +46,7 @@ class Module extends BaseModule
/**
* @var string the module version
*/
private $version = "1.6.0";
private $version = "1.7.0";

/**
* @var integer, priority of initialization
Expand Down Expand Up @@ -75,14 +76,28 @@ public function init()
/**
* {@inheritdoc}
*/
public function dashboardNavItems($options = false)
public function dashboardNavItems($options = null)
{
$items = [
'label' => $this->name,
'url' => [$this->routePrefix . '/'. $this->id],
'icon' => 'fa fa-fw fa-cog',
'active' => in_array(\Yii::$app->controller->module->id, [$this->id])
];

$options['count'] = 9;
if (!is_null($options)) {

if (isset($options['count'])) {
$items['label'] .= '<span class="badge badge-default float-right">' . $options['count'] . '</span>';
unset($options['count']);
}

if (is_array($options))
$items = ArrayHelper::merge($items, $options);

}

return $items;
}

Expand Down
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Yii2](https://img.shields.io/badge/required-Yii2_v2.0.40-blue.svg)](https://packagist.org/packages/yiisoft/yii2)
[![Yii2](https://img.shields.io/badge/required-Yii2_v2.0.35-blue.svg)](https://packagist.org/packages/yiisoft/yii2)
[![Downloads](https://img.shields.io/packagist/dt/wdmg/yii2-options.svg)](https://packagist.org/packages/wdmg/yii2-options)
[![Packagist Version](https://img.shields.io/packagist/v/wdmg/yii2-options.svg)](https://packagist.org/packages/wdmg/yii2-options)
![Progress](https://img.shields.io/badge/progress-ready_to_use-green.svg)
Expand All @@ -11,11 +11,11 @@ Storing application options in DB with runtime autoload and accessibility from Y

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
* Yii2 v.2.0.40 and newest
* Yii2 v.2.0.35 and newest
* [Yii2 Base](https://github.com/wdmg/yii2-base) module (required)
* [Yii2 SelectInput](https://github.com/wdmg/yii2-selectinput) widget

Expand Down Expand Up @@ -93,11 +93,7 @@ Use the `Module::dashboardNavItems()` method of the module to generate a navigat
?>

# Status and version [ready to use]
* v.1.7.0 - Some fix, update copyrights
* v.1.6.0 - Fixed string type detection for option value
* v.1.5.9 - Encrypt/decrypt options on import/export
* v.1.5.8 - Update README.md and dependencies
* v.1.5.7 - Update README.md and dependencies
* v.1.5.6 - Up to date dependencies
* v.1.5.5 - Fixed deprecated class declaration
* v.1.5.4 - Added delete and deleteAll for options component
* v.1.5.3 - Added edit interface for array/object options
* v.1.5.8 - Update README.md and dependencies
2 changes: 1 addition & 1 deletion commands/InitController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function actionIndex($params = null)
'║ ║'. "\n" .
'║ OPTIONS 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);
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"keywords": ["yii2", "yii2-options", "settings", "options", "wdmg"],
"type": "yii2-extension",
"license": "MIT",
"version": "1.6.0",
"version": "1.7.0",
"homepage": "https://github.com/wdmg/yii2-options",
"support": {
"source": "https://github.com/wdmg/yii2-options",
Expand All @@ -21,7 +21,7 @@
}
],
"require": {
"yiisoft/yii2": "^2.0.40",
"yiisoft/yii2": "^2.0.35",
"wdmg/yii2-base": "^1.3.0",
"wdmg/yii2-selectinput": "^1.0.9",
"wdmg/yii2-helpers": "^1.4.1"
Expand Down
3 changes: 1 addition & 2 deletions models/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ public function behaviors()
public function rules()
{
return [
[['param', 'type'], 'required'],
[['value'], 'required', 'skipOnEmpty' => true],
[['param', 'value', 'type'], 'required'],
[['value', 'default'], 'string'],
[['section', 'param'], 'string', 'min' => 3, 'max' => 128],
[['label'], 'string', 'max' => 255],
Expand Down
2 changes: 1 addition & 1 deletion views/options/_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
echo Html::label(Yii::t('app/modules/options', 'Default'), '#innerOptionDefault');
echo '<pre>' . var_export(unserialize($model->default), true) . '</pre>';
} else {
echo $form->field($model, 'default')->textarea(['rows' => 6, 'disabled' => (($model->id) ? true : false)]);
echo $form->field($model, 'default')->textarea(['rows' => 6, 'disabled' => true]);
}
?>
<?php
Expand Down
8 changes: 4 additions & 4 deletions views/options/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@
],
'maxButtonCount' => 5,
'activePageCssClass' => 'active',
'prevPageCssClass' => 'prev',
'nextPageCssClass' => 'next',
'firstPageCssClass' => 'first',
'lastPageCssClass' => 'last',
'prevPageCssClass' => '',
'nextPageCssClass' => '',
'firstPageCssClass' => 'previous',
'lastPageCssClass' => 'next',
'firstPageLabel' => Yii::t('app/modules/options', 'First page'),
'lastPageLabel' => Yii::t('app/modules/options', 'Last page'),
'prevPageLabel' => Yii::t('app/modules/options', '&larr; Prev page'),
Expand Down

0 comments on commit 8713bd4

Please sign in to comment.