Proyectos de Subversion Moodle

Rev

Rev 1 | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
// This file is part of Moodle - http://moodle.org/
3
//
4
// Moodle is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// Moodle is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16
 
17
/**
18
 * prints the form to confirm use template
19
 *
20
 * @author Andreas Grabs
21
 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
22
 * @package mod_feedback
23
 */
24
 
25
if (!defined('MOODLE_INTERNAL')) {
26
    die('Direct access to this script is forbidden.');    ///  It must be included from a Moodle page
27
}
28
 
29
require_once($CFG->libdir.'/formslib.php');
30
 
31
/**
32
 * The mod_feedback_use_templ_form
33
 *
34
 * @deprecated since 4.0. New dynamic forms have been created instead.
1441 ariadna 35
 * @todo       MDL-83522 This class will be deleted in Moodle 6.0.
1 efrain 36
 */
1441 ariadna 37
#[\core\attribute\deprecated(
38
    replacement: 'mod_feedback\form\use_template_form',
39
    since: '4.0',
40
    mdl: 'MDL-71914',
41
    reason: 'New dynamic forms have been created instead.'
42
)]
1 efrain 43
class mod_feedback_use_templ_form extends moodleform {
44
    public function __construct($action = null, $customdata = null, $method = 'post', $target = '',
45
            $attributes = null, $editable = true, $ajaxformdata = null) {
46
        debugging('Class mod_feedback_use_templ_form is deprecated. Replaced with dynamic forms.', DEBUG_DEVELOPER);
47
        parent::__construct($action, $customdata, $method, $target, $attributes, $editable, $ajaxformdata);
48
    }
49
 
50
    public function definition() {
51
        $mform =& $this->_form;
52
 
53
        // visible elements
54
        $mform->addElement('radio', 'deleteolditems', '', get_string('delete_old_items', 'feedback'), 1);
55
        $mform->addElement('radio', 'deleteolditems', '', get_string('append_new_items', 'feedback'), 0);
56
        $mform->setType('deleteolditems', PARAM_INT);
57
        $mform->setDefault('deleteolditems', 1);
58
 
59
        // hidden elements
60
        $mform->addElement('hidden', 'id');
61
        $mform->setType('id', PARAM_INT);
62
        $mform->addElement('hidden', 'templateid');
63
        $mform->setType('templateid', PARAM_INT);
64
        $mform->addElement('hidden', 'do_show');
65
        $mform->setType('do_show', PARAM_INT);
66
        $mform->setConstant('do_show', 'edit');
67
 
68
        //-------------------------------------------------------------------------------
69
        // buttons
70
        $this->add_action_buttons();
71
 
72
    }
73
 
74
    /**
75
     * Overrides parent static method for deprecation purposes.
76
     *
77
     * @deprecated since 4.0
78
     * @return array
79
     */
80
    public static function get_js_module() {
81
        debugging('Class mod_feedback_use_templ_form is deprecated. Replaced with dynamic forms.', DEBUG_DEVELOPER);
82
        return parent::get_js_module();
83
    }
84
 
85
    /**
86
     * Overrides parent static method for deprecation purposes.
87
     *
88
     * @deprecated since 4.0
89
     * @param array $simulatedsubmitteddata
90
     * @param array $simulatedsubmittedfiles
91
     * @param string $method
92
     * @param null $formidentifier
93
     * @return array
94
     */
95
    public static function mock_ajax_submit($simulatedsubmitteddata, $simulatedsubmittedfiles = array(),
96
            $method = 'post', $formidentifier = null) {
97
        debugging('Class mod_feedback_use_templ_form is deprecated. Replaced with dynamic forms.', DEBUG_DEVELOPER);
98
        return parent::mock_ajax_submit($simulatedsubmitteddata, $simulatedsubmittedfiles, $method, $formidentifier);
99
    }
100
 
101
    /**
102
     * Overrides parent static method for deprecation purposes.
103
     *
104
     * @deprecated since 4.0
105
     * @param array $data
106
     * @return array
107
     */
108
    public static function mock_generate_submit_keys($data = []) {
109
        debugging('Class mod_feedback_use_templ_form is deprecated. Replaced with dynamic forms.', DEBUG_DEVELOPER);
110
        return parent::mock_generate_submit_keys($data);
111
    }
112
 
113
    /**
114
     * Overrides parent static method for deprecation purposes.
115
     *
116
     * @deprecated since 4.0
117
     * @param array $simulatedsubmitteddata
118
     * @param array $simulatedsubmittedfiles
119
     * @param string $method
120
     * @param null $formidentifier
121
     */
122
    public static function mock_submit($simulatedsubmitteddata, $simulatedsubmittedfiles = array(),
123
            $method = 'post', $formidentifier = null) {
124
        debugging('Class mod_feedback_use_templ_form is deprecated. Replaced with dynamic forms.', DEBUG_DEVELOPER);
125
        parent::mock_submit($simulatedsubmitteddata, $simulatedsubmittedfiles, $method, $formidentifier);
126
    }
127
}
128