* Fix new post link in post view
authorx2003bruneau <x2003bruneau@9869982d-c50d-0410-be91-f2a2ec7c7c7b>
Sat, 15 Jul 2006 09:54:13 +0000 (09:54 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Fri, 4 Jan 2008 23:34:58 +0000 (00:34 +0100)
* Improve browsing links

git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@103 9869982d-c50d-0410-be91-f2a2ec7c7c7b

banana/banana.inc.php.in
banana/misc.inc.php
banana/post.inc.php
po/banana.pot

index cdf43dd..690f52a 100644 (file)
@@ -75,7 +75,7 @@ class Banana
     var $profile     = Array( 'name' => 'Anonymous <anonymouse@example.com>', 'sig'  => '', 'org'  => '',
             'customhdr' =>'', 'display' => 0, 'lastnews' => 0, 'locale'  => 'fr_FR', 'subscribe' => array());
     
-    var $state       = Array('group' => null, 'artid' => null);
+    var $state       = Array('group' => null, 'artid' => null, 'action' => null);
     var $nntp;
     var $groups;
     var $newgroups;
@@ -111,7 +111,6 @@ class Banana
             $banana->get = $myget;
         }
 
-
         if (!$banana->nntp) {
             return '<p class="error">'._b_('Impossible de contacter le serveur').'</p>';
         }
@@ -125,7 +124,8 @@ class Banana
         }
         $artid  = empty($banana->get['artid']) ? null : strtolower($banana->get['artid']);
         $partid = !isset($banana->get['part']) ? -1 : $banana->get['part'];
-        $banana->state = Array ('group' => $group, 'artid' => $artid);
+        $action = !isset($banana->get['action']) ? null : $banana->get['action'];
+        $banana->state = Array ('group' => $group, 'artid' => $artid, 'action' => $action);
 
         if (is_null($group)) {
             if (isset($banana->get['subscribe'])) {
@@ -138,7 +138,7 @@ class Banana
         } elseif (is_null($artid)) {
             if (isset($_POST['action']) && $_POST['action'] == 'new') {
                 return $banana->action_doFup($group, isset($_POST['artid']) ? intval($_POST['artid']) : -1);
-            } elseif (isset($banana->get['action']) && $banana->get['action'] == 'new') {
+            } elseif ($action == 'new') {
                 return $banana->action_newFup($group);
             } else {
                 return $banana->action_showThread($group, isset($banana->get['first']) ? intval($banana->get['first']) : 1);
@@ -151,8 +151,8 @@ class Banana
                 $res = '';
             }
 
-            if (isset($banana->get['action'])) {
-                switch ($banana->get['action']) {
+            if (!is_null($action)) {
+                switch ($action) {
                     case 'cancel':
                         $res .= $banana->action_showArticle($group, $artid, $partid);
                         if ($banana->post->checkcancel()) {
@@ -174,11 +174,11 @@ class Banana
             }
 
             if (isset($banana->get['pj'])) {
-                $action = false;
-                if (isset($banana->get['action']) && $banana->get['action'] == 'view') {
-                    $action = true;
+                $view = false;
+                if ($action == 'view') {
+                    $view = true;
                 }
-                $att = $banana->action_getAttachment($group, $artid, $banana->get['pj'], $action);
+                $att = $banana->action_getAttachment($group, $artid, $banana->get['pj'], $view);
                 if ($att != "") {
                     return $res.$att;
                 }
index c3215fc..dfcae9e 100644 (file)
@@ -416,8 +416,25 @@ function displayShortcuts($first = -1)
                     $res .= sprintf($fmt, $ndx, min($ndx+$banana->tmax-1,sizeof($banana->spool->overview)));
                 }
             }
+            if (!is_null($action)) {
+                if ($action == 'new') {
+                    $res .= ' > Nouveau Message';
+                }
+            }
         } else {
-            $res .= ' > Message';
+            if (!is_null($action)) {
+                $res .= ' > ' . makeHREF(Array('group' => $group,
+                                               'artid' => $artid),
+                                         'Message')
+                     . ' > ';
+                if ($action == 'new') {
+                    $res .= 'RĂ©pondre';
+                } elseif ($action == 'cancel') {
+                    $res .= 'Annuler';
+                }
+            } else {
+                $res .= ' > Message';
+            }
         }
     }
     return $res.'</div>';
index 93e36a6..d50fc26 100644 (file)
@@ -379,7 +379,7 @@ class BananaPost
         $res .= '<tr><th colspan="2" class="subject">'
              . $this->_browser()
              . '<div class="banana_action">'
-             . makeImgLink(Array('group'  => $this->group,
+             . makeImgLink(Array('group'  => $banana->state['group'],
                                  'action' => 'new'),
                            'post.gif',
                            'Nouveau message')
index d97857a..5ab07bd 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2005-10-19 19:58+0200\n"
+"POT-Creation-Date: 2006-07-15 11:50+0200\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"