mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-31901 repositories serving images from the filepool now provide preview details
This commit is contained in:
parent
0dbf6c88bb
commit
dfad252c9e
@ -124,6 +124,13 @@ class repository_coursefiles extends repository {
|
||||
'source'=> $encodedpath,
|
||||
'thumbnail' => $OUTPUT->pix_url(file_extension_icon($child->get_visible_name(), 32))->out(false)
|
||||
);
|
||||
if ($imageinfo = $child->get_imageinfo()) {
|
||||
$fileurl = new moodle_url($child->get_url());
|
||||
$node['realthumbnail'] = $fileurl->out(false, array('preview' => 'thumb'));
|
||||
$node['realicon'] = $fileurl->out(false, array('preview' => 'tinyicon'));
|
||||
$node['image_width'] = $imageinfo['width'];
|
||||
$node['image_height'] = $imageinfo['height'];
|
||||
}
|
||||
$list[] = $node;
|
||||
}
|
||||
}
|
||||
|
@ -221,6 +221,14 @@ class repository_local_file {
|
||||
$node['license'] = $this->fileinfo->get_license();
|
||||
$node['source'] = $encodedpath;
|
||||
$node['thumbnail'] = $OUTPUT->pix_url(file_extension_icon($node['title'], 32))->out(false);
|
||||
if ($imageinfo = $this->fileinfo->get_imageinfo()) {
|
||||
// what a beautiful picture, isn't it
|
||||
$fileurl = new moodle_url($this->fileinfo->get_url());
|
||||
$node['realthumbnail'] = $fileurl->out(false, array('preview' => 'thumb'));
|
||||
$node['realicon'] = $fileurl->out(false, array('preview' => 'tinyicon'));
|
||||
$node['image_width'] = $imageinfo['width'];
|
||||
$node['image_height'] = $imageinfo['height'];
|
||||
}
|
||||
}
|
||||
return $node;
|
||||
}
|
||||
|
@ -132,6 +132,13 @@ class repository_recent extends repository {
|
||||
'source'=> $params,
|
||||
'thumbnail' => $OUTPUT->pix_url(file_extension_icon($file['filename'], 32))->out(false),
|
||||
);
|
||||
if ($imageinfo = $fileinfo->get_imageinfo()) {
|
||||
$fileurl = new moodle_url($fileinfo->get_url());
|
||||
$node['realthumbnail'] = $fileurl->out(false, array('preview' => 'thumb'));
|
||||
$node['realicon'] = $fileurl->out(false, array('preview' => 'tinyicon'));
|
||||
$node['image_width'] = $imageinfo['width'];
|
||||
$node['image_height'] = $imageinfo['height'];
|
||||
}
|
||||
$list[] = $node;
|
||||
}
|
||||
}
|
||||
|
@ -115,6 +115,13 @@ class repository_user extends repository {
|
||||
'source'=> $encodedpath,
|
||||
'thumbnail' => $OUTPUT->pix_url(file_extension_icon($child->get_visible_name(), 32))->out(false)
|
||||
);
|
||||
if ($imageinfo = $child->get_imageinfo()) {
|
||||
$fileurl = new moodle_url($child->get_url());
|
||||
$node['realthumbnail'] = $fileurl->out(false, array('preview' => 'thumb'));
|
||||
$node['realicon'] = $fileurl->out(false, array('preview' => 'tinyicon'));
|
||||
$node['image_width'] = $imageinfo['width'];
|
||||
$node['image_height'] = $imageinfo['height'];
|
||||
}
|
||||
$list[] = $node;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user