예제 #1
0
 /**
  * Registers the asset bundle and locale
  */
 public function registerAssetBundle()
 {
     $view = $this->getView();
     if ($this->resizeImages) {
         CanvasBlobAsset::register($view);
         $this->pluginOptions['resizeImage'] = true;
     }
     FileInputAsset::register($view)->addLanguage($this->language, 'fileinput_locale_');
 }
예제 #2
0
 /**
  * Registers the asset bundle and locale
  */
 public function registerAssetBundle()
 {
     $view = $this->getView();
     FileInputAsset::register($view)->addLanguage($this->language, 'fileinput_locale_');
 }
예제 #3
0
 /**
  * Registers the needed assets
  */
 public function registerAssets()
 {
     $view = $this->getView();
     FileInputAsset::register($view);
     $this->setPluginDefault('browseLabel', Yii::t('fileinput', 'Browse') . '…');
     $this->setPluginDefault('uploadLabel', Yii::t('fileinput', 'Upload'));
     $this->setPluginDefault('removeLabel', Yii::t('fileinput', 'Remove'));
     $this->registerPlugin('fileinput');
 }
예제 #4
0
파일: FileInput.php 프로젝트: keltstr/basic
 /**
  * Registers the asset bundle and locale
  */
 protected function registerAssetBundle()
 {
     $view = $this->getView();
     if (!empty($this->language) && substr($this->language, 0, 2) != 'en') {
         $path = Yii::getAlias('@vendor/kartik-v/bootstrap-fileinput/js');
         $file = "fileinput_locale_{$this->language}.js";
         if (!Config::fileExists("{$path}/{$file}")) {
             $file = "fileinput_locale_{$this->_lang}.js";
         }
         if (Config::fileExists("{$path}/{$file}")) {
             FileInputAsset::register($view)->js[] = 'js/' . $file;
             return;
         }
     }
     FileInputAsset::register($view);
 }
 /**
  * Registers the asset bundle and locale
  */
 public function registerAssetBundle()
 {
     $view = $this->getView();
     if ($this->resizeImages) {
         CanvasBlobAsset::register($view);
         $this->pluginOptions['resizeImage'] = true;
     }
     $theme = ArrayHelper::getValue($this->pluginOptions, 'theme');
     if (!empty($theme) && in_array($theme, self::$_themes)) {
         FileInputThemeAsset::register($view)->addTheme($theme);
     }
     if ($this->sortThumbs) {
         SortableAsset::register($view);
     }
     if ($this->purifyHtml) {
         DomPurifyAsset::register($view);
         $this->pluginOptions['purifyHtml'] = true;
     }
     FileInputAsset::register($view)->addLanguage($this->language, '', 'js/locales');
 }