Permalink
Browse files

MDL-33857 fixed up whitespace

  • Loading branch information...
Sam Hemelryk
Sam Hemelryk committed Oct 16, 2012
1 parent 2bbf03c commit f7de90a74a23987d54c3a6fb63d7e7af88e763f4
@@ -115,7 +115,7 @@ protected function build_search_files_sql($extensions, $prefix = null) {
$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 @@ public function get_non_empty_children($extensions = '*') {
} 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 @@ public function count_non_empty_children($extensions = '*', $limit = 1) {
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 @@ public function count_non_empty_children($extensions = '*', $limit = 1) {
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 @@ private function get_filtered_children($extensions = '*', $countonly = false, $r
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 @@ private function get_filtered_children($extensions = '*', $countonly = false, $r
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 @@ private function get_filtered_children($extensions = '*', $countonly = false, $r
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 @@ public function get_children() {
}
/**
* 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

0 comments on commit f7de90a

Please sign in to comment.