1: <?php
2: /**
3: * Horde_Form_Action_whups_reload is a Horde_Form Action that reloads the
4: * form with the current (not the original) value after the form element
5: * that the action is attached to is modified.
6: *
7: * Copyright 2008-2012 Horde LLC (http://www.horde.org/)
8: *
9: * See the enclosed file LICENSE for license information (BSD). If you
10: * did not receive this file, see http://www.horde.org/licenses/bsdl.php.
11: *
12: * @author Jan Schneider <jan@horde.org>
13: * @package Horde_Form
14: */
15: class Horde_Form_Action_whups_reload extends Horde_Form_Action {
16:
17: var $_trigger = array('onchange');
18:
19: function getActionScript($form, $renderer, $varname)
20: {
21: Horde::addScriptFile('effects.js', 'horde', true);
22: Horde::addScriptFile('redbox.js', 'horde', true);
23: return 'if (this.value) { document.' . $form->getName()
24: . '.formname.value=\'' . $this->_params['formname']
25: . '\'; RedBox.loading(); document.' . $form->getName()
26: . '.submit() }';
27: }
28:
29: }
30: