Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 63... Línea 63...
63
        // ID of existing tour.
63
        // ID of existing tour.
64
        $mform->addElement('hidden', 'id');
64
        $mform->addElement('hidden', 'id');
65
        $mform->setType('id', PARAM_INT);
65
        $mform->setType('id', PARAM_INT);
Línea 66... Línea 66...
66
 
66
 
67
        // Name of the tour.
67
        // Name of the tour.
68
        $mform->addElement('text', 'name', get_string('name', 'tool_usertours'));
68
        $mform->addElement('text', 'name', get_string('name', 'tool_usertours'), ['size' => '80']);
69
        $mform->addRule('name', get_string('required'), 'required', null, 'client');
69
        $mform->addRule('name', get_string('required'), 'required', null, 'client');
70
        $mform->setType('name', PARAM_TEXT);
70
        $mform->setType('name', PARAM_TEXT);
Línea 71... Línea 71...
71
        $mform->addHelpButton('name', 'name', 'tool_usertours');
71
        $mform->addHelpButton('name', 'name', 'tool_usertours');
72
 
72
 
73
        // Admin-only descriptions.
73
        // Admin-only descriptions.
74
        $mform->addElement('textarea', 'description', get_string('description', 'tool_usertours'));
74
        $mform->addElement('textarea', 'description', get_string('description', 'tool_usertours'));
Línea 75... Línea 75...
75
        $mform->setType('description', PARAM_RAW);
75
        $mform->setType('description', PARAM_RAW);
76
        $mform->addHelpButton('description', 'description', 'tool_usertours');
76
        $mform->addHelpButton('description', 'description', 'tool_usertours');
77
 
77
 
78
        // Application.
78
        // Application.
Línea 79... Línea 79...
79
        $mform->addElement('text', 'pathmatch', get_string('pathmatch', 'tool_usertours'));
79
        $mform->addElement('text', 'pathmatch', get_string('pathmatch', 'tool_usertours'), ['size' => '80']);
Línea 80... Línea 80...
80
        $mform->setType('pathmatch', PARAM_RAW);
80
        $mform->setType('pathmatch', PARAM_RAW);
81
        $mform->addHelpButton('pathmatch', 'pathmatch', 'tool_usertours');
81
        $mform->addHelpButton('pathmatch', 'pathmatch', 'tool_usertours');
82
 
82
 
Línea 83... Línea 83...
83
        $mform->addElement('checkbox', 'enabled', get_string('tourisenabled', 'tool_usertours'));
83
        $mform->addElement('checkbox', 'enabled', get_string('tourisenabled', 'tool_usertours'));
84
 
84
 
Línea 111... Línea 111...
111
            $filterclass::add_filter_to_form($mform);
111
            $filterclass::add_filter_to_form($mform);
112
        }
112
        }
Línea 113... Línea 113...
113
 
113
 
114
        $this->add_action_buttons();
114
        $this->add_action_buttons();
-
 
115
    }
-
 
116
 
-
 
117
    #[\Override]
-
 
118
    public function validation($data, $files): array {
-
 
119
        $errors = parent::validation($data, $files);
-
 
120
 
-
 
121
        // Loop through each filter class and merge any validation errors.
-
 
122
        foreach (helper::get_all_filters() as $filterclass) {
-
 
123
            $errors = array_merge($errors, $filterclass::validate_form($data, $files));
-
 
124
        }
-
 
125
 
-
 
126
        return $errors;
115
    }
127
    }