]> git.wh0rd.org Git - patches.git/blob - dokuwiki-customizable-subjects.patch
initial import
[patches.git] / dokuwiki-customizable-subjects.patch
1 --- dokuwiki-2007-06-26/conf/dokuwiki.php
2 +++ dokuwiki-2007-06-26/conf/dokuwiki.php
3 @@ -86,6 +86,7 @@
4  $conf['locktime']    = 15*60;            //maximum age for lockfiles (defaults to 15 minutes)
5  $conf['fetchsize']   = 0;                //maximum size (bytes) fetch.php may download from extern, disabled by default
6  $conf['notify']      = '';               //send change info to this email (leave blank for nobody)
7 +$conf['notify_subject'] = '[@TITLE@] @REASON@ @ID@'; //subject template for change emails
8  $conf['registernotify'] = '';            //send info about newly registered users to this email (leave blank for nobody)
9  $conf['mailfrom']    = '';               //use this email when sending mails
10  $conf['gzip_output'] = 0;                //use gzip content encodeing for the output xhtml (if allowed by browser)
11 --- dokuwiki-2007-06-26/inc/common.php
12 +++ dokuwiki-2007-06-26/inc/common.php
13 @@ -868,7 +868,7 @@
14    if($who == 'register'){
15      $subject = $lang['mail_new_user'].' '.$summary;
16    }elseif($rev){
17 -    $subject = $lang['mail_changed'].' '.$id;
18 +    $subject = str_replace('@REASON@',$lang['mail_changed'],$conf['notify_subject']);
19      $text = str_replace('@OLDPAGE@',wl($id,"rev=$rev",true,'&'),$text);
20      require_once(DOKU_INC.'inc/DifferenceEngine.php');
21      $df  = new Diff(split("\n",rawWiki($id,$rev)),
22 @@ -876,12 +876,16 @@
23      $dformat = new UnifiedDiffFormatter();
24      $diff    = $dformat->format($df);
25    }else{
26 -    $subject=$lang['mail_newpage'].' '.$id;
27 +    $subject = str_replace('@REASON@',$lang['mail_newpage'],$conf['notify_subject']);
28      $text = str_replace('@OLDPAGE@','none',$text);
29      $diff = rawWiki($id);
30    }
31    $text = str_replace('@DIFF@',$diff,$text);
32 -  $subject = '['.$conf['title'].'] '.$subject;
33 +  $subject = str_replace('@DATE@',date($conf['dformat']),$subject);
34 +  $subject = str_replace('@PAGE@',$id,$subject);
35 +  $subject = str_replace('@TITLE@',$conf['title'],$subject);
36 +  $subject = str_replace('@SUMMARY@',$summary,$subject);
37 +  $subject = str_replace('@USER@',$_SERVER['REMOTE_USER'],$subject);
38  
39    $from = $conf['mailfrom'];
40    $from = str_replace('@USER@',$_SERVER['REMOTE_USER'],$from);
41 --- dokuwiki-2007-06-26/lib/plugins/config/lang/en/lang.php
42 +++ dokuwiki-2007-06-26/lib/plugins/config/lang/en/lang.php
43 @@ -112,6 +112,7 @@
44  $lang['locktime']    = 'Maximum age for lock files (sec)';
45  $lang['fetchsize']   = 'Maximum size (bytes) fetch.php may download from extern';
46  $lang['notify']      = 'Send change notifications to this email address';
47 +$lang['notify_subject'] = 'Subject to use in notification emails';
48  $lang['registernotify'] = 'Send info on newly registered users to this email address';
49  $lang['mailfrom']    = 'Email address to use for automatic mails';
50  $lang['gzip_output'] = 'Use gzip Content-Encoding for xhtml';
51 --- dokuwiki-2007-06-26/lib/plugins/config/settings/config.metadata.php
52 +++ dokuwiki-2007-06-26/lib/plugins/config/settings/config.metadata.php
53 @@ -133,6 +133,7 @@
54  $meta['htmlok']      = array('onoff');
55  $meta['phpok']       = array('onoff');
56  $meta['notify']      = array('email');
57 +$meta['notify_subject'] = array('string');
58  $meta['subscribers'] = array('onoff');
59  $meta['locktime']    = array('numeric');
60  $meta['cachetime']   = array('numeric');