From: stevetruckstuff Date: Mon, 9 Oct 2006 18:06:07 +0000 (+0000) Subject: Fix broken left_main.tpl template. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3444679099254b044b5850d0651969b101120942;p=squirrelmail.git Fix broken left_main.tpl template. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11884 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/src/left_main.php b/src/left_main.php index 4e8e7089..d7feb633 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -192,9 +192,6 @@ $oTemplate->assign('mailboxes', $mailbox_structure); */ $settings = array(); #$settings['imapConnection'] = $imapConnection; -//FIXME: I think this is already included in all templates by init.php -$settings['iconThemePath'] = $icon_theme_path; -//FIXME: I think this is already included in all templates by init.php $settings['templateID'] = $sTemplateID; $settings['unreadNotificationEnabled'] = $unseen_notify!=1; $settings['unreadNotificationAllFolders'] = $unseen_notify == 3; @@ -209,4 +206,3 @@ $oTemplate->display('left_main.tpl'); sqimap_logout($imapConnection); $oTemplate->display('footer.tpl'); -?> diff --git a/templates/default_advanced/left_main.tpl b/templates/default_advanced/left_main.tpl index cedc11c7..5486e328 100644 --- a/templates/default_advanced/left_main.tpl +++ b/templates/default_advanced/left_main.tpl @@ -83,11 +83,12 @@ include_once(SM_PATH . 'templates/util_global.php'); * * @param array $box Array containing mailbox data * @param array $settings Array containing perferences, etc, passed to template + * @param string $icon_theme_path * @param integer $indent_factor Counter used to control indent spacing * @since 1.5.2 * @author Steve Brown */ -function buildMailboxTree ($box, $settings, $parent_node=-1) { +function buildMailboxTree ($box, $settings, $icon_theme_path, $parent_node=-1) { static $counter; // stop condition @@ -95,11 +96,10 @@ function buildMailboxTree ($box, $settings, $parent_node=-1) { return ''; } - $image_path = Template::calculate_template_images_directory($settings['templateID']); $out = ''; - if ($box['IsRoot']) { + if ($box['IsRoot']) { // Determine the path to the correct images - $out .= 'mailboxes = new dTree("mailboxes", "'.$image_path.'");'."\n"; + $out .= 'mailboxes = new dTree("mailboxes", "'.$icon_theme_path.'");'."\n"; $out .= 'mailboxes.config.inOrder = true;'."\n"; $counter = -1; } else { @@ -145,21 +145,21 @@ function buildMailboxTree ($box, $settings, $parent_node=-1) { $img_open = ''; switch (true) { case $box['IsInbox']: - $img = $image_path . 'base.png'; - $img_open = $image_path . 'base.png'; + $img = 'base.png'; + $img_open = 'base.png'; break; case $box['IsTrash']: - $img = $image_path . 'trash.png'; - $img_open = $image_path . 'trash.png'; + $img = 'trash.png'; + $img_open = 'trash.png'; break; case $box['IsNoSelect']: case $box['IsNoInferiors']: - $img = $image_path . 'page.png'; - $img_open = $image_path . 'page.png'; + $img = 'page.png'; + $img_open = 'page.png'; break; default: - $img = $image_path . 'folder.png'; - $img_open = $image_path . 'folderopen.png'; + $img = 'folder.png'; + $img_open = 'folderopen.png'; break; } @@ -231,15 +231,15 @@ function buildMailboxTree ($box, $settings, $parent_node=-1) { $out .= 'mailboxes.add('.$counter.', '.$parent_node.', ' . '"'.addslashes($name).'", "'.$url.'", "'.$title.'", ' . '"'.$target.'", ' . - '"'.$img.'", ' . - '"'.$img_open.'"' . + '"'.getIconPath($icon_theme_path, $img).'", ' . + '"'.getIconPath($icon_theme_path, $img_open).'"' . ');'."\n"; } } $parent_node = $counter; for ($i = 0; $i - +