Exemple #1
0
 /**
  * Runs the widget.
  */
 public function run()
 {
     FileInputAsset::register($this->view);
     if (!empty($this->callbackBeforeInsert)) {
         $this->view->registerJs('
             $("#' . $this->options['id'] . '").on("fileInsert", ' . $this->callbackBeforeInsert . ');');
     }
     $modal = $this->renderFile('@vendor/doavers/yii2-filemanager/views/file/modal.php', ['inputId' => $this->options['id'], 'btnId' => $this->options['id'] . '-btn', 'frameId' => $this->options['id'] . '-frame', 'frameSrc' => Url::to(['/filemanager/file/filemanager']), 'thumb' => $this->thumb]);
     return $this->tinyMCE . $modal;
 }
 /**
  * Runs the widget.
  */
 public function run()
 {
     if ($this->hasModel()) {
         $replace['{input}'] = Html::activeTextInput($this->model, $this->attribute, $this->options);
     } else {
         $replace['{input}'] = Html::textInput($this->name, $this->value, $this->options);
     }
     $replace['{button}'] = Html::tag($this->buttonTag, $this->buttonName, $this->buttonOptions);
     $replace['{reset-button}'] = Html::tag($this->resetButtonTag, $this->resetButtonName, $this->resetButtonOptions);
     FileInputAsset::register($this->view);
     if (!empty($this->callbackBeforeInsert)) {
         $this->view->registerJs('
             $("#' . $this->options['id'] . '").on("fileInsert", ' . $this->callbackBeforeInsert . ');');
     }
     $modal = $this->renderFile('@vendor/doavers/yii2-filemanager/views/file/modal.php', ['inputId' => $this->options['id'], 'btnId' => $this->buttonOptions['id'], 'frameId' => $this->options['id'] . '-frame', 'frameSrc' => Url::to(['/filemanager/file/filemanager']), 'thumb' => $this->thumb, 'imageContainer' => $this->imageContainer, 'pasteData' => $this->pasteData]);
     return strtr($this->template, $replace) . $modal;
 }