diff --git a/FileUploadAsset.php b/FileUploadAsset.php new file mode 100644 index 0000000..228b484 --- /dev/null +++ b/FileUploadAsset.php @@ -0,0 +1,30 @@ +codeMirror)) { $optionsArray['codeMirror'] = $this->codeMirror; } + if($this->allowUpload) { + FileUploadAsset::register($view); + echo Uploader::widget(); + $optionsArray['buttons']['link']['action'] = new JsExpression("function() { $.setUploader(this, 'file'); }"); + $optionsArray['buttons']['image']['action'] = new JsExpression("function(e) { $.setUploader(this, 'image') }"); + } if(!empty($this->buttons)) { $optionsArray['buttons'] = $this->buttons; } diff --git a/TmplAsset.php b/TmplAsset.php new file mode 100644 index 0000000..c9ad1ca --- /dev/null +++ b/TmplAsset.php @@ -0,0 +1,18 @@ +render('uploader'); + } +} diff --git a/UploaderAsset.php b/UploaderAsset.php new file mode 100644 index 0000000..31b7ed0 --- /dev/null +++ b/UploaderAsset.php @@ -0,0 +1,20 @@ + + \ No newline at end of file