Additionally, at least for DIMP, make Growler notification work again.
However, this will only work for IMP options - once a user moves to
another app's options, the regular notifications will be used. Pretty
much means we will have to build a prefs-only Growler notification
handler that doesn't rely on any specific AJAX app to be loaded.
$title = _("My Photos :: Add Content");
require ANSEL_TEMPLATES . '/common-header.inc';
-echo '<div id="menu">' . Ansel::getMenu('string') . '</div>';
+echo '<div id="menu">' . Ansel::getMenu()->render() . '</div>';
$notification->notify(array('listeners' => 'status'));
require $registry->get('templates', 'horde') . '/portal/edit.inc';
require $registry->get('templates', 'horde') . '/common-footer.inc';
/**
* Build Ansel's list of menu items.
*/
- function getMenu($returnType = 'object')
+ function getMenu()
{
global $conf, $registry;
Horde::popupJs($pl, array('urlencode' => true)) . 'return false;');
}
- if ($returnType == 'object') {
- return $menu;
- } else {
- return $menu->render();
- }
+ return $menu;
}
/**
'type' => 'boolean'
),
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ ),
+
'browse' => array(
'args' => array('path' => 'string'),
'type' => '{urn:horde}hashHash',
}
/**
+ * Generate the menu to use on the prefs page.
+ *
+ * @return Horde_Menu A Horde_Menu object.
+ */
+ public function prefsMenu()
+ {
+ return Ansel::getMenu();
+ }
+
+ /**
* Browse through Ansel's gallery tree.
*
* @param string $path The level of the tree to browse.
<div id="menu">
- <?php echo Ansel::getMenu('string') ?>
+ <?php echo Ansel::getMenu()->render() ?>
</div>
<?php
}
/* Set up the template fields. */
-$template->set('menu', Babel::getMenu('string'));
+$template->set('menu', Babel::getMenu()->render());
$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
/* Create upload form */
/**
* Get the module main Menu.
**/
- function getMenu($returnType = 'object')
+ function getMenu()
{
global $registry;
- $menu = new Horde_Menu();
+ $menu = new Horde_Menu();
$menu->addArray(array('url' => Horde::applicationUrl('index.php'),
- 'text' => _("_General"),
- 'icon' => 'list.png'));
-
- if (Babel::hasPermission('view')) {
- $menu->addArray(array('url' => Horde::applicationUrl('view.php'),
- 'text' => _("_View"),
- 'icon' => 'view.png'));
- }
-
- if (Babel::hasPermission('stats')) {
- $menu->addArray(array('url' => Horde::applicationUrl('stats.php'),
- 'text' => _("_Stats"),
- 'icon' => 'extract.png'));
- }
-
- if (Babel::hasPermission('extract')) {
- $menu->addArray(array('url' => Horde::applicationUrl('extract.php'),
- 'text' => _("_Extract"),
- 'icon' => 'extract.png'));
- }
-
- if (Babel::hasPermission('make')) {
- $menu->addArray(array('url' => Horde::applicationUrl('make.php'),
- 'text' => _("_Make"),
- 'icon' => 'make.png'));
- }
-
- if (Babel::hasPermission('upload')) {
- $menu->addArray(array('url' => Horde::applicationUrl('upload.php'),
- 'text' => _("_Upload"),
- 'icon' => 'upload.png'));
- }
- if ($returnType == 'object') {
- return $menu;
- } else {
- return $menu->render();
- }
+ 'text' => _("_General"),
+ 'icon' => 'list.png'));
+
+ if (Babel::hasPermission('view')) {
+ $menu->addArray(array('url' => Horde::applicationUrl('view.php'),
+ 'text' => _("_View"),
+ 'icon' => 'view.png'));
+ }
+
+ if (Babel::hasPermission('stats')) {
+ $menu->addArray(array('url' => Horde::applicationUrl('stats.php'),
+ 'text' => _("_Stats"),
+ 'icon' => 'extract.png'));
+ }
+
+ if (Babel::hasPermission('extract')) {
+ $menu->addArray(array('url' => Horde::applicationUrl('extract.php'),
+ 'text' => _("_Extract"),
+ 'icon' => 'extract.png'));
+ }
+
+ if (Babel::hasPermission('make')) {
+ $menu->addArray(array('url' => Horde::applicationUrl('make.php'),
+ 'text' => _("_Make"),
+ 'icon' => 'make.png'));
+ }
+
+ if (Babel::hasPermission('upload')) {
+ $menu->addArray(array('url' => Horde::applicationUrl('upload.php'),
+ 'text' => _("_Upload"),
+ 'icon' => 'upload.png'));
+ }
+
+ return $menu;
}
-
/**
* Send an Email.
**/
}
/* Set up the template fields. */
-$template->set('menu', Babel::getMenu('string'));
+$template->set('menu', Babel::getMenu()->render());
$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
$template->set('lang', Babel::displayLanguage());
$fmenu = Babel::LanguageSelection();
$vars = &Horde_Variables::getDefaultVariables();
if ($app) {
-
+
$napp = ($app == 'horde') ? '' : $app;
$pofile = HORDE_BASE . '/' . $napp . '/po/' . $lang . '.po';
$po = new File_Gettext_PO();
// Set Scope
$lockscope = sprintf("babel-%s-%s", $app, $lang);
-
+
// Initialize Horde_Lock class
$locks = &Horde_Lock::singleton('sql');
-
+
// $curlocks = $locks->getLocks($lockscope);
// var_dump($curlocks);
}
}
if ($f_save && $cstring) {
-
+
$decstr = $po->encstr[$cstring];
$msgstr = Horde_Util::getFormData('msgstr');
$comments = trim($po->comments[$decstr]);
$phpformat = Horde_Util::getFormData('phpformat');
$fuzzy = Horde_Util::getFormData('fuzzy');
-
+
$status = $po->status[$decstr];
foreach($status as $k => $v) {
if ($v == 'untranslated' && !empty($msgstr)) {
unset($status[$k]);
}
-
+
if ($v == 'php-format' && !$phpformat) {
unset($status[$k]);
}
-
+
if ($v == 'fuzzy' && !$fuzzy) {
unset($status[$k]);
}
}
-
+
if (!in_array('php-format', $status) && $phpformat) {
$status[] = 'php-format';
}
-
+
if (!in_array('fuzzy', $status) && $fuzzy) {
$status[] = 'fuzzy';
}
-
+
$status = array_unique($status);
$po->status[$decstr] = $status;
-
+
$status = '';
if (preg_match('/(#,.*)$/', $comments, $m)) {
$status = $m[1];
}
-
+
if (count($po->status[$decstr])) {
$newstatus = "#, " . implode(', ', $po->status[$decstr]);
} else {
$newstatus = "";
}
-
+
$newcomments = str_replace($status, $newstatus, $comments);
-
+
$po->comments[$decstr] = $newcomments;
$po->strings[$decstr] = Translate_Display::convert_string($msgstr);
$po->save($pofile);
}
-//
+//
/* Set up the template fields. */
-$template->set('menu', Babel::getMenu('string'));
+$template->set('menu', Babel::getMenu()->render());
$template->set('notify', Horde_Util::bufferOutput(array($notification, 'notify'), array('listeners' => 'status')));
/* Create upload form */
$form->setButtons(_("View"));
$form->addVariable(_("Module"), 'module', 'enum', true, false, null, array(Babel::listApps(), true));
$form->addVariable('', '', 'spacer', true);
-
+
$renderer_params = array();
$renderer = new Horde_Form_Renderer($renderer_params);
$renderer->setAttrColumnWidth('20%');
-
+
$form->renderActive($renderer, $vars, Horde::selfURL(), 'post');
} else {
-
+
if (Babel::hasPermission('view', 'tabs', PERMS_EDIT)) {
$hmenu_desc = _("Edit Header");
$url = Horde::applicationUrl('edit.php');
$url = Horde_Util::addParameter($url, array('module' => $app,
'url' => 'view'));
-
+
$hmenu = Horde::link($url, $hmenu_desc, 'menuitem', null);
$hmenu .= Horde::img('edit.png', null, $hmenu_desc) . ' ' . $hmenu_desc . '</a> ';
} else {
$hmenu = '';
}
-
+
Translate_Display::header(_("Meta Informations"), $hmenu);
echo '<table border=0 width=100% style="border: solid 1px black" cellpadding=0 cellspacing=0>';
$i = 0;
}
echo '</table>';
Translate_Display::info();
-
+
Translate_Display::header(_("Statistic"));
-
+
$report = Translate::stats($app, $lang);
-
+
echo '<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">';
echo '<tr class="control">';
echo '<td class="control" style="border-bottom: 1px solid #999;"><b>' . _("Language") . '</b></td>';
echo "\n\t<td>" . @$report[$lang][4] . "</td>";
echo "\n\t<td>" . @$report[$lang][5] . "</td>";
echo "\t</tr>";
-
+
echo '</table>';
Translate_Display::info();
$filter_html .= Horde::img('edit.png') . ' ';
$filter_html .= '<b>' . _("Filter: ") . '</b>';
$filter_html .= '[ ';
- if (!$filter) {
+ if (!$filter) {
$hmenu_desc = '<b>' . _("All") . '</b>';
} else {
$hmenu_desc = _("All");
$filter_html .= Horde::link($url, $hmenu_desc, 'menuitem', null). ' ' . $hmenu_desc . '</a> ';
$filter_html .= '| ';
-
+
if ($filter == 'fuzzy') {
$hmenu_desc = '<b>' . _("Fuzzy") . '</b>';
} else {
$filter_html .= '</form>';
$perpage = 100;
-
+
foreach($po->strings as $msgid => $msgstr) {
if ($filter && !in_array($filter, $po->status[$msgid])) {
unset($po->strings[$msgid]);
unset($po->ref[$msgid]);
}
}
-
+
$numitem = count($po->strings);
// Set list min/max values
$min = $page * $perpage;
$min = $page * $perpage;
}
$max = $min + $perpage;
-
+
// Start start/end items (according to current page)
$start = ($page * $perpage) + 1;
$end = min($numitem, $start + $perpage - 1);
-
+
$cntstr = 0;
-
+
$pageinf = ' <span class="smallheader">[' . sprintf(_("%s to %s of %s"), $start, $end, $numitem) . ']</span>';
Translate_Display::header(_("Translations") . $pageinf, $filter_html);
-
+
foreach($po->strings as $msgid => $msgstr) {
$cntstr++;
-
+
if ($start && $cntstr < $start) {
continue;
}
-
+
if ($end && $cntstr > $end) {
break;
}
-
+
if ($filter && !in_array($filter, $po->status[$msgid])) {
continue;
}
-
+
$encstr = base64_encode($msgid);
$bgcolor = '1px #000000';
if (in_array('fuzzy', $po->status[$msgid])) {
$bgcolor = '3px #FFFF00';
}
-
+
if (in_array('untranslated', $po->status[$msgid])) {
$bgcolor = '3px #FF0000';
}
-
+
$locked = false;
if ($curlock = $locks->getLocks(md5($encstr), $lockscope)) {
foreach($curlock as $lid => $linfo) {
}
}
}
-
+
if ($editmode && $cstring == $encstr) {
-
+
// Lock the current item for 5 minutes
$locks->setLock(Horde_Auth::getAuth(), md5($encstr), $lockscope, 300);
-
+
echo '<form action="' . Horde::applicationUrl('view.php') . "#" . md5($encstr) . '" method="post" name="edit" id="edit">';
echo '<input type="hidden" name="module" value="' . $app . '">';
echo '<input type="hidden" name="page" value="' . $page . '">';
echo '<input type="hidden" name="search" value="' . $search . '">';
echo '<input type="hidden" name="cstring" value="' . $encstr . '">';
}
-
-
+
+
?>
<a name="<?= md5($encstr) ?>">
<table border=0 width=100% style="border: solid <?= $bgcolor ?>;">
</td>
<td valign=top rowspan=3 width=30%>
<table border=0 width=100% cellspacing=0 cellpadding=0>
-
+
<?php
$ref = array();
foreach($po->ref[$msgid] as $k => $v) {
$surl = Horde_Util::addParameter($surl, array('module' => $app,
'file' => $sfile,
'line' => $sline));
-
+
$onclick = "viewwindow=window.open('". $surl . "', 'viewsource', 'toolbar=no,location=no,status=yes,scrollbars=yes,resizable=yes,width=650,height=350,left=100,top=100'); if(window.focus) { viewwindow.focus()} ; return false;";
-
+
$surl = Horde::link('#', $sline, null, null, $onclick);
$surl .= $sline . '</a>';
$surl = str_replace('&', '&', $surl);
} else {
$surl = $sline;
}
-
+
$ref[$sfile][] = $surl;
}
}
-
+
$i = 0;
foreach($ref as $k => $v) {
echo sprintf("<tr class=item%s><td>%s</td><td align=right>[ %s ]</td></tr>", ($i++ %2), $k, implode(' | ', $v));
}
?>
-</table>
+</table>
</td>
<td valign=top rowspan=3 width=10%>
<?php
} else {
echo implode('<br />', $po->status[$msgid]);
}
- ?>
-
-</td>
-</tr>
+ ?>
+
+</td>
+</tr>
<tr>
<td valign=top class="control" style="height: 18px; border-bottom: 1px solid #999;">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
$surl = Horde::applicationUrl('view.php');
$surl = Horde_Util::addParameter($surl, array('module' => $app, 'cstring' => $encstr, 'editmode' => 1, 'page' => $page, 'filter' => $filter, 'search' => $search));
$surl .= "#" . md5($encstr);
-
+
echo Horde::link($surl, _("Edit Translation")) . Horde::img('babel.png') . ' ' ._("Edit Translation") . "</a>";
} elseif ($editmode && $cstring == $encstr) {
echo '<input type="submit" class="button" name="submit" value="' . _("Save") . '">';
}
?></td>
</tr>
- </table>
+ </table>
</tr>
<tr><td valign=top class="item0">
<?php
</td>
</tr>
</table>
-<p />
+<p />
<?php
flush();
-
+
if ($editmode && $cstring == $encstr) {
echo '</form>';
}
<?php
$viewurl = Horde::applicationUrl('view.php');
$viewurl = Horde_Util::addParameter($viewurl, array('editmode' => $editmode,
- 'module' => $app,
+ 'module' => $app,
'filter' => $filter,
'search' => $search));
$pager = new Horde_UI_Pager('page', $vars, array('num' => $numitem, 'url' => $viewurl, 'page_count' => 10, 'perpage' => $perpage));
*/
public $version = 'H4 (3.0-git)';
+ /**
+ * The services provided by this application.
+ *
+ * @var array
+ */
+ public $services = array(
+ 'perms' => array(
+ 'args' => array(),
+ 'type' => '{urn:horde}hashHash'
+ ),
+
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ )
+ );
+
public function perms()
{
static $perms = array();
return $perms;
}
+ /**
+ * Generate the menu to use on the prefs page.
+ *
+ * @return Horde_Menu A Horde_Menu object.
+ */
+ public function prefsMenu()
+ {
+ return Chora::getMenu();
+ }
+
}
{
$menu = new Horde_Menu();
$menu->add(self::url('browsedir'), _("_Browse"), 'chora.png');
- return $menu->render();
+ return $menu;
}
/**
<div class="rightFloat">
<?php echo Chora::repositories() ?>
</div>
- <?php echo Chora::getMenu() ?>
+ <?php echo Chora::getMenu()->render() ?>
</div>
<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
class Crumb_Api extends Horde_Registry_Api
{
public $version = 'H4 (0.1-git)';
+
+ public $services = array(
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ )
+ );
+
+ /**
+ * Generate the menu to use on the prefs page.
+ *
+ * @return Horde_Menu A Horde_Menu object.
+ */
+ public function prefsMenu()
+ {
+ return Crumb::getMenu();
+ }
+
}
/**
* Build Crumb's list of menu items.
*/
- function getMenu($returnType = 'object')
+ function getMenu()
{
global $conf, $registry, $browser, $print_link;
$menu->add(Horde::applicationUrl('listclients.php'), _("List Clients"), 'user.png', $registry->getImageDir('horde'));
$menu->add(Horde::applicationUrl('addclient.php'), _("Add Client"), 'user.png', $registry->getImageDir('horde'));
- if ($returnType == 'object') {
- return $menu;
- } else {
- return $menu->render();
- }
+ return $menu;
}
}
<div id="menu">
- <?php echo Crumb::getMenu('string') ?>
+ <?php echo Crumb::getMenu()->render() ?>
</div>
<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
'updated' => 'boolean'
),
'type' => 'boolean'
+ ),
+
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
)
);
return $updated;
}
+ /**
+ * Generate the menu to use on the prefs page.
+ *
+ * @return Horde_Menu A Horde_Menu object.
+ */
+ public function prefsMenu()
+ {
+ return Fima::getMenu();
+ }
+
}
/**
* Build Fima's list of menu items.
*/
- function getMenu($returnType = 'object')
+ function getMenu()
{
global $conf, $registry, $browser, $print_link;
$menu->add($print_link, _("_Print"), 'print.png', $registry->getImageDir('horde'), '_blank', Horde::popupJs($print_link, array('urlencode' => true)) . 'return false;', '__noselection');
}
- if ($returnType == 'object') {
- return $menu;
- } else {
- return $menu->render();
- }
+ return $menu;
}
}
<ul><li class="rightFloat"><a href="#" onclick="ledgerSubmit(true); return false;"><?php echo Horde::img('list.png', _("Open Ledger"), '') . '<br />' . _("Open Ledger") ?></a></li></ul>
</div>
- <?php echo Fima::getMenu('string') ?>
+ <?php echo Fima::getMenu()->render() ?>
<br class="clear" />
</div>
public $version = 'H4 (0.1-git)';
public $services = array(
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ ),
+
'commentCallback' => array(
'args' => array('id' => 'string'),
'type' => 'string'
}
/**
+ * Generate the menu to use on the prefs page.
+ *
+ * @return Horde_Menu A Horde_Menu object.
+ */
+ public function prefsMenu()
+ {
+ return Folks::getMenu();
+ }
+
+ /**
* Returns profile image URL.
*
* @param string $user User uid
/**
* Build Folks's list of menu items.
*/
- static function getMenu($returnType = 'object')
+ static function getMenu()
{
$img = $GLOBALS['registry']->getImageDir('horde');
$menu = new Horde_Menu(Horde_Menu::MASK_ALL);
$menu->add(Horde::applicationUrl('search.php'), _("Search"), 'search.png', $img);
$menu->add(self::getUrlFor('list', 'online'), _("List"), 'group.png', $img);
- if ($returnType == 'object') {
- return $menu;
- } else {
- return $menu->render();
- }
+ return $menu;
}
}
<div id="menu">
- <?php echo Folks::getMenu('string') ?>
+ <?php echo Folks::getMenu()->render() ?>
</div>
<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
'type' => 'boolean'
),
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ ),
+
'browse' => array(
'args' => array('path' => 'string'),
'type' => '{urn:horde}hashHash',
}
/**
+ * Generate the menu to use on the prefs page.
+ *
+ * @return Horde_Menu A Horde_Menu object.
+ */
+ public function prefsMenu()
+ {
+ return Gollem::getMenu();
+ }
+
+ /**
* Browses through the VFS tree.
*
* Each VFS backend is listed as a directory at the top level. No modify
/**
* Build Gollem's list of menu items.
*
- * @param string $returnType Either 'object' or 'string'.
- *
- * @return mixed Either a Horde_Menu object or the rendered menu text.
+ * @return Horde_Menu A Horde_Menu object.
*/
- static public function getMenu($returnType = 'object')
+ static public function getMenu()
{
$menu = new Horde_Menu();
$menu->add(Horde_Util::addParameter(Horde::applicationUrl('manager.php'), 'dir', Gollem::getHome()), _("_My Home"), 'folder_home.png');
}
}
- return ($returnType == 'object')
- ? $menu
- : $menu->render();
+ return $menu;
}
/**
$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', Gollem::getMenu('string'));
+ $t->set('menu_string', Gollem::getMenu()->render());
echo $t->fetch(GOLLEM_TEMPLATES . '/menu.html');
}
'prefsCallback' => array(
'args' => array()
+ ),
+
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ ),
+
+ 'prefsStatus' => array(
+ 'args' => array()
)
);
}
/**
+ * Generate the menu to use on the prefs page.
+ *
+ * @return Horde_Menu A Horde_Menu object.
+ */
+ public function prefsMenu()
+ {
+ return IMP::getMenu();
+ }
+
+ /**
+ * Output notifications on the preferences page.
+ */
+ public function prefsStatus()
+ {
+ try {
+ $GLOBALS['imp_authentication'] = 'throw';
+ require_once dirname(__FILE__) . '/base.php';
+ if (IMP::getViewMode() == 'dimp') {
+ Horde::addInlineScript(array(DIMP::notify(true)), 'dom');
+ return;
+ }
+ } catch (Horde_Exception $e) {}
+
+ IMP::status();
+ }
+
+ /**
* TODO
*/
protected function _prefsSentmailSelect($updated)
));
if ($new_session) {
- $_SESSION['imp']['cache']['select_view'] = empty($credentials['imp_select_view']) ? '' : $credentials['imp_select_view'];
+ $_SESSION['imp']['cache']['select_view'] = empty($credentials['imp_select_view'])
+ ? ''
+ : $credentials['imp_select_view'];
/* Set the Horde ID, since it may have been altered by the 'realm'
* setting. */
/**
* Return the javascript code necessary to display notification popups.
*
+ * @param boolean $parent Send notifications to parent window?
+ *
* @return string The notification JS code.
*/
- static public function notify()
+ static public function notify($parent = false)
{
$GLOBALS['notification']->notify(array('listeners' => 'status'));
$msgs = $GLOBALS['imp_notify']->getStack();
return count($msgs)
- ? 'DimpCore.showNotifications(' . Horde_Serialize::serialize($msgs, Horde_Serialize::JSON) . ')'
+ ? ($parent ? 'parent.' : '') . 'DimpCore.showNotifications(' . Horde_Serialize::serialize($msgs, Horde_Serialize::JSON) . ')'
: '';
}
/**
* Build IMP's list of menu items.
*
- * @param string $type Return type: either 'object' or 'string'.
- *
- * @return mixed Either a Horde_Menu object or the rendered menu text.
+ * @return Horde_Menu A Horde_Menu object.
*/
- static public function getMenu($type = 'object')
+ static public function getMenu()
{
global $conf, $prefs, $registry;
$menu->add(Horde::applicationUrl('filterprefs.php'), _("Fi_lters"), 'filters.png');
}
- return ($type == 'object') ? $menu : $menu->render();
+ return $menu;
}
/**
$t->set('flist', self::flistSelect(array('selected' => $GLOBALS['imp_mbox']['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('string'));
+ $t->set('menu_string', self::getMenu()->render());
self::$_menuTemplate = $t;
}
public function notify(&$messageStack, $options = array())
{
/* For dimp, don't capture notification messages if we are logging
- * out or accessing the options pages. */
- if (($this->_viewmode == 'dimp') &&
- Horde_Auth::getAuth() && !strstr($_SERVER['PHP_SELF'], '/prefs.php')) {
+ * out. */
+ if (($this->_viewmode == 'dimp') && Horde_Auth::getAuth()) {
$options['store'] = true;
}
parent::notify($messageStack, $options);
'type' => '{urn:horde}stringArray'
),
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ ),
+
'removeUserData' => array(
'args' => array('user' => 'string'),
'type' => 'boolean'
}
/**
+ * 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.
/**
* Build Ingo's list of menu items.
*/
- static public function getMenu($returnType = 'object')
+ static public function getMenu()
{
$menu = new Horde_Menu();
$menu->add(Horde::applicationUrl('filters.php'), _("Filter _Rules"), 'ingo.png', null, null, null, basename($_SERVER['PHP_SELF']) == 'index.php' ? 'current' : null);
$menu->add('#', _("_Permissions"), 'perms.png', $GLOBALS['registry']->getImageDir('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'] . ':' . Horde_Auth::getAuth()), 'urlencode' => true)) . 'return false;');
}
- return ($returnType == 'object') ? $menu : $menu->render();
+ return $menu;
}
}
</div>
<?php endif; ?>
- <?php echo Ingo::getMenu('string') ?>
+ <?php echo Ingo::getMenu()->render() ?>
</div>
</form>
class Jeta_Api extends Horde_Registry_Api
{
public $version = 'H4 (2.0-git)';
+
+ public $services = array(
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ )
+ );
+
+ /**
+ * Generate the menu to use on the prefs page.
+ *
+ * @return Horde_Menu A Horde_Menu object.
+ */
+ public function prefsMenu()
+ {
+ return Jeta::getMenu();
+ }
+
}
/**
* Build Jeta's list of menu items.
*/
- function getMenu($returnType = 'object')
+ function getMenu()
{
global $registry, $conf;
/* Jeta Home. */
$menu->addArray(array('url' => Horde::applicationUrl('main.php'), 'text' => _("_Shell"), 'icon' => 'jeta.png', 'class' => (basename($_SERVER['PHP_SELF']) == 'main.php' || basename($_SERVER['PHP_SELF']) == 'index.php') ? 'current' : ''));
- return ($returnType == 'object') ? $menu : $menu->render();
+ return $menu;
}
}
$applet = Jeta_Applet::factory($prefs->getValue('sshdriver'));
$template = new Horde_Template();
-$template->set('menu', Jeta::getMenu('string'));
+$template->set('menu', Jeta::getMenu()->render());
$template->set('notification', $notification->notify(array('listeners' => 'status')));
$template->set('applet', $applet->generateAppletCode());
class Kastalia_Api extends Horde_Registry_Api
{
public $version = '1.0.1';
+
+ public $services = array(
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ )
+ );
+
+ /**
+ * Generate the menu to use on the prefs page.
+ *
+ * @return Horde_Menu A Horde_Menu object.
+ */
+ public function prefsMenu()
+ {
+ return Kastalia::getMenu();
+ }
+
}
/**
* Build Kastalia's list of menu items.
*/
- function getMenu($returnType = 'object')
+ function getMenu()
{
global $conf, $registry, $browser, $print_link;
- require_once 'Horde/Menu.php';
-
- $menu = new Menu(HORDE_MENU_MASK_ALL);
+ $menu = new Horde_Menu(HORDE_MENU_MASK_ALL);
$menu->add(Horde::applicationUrl('upload_menu.php'), _("Upload"), 'menu/upload.png', $registry->getImageDir('kastalia'));
-
- if ($returnType == 'object') {
- return $menu;
- } else {
- return $menu->render();
- }
+ return $menu;
}
//diese Funktion entfernt aus einem String alle hier angegebenen Sonderzeichen
<div id="menu">
- <?php echo Kastalia::getMenu('string') ?>
+ <?php echo Kastalia::getMenu()->render() ?>
</div>
<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
'args' => array()
),
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ ),
+
'show' => array(
'link' => '%application%/event.php?calendar=|calendar|&eventID=|event|&uid=|uid|'
),
}
/**
+ * Generate the menu to use on the prefs page.
+ *
+ * @return Horde_Menu A Horde_Menu object.
+ */
+ public function prefsMenu()
+ {
+ return Kronolith::getMenu();
+ }
+
+ /**
* TODO
*/
protected function _prefsRemoteCalManagement($updated)
/**
* Builds Kronolith's list of menu items.
*/
- public static function getMenu($returnType = 'object')
+ public static function getMenu()
{
global $conf, $registry, $browser, $prefs;
$menu->add(Horde_Util::addParameter($view->link(), 'print', 1), _("_Print"), 'print.png', $registry->getImageDir('horde'), '_blank', 'Horde.popup({ url: kronolithPrintLink ? kronolithPrintLink : this.href });return false;', '__noselection');
}
- return ($returnType == 'object') ? $menu : $menu->render();
+ return $menu;
}
/**
<div id="menu">
- <?php echo Kronolith::getMenu('string') ?>
+ <?php echo Kronolith::getMenu() ?>
</div>
<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
'type' => 'boolean'
),
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ ),
+
'removeUserData' => array(
'args' => array('user' => 'string'),
'type' => 'boolean'
}
/**
+ * 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.
*/
- function getMenu($returnType = 'object')
+ function getMenu()
{
global $conf, $registry, $print_link;
$menu->add($print_link, _("_Print"), 'print.png', $registry->getImageDir('horde'), '_blank', Horde::popupJs($print_link, array('urlencode' => true)) . 'return false;', '__noselection');
}
- return ($returnType == 'object') ? $menu : $menu->render();
+ return $menu;
}
function status()
<div id="menu">
- <?php echo Nag::getMenu('string') ?>
+ <?php echo Nag::getMenu()->render() ?>
</div>
<?php Nag::status();
<?php
/**
- * News api
- *
- * $Id: api.php 1260 2009-02-01 23:15:50Z duck $
+ * News API.
*
* Copyright 2009 The Horde Project (http://www.horde.org/)
*
'type' => '{urn:horde}hashHash'
),
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ ),
+
'commentCallback' => array(
'args' => array('id' => 'string'),
'type' => 'string'
}
/**
+ * Generate the menu to use on the prefs page.
+ *
+ * @return Horde_Menu A Horde_Menu object.
+ */
+ public function prefsMenu()
+ {
+ return News::getMenu();
+ }
+
+ /**
* Callback for comment API
*
* @param int $id Internal data identifier
/**
* Build News's list of menu articles
*/
- static public function getMenu($returnType = 'object')
+ static public function getMenu()
{
$menu = new Horde_Menu();
$img_dir = $GLOBALS['registry']->getImageDir('horde');
$menu->add(Horde::applicationUrl('admin/categories/index.php'), _("Administration"), 'administration.png', $img_dir);
}
- if ($returnType == 'object') {
- return $menu;
- } else {
- return $menu->render();
- }
+ return $menu;
}
}
</select>
</form>
</div>
-<?php echo News::getMenu('string') ?>
+<?php echo News::getMenu()->render() ?>
</div>
<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
class Skeleton_Api extends Horde_Registry_Api
{
public $version = 'H4 (0.1-git)';
+
+ public $services = array(
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ )
+ );
+
+ /**
+ * Generate the menu to use on the prefs page.
+ *
+ * @return Horde_Menu A Horde_Menu object.
+ */
+ public function prefsMenu()
+ {
+ return Skeleton::getMenu();
+ }
+
}
/**
* Build Skeleton's list of menu items.
*/
- static public function getMenu($returnType = 'object')
+ static public function getMenu()
{
$menu = new Horde_Menu(Horde_Menu::MASK_ALL);
$menu->add(Horde::applicationUrl('list.php'), _("List"), 'user.png', $GLOBALS['registry']->getImageDir('horde'));
- return ($returnType == 'object') ? $menu : $menu->render();
+ return $menu;
}
}
<div id="menu">
- <?php echo Skeleton::getMenu('string') ?>
+ <?php echo Skeleton::getMenu()->render() ?>
</div>
<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
class Skoli_Api extends Horde_Registry_Api
{
public $version = 'H4 (0.1-git)';
+
+ public $services = array(
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ )
+ );
+
+ /**
+ * Generate the menu to use on the prefs page.
+ *
+ * @return Horde_Menu A Horde_Menu object.
+ */
+ public function prefsMenu()
+ {
+ return Skoli::getMenu();
+ }
+
}
/**
* Build Skoli's list of menu items.
*/
- function getMenu($returnType = 'object')
+ function getMenu()
{
global $conf, $registry, $browser, $print_link;
}
*/
- if ($returnType == 'object') {
- return $menu;
- } else {
- return $menu->render();
- }
+ return $menu;
}
/**
<div id="menu">
- <?php echo Skoli::getMenu('string') ?>
+ <?php echo Skoli::getMenu()->render() ?>
</div>
<?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
'type' => 'boolean'
),
+ 'prefsMenu' => array(
+ 'args' => array(),
+ 'type' => 'object'
+ ),
+
'removeUserData' => array(
'args' => array('user' => 'string'),
'type' => 'boolean'
}
/**
+ * Generate the menu to use on the prefs page.
+ *
+ * @return Horde_Menu A Horde_Menu object.
+ */
+ public function prefsMenu()
+ {
+ return Turba::getMenu();
+ }
+
+ /**
* Removes user data.
*
* @param string $user Name of user to remove data for.
/**
* Returns the real name, if available, of a user.
- *
- * @since Turba 2.2
*/
function getUserName($uid)
{
/**
* Gets extended permissions on an address book.
*
- * @since Turba 2.1
- *
* @param Turba_Driver $addressBook The address book to get extended permissions for.
* @param string $permission What extended permission to get.
*
* Retrieve a new source config entry based on a Turba share.
*
* @param Horde_Share object The share to base config on.
- *
- * @since Turba 2.2
*/
function getSourceFromShare(&$share)
{
/**
* Build Turba's list of menu items.
*/
- function getMenu($returnType = 'object')
+ function getMenu()
{
$menu = new Horde_Menu();
$menu->add($GLOBALS['print_link'], _("_Print"), 'print.png', $GLOBALS['registry']->getImageDir('horde'), '_blank', Horde::popupJs($GLOBALS['print_link'], array('urlencode' => true)) . 'return false);', '__noselection');
}
- return ($returnType == 'object') ? $menu : $menu->render();
+ return $menu;
}
}
</div>
<?php endif; ?>
<div class="leftFloat">
- <?php echo Turba::getMenu('string') ?>
+ <?php echo Turba::getMenu()->render() ?>
</div>
</div>
</form>