Skip to content

Commit

Permalink
Updates to release v1.0.9 fixes #147
Browse files Browse the repository at this point in the history
  • Loading branch information
kartik-v committed Apr 19, 2019
1 parent 41820a1 commit fcf5bf4
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 17 deletions.
7 changes: 7 additions & 0 deletions CHANGE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Change Log: `yii2-widget-fileinput`
===================================

## Version 1.0.9

**Date:** 19-Apr-2019

- (enh #147): Auto-set multiple file upload naming convention.
- Bump composer dependencies.

## Version 1.0.8

**Date:** 19-Sep-2018
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014 - 2018, Kartik Visweswaran
Copyright (c) 2014 - 2019, Kartik Visweswaran
Krajee.com
All rights reserved.

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
}
],
"require": {
"kartik-v/yii2-krajee-base": ">=1.9",
"kartik-v/bootstrap-fileinput": "~4.4"
"kartik-v/yii2-krajee-base": ">=2.0.0",
"kartik-v/bootstrap-fileinput": ">=5.0.0"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions src/BaseAsset.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.8
* @version 1.0.9
*/

namespace kartik\file;
Expand Down
4 changes: 2 additions & 2 deletions src/DomPurifyAsset.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.8
* @version 1.0.9
*/

namespace kartik\file;
Expand Down
18 changes: 16 additions & 2 deletions src/FileInput.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.8
* @version 1.0.9
*/

namespace kartik\file;
Expand Down Expand Up @@ -95,9 +95,23 @@ protected function initWidget()
if ($this->pluginLoading) {
Html::addCssClass($this->options, 'file-loading');
}
/**
* Auto-set form enctype for file uploads
*/
if (isset($this->field) && isset($this->field->form) && !isset($this->field->form->options['enctype'])) {
$this->field->form->options['enctype'] = 'multipart/form-data';
}
/**
* Auto-set multiple file upload naming convention
*/
if (ArrayHelper::getValue($this->options, 'multiple')) {
$hasModel = $this->hasModel();
if ($hasModel && strpos($this->attribute, '[]') === false) {
$this->attribute .= '[]';
} elseif (!$hasModel && strpos($this->name, '[]') === false) {
$this->name .= '[]';
}
}
$input = $this->getInput('fileInput');
$script = 'document.getElementById("' . $this->options['id'] . '").className.replace(/\bfile-loading\b/,"");';
if ($this->showMessage) {
Expand Down
4 changes: 2 additions & 2 deletions src/FileInputAsset.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.8
* @version 1.0.9
*/

namespace kartik\file;
Expand Down
4 changes: 2 additions & 2 deletions src/FileInputThemeAsset.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.8
* @version 1.0.9
*/

namespace kartik\file;
Expand Down
4 changes: 2 additions & 2 deletions src/PiExifAsset.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.8
* @version 1.0.9
*/

namespace kartik\file;
Expand Down
4 changes: 2 additions & 2 deletions src/SortableAsset.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

/**
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2018
* @copyright Copyright &copy; Kartik Visweswaran, Krajee.com, 2014 - 2019
* @package yii2-widgets
* @subpackage yii2-widget-fileinput
* @version 1.0.8
* @version 1.0.9
*/

namespace kartik\file;
Expand Down

0 comments on commit fcf5bf4

Please sign in to comment.