Skip to content

Commit

Permalink
MDL-33857 fixed up whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Oct 16, 2012
1 parent 2bbf03c commit f7de90a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions lib/filebrowser/file_info.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -213,12 +213,12 @@ public abstract function get_parent();
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;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/filebrowser/file_info_context_course.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand All @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/filebrowser/file_info_context_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion mod/workshop/fileinfolib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f7de90a

Please sign in to comment.