From: x2003bruneau Date: Sat, 15 Jul 2006 09:54:13 +0000 (+0000) Subject: * Fix new post link in post view X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=1254696cca7afd5bdcd141cfbd17cf7def971c65;p=banana.git * Fix new post link in post view * Improve browsing links git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@103 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- diff --git a/banana/banana.inc.php.in b/banana/banana.inc.php.in index cdf43dd..690f52a 100644 --- a/banana/banana.inc.php.in +++ b/banana/banana.inc.php.in @@ -75,7 +75,7 @@ class Banana var $profile = Array( 'name' => 'Anonymous ', '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 '

'._b_('Impossible de contacter le serveur').'

'; } @@ -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; } diff --git a/banana/misc.inc.php b/banana/misc.inc.php index c3215fc..dfcae9e 100644 --- a/banana/misc.inc.php +++ b/banana/misc.inc.php @@ -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.''; diff --git a/banana/post.inc.php b/banana/post.inc.php index 93e36a6..d50fc26 100644 --- a/banana/post.inc.php +++ b/banana/post.inc.php @@ -379,7 +379,7 @@ class BananaPost $res .= '' . $this->_browser() . '
' - . makeImgLink(Array('group' => $this->group, + . makeImgLink(Array('group' => $banana->state['group'], 'action' => 'new'), 'post.gif', 'Nouveau message') diff --git a/po/banana.pot b/po/banana.pot index d97857a..5ab07bd 100644 --- a/po/banana.pot +++ b/po/banana.pot @@ -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 \n" "Language-Team: LANGUAGE \n"