/** * 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_'); }
/** * Registers the asset bundle and locale */ public function registerAssetBundle() { $view = $this->getView(); FileInputAsset::register($view)->addLanguage($this->language, 'fileinput_locale_'); }
/** * 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'); }
/** * 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'); }