Ejemplo n.º 1
0
 /**
  * Register widget asset.
  */
 public function registerClientAssets()
 {
     $view = $this->getView();
     $assets = Asset::register($view);
     $settings = ['preview' => $this->previewImages];
     $view->registerJs('jQuery(".flist").listfiles(' . Json::encode($settings) . ');', $view::POS_READY);
 }
Ejemplo n.º 2
0
 /**
  * Register widget asset.
  */
 public function registerClientAssets()
 {
     $view = $this->getView();
     $assets = Asset::register($view);
     if ($this->noPhotoImage == '') {
         $this->noPhotoImage = $assets->baseUrl . '/img/file.png';
     }
     $settings = ['url' => $this->uploadUrl, 'name' => $this->uploadParameter, 'previewUrl' => $this->previewUrl, 'tempPreviewUrl' => $this->tempPreviewUrl, 'allowedExtensions' => explode(', ', $this->extensions), 'autoSubmit' => $this->autoSubmit, 'maxUploads' => $this->maxUploads, 'noPhotoImage' => $this->noPhotoImage, 'maxSize' => $this->maxSize / 1024, 'allowedExtensions' => explode(', ', $this->extensions), 'size_error_text' => Yii::t('upload', 'TOO_BIG_ERROR', ['size' => $this->maxSize / (1024 * 1024)]), 'ext_error_text' => Yii::t('upload', 'EXTENSION_ERROR', ['formats' => $this->extensions]), 'galleryType' => $this->galleryType];
     $view->registerJs('jQuery("#' . $this->options['id'] . '").siblings(".upload_box").uploader(' . Json::encode($settings) . ');', $view::POS_READY);
 }