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 / elFinderPlugin.php
file-manager-advanced / application / library / php Last commit date
.tmp 10 months ago editors 4 weeks ago libs 7 years ago plugins 3 years ago resources 7 years ago MySQLStorage.sql 1 year ago autoload.php 10 months ago connector.maximal.php-dist 1 year ago connector.minimal.php-dist 1 year ago elFinder.class.php 4 weeks ago elFinderConnector.class.php 4 weeks ago elFinderFlysystemGoogleDriveNetmount.php 5 years ago elFinderPlugin.php 7 years ago elFinderSession.php 4 years ago elFinderSessionInterface.php 7 years ago elFinderVolumeBox.class.php 5 years ago elFinderVolumeDriver.class.php 4 weeks ago elFinderVolumeDropbox.class.php 1 year ago elFinderVolumeDropbox2.class.php 4 weeks ago elFinderVolumeFTP.class.php 5 years ago elFinderVolumeGoogleDrive.class.php 5 years ago elFinderVolumeGroup.class.php 7 years ago elFinderVolumeLocalFileSystem.class.php 2 years ago elFinderVolumeMySQL.class.php 10 months ago elFinderVolumeOneDrive.class.php 4 weeks ago elFinderVolumeSFTPphpseclib.class.php 4 weeks ago elFinderVolumeTrash.class.php 7 years ago elFinderVolumeTrashMySQL.class.php 7 years ago mime.types 3 years ago
elFinderPlugin.php
114 lines
1 <?php
2
3 /**
4 * elFinder Plugin Abstract
5 *
6 * @package elfinder
7 * @author Naoki Sawada
8 * @license New BSD
9 */
10 class elFinderPlugin
11 {
12
13 /**
14 * This plugin's options
15 *
16 * @var array
17 */
18 protected $opts = array();
19
20 /**
21 * Get current volume's options
22 *
23 * @param object $volume
24 *
25 * @return array options
26 */
27 protected function getCurrentOpts($volume)
28 {
29 $name = substr(get_class($this), 14); // remove "elFinderPlugin"
30 $opts = $this->opts;
31 if (is_object($volume)) {
32 $volOpts = $volume->getOptionsPlugin($name);
33 if (is_array($volOpts)) {
34 $opts = array_merge($opts, $volOpts);
35 }
36 }
37 return $opts;
38 }
39
40 /**
41 * Is enabled with options
42 *
43 * @param array $opts
44 * @param elFinder $elfinder
45 *
46 * @return boolean
47 */
48 protected function iaEnabled($opts, $elfinder = null)
49 {
50 if (!$opts['enable']) {
51 return false;
52 }
53
54 // check post var 'contentSaveId' to disable this plugin
55 if ($elfinder && !empty($opts['disableWithContentSaveId'])) {
56 $session = $elfinder->getSession();
57 $urlContentSaveIds = $session->get('urlContentSaveIds', array());
58 if (!empty(elFinder::$currentArgs['contentSaveId']) && ($contentSaveId = elFinder::$currentArgs['contentSaveId'])) {
59 if (!empty($urlContentSaveIds[$contentSaveId])) {
60 $elfinder->removeUrlContentSaveId($contentSaveId);
61 return false;
62 }
63 }
64 }
65
66 if (isset($opts['onDropWith']) && !is_null($opts['onDropWith'])) {
67 // plugin disabled by default, enabled only if given key is pressed
68 if (isset($_REQUEST['dropWith']) && $_REQUEST['dropWith']) {
69 $onDropWith = $opts['onDropWith'];
70 $action = (int)$_REQUEST['dropWith'];
71 if (!is_array($onDropWith)) {
72 $onDropWith = array($onDropWith);
73 }
74 foreach ($onDropWith as $key) {
75 $key = (int)$key;
76 if (($action & $key) === $key) {
77 return true;
78 }
79 }
80 }
81 return false;
82 }
83
84 if (isset($opts['offDropWith']) && !is_null($opts['offDropWith']) && isset($_REQUEST['dropWith'])) {
85 // plugin enabled by default, disabled only if given key is pressed
86 $offDropWith = $opts['offDropWith'];
87 $action = (int)$_REQUEST['dropWith'];
88 if (!is_array($offDropWith)) {
89 $offDropWith = array($offDropWith);
90 }
91 $res = true;
92 foreach ($offDropWith as $key) {
93 $key = (int)$key;
94 if ($key === 0) {
95 if ($action === 0) {
96 $res = false;
97 break;
98 }
99 } else {
100 if (($action & $key) === $key) {
101 $res = false;
102 break;
103 }
104 }
105 }
106 if (!$res) {
107 return false;
108 }
109 }
110
111 return true;
112 }
113 }
114