From 428b003db2f7c88eafda742a69184dbfb516a59a Mon Sep 17 00:00:00 2001 From: Karnovsky A Date: Fri, 20 May 2016 10:37:02 +0300 Subject: [PATCH] -- --- backend/controllers/BrandController.php | 5 +++++ backend/views/brand/_form.php | 19 ++++--------------- common/components/artboximage/ArtboxImage.php | 7 ++++--- common/config/main.php | 7 +++++-- common/modules/product/models/Brand.php | 4 +--- frontend/views/catalog/product_item.php | 33 +++++++++++++++++---------------- frontend/web/images/products/1305887984-2604-2605.jpg | Bin 0 -> 224221 bytes frontend/web/images/products/1348483804-512-2445.jpg | Bin 0 -> 103925 bytes frontend/web/images/products/1348484212-3723-3585.jpg | Bin 0 -> 101549 bytes frontend/web/images/products/1348484611-4020-7396.jpg | Bin 0 -> 102770 bytes frontend/web/images/products/1348485104-4555-7650.jpg | Bin 0 -> 73228 bytes frontend/web/images/products/1348487239-495-4299.jpg | Bin 0 -> 113978 bytes frontend/web/images/products/1348487515-4424-1546.jpg | Bin 0 -> 133721 bytes frontend/web/images/products/1348489125-7133-6866.jpg | Bin 0 -> 157788 bytes frontend/web/images/products/1348489542-702-5816.jpg | Bin 0 -> 103835 bytes frontend/web/images/products/1348490194-360-284.jpg | Bin 0 -> 105396 bytes frontend/web/images/products/1348490344-6421-5352.jpg | Bin 0 -> 106638 bytes frontend/web/images/products/1348490519-4780-1400.jpg | Bin 0 -> 142623 bytes frontend/web/images/products/1348492885-9127-2291.jpg | Bin 0 -> 160833 bytes frontend/web/images/products/1366971036-9093-9799.jpg | Bin 0 -> 89526 bytes frontend/web/images/products/1366971215-512-3729.jpg | Bin 0 -> 77700 bytes frontend/web/images/products/1366971885-6949-9056.jpg | Bin 0 -> 103160 bytes frontend/web/images/products/1372148121-6202-6680.jpg | Bin 0 -> 125472 bytes frontend/web/images/products/1372148169-4614-4290.jpg | Bin 0 -> 110247 bytes 24 files changed, 36 insertions(+), 39 deletions(-) create mode 100644 frontend/web/images/products/1305887984-2604-2605.jpg create mode 100644 frontend/web/images/products/1348483804-512-2445.jpg create mode 100644 frontend/web/images/products/1348484212-3723-3585.jpg create mode 100644 frontend/web/images/products/1348484611-4020-7396.jpg create mode 100644 frontend/web/images/products/1348485104-4555-7650.jpg create mode 100644 frontend/web/images/products/1348487239-495-4299.jpg create mode 100644 frontend/web/images/products/1348487515-4424-1546.jpg create mode 100644 frontend/web/images/products/1348489125-7133-6866.jpg create mode 100644 frontend/web/images/products/1348489542-702-5816.jpg create mode 100644 frontend/web/images/products/1348490194-360-284.jpg create mode 100644 frontend/web/images/products/1348490344-6421-5352.jpg create mode 100644 frontend/web/images/products/1348490519-4780-1400.jpg create mode 100644 frontend/web/images/products/1348492885-9127-2291.jpg create mode 100644 frontend/web/images/products/1366971036-9093-9799.jpg create mode 100644 frontend/web/images/products/1366971215-512-3729.jpg create mode 100644 frontend/web/images/products/1366971885-6949-9056.jpg create mode 100644 frontend/web/images/products/1372148121-6202-6680.jpg create mode 100644 frontend/web/images/products/1372148169-4614-4290.jpg 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'] + ]); ?> field($model, 'name')->textInput() ?> field($model, 'alias')->textInput(['maxlength' => true]) ?> - $model, - 'field'=>'image', - 'size' => [ - [ - 'width'=>102, - 'height'=>57, - ] - ], - 'multi'=>false, - 'gallery' => $model->image, - 'name' => 'Загрузить изображение' - ]); - ?> + 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;
  • + is_top) || !empty($product->is_new) || !empty($product->akciya)) :?> +
      + is_top)) :?> +
    • top 
    • + + is_new)) :?> +
    • new 
    • + + akciya)) :?> +
    • promo 
    • + +
    +
    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