<?php
$notepads = Mnemo::listNotepads();

// Check here for guest notepads so that we don't get multiple
// messages after redirects, etc.
if (!Auth::getAuth() && !count(Mnemo::listNotepads())) {
    $notification->push(_("No notepads are available to guests."));
}
?>
<div id="menu">
<?php if (!$prefs->isLocked('default_notepad') && (count($notepads) > 1 || !count($GLOBALS['display_notepads']))): ?>
 <span style="float:right">
<?php
require_once 'Horde/Menu.php';
$cmenu = &new Menu(HORDE_MENU_MASK_NONE);
$cmenu->add('#', _("Show"), 'notepads.png', null, null, 'return notepadSubmit()', '__noselection');
echo $cmenu->render();
?>
<form action="list.php" method="post" name="notepadsmenu">
<?php Util::pformInput() ?>
<select name="display_notepad" onchange="notepadSubmit();">
  <option value=""><?php echo _("Show Notepads:") ?></option>
<?php foreach ($notepads as $id => $notepad): ?>
  <option value="<?php echo $id ?>"><?php echo (in_array($id, $GLOBALS['display_notepads']) ? '* ' : '') . $notepad->get('name') ?></option>
<?php endforeach; ?>
</select>
</form>
 </span>
<?php endif; ?>

 <?php echo Mnemo::getMenu('string') ?>
</div>

<script language="JavaScript" type="text/javascript">
<!--
function notepadSubmit()
{
    document.notepadsmenu.submit();
    return false;
}
// -->
</script>

<br />
<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
