Commit 7b3e1bf66e84ada26066ebfec07210e38e3abc22

Authored by Administrator
1 parent e72b37ff

26.05.16 change image download (git strange error, pay attention for this)

common/modules/product/models/Category.php
... ... @@ -177,15 +177,28 @@ class Category extends \yii\db\ActiveRecord
177 177 return empty($this->categoryName) ? null : $this->categoryName->value;
178 178 }
179 179  
180   - public function getImageFile() {
181   - return empty($this->image) ? null : Yii::getAlias('@storage/category/'. $this->image);
  180 +
  181 +
  182 + /**
  183 + * fetch stored image file name with complete path
  184 + * @return string
  185 + */
  186 + public function getImageFile()
  187 + {
  188 + return isset($this->image) ? '/images/category/' . $this->image : null;
182 189 }
183 190  
  191 + /**
  192 + * fetch stored image url
  193 + * @return string
  194 + */
184 195 public function getImageUrl()
185 196 {
186   - return empty($this->image) ? null : '/storage/category/' . $this->image;
  197 + // return a default image placeholder if your source image is not found
  198 + return isset($this->image) ? '/images/category/'. $this->image : '/images/no_photo.png';
187 199 }
188 200  
  201 +
189 202 public function beforeSave($insert)
190 203 {
191 204 if (parent::beforeSave($insert)) {
... ...
frontend/web/css/concat_all.css
... ... @@ -1741,7 +1741,6 @@ span.red {
1741 1741  
1742 1742 .modal_wrapper_reg .modal_window {
1743 1743 text-align: right;
1744   - height: 428px;
1745 1744 width: 560px;
1746 1745 background-color: #fff;
1747 1746 padding: 20px;
... ... @@ -1851,7 +1850,6 @@ span.red {
1851 1850  
1852 1851 .modal_wrapper_login .modal_window {
1853 1852 text-align: right;
1854   - height: 247px;
1855 1853 width: 459px;
1856 1854 background-color: #fff;
1857 1855 padding: 20px;
... ... @@ -1864,6 +1862,7 @@ span.red {
1864 1862 overflow: hidden;
1865 1863 z-index:999;
1866 1864 }
  1865 +.modal_window form#w1, .modal_window form#w0{padding-bottom: 11px;}
1867 1866  
1868 1867 .modal_wrapper_login .modal_window .title {
1869 1868 font-size: 18px;
... ...