Use Horde::getServiceLink() to generate prefsapi link
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 4 Aug 2009 21:52:41 +0000 (15:52 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 4 Aug 2009 21:52:41 +0000 (15:52 -0600)
13 files changed:
gollem/js/manager.js
gollem/templates/javascript_defs.php
imp/config/hooks.php.dist
imp/js/DimpBase.js
imp/templates/javascript_defs_dimp.php
kronolith/js/calendar-panel.js
kronolith/lib/Kronolith.php
kronolith/templates/javascript_defs.php
nag/templates/list/task_headers.inc
nag/templates/panel.inc
skoli/templates/list/headers.inc
skoli/templates/panel.inc
skoli/templates/search/headers.inc

index bc31c62..62ecc7d 100644 (file)
@@ -362,8 +362,8 @@ var Gollem = {
     doPrefsUpdate: function(column, sortDown)
     {
         try {
-            new Ajax.Request(GollemVar.prefs_api, { parameters: { app: 'gollem', pref: 'sortby', value: column.substring(1) } });
-            new Ajax.Request(GollemVar.prefs_api, { parameters: { app: 'gollem', pref: 'sortdir', value: sortDown } });
+            new Ajax.Request(GollemVar.prefs_api, { parameters: { pref: 'sortby', value: column.substring(1) } });
+            new Ajax.Request(GollemVar.prefs_api, { parameters: { pref: 'sortdir', value: sortDown } });
         } catch (e) {}
     }
 };
index 71e82e6..b689904 100644 (file)
@@ -5,7 +5,7 @@ $charset = Horde_Nls::getCharset();
 /* Variables used in core javascript files. */
 $var = array(
     'empty_input' => intval($GLOBALS['browser']->hasQuirk('empty_file_input_value')),
-    'prefs_api' => Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs/', true, -1)
+    'prefs_api' => Horde::getServiceLink('prefsapi', 'gollem')
 );
 
 /* Gettext strings used in core javascript files. */
index 6a2dfd2..975ca1e 100644 (file)
@@ -183,7 +183,7 @@ class IMP_Hooks
 //            return $GLOBALS['registry']->get('webroot', 'turba');
 //
 //        case 'prefs':
-//            return $GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php?app=horde';
+//            return Horde::getServiceLink('options', 'horde');
 //
 //        default:
 //            return '';
index 93adfa6..3e181a3 100644 (file)
@@ -2411,7 +2411,7 @@ var DimpBase = {
     /* Pref updating function. */
     _updatePrefs: function(pref, value)
     {
-        new Ajax.Request(DimpCore.addURLParam(DIMP.conf.URI_PREFS), { parameters: { app: 'imp', pref: pref, value: value } });
+        new Ajax.Request(DimpCore.addURLParam(DIMP.conf.URI_PREFS), { parameters: { pref: pref, value: value } });
     },
 
     /* Onload function. */
index 4466747..6628f95 100644 (file)
@@ -43,14 +43,14 @@ foreach ($imp_flags->getList() as $val) {
 /* Variables used in core javascript files. */
 $code['conf'] = array_filter(array(
     // URL variables
-    'URI_AJAX' => Horde::applicationUrl('ajax.php', true, -1),
+    'URI_AJAX' => Horde::applicationUrl('ajax.php'),
     'URI_COMPOSE' => Horde::applicationUrl('compose-dimp.php'),
-    'URI_DIMP' => Horde::applicationUrl('index-dimp.php', true, -1),
+    'URI_DIMP' => Horde::applicationUrl('index-dimp.php'),
     'URI_MESSAGE' => Horde::applicationUrl('message-dimp.php'),
-    'URI_PREFS' => Horde::url($horde_webroot . '/services/prefs/', true, -1),
+    'URI_PREFS' => Horde::getServiceLink('prefsapi', 'imp'),
     'URI_PREFS_IMP' => str_replace('&amp;', '&', Horde::getServiceLink('options', 'imp')),
     'URI_TIMEOUT' => Horde_Auth::getLogoutUrl(array('reason' => Horde_Auth::REASON_SESSION)),
-    'URI_VIEW' => Horde::applicationUrl('view.php', true, -1),
+    'URI_VIEW' => Horde::applicationUrl('view.php'),
 
     'SESSION_ID' => defined('SID') ? SID : '',
 
index 824bb3f..552d8d7 100644 (file)
@@ -10,7 +10,7 @@ function sbarToggle()
         body.addClassName('rightPanel');
     }
 
-    new Ajax.Request(KronolithVar.pref_api_url, { parameters: { app: 'kronolith', pref: 'show_panel', value: pref_value } });
+    new Ajax.Request(KronolithVar.pref_api_url, { parameters: { pref: 'show_panel', value: pref_value } });
 }
 
 function removeTag(tagid)
index 007b5e2..5fa886c 100644 (file)
@@ -128,7 +128,6 @@ class Kronolith
         /* Variables used in core javascript files. */
         $code['conf'] = array(
             'URI_AJAX' => Horde::url($kronolith_webroot . '/ajax.php', true, -1),
-            'URI_PREFS' => Horde::url($horde_webroot . '/services/prefs/', true, -1),
             'URI_IMG' => $registry->getImageDir() . '/',
             //'URI_VIEW' => Horde_Util::addParameter(Horde::url($imp_webroot . '/view.php', true, -1), array('actionID' => 'view_source', 'id' => 0), null, false),
             'SESSION_ID' => defined('SID') ? SID : '',
@@ -1211,7 +1210,7 @@ class Kronolith
 
         $myemail = $ident->getValue('from_addr');
         if (!$myemail) {
-            $notification->push(sprintf(_("You do not have an email address configured in your Personal Information Options. You must set one %shere%s before event notifications can be sent."), Horde::link(Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php'), array('app' => 'horde', 'group' => 'identities'))), '</a>'), 'horde.error', array('content.raw'));
+            $notification->push(sprintf(_("You do not have an email address configured in your Personal Information Options. You must set one %shere%s before event notifications can be sent."), Horde::link(Horde_Util::addParameter(Horde::getServiceLink('options', 'kronolith'), array('app' => 'horde', 'group' => 'identities'))), '</a>'), 'horde.error', array('content.raw'));
             return;
         }
 
index ff1500f..2b3358c 100644 (file)
@@ -8,7 +8,7 @@ $charset = Horde_Nls::getCharset();
 /* Variables used in core javascript files. */
 $var = array(
     'view_url' => Horde::applicationUrl('view.php'),
-    'pref_api_url' => Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs/', true, -1),
+    'pref_api_url' => Horde::getServiceLink('prefsapi', 'kronolith'),
     'calendar_info_url' => Horde::applicationUrl('calendars/info.php', true),
     'page_title' => $GLOBALS['registry']->get('name') . ' :: ',
 );
index dc0fe17..cfbf96f 100644 (file)
@@ -15,10 +15,10 @@ function table_sortCallback(tableId, column, sortDown)
 
 function doPrefsUpdate(column, sortDown)
 {
-    baseurl = '<?php echo Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs/', true, -1) ?>';
+    baseurl = '<?php echo Horde::getServiceLink('prefsui', 'nag') ?>';
     try {
-        new Ajax.Request(baseurl, { parameters: { app: 'nag', pref: 'sortby', value: encodeURIComponent(column.substring(1)) } });
-        new Ajax.Request(baseurl, { parameters: { app: 'nag', pref: 'sortdir', value: encodeURIComponent(sortDown) } });
+        new Ajax.Request(baseurl, { parameters: { pref: 'sortby', value: encodeURIComponent(column.substring(1)) } });
+        new Ajax.Request(baseurl, { parameters: { pref: 'sortdir', value: encodeURIComponent(sortDown) } });
     } catch (e) {}
 }
 
@@ -65,7 +65,7 @@ function doPrefsUpdate(column, sortDown)
    <?php
    if (Horde_Auth::getAuth() && (!$GLOBALS['prefs']->isLocked('categories') ||
                            !$GLOBALS['prefs']->isLocked('category_colors'))) {
-       $categoryUrl = Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php'), array('app' => 'horde', 'group' => 'categories'));
+       $categoryUrl = Horde_Util::addParameter(Horde::getServiceLink('options', 'horde'), array('group' => 'categories'));
        echo ' ' . Horde::link($categoryUrl, _("Edit categories and colors"), '', '_blank', Horde::popupJs($categoryUrl, array('urlencode' => true)) . 'return false;') . Horde::img('colorpicker.png', _("Edit categories and colors"), '', $GLOBALS['registry']->getImageDir('horde')) . '</a>';
    }
    ?>
index cbe938f..239f030 100644 (file)
@@ -30,7 +30,7 @@ function sbarToggle()
         Element.addClassName(document.body, 'rightPanel');
     }
 
-    new Ajax.Request('<?php echo Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs/', true, -1) ?>', { parameters: { app: 'nag', pref: 'show_panel', value: pref_value } });
+    new Ajax.Request('<?php echo Horde::getServiceLink('prefsapi', 'nag') ?>', { parameters: { pref: 'show_panel', value: pref_value } });
 }
 
 document.observe('dom:loaded', function() {
index 8b3969a..b5e970a 100644 (file)
@@ -16,18 +16,18 @@ function table_sortCallback(tableId, column, sortDown)
 
 function doPrefsUpdate(column, sortDown)
 {
-    baseurl = '<?php echo Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs/', true, -1) ?>';
+    baseurl = '<?php echo Horde::getServiceLink('prefsui', 'skoli') ?>';
     try {
         column = column.substring(1);
         prefscope = 'class';
         if (column == 'lastentry' || column == 'comment') {
             prefscope = 'student';
         }
-        new Ajax.Request(baseurl, { parameters: { app: 'skoli', pref: 'sortby_' + prefscope, value: encodeURIComponent(column) } });
-        new Ajax.Request(baseurl, { parameters: { app: 'skoli', pref: 'sortdir_' + prefscope, value: encodeURIComponent(sortDown) } });
+        new Ajax.Request(baseurl, { parameters: { pref: 'sortby_' + prefscope, value: encodeURIComponent(column) } });
+        new Ajax.Request(baseurl, { parameters: { pref: 'sortdir_' + prefscope, value: encodeURIComponent(sortDown) } });
         if (column == 'name') {
-            new Ajax.Request(baseurl, { parameters: { app: 'skoli', pref: 'sortby_student', value: encodeURIComponent(column) } });
-            new Ajax.Request(baseurl, { parameters: { app: 'skoli', pref: 'sortdir_student', value: encodeURIComponent(sortDown) } });
+            new Ajax.Request(baseurl, { parameters: { pref: 'sortby_student', value: encodeURIComponent(column) } });
+            new Ajax.Request(baseurl, { parameters: { pref: 'sortdir_student', value: encodeURIComponent(sortDown) } });
         }
     } catch (e) {}
 }
@@ -85,7 +85,7 @@ function doPrefsUpdate(column, sortDown)
    <?php
    if (Horde_Auth::getAuth() && (!$GLOBALS['prefs']->isLocked('categories') ||
                            !$GLOBALS['prefs']->isLocked('category_colors'))) {
-       $categoryUrl = Horde_Util::addParameter(Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs.php'), array('app' => 'horde', 'group' => 'categories'));
+       $categoryUrl = Horde_Util::addParameter(Horde::getServiceLink('options', 'horde'), array('group' => 'categories'));
        echo ' ' . Horde::link($categoryUrl, _("Edit categories and colors"), '', '_blank', Horde::popupJs($categoryUrl, array('urlencode' => true)) . 'return false;') . Horde::img('colorpicker.png', _("Edit categories and colors"), '', $GLOBALS['registry']->getImageDir('horde')) . '</a>';
    }
    ?>
index a023bf6..a032e20 100644 (file)
@@ -26,7 +26,7 @@ function sbarToggle()
         Element.addClassName(document.body, 'rightPanel');
     }
 
-    new Ajax.Request('<?php echo Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs/', true, -1) ?>', { parameters: { app: 'skoli', pref: 'show_panel', value: pref_value } });
+    new Ajax.Request('<?php echo Horde::getServiceLink('prefsapi', 'skoli') ?>', { parameters: { pref: 'show_panel', value: pref_value } });
 }
 </script>
 <a id="sbarShow" href="#" onclick="sbarToggle(); return false;"><?php echo _("Classes") ?></a>
index fbf3345..b512c17 100644 (file)
@@ -15,10 +15,10 @@ function table_sortCallback(tableId, column, sortDown)
 
 function doPrefsUpdate(column, sortDown)
 {
-    baseurl = '<?php echo Horde::url($GLOBALS['registry']->get('webroot', 'horde') . '/services/prefs/', true, -1) ?>';
+    baseurl = '<?php echo Horde::getServiceLink('prefsapi', 'skoli') ?>';
     try {
         column = column.substring(1);
-        new Ajax.Request(baseurl, { parameters: { app: 'skoli', pref: 'sortby', value: encodeURIComponent(column) } });
+        new Ajax.Request(baseurl, { parameters: { pref: 'sortby', value: encodeURIComponent(column) } });
     } catch (e) {}
 }