From cffcc40367a41c169506364f93128f9e221087bc Mon Sep 17 00:00:00 2001 From: andi <andi@splitbrain.org> Date: Sat, 23 Apr 2005 13:07:29 +0200 Subject: [PATCH] links to diff and old revisions on recent changes page #255 darcs-hash:20050423110729-9977f-c5830c49d60c32b3b9153412445cd3bfeeca7a15.gz --- images/history.png | Bin 0 -> 202 bytes inc/html.php | 27 +++++++++++++++++++++------ inc/parser/xhtml.php | 12 ++++++++++-- 3 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 images/history.png diff --git a/images/history.png b/images/history.png new file mode 100644 index 0000000000000000000000000000000000000000..ef9e311d30496eb650df6c10fed83d4194e5820d GIT binary patch literal 202 zcmeAS@N?(olHy`uVBq!ia0vp^JV4CH!VDx|PJVD7Nbv{wgt#g)F#P{M=l}ozK!KK~ zmeU&Q>OdA_NswPKgTu2MX&_FLx4R2N2dk_Hki%Kv5n0T@z%2~Ij105pNB{-dOFVsD z*{`yQb6K-~S1Z^J6f*I2aSY+Oo?O7l$j0XG>gt-x#-`43UGPw8kq{8DeF}+@IcVc3 mGEac*yhIw$jN=JBObj3P@<qET-0}hHXYh3Ob6Mw<&;$S$HZu?a literal 0 HcmV?d00001 diff --git a/inc/html.php b/inc/html.php index 9df9aae72..8f717f8c4 100644 --- a/inc/html.php +++ b/inc/html.php @@ -22,7 +22,7 @@ function html_wikilink($id,$name='',$search=''){ $xhtml_renderer = new Doku_Renderer_xhtml(); } - return $xhtml_renderer->internallink($id,$name,$search); + return $xhtml_renderer->internallink($id,$name,$search,true); } /** @@ -396,6 +396,8 @@ function html_revisions(){ print '<ul>'; if($INFO['exists']){ print '<li>'; + print '<img src="'.DOKU_BASE.'images/blank.gif" border="0" width="15" height="11" alt="" /> '; + print $date.' <a class="wikilink1" href="'.wl($ID).'">'.$ID.'</a> '; print $INFO['sum']; @@ -413,16 +415,17 @@ function html_revisions(){ $info = getRevisionInfo($ID,$rev); print '<li>'; + print '<a href="'.wl($ID,"rev=$rev,do=diff").'">'; + print '<img src="'.DOKU_BASE.'images/diff.png" border="0" width="15" height="11" title="'.$lang['diff'].'" />'; + print '</a> '; + print $date.' <a class="wikilink1" href="'.wl($ID,"rev=$rev").'">'.$ID.'</a> '; print $info['sum']; print ' <span class="user">('; print $info['ip']; if($info['user']) print ' '.$info['user']; - print ')</span> '; + print ')</span>'; - print '<a href="'.wl($ID,"rev=$rev,do=diff").'">'; - print '<img src="'.DOKU_BASE.'images/diff.png" border="0" width="15" height="11" title="'.$lang['diff'].'" />'; - print '</a>'; print '</li>'; } print '</ul>'; @@ -435,6 +438,7 @@ function html_revisions(){ */ function html_recent(){ global $conf; + global $lang; $recents = getRecents(0,true); print p_locale_xhtml('recent'); @@ -442,12 +446,23 @@ function html_recent(){ foreach(array_keys($recents) as $id){ $date = date($conf['dformat'],$recents[$id]['date']); print '<li>'; + + print '<a href="'.wl($id,"do=diff").'">'; + print '<img src="'.DOKU_BASE.'images/diff.png" border="0" width="15" height="11" title="'.$lang['diff'].'" />'; + print '</a> '; + + print '<a href="'.wl($id,"do=revisions").'">'; + print '<img src="'.DOKU_BASE.'images/history.png" border="0" width="12" height="14" title="'.$lang['btn_revs'].'" />'; + print '</a> '; + + print $date.' '.html_wikilink($id,$id); - print ' '.htmlspecialchars($recents[$id]['sum']); + print htmlspecialchars($recents[$id]['sum']); print ' <span class="user">('; print $recents[$id]['ip']; if($recents[$id]['user']) print ' '.$recents[$id]['user']; print ')</span>'; + print '</li>'; } print '</ul>'; diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php index 1c26b0645..70a8c7830 100644 --- a/inc/parser/xhtml.php +++ b/inc/parser/xhtml.php @@ -388,7 +388,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer { $this->internallink($link,$link); } - function internallink($id, $name = NULL, $search=NULL) { + /** + * $search and $returnonly are not for the renderer but are used + * elsewhere - no need to implement them in other renderers + */ + function internallink($id, $name = NULL, $search=NULL,$returnonly=false) { global $conf; global $ID; @@ -423,7 +427,11 @@ class Doku_Renderer_xhtml extends Doku_Renderer { } //output formatted - echo $this->_formatLink($link); + if($returnonly){ + return $this->_formatLink($link); + }else{ + echo $this->_formatLink($link); + } } function externallink($url, $name = NULL) { -- GitLab