$form->addVariable(_("User"), 'user', 'text', true);
$view = new Agora_View();
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer();
$form->renderActive(null, null, 'ban.php', 'post');
/* Set up template variables. */
$view = new Agora_View();
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer()
$form->renderActive(null, $vars, 'deleteforum.php', 'post');
/* Set up template variables. */
$view = new Agora_View();
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer();
$form->renderActive(null, null, 'editforum.php', 'post');
$view = new Agora_View();
$view->col_headers = $col_headers;
$view->forums_list = $forums_list;
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer();
$notification->notify(array('listeners' => 'status'));
}
}
- function getMenu($returnType = 'object')
- {
- $menu = new Horde_Menu();
- $img_dir = Horde_Themes::img();
- $scope = Horde_Util::getGet('scope', 'agora');
-
- /* Agora Home. */
- $url = Horde_Util::addParameter(Horde::url('forums.php'), 'scope', $scope);
- $menu->add($url, _("_Forums"), 'forums.png', $img_dir, null, null,
- dirname($_SERVER['PHP_SELF']) == $GLOBALS['registry']->get('webroot') && basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
-
- /* Thread list, if applicable. */
- if (isset($GLOBALS['forum_id'])) {
- $menu->add(Agora::setAgoraId($GLOBALS['forum_id'], null, Horde::url('threads.php')), _("_Threads"), 'threads.png', Horde_Themes::img());
- if ($scope == 'agora' && $GLOBALS['registry']->getAuth()) {
- $menu->add(Agora::setAgoraId($GLOBALS['forum_id'], null, Horde::url('messages/edit.php')), _("New Thread"), 'newmessage.png', Horde_Themes::img());
- }
- }
-
- if ($scope == 'agora' && Agora_Messages::hasPermission(Horde_Perms::DELETE, 0, $scope)) {
- $menu->add(Horde::url('editforum.php'), _("_New Forum"), 'newforum.png', $img_dir, null, null, Horde_Util::getFormData('agora') ? '__noselection' : null);
- }
-
- if (Agora_Messages::hasPermission(Horde_Perms::DELETE, 0, $scope)) {
- $url = Horde_Util::addParameter(Horde::url('moderate.php'), 'scope', $scope);
- $menu->add($url, _("_Moderate"), 'moderate.png', $img_dir);
- }
-
- if ($GLOBALS['registry']->isAdmin()) {
- $menu->add(Horde::url('moderators.php'), _("_Moderators"), 'hot.png', $img_dir);
- }
-
- $url = Horde_Util::addParameter(Horde::url('search.php'), 'scope', $scope);
- $menu->add($url, _("_Search"), 'search.png', Horde_Themes::img(null, 'horde'));
-
- if ($returnType == 'object') {
- return $menu;
- } else {
- return $menu->render();
- }
- }
-
function validateAvatar($avatar_path)
{
if (!$GLOBALS['conf']['avatar']['allow_avatars'] || !$avatar_path) {
}
/**
+ * Add additional items to the menu.
+ *
+ * @param Horde_Menu $menu The menu object.
+ */
+ public function menu($menu)
+ {
+ $img_dir = Horde_Themes::img();
+ $scope = Horde_Util::getGet('scope', 'agora');
+
+ /* Agora Home. */
+ $url = Horde::url('forums.php')->add('scope', $scope);
+ $menu->add($url, _("_Forums"), 'forums.png', $img_dir, null, null,
+ dirname($_SERVER['PHP_SELF']) == $GLOBALS['registry']->get('webroot') && basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
+
+ /* Thread list, if applicable. */
+ if (isset($GLOBALS['forum_id'])) {
+ $menu->add(Agora::setAgoraId($GLOBALS['forum_id'], null, Horde::url('threads.php')), _("_Threads"), 'threads.png', Horde_Themes::img());
+ if ($scope == 'agora' && $GLOBALS['registry']->getAuth()) {
+ $menu->add(Agora::setAgoraId($GLOBALS['forum_id'], null, Horde::url('messages/edit.php')), _("New Thread"), 'newmessage.png', Horde_Themes::img());
+ }
+ }
+
+ if ($scope == 'agora' &&
+ Agora_Messages::hasPermission(Horde_Perms::DELETE, 0, $scope)) {
+ $menu->add(Horde::url('editforum.php'), _("_New Forum"), 'newforum.png', $img_dir, null, null, Horde_Util::getFormData('agora') ? '__noselection' : null);
+ }
+
+ if (Agora_Messages::hasPermission(Horde_Perms::DELETE, 0, $scope)) {
+ $url = Horde::url('moderate.php')->add('scope', $scope);
+ $menu->add($url, _("_Moderate"), 'moderate.png', $img_dir);
+ }
+
+ if ($GLOBALS['registry']->isAdmin()) {
+ $menu->add(Horde::url('moderators.php'), _("_Moderators"), 'hot.png', $img_dir);
+ }
+
+ $url = Horde::url('search.php')->add('scope', $scope);
+ $menu->add($url, _("_Search"), 'search.png', Horde_Themes::img(null, 'horde'));
+ }
+
+ /**
* Code to run on init when viewing prefs for this application.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
return '';
}
- /**
- * Generate the menu to use on the prefs page.
- *
- * @return Horde_Menu A Horde_Menu object.
- */
- public function prefsMenu()
- {
- return Agora::getMenu();
- }
-
}
/* Set up template data. */
$view = new Agora_View();
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer();
$form->renderActive(null, $vars, 'abuse.php', 'post');
$view->message_author = $message['message_author'];
$view->message_date = $messages->dateFormat($message['message_timestamp']);
$view->message_body = Agora_Messages::formatBody($message['body']);
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer();
$notification->notify(array('listeners' => 'status'));
}
$view->replying = $message_parent_id;
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer();
$notification->notify(array('listeners' => 'status'));
}
/* Set up the main template tags. */
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer();
$notification->notify(array('listeners' => 'status'));
/* Set up template data. */
$view = new Agora_View();
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer();
$form->renderActive(null, $vars, 'lock.php', 'post');
/* Template object. */
$view = new Agora_View();
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer();
$form->renderActive(null, $vars, 'merge.php', 'post');
/* Template object. */
$view = new Agora_View();
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer();
$form->renderActive(null, $vars, 'move.php', 'post');
/* Template object. */
$view = new Agora_View();
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer();
$form->renderActive(null, $vars, 'split.php', 'post');
return $view->render('moderate.html.php');
} else {
$title = _("Messages Awaiting Moderation");
- $view->menu = Agora::getMenu('string');
+ $view->menu = Horde::menu();
Horde::addScriptFile('stripe.js', 'horde', true);
require AGORA_TEMPLATES . '/common-header.inc';
echo $view->render('moderate.html.php');
/* Set up template data. */
$view = new Agora_View();
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer();
$form->renderActive(null, null, 'moderators.php', 'post');
require AGORA_TEMPLATES . '/common-header.inc';
-echo '<div id="menu">' . Agora::getMenu('string') . '</div>';
+echo Horde::menu();
$notification->notify(array('listeners' => 'status'));
echo '<h1>' . sprintf(_("Last posts in forums owned by %s"), $owner) . '</h1>';
$view->searchResults = $searchResults['results'];
}
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer();
$notification->notify(array('listeners' => 'status'));
-<div id="menu"><?php echo $this->menu; ?></div>
+<?php echo $this->menu; ?>
<?php echo $this->notify; ?>
<h1 class="header"><?php echo $this->_arrays['forum']['forum_name']; ?></h1>
-<div id="menu"><?php echo $this->menu; ?></div>
+<?php echo $this->menu; ?>
<?php echo $this->notify; ?>
<h1 class="header">
-<div id="menu"><?php echo $this->menu; ?></div>
+<?php echo $this->menu; ?>
<?php echo $this->notify; ?>
<?php echo $this->main; ?>
-<div id="menu"><?php echo $this->menu; ?></div>
+<?php echo $this->menu; ?>
<?php echo $this->notify; ?>
<?php echo $this->formbox; ?>
-<div id="menu"><?php echo $this->menu; ?></div>
+<?php echo $this->menu; ?>
<?php echo $this->notify; ?>
<?php echo $this->formbox; ?>
<link rel="alternate" title="<?php echo _("Messages") ?>" href="<?php echo $this->rss ?>" type="application/rss+xml" />
-<div id="menu"><?php echo $this->menu; ?></div>
+<?php echo $this->menu; ?>
<?php echo $this->notify; ?>
<div class="header">
<?php echo $this->pager_link; ?>
<br class="spacer" />
-<?php echo $this->form; ?>
\ No newline at end of file
+<?php echo $this->form; ?>
-<div id="menu"><?php echo $this->menu; ?></div>
+<?php echo $this->menu; ?>
<?php echo $this->notify; ?>
<div class="header">
<?php if (!empty($this->menu)): ?>
- <div id="menu"><?php echo $this->menu; ?></div>
+<?php echo $this->menu; ?>
<?php endif; ?>
<?php echo $this->notify; ?>
-<div id="menu"><?php echo $this->menu; ?></div>
+<?php echo $this->menu; ?>
<?php echo $this->notify; ?>
<h1 class="header"><?php echo _('Moderators'); ?></h1>
-<div id="menu"><?php echo $this->menu; ?></div>
+<?php echo $this->menu; ?>
<?php echo $this->notify; ?>
<?php if (!empty($this->searchResults)): ?>
<link rel="alternate" title="<?php echo _("Threads") ?>" href="<?php echo $this->rss ?>" type="application/rss+xml" />
-<div id="menu"><?php echo $this->menu; ?></div>
+<?php echo $this->menu; ?>
<?php echo $this->notify; ?>
<div class="header">
$view->forum_name = sprintf(_("Threads in %s"), $forum_array['forum_name']);
$view->forum_description = Agora_Messages::formatBody($forum_array['forum_description']);
$view->actions = $threads->getThreadActions();
-$view->menu = Agora::getMenu('string');
+$view->menu = Horde::menu();
Horde::startBuffer();
$notification->notify(array('listeners' => 'status'));
$title = _("Photo Galleries");
Ansel_Search_Tag::clearSearch();
require ANSEL_BASE . '/templates/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
echo '<div id="menuBottom"><a href="' . Horde::url('browse_edit.php') . '">' . _("Add Content") . '</a></div><div class="clear"> </div>';
echo $layout_html;
require $registry->get('templates', 'horde') . '/common-footer.inc';
$title = _("My Photos :: Add Content");
require ANSEL_TEMPLATES . '/common-header.inc';
-echo '<div id="menu">' . Ansel::getMenu()->render() . '</div>';
+echo Horde::menu();
$notification->notify(array('listeners' => 'status'));
require $registry->get('templates', 'horde') . '/portal/edit.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
}
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
$form->renderActive(null, null, null, 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
}
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
$form->renderActive(null, null, null, 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
Horde::addScriptFile('stripe.js', 'horde');
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
require ANSEL_TEMPLATES . '/faces/custom.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
$title = _("Face") . ' :: ' . $face['face_name'];
$facename = htmlspecialchars($face['face_name']);
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
require_once ANSEL_TEMPLATES . '/faces/face.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
Horde::addScriptFile('stripe.js', 'horde');
Horde::addScriptFile('popup.js', 'horde');
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
require ANSEL_TEMPLATES . '/faces/gallery.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
}
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
-
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
$form->renderActive(null, null, null, 'post');
-
require $registry->get('templates', 'horde') . '/common-footer.inc';
);
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
include ANSEL_TEMPLATES . '/faces/faces.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
$title = _("Upload face photo");
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
-
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
echo $tabs->render(Horde_Util::getGet('search_faces', 'image'));
$form->renderActive(null, null, null, 'post');
Horde::addScriptFile('stripe.js', 'horde');
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
require ANSEL_TEMPLATES . '/faces/define.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
);
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
require ANSEL_TEMPLATES . '/faces/search.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
$title = _("Search by name");
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
-
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
include ANSEL_TEMPLATES . '/faces/faces.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
);
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
include ANSEL_TEMPLATES . '/faces/faces.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
);
$pager->preserve('owner', $owner);
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
include ANSEL_TEMPLATES . '/faces/faces.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
try {
$gallery = $GLOBALS['injector']->getInstance('Ansel_Storage')->getScope()->getGallery($galleryId);
require ANSEL_TEMPLATES . '/common-header.inc';
- require ANSEL_TEMPLATES . '/menu.inc';
+ echo Horde::menu();
+ $notification->notify(array('listeners' => 'status'));
require ANSEL_TEMPLATES . '/gallery/delete_confirmation.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
exit;
'slug' => $gallery_slug
));
Horde::addScriptFile('popup.js', 'horde');
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
require ANSEL_TEMPLATES . '/gallery/gallery.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
$title = _("Caption Editor");
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
require ANSEL_TEMPLATES . '/captions/captions.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
$title = sprintf(_("%s :: Sort"), $gallery->get('name'));
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
?>
<h1 class="header"><?php echo htmlspecialchars($title, ENT_COMPAT, $GLOBALS['registry']->getCharset()) ?></h1>
<div class="instructions">
}
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
require ANSEL_TEMPLATES . '/group/header.inc';
foreach ($groups as $group) {
require ANSEL_TEMPLATES . '/group/' . $groupby . '.inc';
}
require ANSEL_TEMPLATES . '/common-header.inc';
- require ANSEL_TEMPLATES . '/menu.inc';
+ echo Horde::menu();
+ $notification->notify(array('listeners' => 'status'));
if ($actionID == 'cropedit') {
require ANSEL_TEMPLATES . '/image/crop_image.inc';
$breadcrumbs = Ansel::getBreadCrumbs($gallery);
$title = _("Add Photo");
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
require ANSEL_TEMPLATES . '/image/upload.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
}
/**
- * Build Ansel's list of menu items.
- *
- * @return Horde_Menu
- */
- static public function getMenu()
- {
- global $conf, $registry;
-
- $menu = new Horde_Menu();
-
- /* Browse/Search */
- $menu->add(Horde::url('browse.php'), _("_Browse"),
- 'browse.png', null, null, null,
- (($GLOBALS['prefs']->getValue('defaultview') == 'browse' &&
- basename($_SERVER['PHP_SELF']) == 'index.php') ||
- (basename($_SERVER['PHP_SELF']) == 'browse.php'))
- ? 'current'
- : '__noselection');
-
- $menu->add(Ansel::getUrlFor('view', array('view' => 'List')), _("_Galleries"),
- 'galleries.png', null, null, null,
- (($GLOBALS['prefs']->getValue('defaultview') == 'galleries' &&
- basename($_SERVER['PHP_SELF']) == 'index.php') ||
- ((basename($_SERVER['PHP_SELF']) == 'group.php') &&
- Horde_Util::getFormData('owner') !== $GLOBALS['registry']->getAuth())
- ? 'current'
- : '__noselection'));
- if ($GLOBALS['registry']->getAuth()) {
- $url = Ansel::getUrlFor('view', array('owner' => $GLOBALS['registry']->getAuth(),
- 'groupby' => 'owner',
- 'view' => 'List'));
- $menu->add($url, _("_My Galleries"), 'mygalleries.png', null, null,
- null,
- (Horde_Util::getFormData('owner', false) == $GLOBALS['registry']->getAuth())
- ? 'current' :
- '__noselection');
- }
-
- /* Let authenticated users create new galleries. */
- if ($GLOBALS['registry']->isAdmin() ||
- (!$GLOBALS['injector']->getInstance('Horde_Perms')->exists('ansel') && $GLOBALS['registry']->getAuth()) ||
- $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('ansel', $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
- $menu->add(Horde::url('gallery.php')->add('actionID', 'add'),
- _("_New Gallery"), 'add.png', null, null, null,
- (basename($_SERVER['PHP_SELF']) == 'gallery.php' &&
- Horde_Util::getFormData('actionID') == 'add')
- ? 'current'
- : '__noselection');
- }
-
- if ($conf['faces']['driver'] && $registry->isAuthenticated()) {
- $menu->add(Horde::url('faces/search/all.php'), _("_Faces"), 'user.png', Horde_Themes::img(null, 'horde'));
- }
-
- /* Print. */
- if ($conf['menu']['print'] && ($pl = Horde_Util::nonInputVar('print_link'))) {
- $menu->add($pl, _("_Print"), 'print.png',
- Horde_Themes::img(null, 'horde'), '_blank',
- Horde::popupJs($pl, array('urlencode' => true)) . 'return false;');
- }
-
- return $menu;
- }
-
- /**
* Generate a list of breadcrumbs showing where we are in the gallery
* tree.
*
}
/**
+ * Add additional items to the menu.
+ *
+ * @param Horde_Menu $menu The menu object.
+ */
+ public function menu($menu)
+ {
+ global $conf, $registry;
+
+ /* Browse/Search */
+ $menu->add(Horde::url('browse.php'), _("_Browse"),
+ 'browse.png', null, null, null,
+ (($GLOBALS['prefs']->getValue('defaultview') == 'browse' &&
+ basename($_SERVER['PHP_SELF']) == 'index.php') ||
+ (basename($_SERVER['PHP_SELF']) == 'browse.php'))
+ ? 'current'
+ : '__noselection');
+
+ $menu->add(Ansel::getUrlFor('view', array('view' => 'List')), _("_Galleries"),
+ 'galleries.png', null, null, null,
+ (($GLOBALS['prefs']->getValue('defaultview') == 'galleries' &&
+ basename($_SERVER['PHP_SELF']) == 'index.php') ||
+ ((basename($_SERVER['PHP_SELF']) == 'group.php') &&
+ Horde_Util::getFormData('owner') !== $GLOBALS['registry']->getAuth())
+ ? 'current'
+ : '__noselection'));
+
+ if ($GLOBALS['registry']->getAuth()) {
+ $url = Ansel::getUrlFor('view', array('owner' => $GLOBALS['registry']->getAuth(),
+ 'groupby' => 'owner',
+ 'view' => 'List'));
+ $menu->add($url, _("_My Galleries"), 'mygalleries.png', null, null,
+ null,
+ (Horde_Util::getFormData('owner', false) == $GLOBALS['registry']->getAuth())
+ ? 'current' :
+ '__noselection');
+ }
+
+ /* Let authenticated users create new galleries. */
+ if ($GLOBALS['registry']->isAdmin() ||
+ (!$GLOBALS['injector']->getInstance('Horde_Perms')->exists('ansel') && $GLOBALS['registry']->getAuth()) ||
+ $GLOBALS['injector']->getInstance('Horde_Perms')->hasPermission('ansel', $GLOBALS['registry']->getAuth(), Horde_Perms::EDIT)) {
+ $menu->add(Horde::url('gallery.php')->add('actionID', 'add'),
+ _("_New Gallery"), 'add.png', null, null, null,
+ (basename($_SERVER['PHP_SELF']) == 'gallery.php' &&
+ Horde_Util::getFormData('actionID') == 'add')
+ ? 'current'
+ : '__noselection');
+ }
+
+ if ($conf['faces']['driver'] && $registry->isAuthenticated()) {
+ $menu->add(Horde::url('faces/search/all.php'), _("_Faces"), 'user.png', Horde_Themes::img(null, 'horde'));
+ }
+
+ /* Print. */
+ if ($conf['menu']['print'] &&
+ ($pl = Horde_Util::nonInputVar('print_link'))) {
+ $menu->add($pl, _("_Print"), 'print.png',
+ Horde_Themes::img(null, 'horde'), '_blank',
+ Horde::popupJs($pl, array('urlencode' => true)) . 'return false;');
+ }
+ }
+
+ /**
* Populate dynamically-generated preference values.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
return false;
}
- /**
- * Generate the menu to use on the prefs page.
- *
- * @return Horde_Menu A Horde_Menu object.
- */
- public function prefsMenu()
- {
- return Ansel::getMenu();
- }
-
}
}
}
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
echo '<div class="header">' . Ansel::getBreadCrumbs() . '</div>';
$form->renderActive(null, null, null, 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
}
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
$form->renderActive(null, null, null, 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<div id="menu">
- <?php echo Ansel::getMenu()->render() ?>
-</div>
-<?php require HORDE_BASE . '/services/sidebar.php'; ?>
-
-<?php
-$GLOBALS['notification']->notify(array('listeners' => 'status'));
$view = new $view($params);
} catch (Horde_Exception $e) {
require ANSEL_TEMPLATES . '/common-header.inc';
- require ANSEL_TEMPLATES . '/menu.inc';
+ echo Horde::menu();
+ $notification->notify(array('listeners' => 'status'));
echo '<br /><em>' . htmlspecialchars($e->getMessage()) . '</em>';
require $registry->get('templates', 'horde') . '/common-footer.inc';
exit;
$title = $view->getTitle();
require ANSEL_TEMPLATES . '/common-header.inc';
-require ANSEL_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
$view_html = $view->html();
echo $view_html;
require $registry->get('templates', 'horde') . '/common-footer.inc';
}
/**
- * Generate the menu to use on the prefs page.
+ * Add additional items to the menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @param Horde_Menu $menu The menu object.
*/
- public function prefsMenu()
+ public function menu($menu)
{
return Beatnik::getMenu();
}
+
}
}
/**
- * Generate the menu to use on the prefs page.
+ * Add additional items to the menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @param Horde_Menu $menu The menu object.
*/
- public function prefsMenu()
+ public function menu($menu)
{
- return Chora::getMenu();
+ $menu->add(Chora::url('browsedir'), _("_Browse"), 'chora.png');
}
/* Sidebar method. */
}
/**
- * Build Chora's list of menu items.
- *
- * @return string The menu HTML code.
- */
- static public function getMenu()
- {
- $menu = new Horde_Menu();
- $menu->add(self::url('browsedir'), _("_Browse"), 'chora.png');
- return $menu;
- }
-
- /**
* Generate the link used for various file-based views.
*
* @param string $where The current file path.
<div class="rightFloat">
<?php echo Chora::repositories() ?>
</div>
- <?php echo Chora::getMenu()->render() ?>
+ <?php echo Horde::menu(array('menu_ob' => true))->render() ?>
</div>
<?php require HORDE_BASE . '/services/sidebar.php'; ?>
<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
public $version = 'H4 (0.1-git)';
/**
- * Generate the menu to use on the prefs page.
+ * Add additional items to the menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @param Horde_Menu $menu The menu object.
*/
- public function prefsMenu()
+ public function menu($menu)
{
return Crumb::getMenu();
}
public $version = '1.0.1';
/**
+ * Add additional items to the menu.
+ *
+ * @param Horde_Menu $menu The menu object.
+ */
+ public function menu($menu)
+ {
+ return Fima::getMenu();
+ }
+
+ /**
* Populate dynamically-generated preference values.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
}
}
- /**
- * Generate the menu to use on the prefs page.
- *
- * @return Horde_Menu A Horde_Menu object.
- */
- public function prefsMenu()
- {
- return Fima::getMenu();
- }
-
}
public $version = 'H4 (0.1-git)';
/**
- * Generate the menu to use on the prefs page.
+ * Add additional items to the menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @param Horde_Menu $menu The menu object.
*/
- public function prefsMenu()
+ public function menu($menu)
{
return Folks::getMenu();
}
(!$browser->hasFeature('issafari') || $browser->getMajor() >= 2);
}
+ /**
+ * Generates the menu output.
+ *
+ * @param array $opts Additional options:
+ * <pre>
+ * 'app' - (string) The application to generate the menu for.
+ * DEFAULT: current application
+ * 'mask' - (integer) The Horde_Menu mask to use.
+ * DEFAULT: Horde_Menu::MASK_ALL
+ * 'menu_ob' - (boolean) If true, returns the menu object
+ * DEFAULT: false (renders menu)
+ * </pre>
+ * @param string $app The application to generate the menu for. Defaults
+ * to the current app.
+ *
+ * @return string|Horde_Menu The menu output, or the menu object if
+ * 'menu_ob' is true.
+ */
+ static public function menu(array $opts = array())
+ {
+ global $injector, $registry;
+
+ if (empty($opts['app'])) {
+ $opts['app'] = $registry->getApp();
+ }
+ if (!isset($opts['mask'])) {
+ $opts['mask'] = Horde_Menu::MASK_ALL;
+ }
+
+ $menu = new Horde_Menu(isset($opts['mask']) ? $opts['mask'] : Horde_Menu::MASK_ALL);
+
+ if (!in_array($registry->get('status', 'horde'), array('notoolbar', 'hidden', 'inactive'))) {
+ $menu->add(Horde::url('services/portal/', false, array('app' => 'horde')), _("_Home"), 'horde.png');
+ }
+
+ $registry->callAppMethod($opts['app'], 'menu', array(
+ 'args' => array($menu)
+ ));
+
+ if (!empty($opts['menu_ob'])) {
+ return $menu;
+ }
+
+ self::startBuffer();
+ require $registry->get('templates', 'horde') . '/menu/menu.inc';
+ return self::endBuffer();
+ }
+
}
/* Get the menu output before we start to output the page.
* Again, this will catch any javascript inserted into the page. */
- if ($this->vars->ajaxui) {
- $menu_out = '';
- } else {
- if ($registry->hasAppMethod($this->app, 'prefsMenu')) {
- $menu = $registry->callAppMethod($this->app, 'prefsMenu', array('args' => array($this)));
- }
-
- /* Buffer this, as it may add javascript/stylesheets/meta tags to
- * the document HEAD. */
- Horde::startBuffer();
- require $h_templates . '/menu/menu.inc';
- $menu_out = Horde::endBuffer();
- }
+ $menu_out = $this->vars->ajaxui
+ ? ''
+ : Horde::menu(array(
+ 'app' => $this->app,
+ 'mask' => Horde_Menu::MASK_HELP | Horde_Menu::MASK_LOGIN | Horde_Menu::MASK_PROBLEM
+ ));
/* Get list of accessible applications. */
$apps = array();
{
}
+ /**
+ * Add additional items to the menu.
+ *
+ * @param Horde_Menu $menu The menu object.
+ */
+ public function menu($menu)
+ {
+ }
+
// Functions called from Horde's API.
// public function prefsCallback($ui) {}
/**
- * Generate the menu to use on the prefs page.
- *
- * @param Horde_Core_Prefs_Ui $ui The UI object.
- *
- * @return Horde_Menu The Horde_Menu object to display.
- */
- // public function prefsMenu($ui) {}
-
- /**
* Generate code used to display a special preference.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
$title = _("Clipboard");
Horde::addScriptFile('tables.js', 'horde');
-Gollem::prepareMenu();
+$menu = Gollem::menu();
require GOLLEM_TEMPLATES . '/common-header.inc';
-Gollem::menu();
+echo $menu;
Gollem::status();
echo $template->fetch(GOLLEM_TEMPLATES . '/clipboard/clipboard.html');
require $registry->get('templates', 'horde') . '/common-footer.inc';
}
/**
- * Generate the menu to use on the prefs page.
+ * Add additional items to the menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @param Horde_Menu $menu The menu object.
*/
- public function prefsMenu()
+ public function menu($menu)
{
- return Gollem::getMenu();
+ $menu->add(Horde::url('manager.php')->add('dir', Gollem::getHome()), _("_My Home"), 'folder_home.png');
+
+ if (!empty($_SESSION['gollem'])) {
+ $backend_key = $_SESSION['gollem']['backend_key'];
+ if ($GLOBALS['registry']->isAdmin()) {
+ $menu->add(Horde::url('permissions.php')->add('backend', $backend_key), _("_Permissions"), 'perms.png');
+ }
+
+ if ($_SESSION['gollem']['backends'][$backend_key]['quota_val'] != -1) {
+ if ($GLOBALS['browser']->hasFeature('javascript')) {
+ $quota_url = 'javascript:' . Horde::popupJs(Horde::url('quota.php'), array('params' => array('backend' => $backend_key), 'height' => 300, 'width' => 300, 'urlencode' => true));
+ } else {
+ $quota_url = Horde::url('quota.php')->add('backend', $backend_key);
+ }
+ $menu->add($quota_url, _("Check Quota"), 'info_icon.png');
+ }
+ }
}
/* Sidebar method. */
const SORT_DESCEND = 1;
/**
- * prepareMenu() cache.
- *
- * @var array
- */
- static private $_menu = null;
-
- /**
* Changes the current directory of the Gollem session to the supplied
* value.
*
}
/**
- * Build Gollem's list of menu items.
+ * Build Gollem's menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @return string Menu.
*/
- static public function getMenu()
- {
- $menu = new Horde_Menu();
-
- $menu->add(Horde::url('manager.php')->add('dir', Gollem::getHome()), _("_My Home"), 'folder_home.png');
-
- if (!empty($_SESSION['gollem'])) {
- $backend_key = $_SESSION['gollem']['backend_key'];
- if ($GLOBALS['registry']->isAdmin()) {
- $menu->add(Horde::url('permissions.php')->add('backend', $backend_key), _("_Permissions"), 'perms.png');
- }
-
- if ($_SESSION['gollem']['backends'][$backend_key]['quota_val'] != -1) {
- if ($GLOBALS['browser']->hasFeature('javascript')) {
- $quota_url = 'javascript:' . Horde::popupJs(Horde::url('quota.php'), array('params' => array('backend' => $backend_key), 'height' => 300, 'width' => 300, 'urlencode' => true));
- } else {
- $quota_url = Horde::url('quota.php')->add('backend', $backend_key);
- }
- $menu->add($quota_url, _("Check Quota"), 'info_icon.png');
- }
- }
-
- return $menu;
- }
-
- /**
- * Build Gollem's list of menu items.
- */
- static public function prepareMenu()
+ static public function menu()
{
- if (isset(self::$_menu)) {
- return;
- }
-
$t = $GLOBALS['injector']->createInstance('Horde_Template');
$t->set('forminput', Horde_Util::formInput());
$link = Horde::link('#', _("Change Server"), '', '', 'serverSubmit(true);return false;');
$t->set('slink', sprintf('<ul><li>%s%s<br />%s</a></li></ul>', $link, ($menu_view != 'text') ? Horde::img('gollem.png') : '', ($menu_view != 'icon') ? Horde::highlightAccessKey(_("_Change Server"), $t->get('accesskey')) : ''));
}
- $t->set('menu_string', self::getMenu()->render());
+ $t->set('menu_string', Horde::menu(array('menu_ob' => true))->render());
- self::$_menu = $t->fetch(GOLLEM_TEMPLATES . '/menu/menu.html');
+ $menu = $t->fetch(GOLLEM_TEMPLATES . '/menu/menu.html');
/* Need to buffer sidebar output here, because it may add things like
* cookies which need to be sent before output begins. */
Horde::startBuffer();
require HORDE_BASE . '/services/sidebar.php';
- self::$_menu .= Horde::endBuffer();
- }
-
- /**
- * Outputs Gollem's menu to the current output stream.
- */
- static public function menu()
- {
- self::prepareMenu();
- echo self::$_menu;
+ return $menu .= Horde::endBuffer();
}
/**
'-warn_recursive' => intval($prefs->getValue('recursive_deletes') == 'warn')
));
-Gollem::prepareMenu();
+$menu = Gollem::menu();
require GOLLEM_TEMPLATES . '/common-header.inc';
-Gollem::menu();
+echo $menu;
Gollem::status();
echo $template->fetch(GOLLEM_TEMPLATES . '/manager/manager.html');
require $registry->get('templates', 'horde') . '/common-footer.inc';
$notification->push(_("You need at least one backend defined to set permissions."), 'horde.error');
$title = _("Gollem Backend Permissions Administration");
- Gollem::prepareMenu();
+ $menu = Gollem::menu();
require GOLLEM_TEMPLATES . '/common-header.inc';
- Gollem::menu();
+ echo $menu;
Gollem::status();
require $registry->get('templates', 'horde') . '/common-footer.inc';
exit;
$title = _("My Portal Layout");
require HORDE_TEMPLATES . '/common-header.inc';
-require HORDE_TEMPLATES . '/menu/menu.inc';
+echo Horde::menu();
$notification->notify(array('listeners' => 'status'));
require HORDE_TEMPLATES . '/portal/edit.inc';
require HORDE_TEMPLATES . '/common-footer.inc';
Horde::addScriptFile('prototype.js', 'horde');
$title = _("My Portal");
require HORDE_TEMPLATES . '/common-header.inc';
-require HORDE_TEMPLATES . '/menu/menu.inc';
+echo Horde::menu();
echo '<div id="menuBottom">';
echo htmlspecialchars($injector->getInstance('Horde_Prefs_Identity')->getIdentity()->getName());
if (!$prefs->isLocked('portal_layout')) {
$title = _("Problem Description");
require HORDE_TEMPLATES . '/common-header.inc';
-require HORDE_TEMPLATES . '/menu/menu.inc';
+echo Horde::menu();
$notification->notify(array('listeners' => 'status'));
require HORDE_TEMPLATES . '/problem/problem.inc';
require HORDE_TEMPLATES . '/common-footer.inc';
-<?php
- if (!(isset($menu) && ($menu instanceof Horde_Menu))) {
- $menu = new Horde_Menu();
- if (($GLOBALS['registry']->getApp() == 'horde') &&
- !in_array($GLOBALS['registry']->get('status', 'horde'), array('notoolbar', 'hidden', 'inactive'))) {
- $menu->add(Horde::url('services/portal/'), _("_Home"), 'horde.png', Horde_Themes::img(null, 'horde'));
- }
- }
-?>
<div id="menu">
<div class="leftFloat"><?php echo $menu->render(); ?></div>
</div>
}
if ($showmenu) {
- IMP::prepareMenu();
+ $menu = IMP::menu();
}
Horde::addScriptFile('compose-base.js', 'imp');
Horde::addScriptFile('compose.js', 'imp');
require IMP_TEMPLATES . '/common-header.inc';
Horde::addInlineScript($js_code);
if ($showmenu) {
- IMP::menu();
+ echo $menu;
}
echo $template_output;
require $registry->get('templates', 'horde') . '/common-footer.inc';
}
$title = _("Folder Actions - Confirmation");
- IMP::prepareMenu();
+ $menu = IMP::menu();
require IMP_TEMPLATES . '/common-header.inc';
- IMP::menu();
+ echo $menu;
$template = $injector->createInstance('Horde_Template');
$template->setOption('gettext', true);
Horde::addScriptFile('tables.js', 'horde');
$title = _("Folder Sizes");
- IMP::prepareMenu();
+ $menu = IMP::menu();
require IMP_TEMPLATES . '/common-header.inc';
- IMP::menu();
+ echo $menu;
IMP::status();
IMP::quota();
if ($_SESSION['imp']['file_upload'] && ($vars->actionID == 'import_mbox')) {
$title = _("Folder Navigator");
- IMP::prepareMenu();
+ $menu = IMP::menu();
require IMP_TEMPLATES . '/common-header.inc';
- IMP::menu();
+ echo $menu;
IMP::status();
IMP::quota();
));
$title = _("Folder Navigator");
-IMP::prepareMenu();
+$menu = IMP::menu();
Horde::metaRefresh($refresh_time, Horde::url('folders.php', true));
require IMP_TEMPLATES . '/common-header.inc';
-IMP::menu();
+echo $menu;
IMP::status();
IMP::quota();
: $allowed;
}
+ /* Menu methods. */
+
+ /**
+ * Add additional items to the menu.
+ *
+ * @param Horde_Menu $menu The menu object.
+ */
+ public function menu($menu)
+ {
+ global $conf, $prefs, $registry;
+
+ $menu_search_url = Horde::url('search.php');
+ $menu_mailbox_url = Horde::url('mailbox.php');
+
+ $spam_folder = IMP::folderPref($prefs->getValue('spam_folder'), true);
+
+ $menu->add(IMP::generateIMPUrl($menu_mailbox_url, 'INBOX'), _("_Inbox"), 'folders/inbox.png');
+
+ if ($_SESSION['imp']['protocol'] != 'pop') {
+ if ($prefs->getValue('use_trash') &&
+ $prefs->getValue('empty_trash_menu')) {
+ $mailbox = null;
+ if ($prefs->getValue('use_vtrash')) {
+ $mailbox = $GLOBALS['injector']->getInstance('IMP_Search')->createSearchID($prefs->getValue('vtrash_id'));
+ } else {
+ $trash_folder = IMP::folderPref($prefs->getValue('trash_folder'), true);
+ if (!is_null($trash_folder)) {
+ $mailbox = $trash_folder;
+ }
+ }
+
+ if (!empty($mailbox) &&
+ !$GLOBALS['injector']->getInstance('IMP_Imap')->getOb()->isReadOnly($mailbox)) {
+ $menu_trash_url = IMP::generateIMPUrl($menu_mailbox_url, $mailbox)->add(array('actionID' => 'empty_mailbox', 'mailbox_token' => Horde::getRequestToken('imp.mailbox')));
+ $menu->add($menu_trash_url, _("Empty _Trash"), 'empty_trash.png', null, null, 'return window.confirm(' . Horde_Serialize::serialize(_("Are you sure you wish to empty your trash folder?"), Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()) . ')', '__noselection');
+ }
+ }
+
+ if (!empty($spam_folder) &&
+ $prefs->getValue('empty_spam_menu')) {
+ $menu_spam_url = IMP::generateIMPUrl($menu_mailbox_url, $spam_folder)->add(array('actionID' => 'empty_mailbox', 'mailbox_token' => Horde::getRequestToken('imp.mailbox')));
+ $menu->add($menu_spam_url, _("Empty _Spam"), 'empty_spam.png', null, null, 'return window.confirm(' . Horde_Serialize::serialize(_("Are you sure you wish to empty your trash folder?"), Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()) . ')', '__noselection');
+ }
+ }
+
+ if (IMP::canCompose()) {
+ $menu->add(IMP::composeLink(array('mailbox' => IMP::$mailbox)), _("_New Message"), 'compose.png');
+ }
+
+ if ($conf['user']['allow_folders']) {
+ $menu->add(Horde::url('folders.php')->unique(), _("_Folders"), 'folders/folder.png');
+ }
+
+ if ($_SESSION['imp']['protocol'] != 'pop') {
+ $menu->add($menu_search_url, _("_Search"), 'search.png');
+ }
+
+ if ($prefs->getValue('filter_menuitem')) {
+ $menu->add(Horde::url('filterprefs.php'), _("Fi_lters"), 'filters.png');
+ }
+ }
+
/* Horde_Core_Auth_Application methods. */
/**
$GLOBALS['injector']->getInstance('IMP_Prefs_Ui')->prefsCallback($ui);
}
- /**
- * Generate the menu to use on the prefs page.
- *
- * @param Horde_Core_Prefs_Ui $ui The UI object.
- *
- * @return Horde_Menu A Horde_Menu object.
- */
- public function prefsMenu($ui)
- {
- return $GLOBALS['injector']->getInstance('IMP_Prefs_Ui')->prefsMenu($ui);
- }
-
/* Sidebar method. */
/**
static private $_delhide = null;
/**
- * prepareMenu() cache.
- *
- * @var string
- */
- static private $_menu = null;
-
- /**
* Returns the current view mode for IMP.
*
* @return string Either 'dimp', 'imp', or 'mimp'.
}
/**
- * Build IMP's list of menu items.
+ * Build IMP's menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @return string The menu output.
*/
- static public function getMenu()
- {
- global $conf, $prefs, $registry;
-
- $menu_search_url = Horde::url('search.php');
- $menu_mailbox_url = Horde::url('mailbox.php');
-
- $spam_folder = self::folderPref($prefs->getValue('spam_folder'), true);
-
- $menu = new Horde_Menu();
-
- $menu->add(self::generateIMPUrl($menu_mailbox_url, 'INBOX'), _("_Inbox"), 'folders/inbox.png');
-
- if ($_SESSION['imp']['protocol'] != 'pop') {
- if ($prefs->getValue('use_trash') &&
- $prefs->getValue('empty_trash_menu')) {
- $mailbox = null;
- if ($prefs->getValue('use_vtrash')) {
- $mailbox = $GLOBALS['injector']->getInstance('IMP_Search')->createSearchID($prefs->getValue('vtrash_id'));
- } else {
- $trash_folder = self::folderPref($prefs->getValue('trash_folder'), true);
- if (!is_null($trash_folder)) {
- $mailbox = $trash_folder;
- }
- }
-
- if (!empty($mailbox) &&
- !$GLOBALS['injector']->getInstance('IMP_Imap')->getOb()->isReadOnly($mailbox)) {
- $menu_trash_url = self::generateIMPUrl($menu_mailbox_url, $mailbox)->add(array('actionID' => 'empty_mailbox', 'mailbox_token' => Horde::getRequestToken('imp.mailbox')));
- $menu->add($menu_trash_url, _("Empty _Trash"), 'empty_trash.png', null, null, 'return window.confirm(' . Horde_Serialize::serialize(_("Are you sure you wish to empty your trash folder?"), Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()) . ')', '__noselection');
- }
- }
-
- if (!empty($spam_folder) &&
- $prefs->getValue('empty_spam_menu')) {
- $menu_spam_url = self::generateIMPUrl($menu_mailbox_url, $spam_folder)->add(array('actionID' => 'empty_mailbox', 'mailbox_token' => Horde::getRequestToken('imp.mailbox')));
- $menu->add($menu_spam_url, _("Empty _Spam"), 'empty_spam.png', null, null, 'return window.confirm(' . Horde_Serialize::serialize(_("Are you sure you wish to empty your trash folder?"), Horde_Serialize::JSON, $GLOBALS['registry']->getCharset()) . ')', '__noselection');
- }
- }
-
- if (self::canCompose()) {
- $menu->add(self::composeLink(array('mailbox' => self::$mailbox)), _("_New Message"), 'compose.png');
- }
-
- if ($conf['user']['allow_folders']) {
- $menu->add(Horde::url('folders.php')->unique(), _("_Folders"), 'folders/folder.png');
- }
-
- if ($_SESSION['imp']['protocol'] != 'pop') {
- $menu->add($menu_search_url, _("_Search"), 'search.png');
- }
-
- if ($prefs->getValue('filter_menuitem')) {
- $menu->add(Horde::url('filterprefs.php'), _("Fi_lters"), 'filters.png');
- }
-
- return $menu;
- }
-
- /**
- * Build IMP's list of menu items.
- */
- static public function prepareMenu()
+ static public function menu()
{
- if (isset(self::$_menu)) {
- return;
- }
-
$t = $GLOBALS['injector']->createInstance('Horde_Template');
$t->set('forminput', Horde_Util::formInput());
$t->set('use_folders', ($_SESSION['imp']['protocol'] != 'pop') && $GLOBALS['conf']['user']['allow_folders'], true);
$t->set('flist', self::flistSelect(array('selected' => self::$mailbox, 'inc_vfolder' => true)));
$t->set('flink', sprintf('%s%s<br />%s</a>', Horde::link('#'), ($menu_view != 'text') ? Horde::img('folders/open.png', _("Open Folder"), ($menu_view == 'icon') ? array('title' => _("Open Folder")) : array()) : '', ($menu_view != 'icon') ? Horde::highlightAccessKey(_("Open Fo_lder"), $ak) : ''));
}
- $t->set('menu_string', self::getMenu()->render());
+ $t->set('menu_string', Horde::menu(array('app' => 'imp', 'menu_ob' => true))->render());
- self::$_menu = $t->fetch(IMP_TEMPLATES . '/imp/menu/menu.html');
+ $menu = $t->fetch(IMP_TEMPLATES . '/imp/menu/menu.html');
/* Need to buffer sidebar output here, because it may add things like
* cookies which need to be sent before output begins. */
Horde::startBuffer();
require HORDE_BASE . '/services/sidebar.php';
- self::$_menu .= Horde::endBuffer();
- }
-
- /**
- * Outputs IMP's menu to the current output stream.
- */
- static public function menu()
- {
- self::prepareMenu();
- echo self::$_menu;
+ return $menu . Horde::endBuffer();
}
/**
}
}
- /**
- * Generate the menu to use on the prefs page.
- *
- * @param Horde_Core_Prefs_Ui $ui The UI object.
- *
- * @return Horde_Menu A Horde_Menu object.
- */
- public function prefsMenu($ui)
- {
- return IMP::getMenu();
- }
-
/* Accounts management handling. */
/**
}
}
-IMP::prepareMenu();
+$menu = IMP::menu();
Horde::metaRefresh($prefs->getValue('refresh_time'), $refresh_url);
require IMP_TEMPLATES . '/common-header.inc';
-IMP::menu();
+echo $menu;
IMP::status();
IMP::quota();
Horde::addScriptFile('redbox.js', 'horde');
}
-IMP::prepareMenu();
+$menu = IMP::menu();
Horde::noDnsPrefetch();
require IMP_TEMPLATES . '/common-header.inc';
if (!empty($conf['maillog']['use_maillog'])) {
IMP_Maillog::displayLog($envelope['message-id']);
}
-IMP::menu();
+echo $menu;
IMP::status();
IMP::quota();
$t->set('f_fields', $f_fields);
$title = _("Search");
-IMP::prepareMenu();
+$menu = IMP::menu();
require IMP_TEMPLATES . '/common-header.inc';
-IMP::menu();
+echo $menu;
IMP::status();
if ($browser->hasFeature('javascript')) {
if ($dimp_view) {
$t->set('return_mailbox_val', sprintf(_("Return to %s"), htmlspecialchars($search_mailbox)));
} else {
- IMP::prepareMenu();
+ $menu = IMP::menu();
}
require IMP_TEMPLATES . '/common-header.inc';
if (!$dimp_view) {
- IMP::menu();
+ echo $menu;
}
IMP::status();
$title = ($mode == 'thread') ? _("Thread View") : _("Multiple Message View");
Horde::addScriptFile('stripe.js', 'horde');
Horde::noDnsPrefetch();
-IMP::prepareMenu();
+$menu = IMP::menu();
require IMP_TEMPLATES . '/common-header.inc';
-IMP::menu();
+echo $menu;
IMP::status();
echo $template->fetch(IMP_TEMPLATES . '/imp/thread/thread.html');
require $registry->get('templates', 'horde') . '/common-footer.inc';
$filters = $ingo_storage->retrieve(Ingo_Storage::ACTION_FILTERS);
$bl_rule = $filters->findRule(Ingo_Storage::ACTION_BLACKLIST);
-Ingo::prepareMenu();
+$menu = Ingo::menu();
Ingo::addNewFolderJs();
$title = _("Blacklist Edit");
require INGO_TEMPLATES . '/common-header.inc';
-Ingo::menu();
+echo $menu;
Ingo::status();
require INGO_TEMPLATES . '/blacklist/blacklist.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
Horde::addScriptFile('stripe.js', 'horde');
Horde::addScriptFile('filters.js', 'ingo');
-Ingo::prepareMenu();
+$menu = Ingo::menu();
$title = _("Filter Rules");
require INGO_TEMPLATES . '/common-header.inc';
-Ingo::menu();
+echo $menu;
Ingo::status();
require INGO_TEMPLATES . '/filters/header.inc';
$form->setTitle($form_title);
$title = _("Forwards Edit");
-Ingo::prepareMenu();
+$menu = Ingo::menu();
require INGO_TEMPLATES . '/common-header.inc';
-Ingo::menu();
+echo $menu;
Ingo::status();
$form->renderActive(new Horde_Form_Renderer(array('encode_title' => false)), $vars, 'forward.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
}
/**
+ * Add additional items to the menu.
+ *
+ * @param Horde_Menu $menu The menu object.
+ */
+ public function menu($menu)
+ {
+ try {
+ $menu->add(Horde::url('filters.php'), _("Filter _Rules"), 'ingo.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
+ $menu->add(Horde::url($GLOBALS['injector']->getInstance('Horde_Registry')->link('mail/showWhitelist')), _("_Whitelist"), 'whitelist.png');
+ $menu->add(Horde::url($GLOBALS['injector']->getInstance('Horde_Registry')->link('mail/showBlacklist')), _("_Blacklist"), 'blacklist.png');
+ } catch (Horde_Exception $e) {
+ Horde::logMessage($e->getMessage(), 'ERR');
+ }
+
+ if (in_array(Ingo_Storage::ACTION_VACATION, $_SESSION['ingo']['script_categories'])) {
+ $menu->add(Horde::url('vacation.php'), _("_Vacation"), 'vacation.png');
+ }
+
+ if (in_array(Ingo_Storage::ACTION_FORWARD, $_SESSION['ingo']['script_categories'])) {
+ $menu->add(Horde::url('forward.php'), _("_Forward"), 'forward.png');
+ }
+
+ if (in_array(Ingo_Storage::ACTION_SPAM, $_SESSION['ingo']['script_categories'])) {
+ $menu->add(Horde::url('spam.php'), _("S_pam"), 'spam.png');
+ }
+
+ if ($_SESSION['ingo']['script_generate'] &&
+ (!$GLOBALS['prefs']->isLocked('auto_update') ||
+ !$GLOBALS['prefs']->getValue('auto_update'))) {
+ $menu->add(Horde::url('script.php'), _("_Script"), 'script.png');
+ }
+
+ if (!empty($GLOBALS['ingo_shares']) && empty($GLOBALS['conf']['share']['no_sharing'])) {
+ $menu->add('#', _("_Permissions"), 'perms.png', Horde_Themes::img(null, 'horde'), '', Horde::popupJs(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/shares/edit.php', true), array('params' => array('app' => 'ingo', 'share' => $_SESSION['ingo']['backend']['id'] . ':' . $GLOBALS['registry']->getAuth()), 'urlencode' => true)) . 'return false;');
+ }
+ }
+
+ /**
* Returns the specified permission for the given app permission.
*
* @param string $permission The permission to check.
}
/**
- * Generate the menu to use on the prefs page.
- *
- * @return Horde_Menu A Horde_Menu object.
- */
- public function prefsMenu()
- {
- return Ingo::getMenu();
- }
-
- /**
* Removes user data.
*
* @param string $user Name of user to remove data for.
const USER_HEADER = '++USER_HEADER++';
/**
- * prepareMenu() cache.
- *
- * @var Horde_Template
- */
- static private $_menuTemplate = null;
-
- /**
* hasSharePermission() cache.
*
* @var integer
}
/**
- * Build Ingo's list of menu items.
- *
- * @return Horde_Menu A Horde_Menu object.
- */
- static public function getMenu()
- {
- $menu = new Horde_Menu();
- try {
- $menu->add(Horde::url('filters.php'), _("Filter _Rules"), 'ingo.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
- $menu->add(Horde::url($GLOBALS['injector']->getInstance('Horde_Registry')->link('mail/showWhitelist')), _("_Whitelist"), 'whitelist.png');
- $menu->add(Horde::url($GLOBALS['injector']->getInstance('Horde_Registry')->link('mail/showBlacklist')), _("_Blacklist"), 'blacklist.png');
- } catch (Horde_Exception $e) {
- Horde::logMessage($e->getMessage(), 'ERR');
- }
- if (in_array(Ingo_Storage::ACTION_VACATION, $_SESSION['ingo']['script_categories'])) {
- $menu->add(Horde::url('vacation.php'), _("_Vacation"), 'vacation.png');
- }
- if (in_array(Ingo_Storage::ACTION_FORWARD, $_SESSION['ingo']['script_categories'])) {
- $menu->add(Horde::url('forward.php'), _("_Forward"), 'forward.png');
- }
- if (in_array(Ingo_Storage::ACTION_SPAM, $_SESSION['ingo']['script_categories'])) {
- $menu->add(Horde::url('spam.php'), _("S_pam"), 'spam.png');
- }
- if ($_SESSION['ingo']['script_generate'] &&
- (!$GLOBALS['prefs']->isLocked('auto_update') ||
- !$GLOBALS['prefs']->getValue('auto_update'))) {
- $menu->add(Horde::url('script.php'), _("_Script"), 'script.png');
- }
- if (!empty($GLOBALS['ingo_shares']) && empty($GLOBALS['conf']['share']['no_sharing'])) {
- $menu->add('#', _("_Permissions"), 'perms.png', Horde_Themes::img(null, 'horde'), '', Horde::popupJs(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/shares/edit.php', true), array('params' => array('app' => 'ingo', 'share' => $_SESSION['ingo']['backend']['id'] . ':' . $GLOBALS['registry']->getAuth()), 'urlencode' => true)) . 'return false;');
- }
-
- return $menu;
- }
-
- /**
- * Prepares and caches Ingo's list of menu items.
+ * Create ingo's menu.
*
* @return string The menu text.
*/
- static public function prepareMenu()
+ static public function menu()
{
- if (isset(self::$_menuTemplate)) {
- return;
- }
-
$t = $GLOBALS['injector']->createInstance('Horde_Template');
$t->set('forminput', Horde_Util::formInput());
$t->set('options', $options);
}
- $t->set('menu_string', self::getMenu()->render());
+ $t->set('menu_string', Horde::menu(array('menu_ob' => true))->render());
- self::$_menuTemplate = $t;
- }
+ $menu = $t->fetch(INGO_TEMPLATES . '/menu/menu.html');
- /**
- * Outputs IMP's menu to the current output stream.
- */
- static public function menu()
- {
- self::prepareMenu();
- echo self::$_menuTemplate->fetch(INGO_TEMPLATES . '/menu/menu.html');
+ /* Need to buffer sidebar output here, because it may add things like
+ * cookies which need to be sent before output begins. */
+ Horde::startBuffer();
require HORDE_BASE . '/services/sidebar.php';
+ return $menu . Horde::endBuffer();
}
/**
$title = $rule['name'];
Horde::addScriptFile('rule.js', 'ingo');
-Ingo::prepareMenu();
+$menu = Ingo::menu();
Ingo::addNewFolderJs();
require INGO_TEMPLATES . '/common-header.inc';
-Ingo::menu();
+echo $menu;
Ingo::status();
require INGO_TEMPLATES . '/rule/header.inc';
}
$title = _("Filter Script Display");
-Ingo::prepareMenu();
+$menu = Ingo::menu();
require INGO_TEMPLATES . '/common-header.inc';
-Ingo::menu();
+echo $menu;
Ingo::status();
require INGO_TEMPLATES . '/script/header.inc';
if (!empty($script)) {
$form->setTitle($form_title);
$title = _("Spam Filtering");
-Ingo::prepareMenu();
+$menu = Ingo::menu();
Ingo::addNewFolderJs();
require INGO_TEMPLATES . '/common-header.inc';
-Ingo::menu();
+echo $menu;
Ingo::status();
$form->renderActive($renderer, $vars, 'spam.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
$form->setTitle($form_title);
$title = _("Vacation Edit");
-Ingo::prepareMenu();
+$menu = Ingo::menu();
require INGO_TEMPLATES . '/common-header.inc';
-Ingo::menu();
+echo $menu;
Ingo::status();
$form->renderActive(new Horde_Form_Renderer(array('encode_title' => false)), $vars, 'vacation.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
$wl_rule = $filters->findRule(Ingo_Storage::ACTION_WHITELIST);
$title = _("Whitelist Edit");
-Ingo::prepareMenu();
+$menu = Ingo::menu();
require INGO_TEMPLATES . '/common-header.inc';
-Ingo::menu();
+echo $menu;
Ingo::status();
require INGO_TEMPLATES . '/whitelist/whitelist.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
$applet = Jeta_Applet::factory($prefs->getValue('sshdriver'));
$template = $injector->createInstance('Horde_Template');
-$template->set('menu', Jeta::getMenu()->render());
+$template->set('menu', Horde::menu());
$template->set('notification', $notification->notify(array('listeners' => 'status')));
$template->set('applet', $applet->generateAppletCode());
public $version = 'H4 (2.0-git)';
/**
- * Generate the menu to use on the prefs page.
+ * Add additional items to the menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @param Horde_Menu $menu The menu object.
*/
- public function prefsMenu()
+ public function menu($menu)
{
- return Jeta::getMenu();
+ $menu->addArray(array(
+ 'class' => ((basename($_SERVER['PHP_SELF']) == 'index.php') ? 'current' : ''),
+ 'icon' => 'jeta.png',
+ 'text' => _("_Shell"),
+ 'url' => Horde::url('index.php')
+ ));
}
}
+++ /dev/null
-<?php
-/**
- * Copyright 2006-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file LICENSE for license information (GPL). If you
- * did not receive this file, see http://www.horde.org/licenses/gpl.php.
- *
- * @author Michael Slusarz <slusarz@horde.org>
- * @package Jeta
- */
-class Jeta
-{
- /**
- * Build Jeta's list of menu items.
- */
- public function getMenu()
- {
- $menu = new Horde_Menu();
-
- /* Jeta Home. */
- $menu->addArray(array('url' => Horde::url('index.php'), 'text' => _("_Shell"), 'icon' => 'jeta.png', 'class' => (basename($_SERVER['PHP_SELF']) == 'index.php') ? 'current' : ''));
-
- return $menu;
- }
-
-}
-<div id="menu">
- <tag:menu />
-</div>
-
+<tag:menu />
<tag:notification />
<p>
$template = new Horde_Template();
$template->set('main', $main);
-$template->set('menu', Jonah::getMenu('string'));
+$template->set('menu', Horde::menu());
// Buffer the notifications and send to the template
Horde::startBuffer();
Horde::startBuffer();
$form->renderActive(null, $vars, 'delete.php', 'post');
$template->set('main', Horde::endBuffer());
-
-$template->set('menu', Jonah::getMenu('string'));
+$template->set('menu', Horde::menu());
// Buffer the notifications and send to the template
Horde::startBuffer();
$template = new Horde_Template();
$template->set('main', $main);
-$template->set('menu', Jonah::getMenu('string'));
+$template->set('menu', Horde::menu());
// Buffer the notifications and send to the template
Horde::startBuffer();
array('attrs' => '', 'label' => _("Type")),
array('attrs' => '', 'label' => _("Last Update"))));
$template->set('channels', $channels, true);
-$template->set('menu', Jonah::getMenu('string'));
+$template->set('menu', Horde::menu());
$template->set('search_img', Horde::img('search.png'));
// Buffer the notifications and send to the template
$template->set('format', $criteria['channel_format']);
$template->set('options', $options);
$template->set('stories', $news->renderChannel($criteria['channel_id'], $criteria['channel_format']));
-$template->set('menu', Jonah::getMenu('string'));
+$template->set('menu', Horde::menu());
// Buffer the notifications and send to the template
Horde::startBuffer();
$template->set('format', $criteria['channel_format']);
$template->set('options', $options);
$template->set('stories', $news->renderChannel($criteria['channel_id'], $criteria['channel_format']));
-$template->set('menu', Jonah::getMenu('string'));
+$template->set('menu', Horde::menu());
// Buffer the notifications and send to the template
Horde::startBuffer();
}
/**
- * Generate the menu to use on the prefs page.
+ * Add additional items to the menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @param Horde_Menu $menu The menu object.
*/
- public function prefsMenu()
+ public function menu($menu)
{
- return Jonah::getMenu();
+ /* If authorized, show admin links. */
+ if (Jonah::checkPermissions('jonah:news', Horde_Perms::EDIT)) {
+ $menu->addArray(array(
+ 'icon' => 'jonah.png',
+ 'text' => _("_Feeds"),
+ 'url' => Horde::url('channels/index.php')
+ ));
+ }
+ foreach ($GLOBALS['conf']['news']['enable'] as $channel_type) {
+ if (Jonah::checkPermissions($channel_type, Horde_Perms::EDIT)) {
+ $menu->addArray(array(
+ 'icon' => 'new.png',
+ 'text' => _("New Feed"),
+ 'url' => Horde::url('channels/edit.php')
+ ));
+ break;
+ }
+ }
+ if ($channel_id = Horde_Util::getFormData('channel_id')) {
+ $news = $GLOBALS['injector']->getInstance('Jonah_Driver');
+ $channel = $news->getChannel($channel_id);
+ if ($channel['channel_type'] == Jonah::INTERNAL_CHANNEL &&
+ Jonah::checkPermissions(Jonah::typeToPermName($channel['channel_type']), Horde_Perms::EDIT, $channel_id)) {
+ $menu->addArray(array(
+ 'icon' => 'new.png',
+ 'text' => _("_New Story"),
+ 'url' => Horde::url('stories/edit.php')->add('channel_id', (int)$channel_id)
+ ));
+ }
+ }
}
/* Sidebar method. */
return array_shift(array_keys($types));
}
- /**
- * Build Jonah's list of menu items.
- */
- static public function getMenu($returnType = 'object')
- {
- global $registry, $conf;
-
- $menu = new Horde_Menu();
-
- /* If authorized, show admin links. */
- if (Jonah::checkPermissions('jonah:news', Horde_Perms::EDIT)) {
- $menu->addArray(array('url' => Horde::url('channels/index.php'), 'text' => _("_Feeds"), 'icon' => 'jonah.png'));
- }
- foreach ($conf['news']['enable'] as $channel_type) {
- if (Jonah::checkPermissions($channel_type, Horde_Perms::EDIT)) {
- $menu->addArray(array('url' => Horde::url('channels/edit.php'), 'text' => _("New Feed"), 'icon' => 'new.png'));
- break;
- }
- }
- if ($channel_id = Horde_Util::getFormData('channel_id')) {
- $news = $GLOBALS['injector']->getInstance('Jonah_Driver');
- $channel = $news->getChannel($channel_id);
- if ($channel['channel_type'] == Jonah::INTERNAL_CHANNEL &&
- Jonah::checkPermissions(Jonah::typeToPermName($channel['channel_type']), Horde_Perms::EDIT, $channel_id)) {
- $menu->addArray(array('url' => Horde::url('stories/edit.php')->add('channel_id', (int)$channel_id), 'text' => _("_New Story"), 'icon' => 'new.png'));
- }
- }
-
- if ($returnType == 'object') {
- return $menu;
- } else {
- return $menu->render();
- }
- }
-
}
Horde::startBuffer();
$form->renderActive(null, $vars, 'delete.php', 'post');
$template->set('main', Horde::endBuffer());
-
-$template->set('menu', Jonah::getMenu('string'));
+$template->set('menu', Horde::menu());
// Buffer the notifications and send to the template
Horde::startBuffer();
Horde::startBuffer();
$form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
$template->set('main', Horde::endBuffer());
-
-$template->set('menu', Jonah::getMenu('string'));
+$template->set('menu', Horde::menu());
// Buffer the notifications and send to the template
Horde::startBuffer();
$template->set('stories', $stories, true);
$template->set('read', $channel['channel_type'] == Jonah::INTERNAL_CHANNEL || $channel['channel_type'] == Jonah::COMPOSITE_CHANNEL, true);
$template->set('comments', $conf['comments']['allow'] && $registry->hasMethod('forums/numMessages') && $channel['channel_type'] == Jonah::INTERNAL_CHANNEL, true);
-$template->set('menu', Jonah::getMenu('string'));
+$template->set('menu', Horde::menu());
// Buffer the notifications and send to the template
Horde::startBuffer();
$template->set('stories', $stories, true);
$template->set('read', true, true);
$template->set('comments', $conf['comments']['allow'] && $registry->hasMethod('forums/numMessages'), true);
-$template->set('menu', Jonah::getMenu('string'));
+$template->set('menu', Horde::menu());
// Buffer the notifications and send to the template
Horde::startBuffer();
$view_template->set('comments', false, true);
}
-$view_template->set('menu', Jonah::getMenu('string'));
+$view_template->set('menu', Horde::menu());
// Buffer the notifications and send to the template
Horde::startBuffer();
-<div id="menu">
- <tag:menu />
-</div>
-
+<tag:menu />
<tag:notify />
<div class="header">
-<div id="menu">
- <tag:menu />
-</div>
-
+<tag:menu />
<tag:notify />
<table width="100%" cellspacing="0">
-<div id="menu">
- <tag:menu />
-</div>
-
+<tag:menu />
<tag:notify />
<tag:main />
-<div id="menu">
- <tag:menu />
-</div>
-
+<tag:menu />
<tag:notify />
<div class="header">
-<div id="menu">
- <tag:menu />
-</div>
-
+<tag:menu />
<tag:notify />
+
<if:cloud>
<div style="float:right;"><tag:cloud /></div>
<div style="margin-right:170px;">
public $version = '1.0.1';
/**
- * Generate the menu to use on the prefs page.
+ * Add additional items to the menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @param Horde_Menu $menu The menu object.
*/
- public function prefsMenu()
+ public function menu($menu)
{
return Kastalia::getMenu();
}
}
$title = $form->getTitle();
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo $form->renderActive($form->getRenderer(), $vars, 'create.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
}
$title = $form->getTitle();
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo $form->renderActive($form->getRenderer(), $vars, 'delete.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
'triggerId' => 'tags'
));
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
Horde::addScriptFile('tables.js', 'horde');
$title = _("Manage Calendars");
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
require KRONOLITH_TEMPLATES . '/calendar_list.php';
require $registry->get('templates', 'horde') . '/common-footer.inc';
$vars->set('user', $username);
$vars->set('password', $password);
$title = $form->getTitle();
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo $form->renderActive($form->getRenderer(), $vars, 'remote_edit.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
}
$title = $form->getTitle();
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo $form->renderActive($form->getRenderer(), $vars, 'remote_subscribe.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
$vars->set('url', $calendar['url']);
$title = $form->getTitle();
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo $form->renderActive($form->getRenderer(), $vars, 'remote_unsubscribe.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
$export_calendars = Kronolith::listCalendars(Horde_Perms::READ, true);
$title = _("Import/Export Calendar");
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo '<div id="page">';
foreach ($templates[$next_step] as $template) {
$title = $view->getTime($prefs->getValue('date_format'));
Horde::addScriptFile('tooltips.js', 'horde');
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo '<div id="page">';
Kronolith::tabs();
}
$title = $view->getTitle();
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo '<div id="page">';
Kronolith::eventTabs($viewName, $view->event);
}
/**
+ * Add additional items to the menu.
+ *
+ * @param Horde_Menu $menu The menu object.
+ */
+ public function menu($menu)
+ {
+ global $browser, $conf, $injector, $notification, $prefs, $registry;
+
+ /* Check here for guest calendars so that we don't get multiple
+ * messages after redirects, etc. */
+ if (!$registry->getAuth() && !count(Kronolith::listCalendars())) {
+ $notification->push(_("No calendars are available to guests."));
+ }
+
+ $menu->add(Horde::url($prefs->getValue('defaultview') . '.php'), _("_Today"), 'today.png', null, null, null, '__noselection');
+ if (Kronolith::getDefaultCalendar(Horde_Perms::EDIT) &&
+ (!empty($conf['hooks']['permsdenied']) ||
+ $injector->getInstance('Horde_Perms')->hasAppPermission('max_events') === true ||
+ $injector->getInstance('Horde_Perms')->hasAppPermission('max_events') > self::countEvents())) {
+ $menu->add(Horde::url('new.php')->add('url', Horde::selfUrl(true, false, true)), _("_New Event"), 'new.png');
+ }
+
+ if ($browser->hasFeature('dom')) {
+ Horde_Core_Ui_JsCalendar::init(array(
+ 'click_month' => true,
+ 'click_week' => true,
+ 'click_year' => true,
+ 'full_weekdays' => true
+ ));
+ Horde::addScriptFile('goto.js', 'kronolith');
+ Horde::addInlineJsVars(array(
+ 'KronolithGoto.dayurl' => strval(Horde::url('day.php')),
+ 'KronolithGoto.monthurl' => strval(Horde::url('month.php')),
+ 'KronolithGoto.weekurl' => strval(Horde::url('week.php')),
+ 'KronolithGoto.yearurl' => strval(Horde::url('year.php'))
+ ));
+ $menu->add(new Horde_Url(''), _("_Goto"), 'goto.png', null, '', null, 'kgotomenu');
+ }
+ $menu->add(Horde::url('search.php'), _("_Search"), 'search.png', Horde_Themes::img(null, 'horde'));
+
+ /* Import/Export. */
+ if ($conf['menu']['import_export']) {
+ $menu->add(Horde::url('data.php'), _("_Import/Export"), 'data.png', Horde_Themes::img(null, 'horde'));
+ }
+ }
+
+ /**
* Returns the specified permission for the given app permission.
*
* @param string $permission The permission to check.
}
/**
- * Generate the menu to use on the prefs page.
- *
- * @param Horde_Core_Prefs_Ui $ui The UI object.
- *
- * @return Horde_Menu A Horde_Menu object.
- */
- public function prefsMenu($ui)
- {
- return Kronolith::getMenu();
- }
-
- /**
* Create code for default alarm management.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
}
/**
- * Builds Kronolith's list of menu items.
- */
- public static function getMenu()
- {
- global $conf, $registry, $browser, $prefs;
-
- /* Check here for guest calendars so that we don't get multiple
- * messages after redirects, etc. */
- if (!$GLOBALS['registry']->getAuth() &&
- !count(Kronolith::listCalendars())) {
- $GLOBALS['notification']->push(_("No calendars are available to guests."));
- }
-
- $menu = new Horde_Menu();
-
- $menu->add(Horde::url($prefs->getValue('defaultview') . '.php'), _("_Today"), 'today.png', null, null, null, '__noselection');
- if (self::getDefaultCalendar(Horde_Perms::EDIT) &&
- (!empty($conf['hooks']['permsdenied']) ||
- $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_events') === true ||
- $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_events') > self::countEvents())) {
- $menu->add(Horde::url('new.php')->add('url', Horde::selfUrl(true, false, true)), _("_New Event"), 'new.png');
- }
- if ($browser->hasFeature('dom')) {
- Horde_Core_Ui_JsCalendar::init(array(
- 'click_month' => true,
- 'click_week' => true,
- 'click_year' => true,
- 'full_weekdays' => true
- ));
- Horde::addScriptFile('goto.js', 'kronolith');
- Horde::addInlineJsVars(array(
- 'KronolithGoto.dayurl' => strval(Horde::url('day.php')),
- 'KronolithGoto.monthurl' => strval(Horde::url('month.php')),
- 'KronolithGoto.weekurl' => strval(Horde::url('week.php')),
- 'KronolithGoto.yearurl' => strval(Horde::url('year.php'))
- ));
- $menu->add(new Horde_Url(''), _("_Goto"), 'goto.png', null, '', null, 'kgotomenu');
- }
- $menu->add(Horde::url('search.php'), _("_Search"), 'search.png', Horde_Themes::img(null, 'horde'));
-
- /* Import/Export. */
- if ($conf['menu']['import_export']) {
- $menu->add(Horde::url('data.php'), _("_Import/Export"), 'data.png', Horde_Themes::img(null, 'horde'));
- }
-
- return $menu;
- }
-
- /**
* Returns whether to display the ajax view.
*
* return boolean True if the ajax view should be displayed.
$title = $view->date->strftime('%B %Y');
Horde::addScriptFile('tooltips.js', 'horde');
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo '<div id="page">';
Kronolith::tabs();
));
$title = _("Add a new event");
+$menu = Horde::menu();
Horde::addScriptFile('edit.js', 'kronolith');
Horde::addScriptFile('popup.js', 'horde');
+
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
require KRONOLITH_TEMPLATES . '/edit/edit.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
exit;
}
+$menu = Horde::menu();
$title = $form->getTitle();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo $form->renderActive($form->getRenderer(), $vars, 'create.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
Horde::url('resources/', true)->redirect();
}
+$menu = Horde::menu();
$title = $form->getTitle();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo $form->renderActive($form->getRenderer(), $vars, 'delete.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
$vars->set('category', Kronolith::getDriver('Resource')->getGroupMemberships($resource->getId()));
$vars->set('responsetype', $resource->get('response_type'));
+$menu = Horde::menu();
$title = $form->getTitle();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
}
$title = $form->getTitle();
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo $form->renderActive($form->getRenderer(), $vars, 'create.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
}
$title = $form->getTitle();
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo $form->renderActive($form->getRenderer(), $vars, 'delete.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
$vars->set('members', $group->get('members'));
$title = $form->getTitle();
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
require_once dirname(__FILE__) . '/../../lib/Application.php';
Horde_Registry::appInit('kronolith');
-$title = _("Resource Groups");
-
-require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
-
// Exit if this isn't an authenticated user.
if (!$GLOBALS['registry']->getAuth()) {
Horde::url($prefs->getValue('defaultview') . '.php')->redirect();
}
+
+$menu = Horde::menu();
+$title = _("Resource Groups");
+
+require KRONOLITH_TEMPLATES . '/common-header.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
+
$edit_url_base = Horde::url('resources/groups/edit.php');
$edit_img = Horde::img('edit.png', _("Edit"));
Horde::url('', true)->redirect();
}
-$title = _("Edit resources");
-
-require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
-
// Exit if this isn't an authenticated user.
if (!$GLOBALS['registry']->getAuth()) {
Horde::url($prefs->getValue('defaultview') . '.php')->redirect();
}
+
+$menu = Horde::menu();
+$title = _("Edit resources");
+
+require KRONOLITH_TEMPLATES . '/common-header.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
+
$edit_url_base = Horde::url('resources/edit.php');
$edit_img = Horde::img('edit.png', _("Edit"));
$resources = Kronolith::getDriver('Resource')->listResources(Horde_Perms::READ, array('type' => Kronolith_Resource::TYPE_SINGLE));
Horde::addScriptFile('edit.js', 'kronolith');
}
+$menu = Horde::menu();
$title = _("Search");
Horde::addScriptFile('tooltips.js', 'horde');
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo '<div id="page">';
+++ /dev/null
-<div id="menu">
- <?php echo Kronolith::getMenu()->render() ?>
-</div>
-<?php require HORDE_BASE . '/services/sidebar.php'; ?>
-<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
$view = Kronolith::getView('Week');
$title = sprintf(_("Week %d"), $view->week);
+$menu = Horde::menu();
Horde::addScriptFile('tooltips.js', 'horde');
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo '<div id="page">';
Kronolith::tabs();
$view = Kronolith::getView('WorkWeek');
$title = sprintf(_("Week %d"), $view->week);
+$menu = Horde::menu();
Horde::addScriptFile('tooltips.js', 'horde');
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo '<div id="page">';
Kronolith::tabs();
$view = Kronolith::getView('Year');
$title = $view->year;
+$menu = Horde::menu();
require KRONOLITH_TEMPLATES . '/common-header.inc';
-require KRONOLITH_TEMPLATES . '/menu.inc';
+echo $menu;
+$notification->notify(array('listeners' => 'status'));
echo '<div id="page">';
Kronolith::tabs();
}
/**
- * Generate the menu to use on the prefs page.
+ * Add additional items to the menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @param Horde_Menu $menu The menu object.
*/
- public function prefsMenu()
+ public function menu($menu()
{
return Luxor::getMenu();
}
+
}
$title = _("Import/Export Notes");
require MNEMO_TEMPLATES . '/common-header.inc';
-require MNEMO_TEMPLATES . '/menu.inc';
+echo Horde::menu();
$notification->notify();
if (isset($templates[$next_step])) {
}
/**
+ * Add additional items to the menu.
+ *
+ * @param Horde_Menu $menu The menu object.
+ */
+ public function menu($menu)
+ {
+ global $conf, $injector, $print_link;
+
+ $menu->add(Horde::url('list.php'), _("_List Notes"), 'mnemo.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
+
+ if (Mnemo::getDefaultNotepad(Horde_Perms::EDIT) &&
+ (!empty($conf['hooks']['permsdenied']) ||
+ $injector->getInstance('Horde_Perms')->hasAppPermission('max_notes') === true ||
+ $injector->getInstance('Horde_Perms')->hasAppPermission('max_notes') > Mnemo::countMemos())) {
+ $menu->add(Horde::url(Horde_Util::addParameter('memo.php', 'actionID', 'add_memo')), _("_New Note"), 'add.png', null, null, null, Horde_Util::getFormData('memo') ? '__noselection' : null);
+ }
+
+ /* Search. */
+ $menu->add(Horde::url('search.php'), _("_Search"), 'search.png', Horde_Themes::img(null, 'horde'));
+
+ /* Import/Export */
+ if ($conf['menu']['import_export']) {
+ $menu->add(Horde::url('data.php'), _("_Import/Export"), 'data.png', Horde_Themes::img(null, 'horde'));
+ }
+
+ /* Print */
+ if ($conf['menu']['print'] && isset($print_link)) {
+ $menu->add(Horde::url($print_link), _("_Print"), 'print.png', Horde_Themes::img(null, 'horde'), '_blank', 'popup(this.href); return false;');
+ }
+ }
+
+ /**
* Returns the specified permission for the given app permission.
*
* @param string $permission The permission to check.
}
}
- /**
- * Generate the menu to use on the prefs page.
- *
- * @return Horde_Menu A Horde_Menu object.
- */
- public function prefsMenu()
- {
- return Mnemo::getMenu();
- }
-
/* Sidebar method. */
/**
<?php
/**
- * $Horde: mnemo/lib/Mnemo.php,v 1.86 2009/12/03 00:01:11 jan Exp $
- *
* Copyright 2001-2009 The Horde Project (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (ASL). If you
* Mnemo Base Class.
*
* @author Jon Parise <jon@horde.org>
- * @since Mnemo 1.0
* @package Mnemo
*/
class Mnemo {
$GLOBALS['prefs']->setValue('display_notepads', serialize($GLOBALS['display_notepads']));
}
- /**
- * Builds Mnemo's list of menu items.
- */
- public static function getMenu()
- {
- global $conf, $registry, $print_link;
-
- $menu = new Horde_Menu();
- $menu->add(Horde::url('list.php'), _("_List Notes"), 'mnemo.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
-
- if (Mnemo::getDefaultNotepad(Horde_Perms::EDIT) &&
- (!empty($conf['hooks']['permsdenied']) ||
- $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes') === true ||
- $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_notes') > Mnemo::countMemos())) {
- $menu->add(Horde::url(Horde_Util::addParameter('memo.php', 'actionID', 'add_memo')), _("_New Note"), 'add.png', null, null, null, Horde_Util::getFormData('memo') ? '__noselection' : null);
- }
-
- /* Search. */
- $menu->add(Horde::url('search.php'), _("_Search"), 'search.png', Horde_Themes::img(null, 'horde'));
-
- /* Import/Export */
- if ($conf['menu']['import_export']) {
- $menu->add(Horde::url('data.php'), _("_Import/Export"), 'data.png', Horde_Themes::img(null, 'horde'));
- }
-
- /* Print */
- if ($conf['menu']['print'] && isset($print_link)) {
- $menu->add(Horde::url($print_link), _("_Print"), 'print.png', Horde_Themes::img(null, 'horde'), '_blank', 'popup(this.href); return false;');
- }
-
- return $menu;
- }
-
}
Horde::addScriptFile('tables.js', 'horde', true);
Horde::addScriptFile('quickfinder.js', 'horde', true);
require MNEMO_TEMPLATES . '/common-header.inc';
-require MNEMO_TEMPLATES . '/menu.inc';
+echo Horde::menu();
$notification->notify();
require MNEMO_TEMPLATES . '/list/header.inc';
$notepads = Mnemo::listNotepads(false, Horde_Perms::EDIT);
require MNEMO_TEMPLATES . '/common-header.inc';
-require MNEMO_TEMPLATES . '/menu.inc';
+echo Horde::menu();
$notification->notify();
require MNEMO_TEMPLATES . '/memo/memo.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
$title = $form->getTitle();
require MNEMO_TEMPLATES . '/common-header.inc';
-require MNEMO_TEMPLATES . '/menu.inc';
+echo Horde::menu();
$notification->notify();
echo $form->renderActive($form->getRenderer(), $vars, 'create.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
$title = $form->getTitle();
require MNEMO_TEMPLATES . '/common-header.inc';
-require MNEMO_TEMPLATES . '/menu.inc';
+echo Horde::menu();
$notification->notify();
echo $form->renderActive($form->getRenderer(), $vars, 'delete.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
$vars->set('description', $notepad->get('desc'));
$title = $form->getTitle();
require MNEMO_TEMPLATES . '/common-header.inc';
-require MNEMO_TEMPLATES . '/menu.inc';
+echo Horde::menu();
$notification->notify();
echo $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
Horde::addScriptFile('tables.js', 'horde', true);
$title = _("Manage Notepads");
require MNEMO_TEMPLATES . '/common-header.inc';
-require MNEMO_TEMPLATES . '/menu.inc';
+echo Horde::menu();
$notification->notify();
require MNEMO_TEMPLATES . '/notepad_list.php';
require $registry->get('templates', 'horde') . '/common-footer.inc';
Horde::addScriptFile('quickfinder.js', 'horde', true);
require MNEMO_TEMPLATES . '/common-header.inc';
-require MNEMO_TEMPLATES . '/menu.inc';
+echo Horde::menu();
require MNEMO_TEMPLATES . '/list/header.inc';
if (count($memos)) {
$title = _("Search");
require MNEMO_TEMPLATES . '/common-header.inc';
-require MNEMO_TEMPLATES . '/menu.inc';
+echo Horde::menu();
$notification->notify();
require MNEMO_TEMPLATES . '/search/search.inc';
require MNEMO_TEMPLATES . '/panel.inc';
+++ /dev/null
-<div id="menu">
- <?php echo Mnemo::getMenu()->render() ?>
-</div>
-<?php require HORDE_BASE . '/services/sidebar.php'; ?>
'print' => 'true'));
$print_link = Horde::url($print_link);
Horde::addScriptFile('stripe.js', 'horde', true);
- require MNEMO_TEMPLATES . '/menu.inc';
+ echo Horde::menu();
}
require MNEMO_TEMPLATES . '/view/memo.inc';
$title = _("Import/Export Tasks");
require NAG_TEMPLATES . '/common-header.inc';
-require NAG_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+Nag::status();
foreach ($templates[$next_step] as $template) {
require $template;
}
/**
+ * Add additional items to the menu.
+ *
+ * @param Horde_Menu $menu The menu object.
+ */
+ public function menu($menu)
+ {
+ global $conf, $injector;
+
+ $menu->add(Horde::url('list.php'), _("_List Tasks"), 'nag.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
+
+ if (Nag::getDefaultTasklist(Horde_Perms::EDIT) &&
+ (!empty($conf['hooks']['permsdenied']) ||
+ $injector->getInstance('Horde_Perms')->hasAppPermission('max_tasks') === true ||
+ $injector->getInstance('Horde_Perms')->hasAppPermission('max_tasks') > Nag::countTasks())) {
+ $menu->add(Horde::url('task.php')->add('actionID', 'add_task'), _("_New Task"), 'add.png', null, null, null, Horde_Util::getFormData('task') ? '__noselection' : null);
+ if ($GLOBALS['browser']->hasFeature('dom')) {
+ $menu->add(new Horde_Url(''), _("_Quick Add"), 'add.png', null, null, 'Nag.quickAddPanel.show(); $(\'quickText\').focus(); return false;', Horde_Util::getFormData('task') ? 'quickAdd __noselection' : 'quickAdd');
+ }
+ }
+
+ /* Search. */
+ $menu->add(Horde::url('search.php'), _("_Search"), 'search.png', Horde_Themes::img(null, 'horde'));
+
+ /* Import/Export. */
+ if ($conf['menu']['import_export']) {
+ $menu->add(Horde::url('data.php'), _("_Import/Export"), 'data.png', Horde_Themes::img(null, 'horde'));
+ }
+ }
+
+ /**
* Returns the specified permission for the given app permission.
*
* @param string $permission The permission to check.
}
/**
- * Generate the menu to use on the prefs page.
- *
- * @return Horde_Menu A Horde_Menu object.
- */
- public function prefsMenu()
- {
- return Nag::getMenu();
- }
-
- /**
* Removes user data.
*
* @param string $user Name of user to remove data for.
}
/**
- * Build Nag's list of menu items.
+ * Trigger notifications.
*/
- public static function getMenu()
- {
- global $conf, $registry;
-
- $menu = new Horde_Menu();
- $menu->add(Horde::url('list.php'), _("_List Tasks"), 'nag.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
- if (Nag::getDefaultTasklist(Horde_Perms::EDIT) &&
- (!empty($conf['hooks']['permsdenied']) ||
- $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_tasks') === true ||
- $GLOBALS['injector']->getInstance('Horde_Perms')->hasAppPermission('max_tasks') > Nag::countTasks())) {
- $menu->add(Horde::url('task.php')->add('actionID', 'add_task'), _("_New Task"), 'add.png', null, null, null, Horde_Util::getFormData('task') ? '__noselection' : null);
- if ($GLOBALS['browser']->hasFeature('dom')) {
- $menu->add(new Horde_Url(''), _("_Quick Add"), 'add.png', null, null, 'Nag.quickAddPanel.show(); $(\'quickText\').focus(); return false;', Horde_Util::getFormData('task') ? 'quickAdd __noselection' : 'quickAdd');
- }
- }
-
- /* Search. */
- $menu->add(Horde::url('search.php'), _("_Search"), 'search.png', Horde_Themes::img(null, 'horde'));
-
- /* Import/Export. */
- if ($conf['menu']['import_export']) {
- $menu->add(Horde::url('data.php'), _("_Import/Export"), 'data.png', Horde_Themes::img(null, 'horde'));
- }
-
- return $menu;
- }
-
public static function status()
{
global $notification;
Horde::addScriptFile('quickfinder.js', 'horde');
require NAG_TEMPLATES . '/common-header.inc';
-require NAG_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+Nag::status();
echo '<div id="page">';
if (!$prefs->isLocked('show_completed')) {
$title = _("Search");
require NAG_TEMPLATES . '/common-header.inc';
-require NAG_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+Nag::status();
require NAG_TEMPLATES . '/search/search.inc';
require NAG_TEMPLATES . '/panel.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
$title = $form->getTitle();
require NAG_TEMPLATES . '/common-header.inc';
-require NAG_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+Nag::status();
$form->renderActive();
require $registry->get('templates', 'horde') . '/common-footer.inc';
$title = $form->getTitle();
require NAG_TEMPLATES . '/common-header.inc';
-require NAG_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+Nag::status();
echo $form->renderActive($form->getRenderer(), $vars, 'create.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
$title = $form->getTitle();
require NAG_TEMPLATES . '/common-header.inc';
-require NAG_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+Nag::status();
echo $form->renderActive($form->getRenderer(), $vars, 'delete.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
$vars->set('system', is_null($tasklist->get('owner')));
$title = $form->getTitle();
require NAG_TEMPLATES . '/common-header.inc';
-require NAG_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+Nag::status();
echo $form->renderActive($form->getRenderer(), $vars, 'edit.php', 'post');
require $registry->get('templates', 'horde') . '/common-footer.inc';
Horde::addScriptFile('tables.js', 'horde');
$title = _("Manage Task Lists");
require NAG_TEMPLATES . '/common-header.inc';
-require NAG_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+Nag::status();
require NAG_TEMPLATES . '/tasklist_list.php';
require $registry->get('templates', 'horde') . '/common-footer.inc';
Horde::addScriptFile('quickfinder.js', 'horde');
require NAG_TEMPLATES . '/common-header.inc';
-require NAG_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+Nag::status();
echo '<div id="page">';
require NAG_TEMPLATES . '/list.html.php';
require NAG_TEMPLATES . '/panel.inc';
+++ /dev/null
-<div id="menu">
- <?php echo Nag::getMenu()->render() ?>
-</div>
-<?php require HORDE_BASE . '/services/sidebar.php'; ?>
-<?php Nag::status();
}
require NAG_TEMPLATES . '/common-header.inc';
-require NAG_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+Nag::status();
/* Set up alarm units and value. */
$task_alarm = $task->alarm;
}
/**
- * Generate the menu to use on the prefs page.
+ * Add additional items to the menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @param Horde_Menu $menu The menu object.
*/
- public function prefsMenu()
+ public function menu($menu)
{
return News::getMenu();
}
}
/**
- * Generate the menu to use on the prefs page.
+ * Add additional items to the menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @param Horde_Menu $menu The menu object.
*/
- public function prefsMenu()
+ public function menu($menu)
{
return Pastie::getMenu();
}
public $version = 'H4 (0.1-git)';
/**
- * Generate the menu to use on the prefs page.
+ * Add additional items to the menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @param Horde_Menu $menu The menu object.
*/
- public function prefsMenu()
+ public function menu($menu)
{
- return Skeleton::getMenu();
+ $menu->add(Horde::url('list.php'), _("List"), 'user.png');
}
}
+++ /dev/null
-<?php
-/**
- * Skeleton Base Class.
- *
- * Copyright 2007-2010 The Horde Project (http://www.horde.org/)
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- *
- * @author Your Name <you@example.com>
- * @package Skeleton
- */
-class Skeleton
-{
- /**
- * Build Skeleton's list of menu items.
- */
- static public function getMenu()
- {
- $menu = new Horde_Menu(Horde_Menu::MASK_ALL);
- $menu->add(Horde::url('list.php'), _("List"), 'user.png', Horde_Themes::img(null, 'horde'));
-
- return $menu;
- }
-
-}
$title = _("List");
require SKELETON_TEMPLATES . '/common-header.inc';
-require SKELETON_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
require $registry->get('templates', 'horde') . '/common-footer.inc';
+++ /dev/null
-<div id="menu">
- <?php echo Skeleton::getMenu()->render() ?>
-</div>
-<?php require HORDE_BASE . '/services/sidebar.php'; ?>
-<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
public $version = 'H4 (0.1-git)';
/**
- * Generate the menu to use on the prefs page.
+ * Add additional items to the menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @param Horde_Menu $menu The menu object.
*/
- public function prefsMenu()
+ public function menu($menu)
{
return Skoli::getMenu();
}
$title = _("New Bookmark");
require TREAN_TEMPLATES . '/common-header.inc';
if (!Horde_Util::getFormData('popup') && !Horde_Util::getFormData('iframe')) {
- require TREAN_TEMPLATES . '/menu.inc';
+ echo Horde::menu();
+ $notification->notify(array('listeners' => 'status'));
}
require TREAN_TEMPLATES . '/add.html.php';
require $registry->get('templates', 'horde') . '/common-footer.inc';
$title = _("Browse");
require TREAN_TEMPLATES . '/common-header.inc';
if (!Horde_Util::getFormData('popup')) {
- require TREAN_TEMPLATES . '/menu.inc';
+ echo Horde::menu();
+ $notification->notify(array('listeners' => 'status'));
}
require TREAN_TEMPLATES . '/browse.php';
require $registry->get('templates', 'horde') . '/common-footer.inc';
$title = _("Import Bookmarks");
require TREAN_TEMPLATES . '/common-header.inc';
-require TREAN_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
if (!$folders_exceeded || !$bookmarks_exceeded) {
require TREAN_TEMPLATES . '/data/import.inc';
}
$folder = &$trean_shares->getFolder($folderId);
$title = _("Confirm Deletion");
require TREAN_TEMPLATES . '/common-header.inc';
- require TREAN_TEMPLATES . '/menu.inc';
+ echo Horde::menu();
+ $notification->notify(array('listeners' => 'status'));
require TREAN_TEMPLATES . '/edit/delete_folder_confirmation.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
exit;
$title = _("Edit Bookmark");
require TREAN_TEMPLATES . '/common-header.inc';
if (!Horde_Util::getFormData('popup')) {
- require TREAN_TEMPLATES . '/menu.inc';
+ echo Horde::menu();
+ $notification->notify(array('listeners' => 'status'));
}
require TREAN_TEMPLATES . '/edit/header.inc';
}
/**
- * Generate the menu to use on the prefs page.
+ * Add additional items to the menu.
*
- * @return Horde_Menu A Horde_Menu object.
+ * @param Horde_Menu $menu The menu object.
*/
- public function prefsMenu()
+ public function menu($menu)
{
- return Trean::getMenu();
+ $menu->add(Horde::url('browse.php'), _("_Browse"), 'trean.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
+ $menu->add(Horde::url('search.php'), _("_Search"), 'search.png');
+ $menu->add(Horde::url('reports.php'), _("_Reports"), 'reports.png');
+
+ /* Import/Export. */
+ if ($GLOBALS['conf']['menu']['import_export']) {
+ $menu->add(Horde::url('data.php'), _("_Import/Export"), 'data.png');
+ }
}
/* Sidebar method. */
}
/**
- * Builds Trean's list of menu items.
- */
- function getMenu($returnType = 'object')
- {
- global $conf, $registry;
-
- $menu = new Horde_Menu();
- $menu->add(Horde::url('browse.php'), _("_Browse"), 'trean.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
- $menu->add(Horde::url('search.php'), _("_Search"), 'search.png');
- $menu->add(Horde::url('reports.php'), _("_Reports"), 'reports.png');
-
- /* Import/Export. */
- if ($conf['menu']['import_export']) {
- $menu->add(Horde::url('data.php'), _("_Import/Export"), 'data.png');
- }
-
- if ($returnType == 'object') {
- return $menu;
- } else {
- return $menu->render();
- }
- }
-
- /**
* Returns the "Reason Phrase" associated with the given HTTP status code
* according to rfc2616.
*/
$title = _("Reports");
Horde::addScriptFile('stripe.js', 'horde', true);
require TREAN_TEMPLATES . '/common-header.inc';
-require TREAN_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
if ($drilldown) {
$bookmarks = $trean_shares->searchBookmarks(array(array('http_status', 'LIKE', substr($drilldown, 0, 1), array('begin' => true))));
$title = _("Search");
require TREAN_TEMPLATES . '/common-header.inc';
-require TREAN_TEMPLATES . '/menu.inc';
+echo Horde::menu();
+$notification->notify(array('listeners' => 'status'));
// Set up the search form.
$vars = Horde_Variables::getDefaultVariables();
+++ /dev/null
-<div id="menu">
- <?php echo Trean::getMenu('string') ?>
-</div>
-<?php require HORDE_BASE . '/services/sidebar.php'; ?>
-<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
}
/**
+ * Add additional items to the menu.
+ *
+ * @param Horde_Menu $menu The menu object.
+ */
+ public function menu($menu)
+ {
+ if (!empty($_SESSION['turba']['has_share'])) {
+ $menu->add(Horde::url('addressbooks/index.php'), _("_My Address Books"), 'turba.png');
+ }
+
+ if ($GLOBALS['browse_source_count']) {
+ $menu->add(Horde::url('browse.php'), _("_Browse"), 'menu/browse.png', null, null, null, (($GLOBALS['prefs']->getValue('initial_page') == 'browse.php' && basename($_SERVER['PHP_SELF']) == 'index.php' && basename(dirname($_SERVER['PHP_SELF'])) != 'addressbooks') || (basename($_SERVER['PHP_SELF']) == 'browse.php' && Horde_Util::getFormData('key') != '**search')) ? 'current' : '__noselection');
+ }
+
+ if (count($GLOBALS['addSources'])) {
+ $menu->add(Horde::url('add.php'), _("_New Contact"), 'menu/new.png');
+ }
+
+ $menu->add(Horde::url('search.php'), _("_Search"), 'search.png', Horde_Themes::img(null, 'horde'), null, null, (($GLOBALS['prefs']->getValue('initial_page') == 'search.php' && basename($_SERVER['PHP_SELF']) == 'index.php' && strpos($_SERVER['PHP_SELF'], 'addressbooks/index.php') === false) || (basename($_SERVER['PHP_SELF']) == 'browse.php' && Horde_Util::getFormData('key') == '**search')) ? 'current' : null);
+
+ /* Import/Export */
+ if ($GLOBALS['conf']['menu']['import_export']) {
+ $menu->add(Horde::url('data.php'), _("_Import/Export"), 'data.png', Horde_Themes::img(null, 'horde'));
+ }
+ }
+
+ /**
* Populate dynamically-generated preference values.
*
* @param Horde_Core_Prefs_Ui $ui The UI object.
}
/**
- * Generate the menu to use on the prefs page.
- *
- * @param Horde_Core_Prefs_Ui $ui The UI object.
- *
- * @return Horde_Menu A Horde_Menu object.
- */
- public function prefsMenu($ui)
- {
- return Turba::getMenu();
- }
-
- /**
* Removes user data.
*
* @param string $user Name of user to remove data for.
}
/**
- * Build Turba's list of menu items.
- */
- function getMenu()
- {
- $menu = new Horde_Menu();
-
- if (!empty($_SESSION['turba']['has_share'])) {
- $menu->add(Horde::url('addressbooks/index.php'), _("_My Address Books"), 'turba.png');
- }
- if ($GLOBALS['browse_source_count']) {
- $menu->add(Horde::url('browse.php'), _("_Browse"), 'menu/browse.png', null, null, null, (($GLOBALS['prefs']->getValue('initial_page') == 'browse.php' && basename($_SERVER['PHP_SELF']) == 'index.php' && basename(dirname($_SERVER['PHP_SELF'])) != 'addressbooks') || (basename($_SERVER['PHP_SELF']) == 'browse.php' && Horde_Util::getFormData('key') != '**search')) ? 'current' : '__noselection');
- }
- if (count($GLOBALS['addSources'])) {
- $menu->add(Horde::url('add.php'), _("_New Contact"), 'menu/new.png');
- }
- $menu->add(Horde::url('search.php'), _("_Search"), 'search.png', Horde_Themes::img(null, 'horde'), null, null, (($GLOBALS['prefs']->getValue('initial_page') == 'search.php' && basename($_SERVER['PHP_SELF']) == 'index.php' && strpos($_SERVER['PHP_SELF'], 'addressbooks/index.php') === false) || (basename($_SERVER['PHP_SELF']) == 'browse.php' && Horde_Util::getFormData('key') == '**search')) ? 'current' : null);
-
- /* Import/Export */
- if ($GLOBALS['conf']['menu']['import_export']) {
- $menu->add(Horde::url('data.php'), _("_Import/Export"), 'data.png', Horde_Themes::img(null, 'horde'));
- }
-
- return $menu;
- }
-
- /**
* Add browse.js javascript to page.
*/
public function addBrowseJs()
</div>
<?php endif; ?>
<div class="leftFloat">
- <?php echo Turba::getMenu()->render() ?>
+ <?php echo Horde::menu(array('menu_ob' => true))->render() ?>
</div>
</div>
</form>