Skip to content

Commit

Permalink
watermark
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailDev committed Nov 28, 2014
1 parent fb7548a commit eb4bbc2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Controller extends BaseController{
public $roots = [];
public $access = ['@'];
public $disabledCommands = ['netmount'];
public $watermark;

public function behaviors()
{
Expand Down Expand Up @@ -69,6 +70,20 @@ public function getOptions()
$this->_options['roots'][] = $root->getRoot();
}

if(!empty($this->watermark)){
$this->_options['bind']['upload.presave'] = 'Plugin.Watermark.onUpLoadPreSave';

if(is_string($this->watermark)){
$watermark = [
'source' => $this->watermark
];
}else{
$watermark = $this->watermark;
}

$this->_options['plugin']['Watermark'] = $watermark;
}

return $this->_options;
}

Expand Down
15 changes: 15 additions & 0 deletions PathController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class PathController extends Controller{
'basePath' => '@webroot/files',
'path' => ''
];
public $watermark;

public function behaviors()
{
Expand Down Expand Up @@ -78,6 +79,20 @@ public function getOptions($subPath = '')
if($root->isAvailable())
$this->_options['roots'][] = $root->getRoot();

if(!empty($this->watermark)){
$this->_options['bind']['upload.presave'] = 'Plugin.Watermark.onUpLoadPreSave';

if(is_string($this->watermark)){
$watermark = [
'source' => $this->watermark
];
}else{
$watermark = $this->watermark;
}

$this->_options['plugin']['Watermark'] = $watermark;
}

return $this->_options;
}

Expand Down

0 comments on commit eb4bbc2

Please sign in to comment.