From: Jan Schneider Date: Tue, 16 Nov 2010 18:00:38 +0000 (+0100) Subject: Allow to specify class name and additional link attributes. Don't hardcode the url. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=10c3f0721b7a4bb2c86c22c299fe8c9850523f22;p=horde.git Allow to specify class name and additional link attributes. Don't hardcode the url. --- diff --git a/framework/Tree/lib/Horde/Tree/Jquerymobile.php b/framework/Tree/lib/Horde/Tree/Jquerymobile.php index 6c138e53f..b3b52a543 100644 --- a/framework/Tree/lib/Horde/Tree/Jquerymobile.php +++ b/framework/Tree/lib/Horde/Tree/Jquerymobile.php @@ -22,9 +22,11 @@ class Horde_Tree_Jquerymobile extends Horde_Tree_Base * @var array */ protected $_allowed = array( + 'class', 'icon', 'special', 'url', + 'urlattributes', ); /** @@ -57,12 +59,22 @@ class Horde_Tree_Jquerymobile extends Horde_Tree_Base $output = ''; if ($node['special'] == $special) { - $output = '
  • '; + $output = ''; + $output .= ' $value) { + $output .= ' ' . $attribute . '="' . htmlspecialchars($value) . '"'; + } + } + $output .= '>'; } $output .= $this->_getIcon($node_id) . $node['label']; if (!empty($node['url'])) { diff --git a/imp/lib/Imap/Tree.php b/imp/lib/Imap/Tree.php index e7d0b3bee..2be5e56fa 100644 --- a/imp/lib/Imap/Tree.php +++ b/imp/lib/Imap/Tree.php @@ -1526,6 +1526,8 @@ class IMP_Imap_Tree implements ArrayAccess, Iterator, Serializable $icon = $val->icon; $params['icon'] = $icon->icon; $params['special'] = $val->special; + $params['class'] = 'imp-folder'; + $params['urlattributes'] = array('mailbox' => $val->value); break; } @@ -1551,10 +1553,13 @@ class IMP_Imap_Tree implements ArrayAccess, Iterator, Serializable } if (!$val->container) { - $params['url'] = $mailbox_url->add('mailbox', $val->value); - - if ($this->_showunsub && !$val->sub) { - $params['class'] = 'folderunsub'; + if ($opts['render_type'] == 'Jquerymobile') { + $params['url'] = '#'; + } else { + $params['url'] = $mailbox_url->add('mailbox', $val->value); + if ($this->_showunsub && !$val->sub) { + $params['class'] = 'folderunsub'; + } } }