Skip to content
Snippets Groups Projects
Commit 421ec38e authored by Kate Arzamastseva's avatar Kate Arzamastseva
Browse files

issue #38 links and icons in recent changes

parent 676706d3
No related branches found
No related tags found
No related merge requests found
......@@ -209,6 +209,7 @@ function getRecents($first,$num,$ns='',$flags=0){
} else {
$lines_position--;
$x = $rec;
if ($flags & RECENTS_MEDIA_CHANGES) $x['media'] = true;
$rec = false;
}
if(--$first >= 0) continue; // skip first entries
......
......@@ -680,13 +680,20 @@ function html_recent($first=0, $show_changes='both'){
$form->addElement(form_makeOpenTag('div', array('class' => 'li')));
if ($recent['media']) {
$form->addElement(media_printicon($recent['id']));
} else {
$icon = DOKU_BASE.'lib/images/fileicons/file.png';
$form->addElement('<img src="'.$icon.'" alt="'.$filename.'" class="icon" />');
}
$form->addElement(form_makeOpenTag('span', array('class' => 'date')));
$form->addElement($date);
$form->addElement(form_makeCloseTag('span'));
if ($recent['media']) {
$href = media_managerURL(array('tab_details' => 'history',
'mediado' => 'diff', 'image' => $recent['id']), '&');
'mediado' => 'diff', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
} else {
$href = wl($recent['id'],"do=diff", false, '&');
}
......@@ -701,7 +708,8 @@ function html_recent($first=0, $show_changes='both'){
$form->addElement(form_makeCloseTag('a'));
if ($recent['media']) {
$href = media_managerURL(array('tab_details' => 'history', 'image' => $recent['id']), '&');
$href = media_managerURL(array('tab_details' => 'history',
'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
} else {
$href = wl($recent['id'],"do=revisions",false,'&');
}
......@@ -716,13 +724,8 @@ function html_recent($first=0, $show_changes='both'){
$form->addElement(form_makeCloseTag('a'));
if ($recent['media']) {
// Prepare fileicons
list($ext,$mime,$dl) = mimetype($recent['id'],false);
$class = preg_replace('/[^_\-a-z0-9]+/i','_',$ext);
$class = 'mediafile mf_'.$class;
$href = media_managerURL(array('tab_details' => 'view', 'image' => $recent['id']), '&');
$form->addElement(form_makeOpenTag('a', array('class' => 'wikilink1 '.$class, 'href' => $href)));
$href = media_managerURL(array('tab_details' => 'view', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
$form->addElement(form_makeOpenTag('a', array('class' => 'wikilink1', 'href' => $href)));
$form->addElement($recent['id']);
$form->addElement(form_makeCloseTag('a'));
} else {
......
......@@ -1338,7 +1338,7 @@ function media_printicon($filename){
$icon = DOKU_BASE.'lib/images/fileicons/file.png';
}
echo '<img src="'.$icon.'" alt="'.$filename.'" class="icon" />';
return '<img src="'.$icon.'" alt="'.$filename.'" class="icon" />';
}
......@@ -1363,7 +1363,7 @@ function media_printfile_thumbs($item,$auth,$jump=false){
} else {
echo '<a name="d_:'.$item['id'].'" class="image" title="'.$item['id'].'" href="'.
media_managerURL(array('image' => hsc($item['id']))).'"><div>';
media_printicon($item['id']);
echo media_printicon($item['id']);
echo '</div></a>';
}
//echo '<input type=checkbox />';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment