Improves nl pages header for nl administrator.
authorStéphane Jacob <sj@m4x.org>
Wed, 2 Nov 2011 15:55:56 +0000 (16:55 +0100)
committerStéphane Jacob <sj@m4x.org>
Wed, 2 Nov 2011 15:55:56 +0000 (16:55 +0100)
Signed-off-by: Stéphane Jacob <sj@m4x.org>
include/newsletter.inc.php
templates/newsletter/admin.tpl
templates/newsletter/index.tpl

index 7f1975c..b9e51dc 100644 (file)
@@ -574,6 +574,16 @@ class NewsLetter
         }
     }
 
+    /** Get links for nl pages.
+     */
+    public function adminLinks()
+    {
+        return array(
+            'index' => array('link' => $this->prefix(), 'title' => 'Archives'),
+            'admin' => array('link' => $this->adminPrefix(), 'title' => 'Administrer')
+        );
+    }
+
     /** Hack used to remove "admin" links on X.org page on X.net
      * The 'admin' links are enabled for all pages, except for X.org when accessing NL through X.net
      */
index a5d2c03..4ad6c47 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 
-
-<h1>
-  {$nl->name}
-</h1>
+{include file="newsletter/header.tpl" current="admin"}
 
 <h3>
   <a href="{$nl->adminPrefix()}/categories">Gérer les catégories d'articles</a>
index 79da294..f9fe9df 100644 (file)
 {*                                                                        *}
 {**************************************************************************}
 
-
-<h1>
-  {$nl->name}
-{if $nl->mayEdit() && $nl->adminLinksEnabled()}
-  [<a href="{$nl->adminPrefix()}">Administrer</a>]
-{/if}
-</h1>
+{include file="newsletter/header.tpl" current="index"}
 
 {if $nl->maySubmit()}
 <p class="center">