Commit 9b462595 authored by Robert Lyon's avatar Robert Lyon

Clicking 'details' link for images goes directly to details page (bug #633658)

Before patch:
- Clicking 'View' (details) link in 'files(s) to download block took
you to a preview page for the image

After patch:
- clicking the 'Details' link takes you to the details page - now
consistent UI with the other file types. And there is no preview page.
If one wants to see image they can click on the title link on
view/artefact.php page or click the small 'preview' image.

Change-Id: Ia6c3304e0e4fef50c929aa30962265036d11df93
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 4735d5e5
......@@ -5,7 +5,7 @@
<h3 class="title"><a href="{$file.downloadurl}" target="_blank">{$file.title}</a></h3>
{if $file.description}<p>{$file.description}</p>{/if}
<div class="description">{$file.size|display_size} | {$file.ctime|format_date:'strftimedaydate'}
| <a href="{$WWWROOT}view/artefact.php?artefact={$file.id}&view={$viewid}">{if $file.is_image}{str tag=View section=artefact.file}{else}{str tag=Details section=artefact.file}{/if}</a></div>
| <a href="{$WWWROOT}view/artefact.php?artefact={$file.id}&view={$viewid}">{str tag=Details section=artefact.file}</a></div>
</div>
</div>
{/foreach}
......@@ -1981,7 +1981,7 @@ class ArtefactTypeImage extends ArtefactTypeFile {
$result = parent::render_self($options);
$result['html'] = '<div class="fl filedata-icon"><h4 class="title">'
. get_string('Preview', 'artefact.file') . '</h4><a href="'
. hsc($url) . '"><img src="' . hsc($downloadpath) . '&maxwidth=400&maxheight=180'
. hsc($downloadpath) . '"><img src="' . hsc($downloadpath) . '&maxwidth=400&maxheight=180'
. '" alt=""></a></div>' . $result['html'];
return $result;
}
......
......@@ -92,10 +92,9 @@ $options = array(
'viewid' => $viewid,
'path' => $path,
'details' => true,
'metadata' => 1,
);
if (param_integer('details', 0)) {
$options['metadata'] = 1;
}
if ($artefact->get('artefacttype') == 'folder') {
// get folder block sort order - returns the first instance of folder on view
// why you'd want more than one folder block on the same view is m̶a̶d̶n̶e̶s̶s̶ user preference.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment