forked from MihailDev/yii2-elfinder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PluginInterface.php
43 lines (36 loc) · 845 Bytes
/
PluginInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/**
* Date: 05.01.2017
* Time: 20:10
*/
namespace mihaildev\elfinder;
abstract class PluginInterface
{
/**
* @return string
*/
abstract public function getName();
public $bind = [];
public $enable = true;
/**
* @param $name string
* @param $volume \elFinderVolumeDriver
* @return mixed
*/
protected function getOption($name, $volume) {
if (is_object($volume)) {
$volumeOptions = $volume->getOptionsPlugin($this->getName());
if (isset($volumeOptions[$name])) {
return $volumeOptions[$name];
}
}
return $this->$name;
}
/**
* @param $volume \elFinderVolumeDriver
* @return bool
*/
public function isEnable($volume){
return $this->getOption('enable', $volume);
}
}