diff --git a/backend/controllers/BrandController.php b/backend/controllers/BrandController.php
index fd49a06..a15be2f 100755
--- a/backend/controllers/BrandController.php
+++ b/backend/controllers/BrandController.php
@@ -98,6 +98,11 @@ class BrandController extends Controller
{
$model = $this->findModel($id);
+ var_dump($_POST);
+ print "\n+++++++++++++++++++++++++++++++++++++\n";
+ var_dump($_FILES);
+ exit;
+
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->brand_id]);
} else {
diff --git a/backend/views/brand/_form.php b/backend/views/brand/_form.php
index 939566d..2e02b74 100755
--- a/backend/views/brand/_form.php
+++ b/backend/views/brand/_form.php
@@ -10,26 +10,15 @@ use yii\widgets\ActiveForm;
-
+ ['enctype' => 'multipart/form-data']
+ ]); ?>
= $form->field($model, 'name')->textInput() ?>
= $form->field($model, 'alias')->textInput(['maxlength' => true]) ?>
- = \common\modules\file\widgets\ImageUploader::widget([
- 'model'=> $model,
- 'field'=>'image',
- 'size' => [
- [
- 'width'=>102,
- 'height'=>57,
- ]
- ],
- 'multi'=>false,
- 'gallery' => $model->image,
- 'name' => 'Загрузить изображение'
- ]);
- ?>
+ = \common\components\artboximage\ArtboxImageHelper::fileinputWidget($model, 'imageUrl');?>
= $form->field($model, 'meta_title')->textInput(['maxlength' => true]) ?>
diff --git a/common/components/artboximage/ArtboxImage.php b/common/components/artboximage/ArtboxImage.php
index 244bd62..e916b40 100644
--- a/common/components/artboximage/ArtboxImage.php
+++ b/common/components/artboximage/ArtboxImage.php
@@ -28,7 +28,7 @@ class ArtboxImage extends Component {
'bmp' => 'bmp',
];
- public $uploadUrl = '/admin/artboxfile/action/upload';
+ public $uploadUrl = '@web/artboxfile/action/upload';
public function load($file = null, $driver = null) {
if(empty($file) || !realpath($file)) {
@@ -37,7 +37,8 @@ class ArtboxImage extends Component {
return Image::factory($file, $driver ? $driver : $this->driver);
}
- public function fileinputWidget($model, $modelField, $formField = 'fileUpload', $multiple = false, $imageOnly = true) {
+ public function fileinputWidget($model, $modelField = 'file', $formField = 'fileUpload', $multiple = false, $imageOnly = true) {
+ $uploadUrl = Yii::getAlias($this->uploadUrl);
$options = [
'multiple' => $multiple,
];
@@ -54,7 +55,7 @@ class ArtboxImage extends Component {
'overwriteInitial' => !$multiple,
'showRemove' => true,
'showUpload' => false,
- 'uploadUrl' => $this->uploadUrl,
+ 'uploadUrl' => $uploadUrl,
'uploadExtraData' => [
'fileField' => $modelField,
'multiple' => intval($multiple),
diff --git a/common/config/main.php b/common/config/main.php
index 91bcbce..fe09ece 100755
--- a/common/config/main.php
+++ b/common/config/main.php
@@ -130,8 +130,11 @@ return [
],
'modules' => [
- 'file' => [
- 'class' => 'common\modules\file\Module',
+// 'file' => [
+// 'class' => 'common\modules\file\Module',
+// ],
+ 'artboxfile' => [
+ 'class' => 'common\modules\artboxfile\Module',
],
'relation' => [
'class' => 'common\modules\relation\Module',
diff --git a/common/modules/product/models/Brand.php b/common/modules/product/models/Brand.php
index 11d83fa..b9ab809 100755
--- a/common/modules/product/models/Brand.php
+++ b/common/modules/product/models/Brand.php
@@ -10,7 +10,7 @@ use Yii;
* This is the model class for table "brand".
*
* @property integer $brand_id
- * @property string $remote_id
+
* @property integer $brand_name_id
* @property string $alias
* @property string $image
@@ -67,7 +67,6 @@ class Brand extends \yii\db\ActiveRecord
[['alias', 'name'], 'string', 'max' => 250],
[['image', 'meta_title'], 'string', 'max' => 255],
[['meta_robots'], 'string', 'max' => 50],
- [['remote_id'], 'string', 'max' => 25],
[['imageUpload'], 'safe'],
[['imageUpload'], 'file', 'extensions' => 'jpg, gif, png'],
// [['brand_name_id'], 'exist', 'skipOnError' => true, 'targetClass' => BrandName::className(), 'targetAttribute' => ['brand_name_id' => 'brand_name_id']],
@@ -90,7 +89,6 @@ class Brand extends \yii\db\ActiveRecord
'meta_desc' => Yii::t('product', 'Meta Desc'),
'meta_robots' => Yii::t('product', 'Meta Robots'),
'seo_text' => Yii::t('product', 'Seo Text'),
- 'remote_id' => Yii::t('product', '1C brand name'),
];
}
diff --git a/frontend/views/catalog/product_item.php b/frontend/views/catalog/product_item.php
index e12e56b..bbbaacd 100755
--- a/frontend/views/catalog/product_item.php
+++ b/frontend/views/catalog/product_item.php
@@ -5,17 +5,23 @@ use yii\helpers\Url;
diff --git a/frontend/web/images/products/1305887984-2604-2605.jpg b/frontend/web/images/products/1305887984-2604-2605.jpg
new file mode 100644
index 0000000..7d2002f
Binary files /dev/null and b/frontend/web/images/products/1305887984-2604-2605.jpg differ
diff --git a/frontend/web/images/products/1348483804-512-2445.jpg b/frontend/web/images/products/1348483804-512-2445.jpg
new file mode 100644
index 0000000..408a581
Binary files /dev/null and b/frontend/web/images/products/1348483804-512-2445.jpg differ
diff --git a/frontend/web/images/products/1348484212-3723-3585.jpg b/frontend/web/images/products/1348484212-3723-3585.jpg
new file mode 100644
index 0000000..d159571
Binary files /dev/null and b/frontend/web/images/products/1348484212-3723-3585.jpg differ
diff --git a/frontend/web/images/products/1348484611-4020-7396.jpg b/frontend/web/images/products/1348484611-4020-7396.jpg
new file mode 100644
index 0000000..d8a3e02
Binary files /dev/null and b/frontend/web/images/products/1348484611-4020-7396.jpg differ
diff --git a/frontend/web/images/products/1348485104-4555-7650.jpg b/frontend/web/images/products/1348485104-4555-7650.jpg
new file mode 100644
index 0000000..61e01fa
Binary files /dev/null and b/frontend/web/images/products/1348485104-4555-7650.jpg differ
diff --git a/frontend/web/images/products/1348487239-495-4299.jpg b/frontend/web/images/products/1348487239-495-4299.jpg
new file mode 100644
index 0000000..eeaf922
Binary files /dev/null and b/frontend/web/images/products/1348487239-495-4299.jpg differ
diff --git a/frontend/web/images/products/1348487515-4424-1546.jpg b/frontend/web/images/products/1348487515-4424-1546.jpg
new file mode 100644
index 0000000..01e68f7
Binary files /dev/null and b/frontend/web/images/products/1348487515-4424-1546.jpg differ
diff --git a/frontend/web/images/products/1348489125-7133-6866.jpg b/frontend/web/images/products/1348489125-7133-6866.jpg
new file mode 100644
index 0000000..e239687
Binary files /dev/null and b/frontend/web/images/products/1348489125-7133-6866.jpg differ
diff --git a/frontend/web/images/products/1348489542-702-5816.jpg b/frontend/web/images/products/1348489542-702-5816.jpg
new file mode 100644
index 0000000..b2663e6
Binary files /dev/null and b/frontend/web/images/products/1348489542-702-5816.jpg differ
diff --git a/frontend/web/images/products/1348490194-360-284.jpg b/frontend/web/images/products/1348490194-360-284.jpg
new file mode 100644
index 0000000..d559b8b
Binary files /dev/null and b/frontend/web/images/products/1348490194-360-284.jpg differ
diff --git a/frontend/web/images/products/1348490344-6421-5352.jpg b/frontend/web/images/products/1348490344-6421-5352.jpg
new file mode 100644
index 0000000..0e63d72
Binary files /dev/null and b/frontend/web/images/products/1348490344-6421-5352.jpg differ
diff --git a/frontend/web/images/products/1348490519-4780-1400.jpg b/frontend/web/images/products/1348490519-4780-1400.jpg
new file mode 100644
index 0000000..59f0f72
Binary files /dev/null and b/frontend/web/images/products/1348490519-4780-1400.jpg differ
diff --git a/frontend/web/images/products/1348492885-9127-2291.jpg b/frontend/web/images/products/1348492885-9127-2291.jpg
new file mode 100644
index 0000000..d5885a7
Binary files /dev/null and b/frontend/web/images/products/1348492885-9127-2291.jpg differ
diff --git a/frontend/web/images/products/1366971036-9093-9799.jpg b/frontend/web/images/products/1366971036-9093-9799.jpg
new file mode 100644
index 0000000..8a5f4c7
Binary files /dev/null and b/frontend/web/images/products/1366971036-9093-9799.jpg differ
diff --git a/frontend/web/images/products/1366971215-512-3729.jpg b/frontend/web/images/products/1366971215-512-3729.jpg
new file mode 100644
index 0000000..d56dbbb
Binary files /dev/null and b/frontend/web/images/products/1366971215-512-3729.jpg differ
diff --git a/frontend/web/images/products/1366971885-6949-9056.jpg b/frontend/web/images/products/1366971885-6949-9056.jpg
new file mode 100644
index 0000000..a912810
Binary files /dev/null and b/frontend/web/images/products/1366971885-6949-9056.jpg differ
diff --git a/frontend/web/images/products/1372148121-6202-6680.jpg b/frontend/web/images/products/1372148121-6202-6680.jpg
new file mode 100644
index 0000000..200e072
Binary files /dev/null and b/frontend/web/images/products/1372148121-6202-6680.jpg differ
diff --git a/frontend/web/images/products/1372148169-4614-4290.jpg b/frontend/web/images/products/1372148169-4614-4290.jpg
new file mode 100644
index 0000000..de05f98
Binary files /dev/null and b/frontend/web/images/products/1372148169-4614-4290.jpg differ
--
libgit2 0.21.4