gross hack to reinstate NL navigation
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 16 Sep 2006 16:34:40 +0000 (16:34 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 16 Sep 2006 16:34:40 +0000 (16:34 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@842 839d8a87-29fc-0310-9880-83ba4fa771e5

include/newsletter.inc.php
templates/newsletter/show.tpl

index 79c70d7..b7bba9c 100644 (file)
@@ -234,15 +234,16 @@ class NewsLetter
     // }}}
     // {{{ function toHtml()
     
-    function toHtml($prenom,$nom,$sexe,$body=false)
+    function toHtml($prenom, $nom, $sexe, $body=false, $urlprefix = false)
     {
+        $u    = $urlprefix ? 'nl/show/'.$this->_id : '';
        $res  = '<div class="title">'.$this->title().'</div>';
        
        $head = $this->head();
        $head = str_replace('<cher>',   $sexe ? 'Chère' : 'Cher', $head);
        $head = str_replace('<prenom>', $prenom, $head);
        $head = str_replace('<nom>',    $nom,    $head);
-       $head = enriched_to_text($head,true);
+       $head = enriched_to_text($head, true);
 
        if($head) {
             $res .= "<div class='intro'>$head</div>";
@@ -251,9 +252,9 @@ class NewsLetter
        $i = 1;
        $res .= "<a id='top_lnk'></a>";
        foreach ($this->_arts as $cid=>$arts) {
-           $res .= "<div class='lnk'><a href='#cat$cid'><strong>$i. {$this->_cats[$cid]}</strong></a>";
+           $res .= "<div class='lnk'><a href='$u#cat$cid'><strong>$i. {$this->_cats[$cid]}</strong></a>";
            foreach ($arts as $art) {
-               $res .= "<a href='#art{$art->_aid}'>&nbsp;&nbsp;- ".htmlentities($art->title())."</a>";
+               $res .= "<a href='$u#art{$art->_aid}'>&nbsp;&nbsp;- ".htmlentities($art->title())."</a>";
            }
            $res .= '</div>';
            $i ++;
@@ -263,7 +264,7 @@ class NewsLetter
            $res .= "<h1><a id='cat$cid'></a><span>".$this->_cats[$cid].'</span></h1>';
            foreach($arts as $art) {
                $res .= $art->toHtml();
-               $res .= "<p><a href='#top_lnk'>Revenir au sommaire</a></p>";
+               $res .= "<p><a href='$u#top_lnk'>Revenir au sommaire</a></p>";
            }
        }
 
index ec4b76e..6dce87a 100644 (file)
   <tr>
     <td>
       {if $smarty.get.text}
-      <pre>{$nl->toText($smarty.session.prenom,$smarty.session.nom,$smarty.session.femme)}</pre>
+      <pre>{$nl->toText($smarty.session.prenom, $smarty.session.nom, $smarty.session.femme)}</pre>
       {else}
       <div class='nl'>
-        {$nl->toHtml($smarty.session.prenom,$smarty.session.nom,$smarty.session.femme)|smarty:nodefaults}
+        {$nl->toHtml($smarty.session.prenom, $smarty.session.nom, $smarty.session.femme,
+                     false, true)|smarty:nodefaults}
       </div>
       {/if}
     </td>