tmp = elt.cloneNode(false);
u = thread.get(row.imapuid);
$R(0, u.length, true).each(function(i) {
- tmp.insert(new Element('SPAN', { className: 'iconImg threadImg threadImg' + u.charAt(i) }));
+ tmp.insert(new Element('SPAN', { className: 'threadImg threadImg' + u.charAt(i) }));
});
elt.replace(tmp.insert(elt.getText().escapeHTML()));
}
protected $_thread;
/**
- * Images used and their internal representations.
- *
- * @var array
- */
- static protected $_imglist = array(
- '0' => 'blank.png',
- '1' => 'line.png',
- '2' => 'join.png',
- '3' => 'joinbottom-down.png',
- '4' => 'joinbottom.png'
- );
-
- /**
* Constructor.
*
* @param Horde_Imap_Client_Thread $thread The thread data object.
/**
* Generate the thread representation for the given index list in the
- * internal format (a string with each character representing the graphic
- * to be displayed from $_imglist).
+ * internal format.
*
* @param array $indices The list of indices to create a tree for.
* @param boolean $sortdir True for newest first, false for oldest first.
*
* @return array An array with the index as the key and the internal
* thread representation as the value.
+ * <pre>
+ * 0 - blank
+ * 1 - line
+ * 2 - join
+ * 3 - joinbottom-down
+ * 4 - joinbottom
+ * 5 - line (reverse)
+ * 6 - join (reverse)
+ * 7 - joinbottom-down (reverse)
+ * 8 - joinbottom (reverse)
+ * </pre>
*/
public function getThreadTreeOb($indices, $sortdir)
{
$container = $last_level = $last_thread = null;
+ $rtl = !empty($GLOBALS['nls']['rtl'][$GLOBALS['language']]);
$thread_level = $tree = array();
$t = &$this->_thread;
$join_img = 2;
}
+ if ($rtl) {
+ $join_img += 4;
+ }
+
$thread_level[$indentLevel] = $lastinlevel;
$line = '';
for ($i = 1; $i < $indentLevel; ++$i) {
- $line .= (!isset($thread_level[$i]) || ($thread_level[$i])) ? 0 : 1;
+ $line .= (!isset($thread_level[$i]) || ($thread_level[$i])) ? 0 : ($rtl ? 5 : 1);
}
$tree[$val] = $line . $join_img;
}
*/
public function getThreadImageTree($indices, $sortdir)
{
- $imgs = $tree = array();
-
- foreach (self::$_imglist as $key => $val) {
- $imgs[$key] = Horde::img('tree/' . (($key != 0 && !empty($GLOBALS['nls']['rtl'][$GLOBALS['language']])) ? ('rev-' . $val) : $val), null, null, $GLOBALS['registry']->getImageDir('horde'));
- }
+ $tree = array();
foreach ($this->getThreadTreeOb($indices, $sortdir) as $k => $v) {
$tree[$k] = '';
for ($i = 0, $length = strlen($v); $i < $length; ++$i) {
- $tree[$k] .= $imgs[$v[$i]];
+ $tree[$k] .= '<span class="threadImg threadImg' . $v[$i] . '"></span>';
}
}
return $tree;
/**
* Initializes and returns the list of mailboxes to poll.
*
- * @param boolean $prune Prune non-existant folders from list?
+ * @param boolean $prune Prune non-existent folders from list?
* @param boolean $sort Sort the directory list?
*
* @return array The list of mailboxes to poll.
{
$this->_initPollList();
- $plist = ($prune) ? array_values(array_intersect(array_keys($this->_poll), $this->folderList())) : $this->_poll;
+ $plist = ($prune)
+ ? array_values(array_intersect(array_keys($this->_poll), $this->folderList()))
+ : $this->_poll;
+
if ($sort) {
$ns_new = $this->_getNamespace(null);
Horde_Imap_Client_Sort::sortMailboxes($plist, array('delimiter' => $ns_new['delimiter'], 'inbox' => true));
border: 1px solid #ddd;
vertical-align: middle;
}
-.messageList img {
- padding-right: 1px;
-}
.messageList td label input {
vertical-align: middle;
}
text-decoration: underline;
}
+/* Thread images */
+span.threadImg {
+ height: 20px;
+ width: 20px;
+ display: inline-block;
+ vertical-align: middle;
+}
+
+span.threadImg1 {
+ background-image: url("graphics/tree/line.png");
+}
+span.threadImg2 {
+ background-image: url("graphics/tree/join.png");
+}
+span.threadImg3 {
+ background-image: url("graphics/tree/joinbottom-down.png");
+}
+span.threadImg4 {
+ background-image: url("graphics/tree/joinbottom.png");
+}
+span.threadImg5 {
+ background-image: url("graphics/tree/rev-line.png");
+}
+span.threadImg6 {
+ background-image: url("graphics/tree/rev-join.png");
+}
+span.threadImg7 {
+ background-image: url("graphics/tree/rev-joinbottom-down.png");
+}
+span.threadImg8 {
+ background-image: url("graphics/tree/rev-joinbottom.png");
+}
+
/* MIME styles. */
.mimeStatusMessage, .mimeStatusWarning, .mimeHeaders, .mimePartInfo {
padding: 4px;