* 'login'
* 'logintasks'
* 'logout'
- * 'prefsapi
* 'problem'
* 'sidebar'
* 'prefs'
return $GLOBALS['registry']->getLogoutUrl(array('reason' => Horde_Auth::REASON_LOGOUT));
case 'prefs':
- case 'prefsapi':
if (!in_array($GLOBALS['conf']['prefs']['driver'], array('', 'none'))) {
- $url = self::url(($type == 'prefs') ? 'services/prefs.php' : 'services/prefs/', false, $opts);
+ $url = self::url('services/prefs.php', false, $opts);
if (!is_null($app)) {
$url->add('app', $app);
}
- if ($type == 'prefsapi') {
- $url->remove('ajaxui');
- }
return $url;
}
break;
return $result;
}
+ /**
+ * Sets a preference value.
+ *
+ * Variables used:
+ * <pre>
+ * 'pref' - (string) The preference name.
+ * 'value' - (mixed) The preference value.
+ * </pre>
+ *
+ * @return boolean True on success.
+ */
+ public function setPrefValue()
+ {
+ return $GLOBALS['prefs']->setValue($this->_vars->pref, $this->_vars->value);
+ }
+
}
doPrefsUpdate: function(column, sortDown)
{
try {
- new Ajax.Request(GollemVar.prefs_api, { parameters: { pref: 'sortby', value: column.substring(1) } });
- new Ajax.Request(GollemVar.prefs_api, { parameters: { pref: 'sortdir', value: sortDown } });
+ new Ajax.Request(GollemVar.URI_AJAX + 'setPrefValue', { parameters: { pref: 'sortby', value: column.substring(1) } });
+ new Ajax.Request(GollemVar.URI_AJAX + 'setPrefValue', { parameters: { pref: 'sortdir', value: sortDown } });
} catch (e) {}
}
};
--- /dev/null
+<?php
+/**
+ * Defines the AJAX interface for Gollem.
+ *
+ * Copyright 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 Michael Slusarz <slusarz@horde.org>
+ * @category Horde
+ * @license http://www.fsf.org/copyleft/gpl.html GPL
+ * @package Gollem
+ */
+class Gollem_Ajax_Application extends Horde_Core_Ajax_Application {}
/* Variables used in core javascript files. */
$var = array(
- 'empty_input' => intval($GLOBALS['browser']->hasQuirk('empty_file_input_value')),
- 'prefs_api' => Horde::getServiceLink('prefsapi', 'gollem')
+ 'URI_AJAX' => Horde::getServiceLink('ajax', 'gollem')->url,
+ 'empty_input' => intval($GLOBALS['browser']->hasQuirk('empty_file_input_value'))
);
/* Gettext strings used in core javascript files. */
/* Pref updating function. */
_updatePrefs: function(pref, value)
{
- new Ajax.Request(DimpCore.addURLParam(DIMP.conf.URI_PREFS), { parameters: { pref: pref, value: value } });
+ DimpCore.doAction('setPrefValue', { pref: pref, value: value });
},
/* Onload function. */
'URI_COMPOSE' => strval(Horde::url('compose-dimp.php')->setRaw(true)->add('ajaxui', 1)),
'URI_DIMP' => strval(Horde::url('index-dimp.php')),
'URI_MESSAGE' => strval(Horde::url('message-dimp.php')->setRaw(true)->add('ajaxui', 1)),
- 'URI_PREFS' => strval(Horde::getServiceLink('prefsapi', 'imp')),
'URI_PREFS_IMP' => strval(Horde::getServiceLink('prefs', 'imp')->setRaw(true)->add('ajaxui', 1)),
'URI_SEARCH' => strval(Horde::url('search.php')),
'URI_VIEW' => strval(Horde::url('view.php')),
body.addClassName('rightPanel');
}
- new Ajax.Request(KronolithVar.pref_api_url, { parameters: { pref: 'show_panel', value: pref_value } });
+ new Ajax.Request(KronolithVar.URI_AJAX + 'setPrefValue', { parameters: { pref: 'show_panel', value: pref_value } });
}
document.observe('dom:loaded', function() {
/* Variables used in core javascript files. */
$var = array(
+ 'URI_AJAX' => Horde::getServiceLink('ajax', 'kronolith')->url,
'calendar_info_url' => (string)Horde::url('calendars/info.php', true),
'page_title' => $GLOBALS['registry']->get('name') . ' :: ',
- 'pref_api_url' => (string)Horde::getServiceLink('prefsapi', 'kronolith'),
'twentyFour' => intval($GLOBALS['prefs']->getValue('twentyFour')),
'view_url' => (string)Horde::url('view.php'),
);
--- /dev/null
+<?php
+/**
+ * Defines the AJAX interface for Nag.
+ *
+ * Copyright 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 Michael Slusarz <slusarz@horde.org>
+ * @category Horde
+ * @license http://www.fsf.org/copyleft/gpl.html GPL
+ * @package Nag
+ */
+class Nag_Ajax_Application extends Horde_Core_Ajax_Application {}
Element.addClassName(document.body, 'rightPanel');
}
- new Ajax.Request('<?php echo Horde::getServiceLink('prefsapi', 'nag') ?>', { parameters: { pref: 'show_panel', value: pref_value } });
+ new Ajax.Request('<?php echo Horde::getServiceLink('ajax', 'nag')->url ?>setPrefValue', { parameters: { pref: 'show_panel', value: pref_value } });
}
document.observe('dom:loaded', function() {
--- /dev/null
+<?php
+/**
+ * Defines the AJAX interface for Skoli.
+ *
+ * Copyright 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 Michael Slusarz <slusarz@horde.org>
+ * @category Horde
+ * @license http://www.fsf.org/copyleft/gpl.html GPL
+ * @package Skoli
+ */
+class Skoli_Ajax_Application extends Horde_Core_Ajax_Application {}
Element.addClassName(document.body, 'rightPanel');
}
- new Ajax.Request('<?php echo Horde::getServiceLink('prefsapi', 'skoli') ?>', { parameters: { pref: 'show_panel', value: pref_value } });
+ new Ajax.Request('<?php echo Horde::getServiceLink('ajax', 'skoli')->url ?>setPrefValue', { parameters: { pref: 'show_panel', value: pref_value } });
}
</script>
<a id="sbarShow" href="#" onclick="sbarToggle(); return false;"><?php echo _("Classes") ?></a>
function doPrefsUpdate(column, sortDown)
{
- baseurl = '<?php echo Horde::getServiceLink('prefsapi', 'skoli') ?>';
try {
column = column.substring(1);
- new Ajax.Request(baseurl, { parameters: { pref: 'sortby', value: encodeURIComponent(column) } });
+ new Ajax.Request('<?php echo Horde::getServiceLink('ajax', 'skoli')->url ?>setPrefValue', { parameters: { pref: 'sortby', value: column } });
} catch (e) {}
}