diff --git a/inc/changelog.php b/inc/changelog.php index 578a042980e38398e8b494591a5f34f4eda50085..1886703972cd3b9d4134a200165d72269ad589da 100644 --- a/inc/changelog.php +++ b/inc/changelog.php @@ -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 diff --git a/inc/html.php b/inc/html.php index 4bbfe6a31d7459247b3cf4bf28a1c1622d41f66d..1df61dc7e783774b6d4a6c87fbd89f4a9cc7a24b 100644 --- a/inc/html.php +++ b/inc/html.php @@ -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 { diff --git a/inc/media.php b/inc/media.php index a08d394ef7ffdec0034f56f3cbe608450c32f073..5f9fb63de91ab2903d397b2df91058d8fa6e8156 100644 --- a/inc/media.php +++ b/inc/media.php @@ -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 />';