1<?php
2/**
3 * Copyright 2002-2017 Horde LLC (http://www.horde.org/)
4 *
5 * See the enclosed file COPYING for license information (LGPL). If you
6 * did not receive this file, see http://www.horde.org/licenses/lgpl21.
7 *
8 * @author   Chuck Hagenbuch <chuck@horde.org>
9 * @category Horde
10 * @license  http://www.horde.org/licenses/lgpl21 LGPL
11 * @package  Form
12 */
13
14/**
15 * Horde_Form_Action_submit is a Horde_Form Action that submits the
16 * form after the form element that the action is attached to is
17 * modified.
18 *
19 * @author    Chuck Hagenbuch <chuck@horde.org>
20 * @category  Horde
21 * @copyright 2002-2017 Horde LLC
22 * @license   http://www.horde.org/licenses/lgpl21 LGPL
23 * @package   Form
24 */
25class Horde_Form_Action_submit extends Horde_Form_Action {
26
27    var $_trigger = array('onchange');
28
29    function getActionScript($form, $renderer, $varname)
30    {
31        $page_output = $GLOBALS['injector']->getInstance('Horde_PageOutput');
32        $page_output->addScriptFile('scriptaculous/effects.js', 'horde');
33        $page_output->addScriptFile('redbox.js', 'horde');
34        return 'RedBox.loading(); document.' . $form->getName() . '.submit()';
35    }
36
37}
38