Make $app optional to Horde::getServiceLink().
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 10 Feb 2010 06:50:17 +0000 (23:50 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 10 Feb 2010 06:51:04 +0000 (23:51 -0700)
framework/Core/lib/Horde.php

index cab34ce..d1ae0cb 100644 (file)
@@ -561,7 +561,8 @@ HTML;
      *
      * @return Horde_Url|boolean  The HTML to create the link.
      */
-    static public function getServiceLink($type, $app, $override = false)
+    static public function getServiceLink($type, $app = null,
+                                          $override = false)
     {
         if (!in_array($type, array('ajax', 'cache', 'download', 'go', 'prefsapi')) &&
             !self::showService($type, $override)) {
@@ -587,8 +588,11 @@ HTML;
         case 'options':
         case 'prefsapi':
             if (!in_array($GLOBALS['conf']['prefs']['driver'], array('', 'none'))) {
-                return self::url($webroot . ($type == 'options' ? '/services/prefs.php' : '/services/prefs/'))
-                    ->add('app', $app);
+                $url = self::url($webroot . ($type == 'options' ? '/services/prefs.php' : '/services/prefs/'));
+                if (!is_null($app)) {
+                    $url->add('app', $app);
+                }
+                return $url;
             }
             break;