/var/www/hkosl.com/demo_google/assets/libraries/elFinder-2.1.32/php/elFinderPlugin.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/**
 * elFinder Plugin Abstract
 *
 * @package elfinder
 * @author Naoki Sawada
 * @license New BSD
 */
class elFinderPlugin {
    
    
/**
     * This plugin's options
     * 
     * @var array
     */
    
protected $opts = array();
    
    
/**
     * Get current volume's options
     * 
     * @param object $volume
     * @return array options
     */
    
protected function getCurrentOpts($volume) {
        
$name substr(get_class($this), 14); // remove "elFinderPlugin"
        
$opts $this->opts;
        if (
is_object($volume)) {
            
$volOpts $volume->getOptionsPlugin($name);
            if (
is_array($volOpts)) {
                
$opts array_merge($opts$volOpts);
            }
        }
        return 
$opts;
    }
    
    
/**
     * Is enabled with options
     * 
     * @param array $opts
     * @return boolean
     */
    
protected function iaEnabled($opts) {
        if (! 
$opts['enable']) {
            return 
false;
        }
        
        if (isset(
$opts['offDropWith']) && ! is_null($opts['offDropWith']) && isset($_REQUEST['dropWith'])) {
            
$offDropWith $opts['offDropWith'];
            
$action = (int)$_REQUEST['dropWith'];
            if (! 
is_array($offDropWith)) {
                
$offDropWith = array($offDropWith);
            }
            
$res true;
            foreach(
$offDropWith as $key) {
                
$key = (int)$key;
                if (
$key === 0) {
                    if (
$action === 0) {
                        
$res false;
                        break;
                    }
                } else {
                    if ((
$action $key) === $key) {
                        
$res false;
                        break;
                    }
                }
            }
            if (! 
$res) {
                return 
false;
            }
        }
        
        return 
true;
    }
}