$tree->addNode($gallery->id, $parent, $gallery->get('name'), null,
($gallery->id == $this->_view->gallery->id),
- array('icon' => $img, 'icondir' => '', 'url' => $link));
+ array('icon' => $img, 'url' => $link));
}
Horde::startBuffer();
$indent + 1,
false,
array(
- 'icon' => 'folder.png',
- 'icondir' => (string)Horde_Themes::img(null, 'horde') . '/tree',
+ 'icon' => Horde_Themes::img('tree/folder.png'),
'url' => Chora::url('browsedir', '', array('rt' => $key))
)
);
{
$menus = array(
array('add', _("Add Postings"), 'add.png', Horde_Util::addParameter(Horde::applicationUrl('postings.php'), 'actionID', 'add_postings')),
- array('search', _("Search"), 'search.png', Horde::applicationUrl('search.php'), (string)Horde_Themes::img(null, 'horde')),
+ array('search', _("Search"), 'search.png', Horde::applicationUrl('search.php')),
array('accounts', _("Accounts"), 'accounts.png', Horde::applicationUrl('accounts.php')),
- array('reports', _("Reports"), 'report.png', Horde::applicationUrl('report.php')),
+ array('reports', _("Reports"), 'report.png', Horde::applicationUrl('report.php'))
);
foreach ($menus as $menu) {
- $tree->addNode($parent . $menu[0],
- $parent,
- $menu[1],
- $indent + 1,
- false,
- array('icon' => $menu[2],
- 'icondir' => isset($menu[4]) ? $menu[4] : (string)Horde_Themes::img(),
- 'url' => $menu[3]));
+ $tree->addNode(
+ $parent . $menu[0],
+ $parent,
+ $menu[1],
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img($menu[2]),
+ 'url' => $menu[3]
+ )
+ );
}
}
<div id="accountList">
<?php
-$params = array('icondir' => Horde_Themes::img(), 'icon' => '');
$tree = $GLOBALS['injector']->getInstance('Horde_Tree')->getTree('account_tree', 'Javascript');
foreach ($accounts as $accountId => $account) {
- $params['icon'] = $account['icon'];
+ $params = array('icon' => Horde_Themes::img($account['icon']));
$accountLabel = htmlspecialchars(trim($account['number'] . ' ' . $account['name']));
if ($account['closed']) {
$accountLabel = '<span class="closed">' . $accountLabel . '</span>';
/* Get the perms tree. */
$nodes = $this->_perms->getTree();
- $icondir = array('icondir' => Horde_Themes::img());
- $perms_node = $icondir + array('icon' => 'perms.png');
+ $perms_node = array('icon' => Horde_Themes::img('perms.png'));
$add = Horde::applicationUrl('admin/perms/addchild.php');
$add_img = Horde::img('add_perm.png', _("Add Permission"));
$edit = Horde::applicationUrl('admin/perms/edit.php');
: array();
if ($perm_id == Horde_Perms::ROOT) {
$add_link = $add->add('perm_id', $perm_id)->link(array('title' => _("Add New Permission"))) . $add_img . '</a>';
- $base_node_params = $icondir +
- array('icon' => 'administration.png');
+ $base_node_params = array('icon' => Horde_Themes::img('administration.png'));
$tree->addNode($perm_id, null, _("All Permissions"), 0, true,
$base_node_params + $node_class,
* class - CSS class to use with this node
* icon - Icon to display next node
* iconalt - Alt text to use for the icon
- * icondir - Icon directory
* iconopen - Icon to indicate this node as expanded
* onclick - Onclick event attached to this node
* url - URL to link the node to
}
$allowed = array(
- 'class', 'icon', 'iconalt', 'icondir', 'iconopen',
+ 'class', 'icon', 'iconalt', 'iconopen',
'onclick', 'url', 'urlclass', 'title', 'target',
);
/* Use standard icon set. */
if (isset($this->_nodes[$node_id]['children'])) {
/* Node with children. */
- $img = ($this->_nodes[$node_id]['expanded']) ? $this->_images['folderopen'] : $this->_images['folder'];
+ $img = ($this->_nodes[$node_id]['expanded'])
+ ? $this->_images['folderopen']
+ : $this->_images['folder'];
} else {
/* Leaf node (no children). */
$img = $this->_images['leaf'];
// TODO
return;
- $icondir = (string)Horde_Themes::img();
$login_url = Horde::applicationUrl('login.php');
foreach ($GLOBALS['gollem_backends'] as $key => $val) {
if (Gollem::checkPermissions('backend', Horde_Perms::SHOW, $key)) {
- $tree->addNode($parent . $key,
- $parent,
- $val['name'],
- $indent + 1,
- false,
- array('icon' => 'gollem.png',
- 'icondir' => $icondir,
- 'url' => Horde_Util::addParameter($login_url, array('backend_key' => $key, 'change_backend' => 1))));
+ $tree->addNode(
+ $parent . $key,
+ $parent,
+ $val['name'],
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('gollem.png'),
+ 'url' => $login_url->copy()->add(array('backend_key' => $key, 'change_backend' => 1))
+ )
+ );
}
}
}
<?php
$spacer = ' ';
-$icondir = array('icondir' => Horde_Themes::img());
-$base_node_params = $icondir + array('icon' => 'administration.png');
-$device_node = $icondir + array('icon' => 'mobile.png');
-$user_node = $icondir + array('icon' => 'user.png');
+$base_node_params = array('icon' => strval(Horde_Themes::img('administration.png')));
+$device_node = array('icon' => strval(Horde_Themes::img('mobile.png')));
+$user_node = array('icon' => strval(Horde_Themes::img('user.png')));
$users = array();
$tree = $injector->getInstance('Horde_Tree')->getTree('admin_devices', 'Javascript');
/* Set up some node params. */
$spacer = ' ';
-$icondir = array('icondir' => Horde_Themes::img());
-$group_node = $icondir + array('icon' => 'group.png');
+$group_node = array('icon' => strval(Horde_Themes::img('group.png')));
$add = Horde::applicationUrl('admin/groups.php?actionID=addchild');
$add_img = Horde::img('add_group.png');
$edit = Horde::applicationUrl('admin/groups.php?actionID=edit');
if ($id == Horde_Group::ROOT) {
$add_link = Horde::link(Horde_Util::addParameter($add, 'cid', $id), _("Add a new group")) . $add_img . '</a>';
- $base_node_params = $icondir + array('icon' => 'administration.png');
+ $base_node_params = array('icon' => strval(Horde_Themes::img('administration.png')));
$tree->addNode($id, null, _("All Groups"), 0, true, $base_node_params + $node_params, array($spacer, $add_link));
} else {
$name = $groups->getGroupShortName($node);
img.push('<img class="treeIcon" id="nodeIcon_' + nodeId + '" src="');
- // Image directory.
- if (!Object.isUndefined(node.icondir) && node.icondir) {
- img.push(node.icondir + '/');
- }
-
// Image.
if (!Object.isUndefined(node.icon)) {
// Node has a user defined icon.
// Toggle the node's icon if it has separate open and closed
// icons.
if (icon = $('nodeIcon_' + nodeId)) {
- // Image directory.
- if (!Object.isUndefined(node.icondir) && node.icondir) {
- src.push(node.icondir + '/');
- }
-
// Image.
if (!Object.isUndefined(node.icon)) {
src.push((node.expanded && node.iconopen) ? node.iconopen : node.icon);
$node_params = array(
'icon' => strval((isset($params['icon']) ? $params['icon'] : $registry->get('icon', $app))),
- 'icondir' => '',
'target' => isset($params['target']) ? $params['target'] : null,
'url' => $url
);
$topics = $help->topics();
$added_nodes = array();
$node_params_master = array(
- 'target' => 'help_main',
- 'icon' => 'help.png',
- 'icondir' => dirname(Horde_Themes::img('help.png'))
+ 'icon' => strval(Horde_Themes::img('help.png')),
+ 'target' => 'help_main'
);
foreach ($topics as $id => $title) {
* trash folders.)
*
* @return array A list of mailboxes, with the name as keys and the
- * values an array with 'icon', 'icondir', and 'alt' entries.
+ * values an array with 'icon' and 'alt' entries.
* If a mailbox name doesn't appear in the list, the default
* mailbox icon is displayed.
*/
// if ((stripos($box, "INBOX/Calendar") !== false) ||
// preg_match("!^user/[^/]+/Calendar!", $box)) {
// $newmailboxes[$box] = array(
-// 'icon' => 'kronolith.png',
-// 'icondir' => Horde_Themes::img(null, 'kronolith')
-// 'alt' => _("Calendar")
+// 'alt' => _("Calendar"),
+// 'icon' => Horde_Themes::img('kronolith.png', 'kronolith')
// );
// } elseif ((stripos($box, "INBOX/Tasks") !== false) ||
// preg_match("!^user/[^/]+/Tasks!", $box)) {
// $newmailboxes[$box] = array(
-// 'icon' => 'nag.png',
-// 'icondir' => Horde_Themes::img(null, 'nag')
// 'alt' => _("Tasks")
+// 'icon' => Horde_Themes::img('nag.png', 'nag'),
// );
// } elseif ((stripos($box, "INBOX/Notes") !== false) ||
// preg_match("!^user/[^/]+/Notes!", $box)) {
// $newmailboxes[$box] = array(
-// 'icon' => 'mnemo.png',
-// 'icondir' => Horde_Themes::img(null, 'mnemo')
-// 'alt' => _("Notes")
+// 'alt' => _("Notes"),
+// 'icon' => Horde_Themes::img('mnemo.png', 'mnemo')
// );
// } elseif ((stripos($box, "INBOX/Contacts") !== false) ||
// preg_match("!^user/[^/]+/Contacts!", $box)) {
// $newmailboxes[$box] = array(
-// 'icon' => 'turba.png',
-// 'icondir' => Horde_Themes::img(null, 'turba')
-// 'alt' => _("Contacts")
+// 'alt' => _("Contacts"),
+// 'icon' => Horde_Themes::img('turba.png', 'turba')
// );
// }
// }
// switch ($folder[1]) {
// case 'event':
// $icons[$name] = array(
-// 'icon' => 'kronolith.png',
-// 'icondir' => Horde_Themes::img(null, 'kronolith')
-// 'alt' => _("Calendar")
+// 'alt' => _("Calendar"),
+// 'icon' => Horde_Themes::img('kronolith.png', 'kronolith')
// );
// break;
//
// case 'task':
// $icons[$name] = array(
-// 'icon' => 'nag.png',
-// 'icondir' => Horde_Themes::img(null, 'nag')
-// 'alt' => _("Tasks")
+// 'alt' => _("Tasks"),
+// 'icon' => Horde_Themes::img('nag.png', 'nag')
// );
// break;
//
// case 'note':
// $icons[$name] = array(
-// 'icon' => 'mnemo.png',
-// 'icondir' => Horde_Themes::img(null, 'mnemo')
-// 'alt' => _("Notes")
+// 'alt' => _("Notes"),
+// 'icon' => Horde_Themes::img('mnemo.png', 'mnemo')
// );
// break;
//
// case 'contact':
// $icons[$name] = array(
-// 'icon' => 'turba.png',
-// 'icondir' => Horde_Themes::img(null, 'turba')
-// 'alt' => _("Contacts")
+// 'alt' => _("Contacts"),
+// 'icon' => Horde_Themes::img('turba.png', 'turba')
// );
// break;
//
// case 'prefs':
// $icons[$name] = array(
-// 'icon' => 'prefs.png',
-// 'icondir' => Horde_Themes::img(null, 'horde')
-// 'alt' => _("Preferences")
+// 'alt' => _("Preferences"),
+// 'icon' => Horde_Themes::img('prefs.png', 'horde')
// );
// break;
// }
$icon = $elt->icon;
if ($icon->user_icon) {
$ob->cl = 'customimg';
- $dir = empty($icon->icondir)
- ? Horde_Themes::img()
- : $icon->icondir;
- $ob->i = empty($dir)
- ? $icon->icon
- : $dir . '/' . $icon->icon;
+ $ob->i = strval($icon->icon);
} else {
$ob->cl = $icon->class;
}
$injector->getInstance('IMP_Filter')->filter('INBOX');
}
- /* Cache some additional values. */
- $image_dir = strval(Horde_Themes::img());
-
$tree->addNode(
$parent . 'compose',
$parent,
$indent,
false,
array(
- 'icon' => 'compose.png',
- 'icondir' => $image_dir,
+ 'icon' => Horde_Themes::img('compose.png'),
'url' => strval(IMP::composeLink())
)
);
$indent,
false,
array(
- 'icon' => 'search.png',
- 'icondir' => $image_dir,
+ 'icon' => Horde_Themes::img('search.png'),
'url' => Horde::applicationUrl('search.php')
)
);
$val->is_open,
array(
'icon' => $icon->icon,
- 'icondir' => strval($icon->icondir),
'iconopen' => $icon->iconopen,
'url' => ($val->container) ? null : $name_url->add('mailbox', $val->value),
)
$node_params = array(
'icon' => strval($registry->get('icon', $parent)),
- 'icondir' => '',
'url' => $url
);
$name = $registry->get('name', $parent);
if ($unseen) {
- $node_params['icon'] = 'newmail.png';
- $node_params['icondir'] = $image_dir;
+ $node_params['icon'] = Horde_Themes::img('newmail.png');
$name = sprintf('<strong>%s</strong> (%s)', $name, $unseen);
}
* 'icon' - (object) Icon information for the mailbox. Properties:
* 'alt' - (string) The alt text for the icon.
* 'class' - (string) The CSS class name.
- * 'icon' - (string) The name of the icon graphic to use.
- * 'icondir' - (string) The path of the icon directory.
- * 'iconopen' - (string) The name of the openicon to use.
+ * 'icon' - (Horde_Themes_Image) The icon graphic to use.
+ * 'iconopen' - (Horde_Themes_Image) The openicon to use.
* 'user_icon' - (boolean) Use a user defined icon?
* 'level' - (integer) The deepness level of this element.
* 'mbox_val' - (string) A html-ized version of 'value'.
$this->_initCache();
$info = new stdClass;
- $info->icondir = $this->_eltCache['image_dir'];
$info->iconopen = null;
$info->user_icon = false;
$info->alt = _("Folder");
$info->class = 'folderImg';
$info->icon = 'folders/folder.png';
- $info->iconopen = 'folders/open.png';
+ $info->iconopen = Horde_Themes::img('folders/open.png');
}
} else {
switch ($this->_mbox['v']) {
if (isset($mi['alt'])) {
$info->alt = $mi['alt'];
}
- $info->icon = $mi['icon'];
- $info->icondir = $mi['icondir'];
+ $info->icon = strval($mi['icon']);
$info->user_icon = true;
+ } elseif ($info->icon) {
+ $info->icon = Horde_Themes::img($info->icon);
}
return $info;
{
if (!isset($this->_eltCache)) {
$this->_eltCache = $this->_treeob->getSpecialMailboxes();
- $this->_eltCache['image_dir'] = Horde_Themes::img();
}
}
$peek = $elt->peek;
$dir2 = $icon->user_icon
- ? Horde::img($icon->icon, $icon->alt, null, $icon->icondir)
+ ? Horde::img($icon->icon, $icon->alt)
: '<span class="foldersImg ' . $icon->class . '"></span>';
if ($elt->children && isset($options['expand_url'])) {
}
$url = Horde::applicationUrl('stories/');
- $icondir = Horde_Themes::img(null, array('notheme' => true, 'nohorde' => true));
$news = Jonah_News::factory();
$channels = $news->getChannels('internal');
if (is_a($channels, 'PEAR_Error')) {
$channels = Jonah::checkPermissions('channels', Horde_Perms::SHOW, $channels);
foreach ($channels as $channel) {
- $tree->addNode($parent . $channel['channel_id'],
- $parent,
- $channel['channel_name'],
- $indent + 1,
- false,
- array('icon' => 'editstory.png',
- 'icondir' => $icondir,
- 'url' => Horde_Util::addParameter($url, array('channel_id' => $channel['channel_id']))));
+ $tree->addNode(
+ $parent . $channel['channel_id'],
+ $parent,
+ $channel['channel_name'],
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('editstory.png'),
+ 'url' => $url->add('channel_id', $channel['channel_id'])
+ )
+ );
}
}
function _buildTree(&$tree, $indent = 0, $parent = null)
{
- global $registry;
-
require_once dirname(__FILE__) . '/../base.php';
- $tree->addNode($parent . '__upload',
- $parent,
- _("Upload"),
- $indent + 1,
- false,
- array('icon' => 'menu/upload.png',
- 'icondir' => (string)Horde_Themes::img(null, 'kastalia'),
- 'url' => Horde::applicationUrl('upload_menu.php')));
+ $tree->addNode(
+ $parent . '__upload',
+ $parent,
+ _("Upload"),
+ $indent + 1,
+ false,
+ array(
+ 'icon' => strval(Horde_Themes::img('menu/upload.png')),
+ 'url' => Horde::applicationUrl('upload_menu.php')
+ )
+ );
}
}
continue;
}
$alarmCount++;
- $tree->addNode($parent . $calId . $event->id,
- $parent,
- htmlspecialchars($event->getTitle(), ENT_COMPAT, $GLOBALS['registry']->getCharset()),
- $indent + 1,
- false,
- array('icon' => 'alarm.png',
- 'icondir' => (string)Horde_Themes::img(),
- 'url' => $event->getViewUrl()));
+ $tree->addNode(
+ $parent . $calId . $event->id,
+ $parent,
+ htmlspecialchars($event->getTitle(), ENT_COMPAT, $GLOBALS['registry']->getCharset()),
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('alarm.png'),
+ 'url' => $event->getViewUrl()
+ )
+ );
}
}
} else {
$purl = Horde::url($GLOBALS['registry']->getInitialPage($parent));
}
- $pnode_params = array('url' => $purl,
- 'icon' => (string)$GLOBALS['registry']->get('icon', $parent),
- 'icondir' => '');
+
$pnode_name = $GLOBALS['registry']->get('name', $parent);
if ($alarmCount) {
$pnode_name = '<strong>' . $pnode_name . '</strong>';
}
- $tree->addNode($parent, $GLOBALS['registry']->get('menu_parent', $parent),
- $pnode_name, $indent, false, $pnode_params);
+ $tree->addNode(
+ $parent,
+ $GLOBALS['registry']->get('menu_parent', $parent),
+ $pnode_name,
+ $indent,
+ false,
+ array(
+ 'icon' => $GLOBALS['registry']->get('icon', $parent),
+ 'url' => $purl,
+ )
+ );
}
}
protected function _buildTree(&$tree, $indent = 0, $parent = null)
{
- global $registry;
-
$menus = array(
array('new', _("New Event"), 'new.png', Horde::applicationUrl('new.php')),
array('day', _("Day"), 'dayview.png', Horde::applicationUrl('day.php')),
array('week', _("Week"), 'weekview.png', Horde::applicationUrl('week.php')),
array('month', _("Month"), 'monthview.png', Horde::applicationUrl('month.php')),
array('year', _("Year"), 'yearview.png', Horde::applicationUrl('year.php')),
- array('search', _("Search"), 'search.png', Horde::applicationUrl('search.php'), (string)Horde_Themes::img(null, 'horde')),
+ array('search', _("Search"), 'search.png', Horde::applicationUrl('search.php'))
);
foreach ($menus as $menu) {
- $tree->addNode($parent . $menu[0],
- $parent,
- $menu[1],
- $indent + 1,
- false,
- array('icon' => $menu[2],
- 'icondir' => isset($menu[4]) ? $menu[4] : (string)Horde_Themes::img(),
- 'url' => $menu[3]));
+ $tree->addNode(
+ $parent . $menu[0],
+ $parent,
+ $menu[1],
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img($menu[2]),
+ 'url' => $menu[3]
+ )
+ );
}
}
protected function _buildTree(&$tree, $indent = 0, $parent = null)
{
- global $registry;
-
$add = Horde::applicationUrl('memo.php')->add('actionID', 'add_memo');
- $icondir = (string)Horde_Themes::img();
- $tree->addNode($parent . '__new',
- $parent,
- _("New Note"),
- $indent + 1,
- false,
- array('icon' => 'add.png',
- 'icondir' => $icondir,
- 'url' => $add));
+ $tree->addNode(
+ $parent . '__new',
+ $parent,
+ _("New Note"),
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('add.png'),
+ 'url' => $add
+ )
+ );
foreach (Mnemo::listNotepads() as $name => $notepad) {
if ($notepad->get('owner') != $GLOBALS['registry']->getAuth() &&
continue;
}
- $tree->addNode($parent . $name . '__new',
- $parent . '__new',
- sprintf(_("in %s"), $notepad->get('name')),
- $indent + 2,
- false,
- array('icon' => 'add.png',
- 'icondir' => $icondir,
- 'url' => Horde_Util::addParameter($add, array('memolist' => $name))));
+ $tree->addNode(
+ $parent . $name . '__new',
+ $parent . '__new',
+ sprintf(_("in %s"), $notepad->get('name')),
+ $indent + 2,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('add.png'),
+ 'url' => $add->copy()->add('memolist', $name)
+ )
+ );
}
- $tree->addNode($parent . '__search',
- $parent,
- _("Search"),
- $indent + 1,
- false,
- array('icon' => 'search.png',
- 'icondir' => (string)Horde_Themes::img(null, 'horde'),
- 'url' => Horde::applicationUrl('search.php')));
+ $tree->addNode(
+ $parent . '__search',
+ $parent,
+ _("Search"),
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('search.png'),
+ 'url' => Horde::applicationUrl('search.php')
+ )
+ );
}
}
$url = Horde_Util::addParameter(Horde::applicationUrl('view.php'),
array('task' => $task->id,
'tasklist' => $task->tasklist));
- $tree->addNode($parent . $taskId,
- $parent,
- $task->name,
- $indent + 1,
- false,
- array('icon' => 'alarm.png',
- 'icondir' => (string)Horde_Themes::img(),
- 'title' => $title,
- 'url' => $url));
+ $tree->addNode(
+ $parent . $taskId,
+ $parent,
+ $task->name,
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('alarm.png'),
+ 'title' => $title,
+ 'url' => $url
+ )
+ );
}
if ($GLOBALS['registry']->get('url', $parent)) {
} else {
$purl = Horde::url($GLOBALS['registry']->getInitialPage($parent));
}
- $pnode_params = array('url' => $purl,
- 'icon' => (string)$GLOBALS['registry']->get('icon', $parent),
- 'icondir' => '');
-
- $pnode_params = array('url' => $purl,
- 'icon' => (string)$GLOBALS['registry']->get('icon', $parent),
- 'icondir' => '');
+ $pnode_params = array(
+ 'url' => $purl,
+ 'icon' => (string)$GLOBALS['registry']->get('icon', $parent)
+ );
$pnode_name = $GLOBALS['registry']->get('name', $parent);
if ($alarmCount) {
$pnode_name = '<strong>' . $pnode_name . '</strong>';
protected function _buildTree(&$tree, $indent = 0, $parent = null)
{
- global $registry;
-
$add = Horde::applicationUrl('task.php')->add('actionID', 'add_task');
- $icondir = (string)Horde_Themes::img();
- $tree->addNode($parent . '__new',
- $parent,
- _("New Task"),
- $indent + 1,
- false,
- array('icon' => 'add.png',
- 'icondir' => $icondir,
- 'url' => $add));
+ $tree->addNode(
+ $parent . '__new',
+ $parent,
+ _("New Task"),
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('add.png'),
+ 'url' => $add
+ )
+ );
foreach (Nag::listTasklists() as $name => $tasklist) {
if ($tasklist->get('owner') != $GLOBALS['registry']->getAuth() &&
!in_array($tasklist->getName(), $GLOBALS['display_tasklists'])) {
continue;
}
- $tree->addNode($parent . $name . '__new',
- $parent . '__new',
- sprintf(_("in %s"), $tasklist->get('name')),
- $indent + 2,
- false,
- array('icon' => 'add.png',
- 'icondir' => $icondir,
- 'url' => Horde_Util::addParameter($add, array('tasklist_id' => $name))));
+ $tree->addNode(
+ $parent . $name . '__new',
+ $parent . '__new',
+ sprintf(_("in %s"), $tasklist->get('name')),
+ $indent + 2,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('add.png'),
+ 'url' => $add->copy()->add('tasklist_id', $name)
+ )
+ );
}
- $tree->addNode($parent . '__search',
- $parent,
- _("Search"),
- $indent + 1,
- false,
- array('icon' => 'search.png',
- 'icondir' => (string)Horde_Themes::img(null, 'horde'),
- 'url' => Horde::applicationUrl('search.php')));
+ $tree->addNode(
+ $parent . '__search',
+ $parent,
+ _("Search"),
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('search.png'),
+ 'url' => Horde::applicationUrl('search.php')
+ )
+ );
}
}
{
$cats = $this->getCategories(false);
- $params = array('icondir' => Horde_Themes::img(),
- 'icon' => 'folder_open.png');
+ $params = array('icon' => Horde_Themes::img('folder_open.png'));
// Set up the tree
$tree = $GLOBALS['injector']->getInstance('Horde_Tree')->getTree('news_cats', 'Javascript', array(
require_once dirname(__FILE__) . '/../base.php';
$add = Horde::applicationUrl('add.php');
- $icondir = (string)Horde_Themes::img();
+ $add_img = Horde_Themes::img('add.png');
$classes = Skoli::listClasses(false, Horde_Perms::EDIT);
if (count($classes) > 0) {
-
- $tree->addNode($parent . '__new',
- $parent,
- _("New Entry"),
- $indent + 1,
- false,
- array('icon' => 'add.png',
- 'icondir' => $icondir,
- 'url' => $add));
+ $tree->addNode(
+ $parent . '__new',
+ $parent,
+ _("New Entry"),
+ $indent + 1,
+ false,
+ array(
+ 'icon' => $add_img,
+ 'url' => $add
+ )
+ );
foreach ($classes as $name => $class) {
- $tree->addNode($parent . $name . '__new',
- $parent . '__new',
- sprintf(_("in %s"), $class->get('name')),
- $indent + 2,
- false,
- array('icon' => 'add.png',
- 'icondir' => $icondir,
- 'url' => Horde_Util::addParameter($add, array('class' => $name))));
+ $tree->addNode(
+ $parent . $name . '__new',
+ $parent . '__new',
+ sprintf(_("in %s"), $class->get('name')),
+ $indent + 2,
+ false,
+ array(
+ 'icon' => $add_img,
+ 'url' => $add->copy()->add('class', $name)
+ )
+ );
}
- $tree->addNode($parent . '__search',
- $parent,
- _("Search"),
- $indent + 1,
- false,
- array('icon' => 'search.png',
- 'icondir' => (string)Horde_Themes::img(null, 'horde'),
- 'url' => Horde::applicationUrl('search.php')));
- }
+ $tree->addNode(
+ $parent . '__search',
+ $parent,
+ _("Search"),
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('search.png'),
+ 'url' => Horde::applicationUrl('search.php')
+ )
+ );
+ }
}
+
}
protected function _buildTree(&$tree, $indent = 0, $parent = null)
{
- global $registry;
-
- $browse = Horde::applicationUrl('browse.php');
-
- $tree->addNode($parent . '__new',
- $parent,
- _("Add"),
- $indent + 1,
- false,
- array('icon' => 'add.png',
- 'icondir' => (string)Horde_Themes::img(),
- 'url' => Horde::applicationUrl('add.php')));
-
- $tree->addNode($parent . '__search',
- $parent,
- _("Search"),
- $indent + 1,
- false,
- array('icon' => 'search.png',
- 'icondir' => (string)Horde_Themes::img('horde'),
- 'url' => Horde::applicationUrl('search.php')));
+ $tree->addNode(
+ $parent . '__new',
+ $parent,
+ _("Add"),
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('add.png'),
+ 'url' => Horde::applicationUrl('add.php')
+ )
+ );
+
+ $tree->addNode(
+ $parent . '__search',
+ $parent,
+ _("Search"),
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('search.png'),
+ 'url' => Horde::applicationUrl('search.php')
+ )
+ );
$folders = Trean::listFolders();
- if (!is_a($folders, 'PEAR_Error')) {
+ if ($folders instanceof PEAR_Error) {
+ $browse = Horde::applicationUrl('browse.php');
+
foreach ($folders as $folder) {
$parent_id = $folder->getParent();
- $tree->addNode($parent . $folder->getId(),
- $parent . $parent_id,
- $folder->get('name'),
- $indent + substr_count($folder->getName(), ':') + 1,
- false,
- array('icon' => 'folder.png',
- 'icondir' => (string)Horde_Themes::img('horde') . '/tree',
- 'url' => Horde_Util::addParameter($browse, 'f', $folder->getId())));
+ $tree->addNode(
+ $parent . $folder->getId(),
+ $parent . $parent_id,
+ $folder->get('name'),
+ $indent + substr_count($folder->getName(), ':') + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('tree/folder.png'),
+ 'url' => $browse->copy()->add('f', $folder->getId()
+ )
+ );
}
}
}
protected function _buildTree(&$tree, $indent = 0, $parent = null)
{
- global $registry;
-
$browse = Horde::applicationUrl('browse.php');
$add = Horde::applicationUrl('add.php');
- $icondir = (string)Horde_Themes::img() . '/menu';
if ($GLOBALS['addSources']) {
- $tree->addNode($parent . '__new',
- $parent,
- _("New Contact"),
- $indent + 1,
- false,
- array('icon' => 'new.png',
- 'icondir' => $icondir,
- 'url' => $add));
+ $newimg = Horde_Themes::img('menu/new.png');
+
+ $tree->addNode(
+ $parent . '__new',
+ $parent,
+ _("New Contact"),
+ $indent + 1,
+ false,
+ array(
+ 'icon' => $newimg,
+ 'url' => $add
+ )
+ );
foreach ($GLOBALS['addSources'] as $addressbook => $config) {
- $tree->addNode($parent . $addressbook . '__new',
- $parent . '__new',
- sprintf(_("in %s"), $config['title']),
- $indent + 2,
- false,
- array('icon' => 'new.png',
- 'icondir' => $icondir,
- 'url' => $add->copy()->add('source', $addressbook)));
+ $tree->addNode(
+ $parent . $addressbook . '__new',
+ $parent . '__new',
+ sprintf(_("in %s"), $config['title']),
+ $indent + 2,
+ false,
+ array(
+ 'icon' => $newimg,
+ 'url' => $add->copy()->add('source', $addressbook)
+ )
+ );
}
}
foreach (Turba::getAddressBooks() as $addressbook => $config) {
if (!empty($config['browse'])) {
- $tree->addNode($parent . $addressbook,
- $parent,
- $config['title'],
- $indent + 1,
- false,
- array('icon' => 'browse.png',
- 'icondir' => $icondir,
- 'url' => $browse->copy()->add('source', $addressbook)));
+ $tree->addNode(
+ $parent . $addressbook,
+ $parent,
+ $config['title'],
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('menu/browse.png'),
+ 'url' => $browse->copy()->add('source', $addressbook)
+ )
+ );
}
}
- $tree->addNode($parent . '__search',
- $parent,
- _("Search"),
- $indent + 1,
- false,
- array('icon' => 'search.png',
- 'icondir' => (string)Horde_Themes::img(null, 'horde'),
- 'url' => Horde::applicationUrl('search.php')));
+ $tree->addNode(
+ $parent . '__search',
+ $parent,
+ _("Search"),
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('search.png'),
+ 'url' => Horde::applicationUrl('search.php')
+ )
+ );
}
}
protected function _buildTree(&$tree, $indent = 0, $parent = null)
{
- global $registry;
+ $tree->addNode(
+ $parent . '__new',
+ $parent,
+ _("New Ticket"),
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('create.png'),
+ 'url' => Horde::applicationUrl('ticket/create.php')
+ )
+ );
- $tree->addNode($parent . '__new',
- $parent,
- _("New Ticket"),
- $indent + 1,
- false,
- array('icon' => 'create.png',
- 'icondir' => (string)Horde_Themes::img(),
- 'url' => Horde::applicationUrl('ticket/create.php')));
-
- $tree->addNode($parent . '__search',
- $parent,
- _("Search"),
- $indent + 1,
- false,
- array('icon' => 'search.png',
- 'icondir' => (string)Horde_Themes::img(),
- 'url' => Horde::applicationUrl('search.php')));
+ $tree->addNode(
+ $parent . '__search',
+ $parent,
+ _("Search"),
+ $indent + 1,
+ false,
+ array(
+ 'icon' => Horde_Themes::img('search.png'),
+ 'url' => Horde::applicationUrl('search.php')
+ )
+ );
}
}