From 8bfa4595f72d796e19c1e7e8829c02f4b67e9cde Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Sun, 14 Jan 2007 13:43:27 +0000 Subject: [PATCH] Can hide the box-list in thread view git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@165 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- banana/banana.inc.php.in | 16 +++++++++++----- banana/page.inc.php | 1 + banana/spool.inc.php | 1 + banana/templates/banana-thread.inc.tpl | 2 ++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/banana/banana.inc.php.in b/banana/banana.inc.php.in index c94af4b..e260626 100644 --- a/banana/banana.inc.php.in +++ b/banana/banana.inc.php.in @@ -29,6 +29,7 @@ class Banana static public $spool_tbefore = 5; static public $spool_tafter = 5; static public $spool_tmax = 50; + static public $spool_boxlist = true; ### Message processing ### static public $msgparse_headers = array('content-disposition', 'content-transfer-encoding', @@ -55,7 +56,7 @@ class Banana * $matches[2] = "http://www.polytechnique.org" * $matches[3] = "]" */ - static public $msgshow_url = '(["\[])?((?:[a-z]+:\/\/|www\.)(?:[\.\,\;\!]*[a-z\@0-9~%$£µ&i#\-+=_\/\?]+)+)(["\]])?'; + static public $msgshow_url = '(["\[])?((?:[a-z]+:\/\/|www\.)(?:[\.\,\;\!]*[a-z\@0-9~%$£µ&i#\-+=_\/\?]+)+)(["\]])?'; ### Message edition ### static public $msgedit_canattach = true; @@ -284,9 +285,11 @@ class Banana if (!$this->loadSpool($group)) { return _b_('Impossible charger la liste des messages de ') . $group; } - $groups = Banana::$protocole->getBoxList(Banana::BOXES_SUB, Banana::$profile['lastnews'], true); + if (Banana::$spool_boxlist) { + $groups = Banana::$protocole->getBoxList(Banana::BOXES_SUB, Banana::$profile['lastnews'], true); + Banana::$page->assign('groups', $groups); + } Banana::$page->assign('msgbypage', Banana::$spool_tmax); - Banana::$page->assign('groups', $groups); return true; } @@ -332,8 +335,10 @@ class Banana if (Banana::$profile['autoup']) { Banana::$spool->markAsRead($artid); } - $groups = Banana::$protocole->getBoxList(Banana::BOXES_SUB, Banana::$profile['lastnews'], true); - Banana::$page->assign('groups', $groups); + if (Banana::$spool_boxlist) { + $groups = Banana::$protocole->getBoxList(Banana::BOXES_SUB, Banana::$profile['lastnews'], true); + Banana::$page->assign('groups', $groups); + } Banana::$page->assign_by_ref('message', $msg); Banana::$page->assign('headers', Banana::$msgshow_headers); return true; @@ -444,6 +449,7 @@ class Banana { Banana::load('spool'); if (!Banana::$spool || Banana::$spool->group != $group) { + $clean = false; if ($group == @$_SESSION['banana_group'] && isset($_SESSION['banana_spool'])) { Banana::$spool = unserialize($_SESSION['banana_spool']); $clean = @(Banana::$profile['lastnews'] != $_SESSION['banana_lastnews']); diff --git a/banana/page.inc.php b/banana/page.inc.php index d4f13e9..d0d67b6 100644 --- a/banana/page.inc.php +++ b/banana/page.inc.php @@ -139,6 +139,7 @@ class BananaPage extends Smarty $this->assign('profile', Banana::$profile); $this->assign('spool', Banana::$spool); $this->assign('protocole', Banana::$protocole); + $this->assign('showboxlist', Banana::$spool_boxlist); $this->register_function('url', array($this, 'makeUrl')); $this->register_function('link', array($this, 'makeLink')); diff --git a/banana/spool.inc.php b/banana/spool.inc.php index 0f8b64c..d6bc579 100644 --- a/banana/spool.inc.php +++ b/banana/spool.inc.php @@ -363,6 +363,7 @@ class BananaSpool } if ($write) { + $this->markAllAsRead(); $this->saveToFile(); } } diff --git a/banana/templates/banana-thread.inc.tpl b/banana/templates/banana-thread.inc.tpl index e555ea3..9bf65fd 100644 --- a/banana/templates/banana-thread.inc.tpl +++ b/banana/templates/banana-thread.inc.tpl @@ -47,7 +47,9 @@ {/if} +{if $showboxlist} {include file="banana-boxlist.inc.tpl" grouplist=$groups withstats=true} +{/if} {if $withtitle}
{if $spool->overview|@count > $msgbypage} -- 2.1.4