mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
MDL-30478 - wiki - Fixing up group problems when viewing and creating wiki pages.
Thanks to Matt Kolb for his contribution.
This commit is contained in:
parent
ead4f180a0
commit
5dedd64d58
4 changed files with 69 additions and 19 deletions
|
@ -64,6 +64,21 @@ class mod_wiki_create_form extends moodleform {
|
|||
$mform->setType('pageformat', PARAM_ALPHANUMEXT);
|
||||
$mform->addRule('pageformat', get_string('required'), 'required', null, 'client');
|
||||
|
||||
if (!empty($this->_customdata['groups']->availablegroups)) {
|
||||
foreach ($this->_customdata['groups']->availablegroups as $groupdata) {
|
||||
$groupinfo[$groupdata->id] = $groupdata->name;
|
||||
}
|
||||
if (count($groupinfo) > 1) {
|
||||
$mform->addElement('select', 'groupinfo', get_string('group'), $groupinfo);
|
||||
$mform->setDefault('groupinfo', $this->_customdata['groups']->currentgroup);
|
||||
} else {
|
||||
$groupid = key($groupinfo);
|
||||
$groupname = $groupinfo[$groupid];
|
||||
$mform->addElement('static', 'groupdesciption', get_string('group'), $groupname);
|
||||
$mform->addElement('hidden', 'groupinfo', $groupid);
|
||||
}
|
||||
}
|
||||
|
||||
//hiddens
|
||||
$mform->addElement('hidden', 'action', 'create');
|
||||
$mform->setType('action', PARAM_ALPHA);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue