From b158d625b53833ef391800a991ad93d965d9425e Mon Sep 17 00:00:00 2001 From: Steven Danz Date: Mon, 27 Jun 2005 04:17:48 +0200 Subject: track_changes.patch Second go at including changes to allow users to sign up on mailing lists so they may receive emails each time the page they are interested in is updated. darcs-hash:20050627021748-3ed6d-5f6993f51ab649e3928a513b0fbe7c421d880325.gz --- inc/template.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index 4f6511e97..9baf19348 100644 --- a/inc/template.php +++ b/inc/template.php @@ -118,6 +118,12 @@ function tpl_content(){ case 'admin': tpl_admin(); break; + case 'track': + html_track(); + break; + case 'ignore': + html_ignore(); + break; default: msg("Failed to handle command: ".hsc($ACT),-1); } @@ -292,6 +298,7 @@ function tpl_getparent($ID){ * @author Matthias Grimm */ function tpl_button($type){ + global $ACT; global $ID; global $NS; global $INFO; @@ -333,6 +340,17 @@ function tpl_button($type){ break; case 'backtomedia': print html_backtomedia_button(array('ns' => $NS),'b'); + break; + case 'track': + if($conf['useacl'] && $ACT == 'show'){ + if($_SERVER['REMOTE_USER']){ + if(tracking($ID,$_SERVER['REMOTE_USER'])){ + print html_btn('ignore',$ID,'',array('do' => 'ignore',)); + } else { + print html_btn('track',$ID,'',array('do' => 'track',)); + } + } + } break; default: print '[unknown button type]'; @@ -420,6 +438,17 @@ function tpl_actionlink($type,$pre='',$suf=''){ if($INFO['perm'] == AUTH_ADMIN) tpl_link(wl($ID,'do=admin'),$pre.$lang['btn_admin'].$suf,'class="action"'); break; + case 'track': + if($conf['useacl'] && $ACT == 'show'){ + if($_SERVER['REMOTE_USER']){ + if(tracking($ID,$_SERVER['REMOTE_USER'])){ + tpl_link(wl($ID,'do=ignore'),$pre.$lang['btn_ignore'].$suf,'class="action"'); + } else { + tpl_link(wl($ID,'do=track'),$pre.$lang['btn_track'].$suf,'class="action"'); + } + } + } + break; default: print '[unknown link type]'; } -- cgit v1.2.3