}
var url = Ansel.widgets[requestType].url;
-
- var params = new Object();
- params.pref_value = pref_value;
- new Ajax.Request(url, {
- parameters: params
- });
+ var params = { "value": "value=" + pref_value };
+ new Ajax.Request(url, { parameters: params });
}
\ No newline at end of file
// Include the js
Horde::addScriptFile('togglewidget.js');
- $url = $this->_getUrl('ToggleGalleryActions', 'ansel', array('input' => 'pref_value', 'sessionWrite' => true));
+ $url = $this->_getUrl('ToggleGalleryActions', 'ansel', array('post' => 'value', 'sessionWrite' => true));
$js = array();
$js[] = "Ansel.widgets['galleryActions'] = {'bindTo': '" . $this->_params['bindTo'] . "', 'url': '" . $url . "'}";
public function handle($args, $post)
{
- if (empty($args['input'])) {
+ if (!isset($post['value'])) {
return 0;
}
- $input = Horde_Util::getPost($args['input']);
+ $input = Horde_Util::getPost($post['value']);
$GLOBALS['prefs']->setValue('show_actions', $input);
return 1;
// Include the js
Horde::addScriptFile('togglewidget.js');
- $url = $this->_getUrl('ToggleOtherGalleries', 'ansel', array('input' => 'pref_value', 'sessionWrite' => true));
+ $url = $this->_getUrl('ToggleOtherGalleries', 'ansel', array('post' => 'value', 'sessionWrite' => true));
$js = array();
$js[] = "Ansel.widgets['otherGalleries'] = {'bindTo': '" . $this->_params['bindTo'] . "', 'url': '" . $url . "'}";
$js[] = "Event.observe(Ansel.widgets.otherGalleries.bindTo + '-toggle', 'click', function(event) {doActionToggle('" . $this->_params['bindTo'] . "', 'otherGalleries'); Event.stop(event)});";
public function handle($args, $post)
{
- if (empty($args['input'])) {
+ if (!isset($post['value'])) {
return 0;
}
- $input = Horde_Util::getPost($args['input']);
- $GLOBALS['prefs']->setValue('show_othergalleries', $input);
- echo $GLOBALS['prefs']->getValue('show_othergalleries');
- return 1;
+ $GLOBALS['prefs']->setValue('show_othergalleries', $post['value']);
+
+ return $GLOBALS['prefs']->getValue('show_othergalleries');
}
}