summaryrefslogtreecommitdiff
path: root/inc/html.php
diff options
context:
space:
mode:
authorKate Arzamastseva <pshns@ukr.net>2011-08-03 15:19:52 +0300
committerKate Arzamastseva <pshns@ukr.net>2011-08-03 15:19:52 +0300
commit92cac9a97ee63d9c3c9bb8b0da1e3eb0604ba04f (patch)
tree95598bccc9a68bb5e4e458fbf7d579e4e70274f9 /inc/html.php
parente5d185e17e613b7a9737fc76310f1e78008f71ec (diff)
downloadrpg-92cac9a97ee63d9c3c9bb8b0da1e3eb0604ba04f.tar.gz
rpg-92cac9a97ee63d9c3c9bb8b0da1e3eb0604ba04f.tar.bz2
issue #38 diff links only if diff available; deleted files
Diffstat (limited to 'inc/html.php')
-rw-r--r--inc/html.php30
1 files changed, 19 insertions, 11 deletions
diff --git a/inc/html.php b/inc/html.php
index 2b4e2835e..c58fd64ad 100644
--- a/inc/html.php
+++ b/inc/html.php
@@ -695,20 +695,28 @@ function html_recent($first=0, $show_changes='both'){
$form->addElement(form_makeCloseTag('span'));
if ($recent['media']) {
- $href = media_managerURL(array('tab_details' => 'history',
- 'mediado' => 'diff', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
+ $diff = (count(getRevisions($recent['id'], 0, 1, 8192, true)) && @file_exists(mediaFN($recent['id'])));
+ if ($diff) {
+ $href = media_managerURL(array('tab_details' => 'history',
+ 'mediado' => 'diff', 'image' => $recent['id'], 'ns' => getNS($recent['id'])), '&');
+ }
} else {
$href = wl($recent['id'],"do=diff", false, '&');
}
- $form->addElement(form_makeOpenTag('a', array('class' => 'diff_link', 'href' => $href)));
- $form->addElement(form_makeTag('img', array(
- 'src' => DOKU_BASE.'lib/images/diff.png',
- 'width' => 15,
- 'height'=> 11,
- 'title' => $lang['diff'],
- 'alt' => $lang['diff']
- )));
- $form->addElement(form_makeCloseTag('a'));
+
+ if ($recent['media'] && !$diff) {
+ $form->addElement('<img src="'.DOKU_BASE.'lib/images/blank.gif" width="15" height="11" alt="" />');
+ } else {
+ $form->addElement(form_makeOpenTag('a', array('class' => 'diff_link', 'href' => $href)));
+ $form->addElement(form_makeTag('img', array(
+ 'src' => DOKU_BASE.'lib/images/diff.png',
+ 'width' => 15,
+ 'height'=> 11,
+ 'title' => $lang['diff'],
+ 'alt' => $lang['diff']
+ )));
+ $form->addElement(form_makeCloseTag('a'));
+ }
if ($recent['media']) {
$href = media_managerURL(array('tab_details' => 'history',