1: <?php
2: /**
3: * Horde_Form_Action_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 2003-2012 Horde LLC (http://www.horde.org/)
8: *
9: * See the enclosed file COPYING for license information (LGPL). If you
10: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
11: *
12: * @author Jan Schneider <jan@horde.org>
13: * @package Form
14: */
15: class Horde_Form_Action_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');
22: Horde::addScriptFile('redbox.js', 'horde');
23: return 'if (this.value) { document.' . $form->getName() . '.formname.value=\'\'; RedBox.loading(); document.' . $form->getName() . '.submit() }';
24: }
25:
26: }
27: