Use API for Prefs UI menu generation.
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 4 Aug 2009 08:45:48 +0000 (02:45 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 4 Aug 2009 08:46:40 +0000 (02:46 -0600)
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.

53 files changed:
ansel/browse_edit.php
ansel/lib/Ansel.php
ansel/lib/Api.php
ansel/templates/menu.inc
babel/edit.php
babel/lib/Babel.php
babel/lib/base.php
babel/view.php
chora/lib/Api.php
chora/lib/Chora.php
chora/templates/menu.inc
crumb/lib/Api.php
crumb/lib/Crumb.php
crumb/templates/menu.inc
fima/lib/Api.php
fima/lib/Fima.php
fima/templates/menu.inc
folks/lib/Api.php
folks/lib/Folks.php
folks/templates/menu.inc
gollem/lib/Api.php
gollem/lib/Gollem.php
imp/lib/Api.php
imp/lib/DIMP.php
imp/lib/IMP.php
imp/lib/Notification/Listener/Status.php
ingo/lib/Api.php
ingo/lib/Ingo.php
ingo/templates/menu.inc
jeta/lib/Api.php
jeta/lib/Jeta.php
jeta/main.php
kastalia/lib/Api.php
kastalia/lib/Kastalia.php
kastalia/templates/menu.inc
kronolith/lib/Api.php
kronolith/lib/Kronolith.php
kronolith/templates/menu.inc
nag/lib/Api.php
nag/lib/Nag.php
nag/templates/menu.inc
news/lib/Api.php
news/lib/News.php
news/templates/menu.inc
skeleton/lib/Api.php
skeleton/lib/Skeleton.php
skeleton/templates/menu.inc
skoli/lib/Api.php
skoli/lib/Skoli.php
skoli/templates/menu.inc
turba/lib/Api.php
turba/lib/Turba.php
turba/templates/menu.inc

index 76a2a41..52a7e95 100644 (file)
@@ -23,7 +23,7 @@ if ($layout->updated()) {
 
 $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';
index 90513a0..0a027d5 100644 (file)
@@ -598,7 +598,7 @@ class Ansel {
     /**
      * Build Ansel's list of menu items.
      */
-    function getMenu($returnType = 'object')
+    function getMenu()
     {
         global $conf, $registry;
 
@@ -655,11 +655,7 @@ class Ansel {
                        Horde::popupJs($pl, array('urlencode' => true)) . 'return false;');
         }
 
-        if ($returnType == 'object') {
-            return $menu;
-        } else {
-            return $menu->render();
-        }
+        return $menu;
     }
 
     /**
index 5c33f44..86c14bb 100644 (file)
@@ -30,6 +30,11 @@ class Ansel_Api extends Horde_Registry_Api
             'type' => 'boolean'
         ),
 
+        'prefsMenu' => array(
+            'args' => array(),
+            'type' => 'object'
+        ),
+
         'browse' => array(
             'args' => array('path' => 'string'),
             'type' => '{urn:horde}hashHash',
@@ -255,6 +260,16 @@ class Ansel_Api extends Horde_Registry_Api
     }
 
     /**
+     * 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.
index e04ca0e..5e21151 100644 (file)
@@ -1,5 +1,5 @@
 <div id="menu">
- <?php echo Ansel::getMenu('string') ?>
+ <?php echo Ansel::getMenu()->render() ?>
 </div>
 
 <?php
index 4f6c298..4d1d377 100644 (file)
@@ -44,7 +44,7 @@ if ($app) {
 }
 
 /* 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 */
index b018348..6eb4b0a 100644 (file)
@@ -186,53 +186,49 @@ class Babel {
     /**
      * 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.
      **/
index b47384f..8eccc30 100644 (file)
@@ -87,7 +87,7 @@ if (($lang = Horde_Util::getFormData('display_language')) !== null) {
 }
 
 /* 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();
index ae87ca0..5302aeb 100644 (file)
@@ -55,7 +55,7 @@ $show = 'edit';
 $vars = &Horde_Variables::getDefaultVariables();
 
 if ($app) {
-    
+
     $napp = ($app == 'horde') ? '' : $app;
     $pofile = HORDE_BASE . '/' . $napp . '/po/' . $lang . '.po';
     $po = new File_Gettext_PO();
@@ -63,10 +63,10 @@ if ($app) {
 
     // 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);
 }
@@ -87,62 +87,62 @@ if (($f_save || $f_cancel) && $cstring) {
 }
 
 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 */
@@ -152,26 +152,26 @@ if (!$app) {
     $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) . '&nbsp;' . $hmenu_desc . '</a>&nbsp;';
     } 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;
@@ -184,11 +184,11 @@ if (!$app) {
     }
     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>';
@@ -209,7 +209,7 @@ if (!$app) {
     echo "\n\t<td>" . @$report[$lang][4] . "</td>";
     echo "\n\t<td>" . @$report[$lang][5] . "</td>";
     echo "\t</tr>";
-    
+
     echo '</table>';
     Translate_Display::info();
 
@@ -219,7 +219,7 @@ if (!$app) {
     $filter_html .= Horde::img('edit.png') . '&nbsp;';
     $filter_html .= '<b>' . _("Filter: ") . '</b>';
     $filter_html .= '[&nbsp;';
-    if (!$filter) { 
+    if (!$filter) {
        $hmenu_desc = '<b>' . _("All") . '</b>';
     } else {
        $hmenu_desc = _("All");
@@ -239,7 +239,7 @@ if (!$app) {
     $filter_html .= Horde::link($url, $hmenu_desc, 'menuitem', null). '&nbsp;' . $hmenu_desc . '</a>&nbsp;';
     $filter_html .= '|&nbsp;';
 
-    
+
     if ($filter == 'fuzzy') {
        $hmenu_desc = '<b>' . _("Fuzzy") . '</b>';
     } else {
@@ -269,7 +269,7 @@ if (!$app) {
     $filter_html .= '</form>';
 
     $perpage = 100;
-    
+
     foreach($po->strings as $msgid => $msgstr) {
        if ($filter && !in_array($filter, $po->status[$msgid])) {
            unset($po->strings[$msgid]);
@@ -282,7 +282,7 @@ if (!$app) {
            unset($po->ref[$msgid]);
        }
     }
-    
+
     $numitem = count($po->strings);
     // Set list min/max values
     $min = $page * $perpage;
@@ -291,43 +291,43 @@ if (!$app) {
        $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 = '&nbsp;<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) {
@@ -337,12 +337,12 @@ if (!$app) {
                }
            }
        }
-       
+
        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 . '">';
@@ -350,8 +350,8 @@ if (!$app) {
            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 ?>;">
@@ -365,7 +365,7 @@ if (!$app) {
 </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) {
@@ -378,26 +378,26 @@ if (!$app) {
                    $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('&amp;', '&', $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
@@ -415,10 +415,10 @@ if (!$app) {
          } 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">
@@ -434,7 +434,7 @@ if (!$app) {
                      $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') . '&nbsp;' ._("Edit Translation") . "</a>";
                  } elseif ($editmode && $cstring == $encstr) {
                      echo '<input type="submit" class="button" name="submit" value="' . _("Save") . '">';
@@ -445,7 +445,7 @@ if (!$app) {
          }
 ?></td>
   </tr>
-  </table>      
+  </table>
 </tr>
 <tr><td valign=top  class="item0">
 <?php
@@ -465,10 +465,10 @@ if (!$app) {
 </td>
 </tr>
 </table>
-<p />    
+<p />
 <?php
          flush();
-    
+
        if ($editmode && $cstring == $encstr) {
            echo '</form>';
        }
@@ -485,7 +485,7 @@ if (!$app) {
 <?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));
index bd458bc..0cf7af2 100644 (file)
@@ -16,6 +16,23 @@ class Chora_Api extends Horde_Registry_Api
      */
     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();
@@ -38,4 +55,14 @@ class Chora_Api extends Horde_Registry_Api
         return $perms;
     }
 
+    /**
+     * Generate the menu to use on the prefs page.
+     *
+     * @return Horde_Menu  A Horde_Menu object.
+     */
+    public function prefsMenu()
+    {
+        return Chora::getMenu();
+    }
+
 }
index 8bc1922..39f1ea9 100644 (file)
@@ -421,7 +421,7 @@ class Chora
     {
         $menu = new Horde_Menu();
         $menu->add(self::url('browsedir'), _("_Browse"), 'chora.png');
-        return $menu->render();
+        return $menu;
     }
 
     /**
index 11c17bc..4b6e3a3 100644 (file)
@@ -2,6 +2,6 @@
  <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')) ?>
index 54fa300..7d72e68 100644 (file)
@@ -2,4 +2,22 @@
 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();
+    }
+
 }
index 2c34253..3ffe1fa 100644 (file)
@@ -17,7 +17,7 @@ class Crumb {
     /**
      * Build Crumb's list of menu items.
      */
-    function getMenu($returnType = 'object')
+    function getMenu()
     {
         global $conf, $registry, $browser, $print_link;
 
@@ -25,11 +25,7 @@ class Crumb {
         $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;
     }
 
 }
index 97ab6d9..583eeba 100644 (file)
@@ -1,4 +1,4 @@
 <div id="menu">
- <?php echo Crumb::getMenu('string') ?>
+ <?php echo Crumb::getMenu()->render() ?>
 </div>
 <?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
index 59cadd0..814d178 100644 (file)
@@ -10,6 +10,11 @@ class Fima_Api extends Horde_Regsitry_Api
                 'updated' => 'boolean'
             ),
             'type' => 'boolean'
+        ),
+
+        'prefsMenu' => array(
+            'args' => array(),
+            'type' => 'object'
         )
     );
 
@@ -45,4 +50,14 @@ class Fima_Api extends Horde_Regsitry_Api
         return $updated;
     }
 
+    /**
+     * Generate the menu to use on the prefs page.
+     *
+     * @return Horde_Menu  A Horde_Menu object.
+     */
+    public function prefsMenu()
+    {
+        return Fima::getMenu();
+    }
+
 }
index 421389d..e9ae5c1 100644 (file)
@@ -747,7 +747,7 @@ class Fima {
     /**
      * Build Fima's list of menu items.
      */
-    function getMenu($returnType = 'object')
+    function getMenu()
     {
         global $conf, $registry, $browser, $print_link;
 
@@ -774,11 +774,7 @@ class Fima {
             $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;
     }
 
 }
index 2eda29f..0eb6b2e 100644 (file)
@@ -19,7 +19,7 @@ foreach ($ledgers as $ledgerId => $ledger) {
   <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>
index f853dbb..dd17627 100644 (file)
@@ -17,6 +17,11 @@ class Folks_Api extends Horde_Registry_Api
     public $version = 'H4 (0.1-git)';
 
     public $services = array(
+        'prefsMenu' => array(
+            'args' => array(),
+            'type' => 'object'
+        ),
+
         'commentCallback' => array(
             'args' => array('id' => 'string'),
             'type' => 'string'
@@ -151,6 +156,16 @@ class Folks_Api extends Horde_Registry_Api
     }
 
     /**
+     * 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
index d7d2d7b..3389575 100644 (file)
@@ -290,7 +290,7 @@ class Folks {
     /**
      * 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);
@@ -301,10 +301,6 @@ class Folks {
         $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;
     }
 }
index 9d3c6ac..ab8185f 100644 (file)
@@ -1,4 +1,4 @@
 <div id="menu">
- <?php echo Folks::getMenu('string') ?>
+ <?php echo Folks::getMenu()->render() ?>
 </div>
 <?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
index b1a6e78..69acc5e 100644 (file)
@@ -38,6 +38,11 @@ class Gollem_Api extends Horde_Registry_Api
             'type' => 'boolean'
         ),
 
+        'prefsMenu' => array(
+            'args' => array(),
+            'type' => 'object'
+        ),
+
         'browse' => array(
             'args' => array('path' => 'string'),
             'type' => '{urn:horde}hashHash',
@@ -156,6 +161,16 @@ class Gollem_Api extends Horde_Registry_Api
     }
 
     /**
+     * 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
index 0a136c0..c7d663a 100644 (file)
@@ -754,11 +754,9 @@ class Gollem
     /**
      * 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');
@@ -779,9 +777,7 @@ class Gollem
             }
         }
 
-        return ($returnType == 'object')
-            ? $menu
-            : $menu->render();
+        return $menu;
     }
 
     /**
@@ -799,7 +795,7 @@ class Gollem
             $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');
     }
index cfe6b3b..4306845 100644 (file)
@@ -211,6 +211,15 @@ class IMP_Api extends Horde_Registry_Api
 
         'prefsCallback' => array(
             'args' => array()
+        ),
+
+        'prefsMenu' => array(
+            'args' => array(),
+            'type' => 'object'
+        ),
+
+        'prefsStatus' => array(
+            'args' => array()
         )
     );
 
@@ -462,6 +471,33 @@ class IMP_Api extends Horde_Registry_Api
     }
 
     /**
+     * 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)
@@ -749,7 +785,9 @@ class IMP_Api extends Horde_Registry_Api
         ));
 
         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. */
index 231dea2..1edd2c9 100644 (file)
@@ -97,15 +97,17 @@ class DIMP
     /**
      * 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) . ')'
             : '';
     }
 
index 3a75cf8..73e273a 100644 (file)
@@ -538,11 +538,9 @@ class IMP
     /**
      * 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;
 
@@ -609,7 +607,7 @@ class IMP
             $menu->add(Horde::applicationUrl('filterprefs.php'), _("Fi_lters"), 'filters.png');
         }
 
-        return ($type == 'object') ? $menu : $menu->render();
+        return $menu;
     }
 
     /**
@@ -635,7 +633,7 @@ class IMP
             $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;
     }
index 6355ba6..9c3da48 100644 (file)
@@ -61,9 +61,8 @@ class IMP_Notification_Listener_Status extends Horde_Notification_Listener_Statu
     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);
index b78a329..ab7cab8 100644 (file)
@@ -29,6 +29,11 @@ class Ingo_Api extends Horde_Registry_Api
             'type' => '{urn:horde}stringArray'
         ),
 
+        'prefsMenu' => array(
+            'args' => array(),
+            'type' => 'object'
+        ),
+
         'removeUserData' => array(
             'args' => array('user' => 'string'),
             'type' => 'boolean'
@@ -107,6 +112,16 @@ class Ingo_Api extends Horde_Registry_Api
     }
 
     /**
+     * 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.
index 0bfc8d1..364bc48 100644 (file)
@@ -382,7 +382,7 @@ class Ingo
     /**
      * 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);
@@ -410,7 +410,7 @@ class Ingo
             $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;
     }
 
 }
index 693191c..1c1e9cf 100644 (file)
@@ -13,7 +13,7 @@
  </div>
 <?php endif; ?>
 
- <?php echo Ingo::getMenu('string') ?>
+ <?php echo Ingo::getMenu()->render() ?>
 </div>
 </form>
 
index 77cc189..5ffa690 100644 (file)
@@ -2,4 +2,22 @@
 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();
+    }
+
 }
index 964afe6..250fb41 100644 (file)
@@ -13,7 +13,7 @@ class Jeta {
     /**
      * Build Jeta's list of menu items.
      */
-    function getMenu($returnType = 'object')
+    function getMenu()
     {
         global $registry, $conf;
 
@@ -22,7 +22,7 @@ class Jeta {
         /* 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;
     }
 
 }
index 34013ba..fb59c49 100644 (file)
@@ -13,7 +13,7 @@ require_once dirname(__FILE__) . '/lib/base.php';
 $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());
 
index 8a0d665..b99a6d5 100644 (file)
@@ -2,4 +2,22 @@
 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();
+    }
+
 }
index c7915d5..6b5aeac 100755 (executable)
@@ -16,22 +16,15 @@ class Kastalia {
     /**
      * 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
index dc4aabd..8ae1df7 100755 (executable)
@@ -1,4 +1,4 @@
 <div id="menu">
- <?php echo Kastalia::getMenu('string') ?>
+ <?php echo Kastalia::getMenu()->render() ?>
 </div>
 <?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
index d02dab5..3ff3e97 100644 (file)
@@ -34,6 +34,11 @@ class Kronolith_Api extends Horde_Registry_Api
             'args' => array()
         ),
 
+        'prefsMenu' => array(
+            'args' => array(),
+            'type' => 'object'
+        ),
+
         'show' => array(
             'link' => '%application%/event.php?calendar=|calendar|&eventID=|event|&uid=|uid|'
         ),
@@ -271,6 +276,16 @@ class Kronolith_Api extends Horde_Registry_Api
     }
 
     /**
+     * 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)
index 54a00a8..94a4192 100644 (file)
@@ -1861,7 +1861,7 @@ class Kronolith
     /**
      * Builds Kronolith's list of menu items.
      */
-    public static function getMenu($returnType = 'object')
+    public static function getMenu()
     {
         global $conf, $registry, $browser, $prefs;
 
@@ -1897,7 +1897,7 @@ class Kronolith
             $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;
     }
 
     /**
index 522c718..9114c33 100644 (file)
@@ -1,4 +1,4 @@
 <div id="menu">
- <?php echo Kronolith::getMenu('string') ?>
+ <?php echo Kronolith::getMenu() ?>
 </div>
 <?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
index 9b5057a..aaa5f1a 100644 (file)
@@ -35,6 +35,11 @@ class Nag_Api extends Horde_Registry_Api
             'type' => 'boolean'
         ),
 
+        'prefsMenu' => array(
+            'args' => array(),
+            'type' => 'object'
+        ),
+
         'removeUserData' => array(
             'args' => array('user' => 'string'),
             'type' => 'boolean'
@@ -240,6 +245,16 @@ class Nag_Api extends Horde_Registry_Api
     }
 
     /**
+     * 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.
index 4764a98..fb3c76c 100644 (file)
@@ -661,7 +661,7 @@ class Nag
     /**
      * Build Nag's list of menu items.
      */
-    function getMenu($returnType = 'object')
+    function getMenu()
     {
         global $conf, $registry, $print_link;
 
@@ -690,7 +690,7 @@ class Nag
             $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()
index da24cd2..344791a 100644 (file)
@@ -1,4 +1,4 @@
 <div id="menu">
- <?php echo Nag::getMenu('string') ?>
+ <?php echo Nag::getMenu()->render() ?>
 </div>
 <?php Nag::status();
index 75ae010..14f7d8b 100644 (file)
@@ -1,8 +1,6 @@
 <?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/)
  *
@@ -22,6 +20,11 @@ class News_Api extends Horde_Registry_Api
             'type' => '{urn:horde}hashHash'
         ),
 
+        'prefsMenu' => array(
+            'args' => array(),
+            'type' => 'object'
+        ),
+
         'commentCallback' => array(
             'args' => array('id' => 'string'),
             'type' => 'string'
@@ -72,6 +75,16 @@ class News_Api extends Horde_Registry_Api
     }
 
     /**
+     * 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
index b1092f2..ea01602 100644 (file)
@@ -490,7 +490,7 @@ class News {
     /**
      * 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');
@@ -511,11 +511,7 @@ class News {
             $menu->add(Horde::applicationUrl('admin/categories/index.php'), _("Administration"), 'administration.png', $img_dir);
         }
 
-        if ($returnType == 'object') {
-            return $menu;
-        } else {
-            return $menu->render();
-        }
+        return $menu;
     }
 
 }
index 9fecbd6..e765e12 100644 (file)
@@ -8,6 +8,6 @@
 </select>
 </form>
 </div>
-<?php echo News::getMenu('string') ?>
+<?php echo News::getMenu()->render() ?>
 </div>
 <?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
index 8477a2f..78ec45d 100644 (file)
@@ -2,4 +2,22 @@
 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();
+    }
+
 }
index dc76980..2c2b3ff 100644 (file)
@@ -15,12 +15,12 @@ class Skeleton
     /**
      * 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;
     }
 
 }
index 72a144d..31a5993 100644 (file)
@@ -1,4 +1,4 @@
 <div id="menu">
- <?php echo Skeleton::getMenu('string') ?>
+ <?php echo Skeleton::getMenu()->render() ?>
 </div>
 <?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
index e43684d..3b4ebf9 100644 (file)
@@ -2,4 +2,22 @@
 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();
+    }
+
 }
index e972bff..7c5832d 100644 (file)
@@ -486,7 +486,7 @@ class Skoli {
     /**
      * Build Skoli's list of menu items.
      */
-    function getMenu($returnType = 'object')
+    function getMenu()
     {
         global $conf, $registry, $browser, $print_link;
 
@@ -513,11 +513,7 @@ class Skoli {
         }
         */
 
-        if ($returnType == 'object') {
-            return $menu;
-        } else {
-            return $menu->render();
-        }
+        return $menu;
     }
 
     /**
index 72cecc8..2996974 100644 (file)
@@ -1,4 +1,4 @@
 <div id="menu">
- <?php echo Skoli::getMenu('string') ?>
+ <?php echo Skoli::getMenu()->render() ?>
 </div>
 <?php $GLOBALS['notification']->notify(array('listeners' => 'status')) ?>
index 06705e8..839077d 100644 (file)
@@ -41,6 +41,11 @@ class Turba_Api extends Horde_Registry_Api
             'type' => 'boolean'
         ),
 
+        'prefsMenu' => array(
+            'args' => array(),
+            'type' => 'object'
+        ),
+
         'removeUserData' => array(
             'args' => array('user' => 'string'),
             'type' => 'boolean'
@@ -370,6 +375,16 @@ class Turba_Api extends Horde_Registry_Api
     }
 
     /**
+     * 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.
index 5d36e06..990229c 100644 (file)
@@ -264,8 +264,6 @@ class Turba {
 
     /**
      * Returns the real name, if available, of a user.
-     *
-     * @since Turba 2.2
      */
     function getUserName($uid)
     {
@@ -287,8 +285,6 @@ class Turba {
     /**
      * 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.
      *
@@ -468,8 +464,6 @@ class Turba {
      * 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)
     {
@@ -586,7 +580,7 @@ class Turba {
     /**
      * Build Turba's list of menu items.
      */
-    function getMenu($returnType = 'object')
+    function getMenu()
     {
         $menu = new Horde_Menu();
 
@@ -611,7 +605,7 @@ class Turba {
             $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;
     }
 
 }
index d064486..afc2cad 100644 (file)
@@ -9,7 +9,7 @@
  </div>
 <?php endif; ?>
  <div class="leftFloat">
-  <?php echo Turba::getMenu('string') ?>
+  <?php echo Turba::getMenu()->render() ?>
  </div>
 </div>
 </form>