MDL-33857 fixed up whitespace
This commit is contained in:
@@ -115,7 +115,7 @@ abstract class file_info {
|
||||
$likes[] = $DB->sql_like($prefix.'filename', ':filename'.$cnt, false);
|
||||
$params['filename'.$cnt] = '%'.$ext;
|
||||
}
|
||||
$sql .= ' AND ('.join(' OR ', $likes).')';
|
||||
$sql .= ' AND (' . join(' OR ', $likes) . ')';
|
||||
}
|
||||
return array($sql, $params);
|
||||
}
|
||||
@@ -144,7 +144,7 @@ abstract class file_info {
|
||||
} else {
|
||||
$filename = $fileinfo->get_visible_name();
|
||||
$extension = textlib::strtolower(pathinfo($filename, PATHINFO_EXTENSION));
|
||||
if (!empty($extension) && in_array('.'.$extension, $extensions)) {
|
||||
if (!empty($extension) && in_array('.' . $extension, $extensions)) {
|
||||
$nonemptylist[] = $fileinfo;
|
||||
}
|
||||
}
|
||||
@@ -178,7 +178,7 @@ abstract class file_info {
|
||||
if ($extensions !== '*') {
|
||||
$filename = $fileinfo->get_visible_name();
|
||||
$extension = textlib::strtolower(pathinfo($filename, PATHINFO_EXTENSION));
|
||||
if (empty($extension) || !in_array('.'.$extension, $extensions)) {
|
||||
if (empty($extension) || !in_array('.' . $extension, $extensions)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -213,12 +213,12 @@ abstract class file_info {
|
||||
public function get_params_rawencoded() {
|
||||
$params = $this->get_params();
|
||||
$encoded = array();
|
||||
$encoded[] = 'contextid='.$params['contextid'];
|
||||
$encoded[] = 'component='.$params['component'];
|
||||
$encoded[] = 'filearea='.$params['filearea'];
|
||||
$encoded[] = 'itemid='.(is_null($params['itemid']) ? -1 : $params['itemid']);
|
||||
$encoded[] = 'filepath='.(is_null($params['filepath']) ? '' : rawurlencode($params['filepath']));
|
||||
$encoded[] = 'filename='.((is_null($params['filename']) or $params['filename'] === '.') ? '' : rawurlencode($params['filename']));
|
||||
$encoded[] = 'contextid=' . $params['contextid'];
|
||||
$encoded[] = 'component=' . $params['component'];
|
||||
$encoded[] = 'filearea=' . $params['filearea'];
|
||||
$encoded[] = 'itemid=' . (is_null($params['itemid']) ? -1 : $params['itemid']);
|
||||
$encoded[] = 'filepath=' . (is_null($params['filepath']) ? '' : rawurlencode($params['filepath']));
|
||||
$encoded[] = 'filename=' . ((is_null($params['filename']) or $params['filename'] === '.') ? '' : rawurlencode($params['filename']));
|
||||
|
||||
return $encoded;
|
||||
}
|
||||
|
||||
@@ -376,7 +376,7 @@ class file_info_context_course extends file_info {
|
||||
if ($child = $this->get_file_info($area[0], $area[1], 0, '/', '.')) {
|
||||
if ($returnemptyfolders || $child->count_non_empty_children($extensions)) {
|
||||
$children[] = $child;
|
||||
if (($countonly !== false) && count($children)>=$countonly) {
|
||||
if (($countonly !== false) && count($children) >= $countonly) {
|
||||
return $countonly;
|
||||
}
|
||||
}
|
||||
@@ -397,7 +397,7 @@ class file_info_context_course extends file_info {
|
||||
if ($child = $this->browser->get_file_info($modcontext)) {
|
||||
if ($returnemptyfolders || $child->count_non_empty_children($extensions)) {
|
||||
$children[] = $child;
|
||||
if (($countonly !== false) && count($children)>=$countonly) {
|
||||
if (($countonly !== false) && count($children) >= $countonly) {
|
||||
return $countonly;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ class file_info_context_module extends file_info {
|
||||
array('mod_'.$this->modname, 'intro'),
|
||||
array('backup', 'activity')
|
||||
);
|
||||
foreach ($this->areas as $area=>$desctiption) {
|
||||
foreach ($this->areas as $area => $desctiption) {
|
||||
$areas[] = array('mod_'.$this->modname, $area);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ class workshop_file_info_submissions_container extends file_info {
|
||||
}
|
||||
|
||||
/**
|
||||
* Help function to return files matching extensions or their count
|
||||
* Helper function to return files matching extensions or their count
|
||||
*
|
||||
* @param string|array $extensions, either '*' or array of lowercase extensions, i.e. array('.gif','.jpg')
|
||||
* @param bool|int $countonly if false returns the children, if an int returns just the
|
||||
|
||||
Reference in New Issue
Block a user