]> git.pld-linux.org Git - packages/dokuwiki.git/blame - task-1821.patch
include rev for NEWPAGE links
[packages/dokuwiki.git] / task-1821.patch
CommitLineData
b38bd2f0
ER
1adds: @DIFFPAGE@ placeholder to templates
2
8c212fe3
ER
3TODO:
4use rev1, rev2
5http://wintersunset.delfi.lan/dokuwiki/googledrawing?do=diff&rev1=1345291381&rev2=&difftype=sidebyside
6
4e1fe290
ER
7--- dokuwiki-2012-07-16/inc/html.php~ 2012-07-16 11:47:58.000000000 +0300
8+++ dokuwiki-2012-07-16/inc/html.php 2012-07-16 11:53:24.640163788 +0300
9@@ -1086,9 +1086,13 @@
638afb06
ER
10 // given as rev and rev2 parameters, with rev2 being optional. Or in an
11 // array in rev2.
12 $rev1 = $REV;
4e1fe290
ER
13-
14 $rev2 = $INPUT->ref('rev2');
15- if(is_array($rev2)){
16+
17+ // handle $r1 + $r2, see DW #1821
18+ if ($INPUT->has('r1') && $INPUT->has('r2')) {
19+ $rev1 = $INPUT->int('r1');
20+ $rev2 = $INPUT->int('r2');
21+ } elseif(is_array($rev2)){
22 $rev1 = (int) $rev2[0];
23 $rev2 = (int) $rev2[1];
638afb06 24
4b73b5a6
ER
25--- dokuwiki-20110329/inc/html.php~ 2011-03-29 09:20:42.000000000 +0300
26+++ dokuwiki-20110329/inc/html.php 2011-03-29 09:21:51.507042136 +0300
27@@ -1030,8 +1030,8 @@
74e18a10 28
4b73b5a6
ER
29 $diffurl = wl($ID, array(
30 'do' => 'diff',
31- 'rev2[0]' => $l_rev,
32- 'rev2[1]' => $r_rev,
33+ 'r1' => $l_rev,
34+ 'r2' => $r_rev,
35 'difftype' => $type,
36 ));
37 ptln('<br /><a class="wikilink1" href="'.$diffurl.'">'.$lang['difflink'].'</a>');
551627a6
ER
38--- dokuwiki/inc/subscription.php 2013-05-29 22:02:46.801329978 +0300
39+++ dokuwiki/inc/subscription.php 2013-05-29 23:04:29.374883349 +0300
40@@ -384,12 +384,13 @@
b38bd2f0
ER
41 * @return bool true if successfully sent
42 */
43 public function send_diff($subscriber_mail, $template, $id, $rev = null, $summary = '') {
44- global $DIFF_INLINESTYLES;
45+ global $DIFF_INLINESTYLES, $INFO;
46
47 // prepare replacements (keys not set in hrep will be taken from trep)
551627a6 48+ $rev2 = $INFO['meta']['date']['modified'];
b38bd2f0 49 $trep = array(
551627a6
ER
50 'PAGE' => $id,
51- 'NEWPAGE' => wl($id, '', true, '&'),
52+ 'NEWPAGE' => wl($id, "rev=$rev2", true, '&'),
53 'SUMMARY' => $summary,
54 'SUBSCRIBE' => wl($id, array('do' => 'subscribe'), true, '&')
55 );
56@@ -398,6 +399,7 @@
b38bd2f0
ER
57 if($rev) {
58 $subject = 'changed';
59 $trep['OLDPAGE'] = wl($id, "rev=$rev", true, '&');
b38bd2f0
ER
60+ $trep['DIFFPAGE']= wl($id,"do=diff&r1=$rev&r2=$rev2",true,'&');
61
62 $old_content = rawWiki($id, $rev);
63 $new_content = rawWiki($id);
64@@ -417,6 +419,7 @@
65 } else {
66 $subject = 'newpage';
67 $trep['OLDPAGE'] = '---';
68+ $trep['DIFFPAGE']= '---';
69 $tdiff = rawWiki($id);
70 $hdiff = nl2br(hsc($tdiff));
71 }
This page took 0.078393 seconds and 4 git commands to generate.