<?php
if (!$prefs->isLocked('initial_page')):
    if ($prefs->getValue('initial_page') == 'folders.php' &&
        $GLOBALS['conf']['user']['allow_folders']) {
        $folders_option = '<option value="folders.php" selected="selected">' .
            _("Folder Navigator") . "</option>\n";
        $mailbox_option = IMP::flistSelect();
    } else {
        if ($GLOBALS['conf']['user']['allow_folders']) {
            $folders_option = '<option value="folders.php">' . _("Folder Navigator") . "</option>\n";
            $mailbox_selected = $prefs->getValue('initial_page');
            if ($mailbox_selected != 'INBOX') {
                $mailbox_selected = IMP::preambleString() . $mailbox_selected;
            }
            $mailbox_option = IMP::flistSelect('', true, array(), $mailbox_selected);
        } else {
            $mailbox_option = '<option value="INBOX" selected="selected">INBOX</option>';
            $folders_option = '';
        }
    }
?>

<table border="0">
<tr>
    <td>
        <?php echo _("View or mailbox to display after login:") ?><br />
	    <select name="initial_page">
	        <?php echo $folders_option ?>
	        <?php echo $mailbox_option ?>
	    </select>
    </td>
</tr></table>

<?php endif; ?>
