PluginProbe ʕ •ᴥ•ʔ
Advanced File Manager – Ultimate File Manager for WordPress And Document Library Solution / trunk
Advanced File Manager – Ultimate File Manager for WordPress And Document Library Solution vtrunk
trunk 4.1.5 4.1.6 5.0 5.2.13 5.2.14 5.3.0 5.3.1 5.3.2 5.3.3 5.3.4 5.3.5 5.3.6 5.4.0 5.4.1 5.4.10 5.4.11 5.4.12 5.4.2 5.4.3 5.4.4 5.4.5 5.4.6 5.4.7 5.4.8
file-manager-advanced / application / library / php / editors / editor.php
file-manager-advanced / application / library / php / editors Last commit date
OnlineConvert 5 years ago ZipArchive 7 years ago ZohoOffice 4 weeks ago editor.php 7 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