src build elFinder-2.1-74efdcf

This commit is contained in:
nao-pon
2016-10-23 14:58:04 +09:00
parent 01edc68ccd
commit a0eab5a06b
5 changed files with 13 additions and 11 deletions
+7 -5
View File
@@ -774,22 +774,24 @@ class elFinderVolumeGoogleDrive extends elFinderVolumeDriver
$path = $this->_normpath($path.'/');
$result = [];
$query = '';
$dirs = array_merge([$itemId], $this->getDirectories($itemId));
$query = '(\''.implode('\' in parents or \'', $dirs).'\' in parents)';
if ($itemId !== 'root') {
$dirs = array_merge([$itemId], $this->getDirectories($itemId));
$query = '(\''.implode('\' in parents or \'', $dirs).'\' in parents)';
}
$tmp = [];
if (!$mimes) {
foreach (explode(' ', $q) as $_v) {
$tmp[] = 'fullText contains \''.str_replace('\'', '\\\'', $_v).'\'';
}
$query .= ' and '.implode(' and ', $tmp);
$query .= ($query? ' and ' : '').implode(' and ', $tmp);
} else {
foreach ($mimes as $_v) {
$tmp[] = 'mimeType contains \''.str_replace('\'', '\\\'', $_v).'\'';
}
$query .= ' and ('.implode(' or ', $tmp).')';
$query .= ($query? ' and ' : '').'('.implode(' or ', $tmp).')';
}
$opts = [