PluginProbe ʕ •ᴥ•ʔ
File Manager Pro – Filester / 1.8
File Manager Pro – Filester v1.8
2.1.1 trunk 1.6.1 1.7.6 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 2.0 2.0.1 2.0.2 2.1.0
filester / includes / File_manager / lib / php / editors / editor.php
filester / includes / File_manager / lib / php / editors Last commit date
OnlineConvert 2 years ago ZipArchive 2 years ago ZohoOffice 2 years ago editor.php 2 years ago
editor.php
80 lines
1 <?php
2
3 /**
4 * Abstract class of editor plugins.
5 *
6 * @author Naoki Sawada
7 */
8 class elFinderEditor
9 {
10 /**
11 * Array of allowed method by request from client side.
12 *
13 * @var array
14 */
15 protected $allowed = array();
16
17 /**
18 * elFinder instance
19 *
20 * @var object elFinder instance
21 */
22 protected $elfinder;
23
24 /**
25 * Arguments
26 *
27 * @var array argValues
28 */
29 protected $args;
30
31 /**
32 * Constructor.
33 *
34 * @param object $elfinder
35 * @param array $args
36 */
37 public function __construct($elfinder, $args)
38 {
39 $this->elfinder = $elfinder;
40 $this->args = $args;
41 }
42
43 /**
44 * Return boolean that this plugin is enabled.
45 *
46 * @return bool
47 */
48 public function enabled()
49 {
50 return true;
51 }
52
53 /**
54 * Return boolean that $name method is allowed.
55 *
56 * @param string $name
57 *
58 * @return bool
59 */
60 public function isAllowedMethod($name)
61 {
62 $checker = array_flip($this->allowed);
63
64 return isset($checker[$name]);
65 }
66
67 /**
68 * Return $this->args value of the key
69 *
70 * @param string $key target key
71 * @param string $empty empty value
72 *
73 * @return mixed
74 */
75 public function argValue($key, $empty = '')
76 {
77 return isset($this->args[$key]) ? $this->args[$key] : $empty;
78 }
79 }
80