Fix the 'view as text' link for NLs (Closes #1395)
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Tue, 22 Feb 2011 21:35:15 +0000 (22:35 +0100)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Tue, 22 Feb 2011 22:00:21 +0000 (23:00 +0100)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
include/newsletter.inc.php
templates/newsletter/show.tpl

index 6a1060e..b8c248e 100644 (file)
@@ -433,7 +433,7 @@ class NewsLetter
     /** Get the prefix leading to the page for this NL
      * Only X.org / AX / X groups may be seen on X.org.
      */
-    public function prefix()
+    public function prefix($enforce_xnet=true)
     {
         if (!empty($GLOBALS['IS_XNET_SITE'])) {
             return $this->group . '/nl';
@@ -447,7 +447,7 @@ class NewsLetter
             return 'epletter';
         default:
             // Don't display groups NLs on X.org
-            assert(false);
+            assert(!$enforce_xnet);
         }
     }
 
index 39f83a6..d81ff65 100644 (file)
@@ -26,9 +26,9 @@
 
 <p style="float: left">
   {if $smarty.get.text}
-  [<a href='nl/show/{$issue->id()}'>version HTML</a>]
+  [<a href='{$nl->prefix()}/show/{$issue->id()}'>version HTML</a>]
   {else}
-  [<a href='nl/show/{$issue->id()}?text=1'>version Texte</a>]
+  [<a href='{$nl->prefix()}/show/{$issue->id()}?text=1'>version Texte</a>]
   {/if}
   {if $nl->mayEdit()}
   [<a href='{$nl->adminPrefix()}/edit/{$issue->id()}'>Éditer</a>]