From b8a111f5605b82b5765cc4bde1826c7e1134c56e Mon Sep 17 00:00:00 2001
From: Michael Klier <chi@chimeric.de>
Date: Fri, 6 Oct 2006 13:34:09 +0200
Subject: [PATCH] added draft-feature to tpl_actionlink

darcs-hash:20061006113409-23886-166f573a8ae5c897011282ef22a581cea1dbce86.gz
---
 inc/template.php | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/inc/template.php b/inc/template.php
index 94ccd2d2c..f601ce620 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -482,14 +482,20 @@ function tpl_actionlink($type,$pre='',$suf=''){
       #most complicated type - we need to decide on current action
       if($ACT == 'show' || $ACT == 'search'){
         if($INFO['writable']){
-          if($INFO['exists']){
-            tpl_link(wl($ID,'do=edit&amp;rev='.$REV),
-                     $pre.$lang['btn_edit'].$suf,
-                     'class="action edit" accesskey="e" rel="nofollow"');
-          }else{
-            tpl_link(wl($ID,'do=edit&amp;rev='.$REV),
-                     $pre.$lang['btn_create'].$suf,
-                     'class="action create" accesskey="e" rel="nofollow"');
+          if(!empty($INFO['draft'])) {
+            tpl_link(wl($ID,'do=draft'),
+                       $pre.$lang['btn_draft'].$suf,
+                       'class="action edit" acceskey="e" rel="nofollow"');
+          } else {
+            if($INFO['exists']){
+              tpl_link(wl($ID,'do=edit&amp;rev='.$REV),
+                       $pre.$lang['btn_edit'].$suf,
+                       'class="action edit" accesskey="e" rel="nofollow"');
+            }else{
+              tpl_link(wl($ID,'do=edit&amp;rev='.$REV),
+                       $pre.$lang['btn_create'].$suf,
+                       'class="action create" accesskey="e" rel="nofollow"');
+            }
           }
         }else{
           if(!actionOK('source')) return false; //pseudo action
-- 
GitLab