From 258a043a31ff002d83097e45b4504e59e6559d1d Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Fri, 19 Mar 2010 10:18:44 -0400
Subject: [PATCH] - hide threads related stuff if threads are not supported

---
 skins/default/templates/mail.html         |   10 +++++-----
 program/steps/settings/manage_folders.inc |    2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/program/steps/settings/manage_folders.inc b/program/steps/settings/manage_folders.inc
index fa5a4db..9202777 100644
--- a/program/steps/settings/manage_folders.inc
+++ b/program/steps/settings/manage_folders.inc
@@ -294,7 +294,7 @@
     $table->add('msgcount', ($folder['virtual'] ? '' : $IMAP->messagecount($folder['id']))); // XXX: Use THREADS or ALL?
     $table->add('subscribed', ($protected || $folder['virtual']) ? ($subscribed ? '&nbsp;&#x2022;' : '&nbsp;') :
         $checkbox_subscribe->show(($subscribed ? $folder_utf8 : ''), array('value' => $folder_utf8)));
-    if ($IMAP->get_capability('thread=references')) {
+    if ($threading_supported) {
       $table->add('threaded',
                   $checkbox_threaded->show(($threaded ? $folder_utf8 : ''), array('value' => $folder_utf8)));
     }
diff --git a/skins/default/templates/mail.html b/skins/default/templates/mail.html
index 206f101..5bfbe0a 100644
--- a/skins/default/templates/mail.html
+++ b/skins/default/templates/mail.html
@@ -84,11 +84,13 @@
       <roundcube:button command="select-all" type="link" prop="unread" title="unread" class="buttonPas unread" classAct="button unread" classSel="button unreadsel" content=" " />
       <roundcube:button command="select-all" type="link" prop="invert" title="invert" class="buttonPas invert" classAct="button invert" classSel="button invertsel" content=" " />
       <roundcube:button command="select-none" type="link" title="none" class="buttonPas none" classAct="button none" classSel="button nonesel" content=" " />
+<roundcube:if condition="env:threads" />
       <span style="margin-left: 20px"><roundcube:label name="threads" />:&nbsp;</span>
       <roundcube:button command="expand-all" type="link" title="expand-all" class="buttonPas expand-all" classAct="button expand-all" classSel="button expand-allsel" content=" "  />
       <roundcube:button command="expand-unread" type="link" title="expand-unread" class="buttonPas expand-unread" classAct="button expand-unread" classSel="button expand-unreadsel" content=" " />
       <roundcube:button command="collapse-all" type="link" title="collapse-all" class="buttonPas collapse-all" classAct="button collapse-all" classSel="button collapse-allsel" content=" " />
       <roundcube:container name="listcontrols" id="listcontrols" />
+<roundcube:endif />
   <roundcube:if condition="env:quota" />
   <span style="margin-left: 20px; margin-right: 5px"><roundcube:label name="quota" />:</span>
   <roundcube:object name="quotaDisplay" display="image" width="100" height="14" id="quotadisplay" />
@@ -160,16 +162,14 @@
 </div>
 
 <div id="listmenu" class="popupmenu">
+<roundcube:if condition="env:threads" />
 <fieldset class="thinbordered"><legend><roundcube:label name="listmode" /></legend>
   <ul class="toolbarmenu">
     <li><input type="radio" name="view" value="list" id="view_default" /><label for="view_default"><roundcube:label name="list" /></label></li>
-    <roundcube:if condition="env:threads" />
-      <li><input type="radio" name="view" value="thread" id="view_thread" /><label for="view_thread"><roundcube:label name="threads" /></label></li>
-    <roundcube:else />
-      <li><input type="radio" name="view" value="thread" id="view_thread" disabled="disabled" /><label for="view_thread" class="disabled"><roundcube:label name="threads" /></label></li>
-    <roundcube:endif />
+    <li><input type="radio" name="view" value="thread" id="view_thread" /><label for="view_thread"><roundcube:label name="threads" /></label></li>
   </ul>
 </fieldset>
+<roundcube:endif />
 <fieldset class="thinbordered"><legend><roundcube:label name="listcolumns" /></legend>
   <ul class="toolbarmenu">
     <li><input type="checkbox" name="list_col[]" value="flag" id="cols_flag" /><label for="cols_flag"><roundcube:label name="flag" /></label></li>

--
Gitblit v1.9.1