mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-61444 question: freeze element for users without caps
This commit is contained in:
parent
e2795e8632
commit
4509be2296
@ -201,13 +201,16 @@ abstract class question_edit_form extends question_wizard_form {
|
||||
// Any questiontype specific fields.
|
||||
$this->definition_inner($mform);
|
||||
|
||||
if (core_tag_tag::is_enabled('core_question', 'question')
|
||||
&& question_has_capability_on($this->question, 'tag')) {
|
||||
if (core_tag_tag::is_enabled('core_question', 'question')) {
|
||||
$mform->addElement('header', 'tagsheader', get_string('tags'));
|
||||
}
|
||||
$mform->addElement('tags', 'tags', get_string('tags'),
|
||||
$mform->addElement('tags', 'tags', get_string('tags'),
|
||||
array('itemtype' => 'question', 'component' => 'core_question'));
|
||||
|
||||
if (!question_has_capability_on($this->question, 'tag')) {
|
||||
$mform->freeze('tags');
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($this->question->id)) {
|
||||
$mform->addElement('header', 'createdmodifiedheader',
|
||||
get_string('createdmodifiedheader', 'question'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user