MDL-8982 : Cleaned up group/index.php and added options with to satisfy strict XHTML.
This commit is contained in:
+88
-63
@@ -155,25 +155,21 @@ if ($success) {
|
||||
$shownotdone = false;
|
||||
|
||||
print_heading(format_string($course->shortname) .' '.$strgroups, 'center', 3);
|
||||
?>
|
||||
<form id="groupeditform" action="index.php" method="post">
|
||||
<div>
|
||||
<input type="hidden" name="id" value="<?php echo $courseid; ?>" />
|
||||
echo '<form id="groupeditform" action="index.php" method="post">'."\n";
|
||||
echo '<div>'."\n";
|
||||
echo '<input type="hidden" name="id" value="' . $courseid . '" />'."\n";
|
||||
|
||||
<?php /*
|
||||
/*
|
||||
<input type="hidden" name="groupid" value="<?php p($selectedgroup) ?>" />
|
||||
<input type="hidden" name="sesskey" value="<?php p($sesskey) ?>" />
|
||||
<input type="hidden" name="roleid" value="<?php p($roleid) ?>" />
|
||||
*/
|
||||
?>
|
||||
|
||||
<table cellpadding="10" class="generaltable generalbox groupmanagementtable boxaligncenter" summary="">
|
||||
<tr>
|
||||
<td class="generalboxcontent">
|
||||
<p><label for="groupings"><?php print_string('groupings', 'group'); ?></label></p>
|
||||
<select name="grouping" id="groupings" size="15" class="select"
|
||||
onchange="groupsCombo.refreshGroups(this.options[this.selectedIndex].value);">
|
||||
<?php
|
||||
*/
|
||||
echo '<table cellpadding="10" class="generaltable generalbox groupmanagementtable boxaligncenter" summary="">'."\n";
|
||||
echo '<tr>'."\n";
|
||||
echo '<td class="generalboxcontent">'."\n";
|
||||
echo '<p><label for="groupings">' . get_string('groupings', 'group') . '</label></p>'."\n";
|
||||
echo '<select name="grouping" id="groupings" size="15" class="select"';
|
||||
echo ' onchange="groupsCombo.refreshGroups(this.options[this.selectedIndex].value);">';
|
||||
|
||||
$groupingids = groups_get_groupings($courseid);
|
||||
if (groups_count_groups_in_grouping(GROUP_NOT_IN_GROUPING, $courseid) > 0) {
|
||||
@@ -200,25 +196,36 @@ if ($success) {
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
echo '</select>'."\n";
|
||||
|
||||
echo '<p><input type="submit" name="act_updategroups" id="updategroups" value="'
|
||||
. get_string('showgroupsingrouping', 'group') . '" /></p>'."\n";
|
||||
echo '<p><input type="submit" name="act_showgroupingsettingsform" id="showeditgroupingsettingsform" value="'
|
||||
. get_string('editgroupingsettings', 'group') . '" /></p>'."\n";
|
||||
|
||||
if ($shownotdone) {
|
||||
echo '<p><input type="submit" disabled="disabled" name="act_showgroupingpermsform" '
|
||||
. 'id="showeditgroupingpermissionsform" value="'
|
||||
. get_string('editgroupingpermissions', 'group') . '" /></p>'."\n";
|
||||
}
|
||||
|
||||
echo '<p><input type="submit" name="act_deletegrouping" id="deletegrouping" value="'
|
||||
. get_string('deletegrouping', 'group') . '" /></p>'."\n";
|
||||
echo '<p><input type="submit" name="act_showcreategroupingform" id="showcreategroupingform" value="'
|
||||
. get_string('creategrouping', 'group') . '" /></p>'."\n";
|
||||
|
||||
if ($shownotdone) {
|
||||
echo '<p><input type="submit" disabled="disabled" name="act_createautomaticgroupingform" '
|
||||
. 'id="showcreateautomaticgroupingform" value="'
|
||||
. get_string('createautomaticgrouping', 'group') . '" /></p>'."\n";
|
||||
}
|
||||
|
||||
echo '<p><input type="submit" name="act_printerfriendly" id="printerfriendly" value="'
|
||||
. get_string('printerfriendly', 'group') . '" /></p>'."\n";
|
||||
echo "</td>\n<td>\n";
|
||||
echo '<p><label for="groups" id="groupslabel">' .get_string('groupsinselectedgrouping', 'group') . '</label></p>'."\n";
|
||||
echo '<select name="group" id="groups" size="15" class="select" onchange="membersCombo.refreshMembers(this.options[this.selectedIndex].value);">'."\n";
|
||||
|
||||
<p><input type="submit" name="act_updategroups" id="updategroups" value="<?php print_string('showgroupsingrouping', 'group'); ?>" /></p>
|
||||
<p><input type="submit" name="act_showgroupingsettingsform" id="showeditgroupingsettingsform" value="<?php print_string('editgroupingsettings', 'group'); ?>" /></p>
|
||||
<?php if ($shownotdone) { ?>
|
||||
<p><input type="submit" disabled="disabled" name="act_showgroupingpermsform" id="showeditgroupingpermissionsform" value="<?php print_string('editgroupingpermissions', 'group'); ?>" /></p>
|
||||
<?php } ?>
|
||||
<p><input type="submit" name="act_deletegrouping" id="deletegrouping" value="<?php print_string('deletegrouping', 'group'); ?>" /></p>
|
||||
<p><input type="submit" name="act_showcreategroupingform" id="showcreategroupingform" value="<?php print_string('creategrouping', 'group'); ?>" /></p>
|
||||
<?php if ($shownotdone) { ?>
|
||||
<p><input type="submit" disabled="disabled" name="act_createautomaticgroupingform" id="showcreateautomaticgroupingform" value="<?php print_string('createautomaticgrouping', 'group'); ?>" /></p>
|
||||
<?php } ?>
|
||||
<p><input type="submit" name="act_printerfriendly" id="printerfriendly" value="<?php print_string('printerfriendly', 'group'); ?>" /></p>
|
||||
</td>
|
||||
<td>
|
||||
<p><label for="groups" id="groupslabel"><?php print_string('groupsinselectedgrouping', 'group'); ?></label></p>
|
||||
<select name="group" id="groups" size="15" class="select" onchange="membersCombo.refreshMembers(this.options[this.selectedIndex].value);">
|
||||
<?php
|
||||
if (GROUP_NOT_IN_GROUPING == $sel_groupingid) {
|
||||
$groupids = groups_get_groups_not_in_any_grouping($courseid); //$sel_groupingid
|
||||
} else {
|
||||
@@ -239,25 +246,37 @@ if ($success) {
|
||||
echo "<option value=\"{$group->id}\"$select>{$group->name}</option>\n";
|
||||
$count++;
|
||||
}
|
||||
} else {
|
||||
// Print an empty option to avoid the XHTML error of having an empty select element
|
||||
echo '<option> </option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
echo '</select>'."\n";
|
||||
echo '<p><input type="submit" name="act_updatemembers" id="updatemembers" value="'
|
||||
. get_string('showmembersforgroup', 'group') . '" /></p>'."\n";
|
||||
echo '<p><input type="submit" name="act_showgroupsettingsform" id="showeditgroupsettingsform" value="'
|
||||
. get_string('editgroupsettings', 'group') . '" /></p>'."\n";
|
||||
echo '<p><input type="submit" name="act_deletegroup" onclick="onDeleteGroup()" id="deletegroup" value="'
|
||||
. get_string('deleteselectedgroup', 'group') . '" /></p>'."\n";
|
||||
|
||||
if ($shownotdone) {
|
||||
echo '<p><input type="submit" disabled="disabled" name="act_removegroup" '
|
||||
. 'id="removegroup" value="' . get_string('removegroupfromselectedgrouping', 'group') . '" /></p>'."\n";
|
||||
}
|
||||
|
||||
echo '<p><input type="submit" name="act_showcreategroupform" id="showcreategroupform" value="'
|
||||
. get_string('creategroupinselectedgrouping', 'group') . '" /></p>'."\n";
|
||||
|
||||
<p><input type="submit" name="act_updatemembers" id="updatemembers" value="<?php print_string('showmembersforgroup', 'group'); ?>" /></p>
|
||||
<p><input type="submit" name="act_showgroupsettingsform" id="showeditgroupsettingsform" value="<?php print_string('editgroupsettings', 'group'); ?>" /></p>
|
||||
<p><input type="submit" name="act_deletegroup" onclick="onDeleteGroup()" id="deletegroup" value="<?php print_string('deleteselectedgroup', 'group'); ?>" /></p>
|
||||
<?php if ($shownotdone) { ?>
|
||||
<p><input type="submit" disabled="disabled" name="act_removegroup" id="removegroup" value="<?php print_string('removegroupfromselectedgrouping', 'group'); ?>" /></p>
|
||||
<?php } ?>
|
||||
<p><input type="submit" name="act_showcreategroupform" id="showcreategroupform" value="<?php print_string('creategroupinselectedgrouping', 'group'); ?>" /></p>
|
||||
<?php if ($shownotdone) { ?>
|
||||
<p><input type="submit" disabled="disabled" name="act_addgroupstogroupingform" id="showaddgroupstogroupingform" value="<?php print_string('addgroupstogrouping', 'group'); ?>" /></p>
|
||||
<?php } ?>
|
||||
</td>
|
||||
<td>
|
||||
<p><label for="members" id="memberslabel"><?php print_string('membersofselectedgroup', 'group'); ?></label></p>
|
||||
<select name="user[]" id="members" size="15" multiple="multiple" class="select">
|
||||
<?php
|
||||
if ($shownotdone) {
|
||||
echo '<p><input type="submit" disabled="disabled" name="act_addgroupstogroupingform" '
|
||||
. 'id="showaddgroupstogroupingform" value="' . get_string('addgroupstogrouping', 'group') . '" /></p>'."\n";
|
||||
}
|
||||
|
||||
echo '</td>'."\n";
|
||||
echo '<td>'."\n";
|
||||
echo '<p><label for="members" id="memberslabel">' . get_string('membersofselectedgroup', 'group') . '</label></p>'."\n";
|
||||
echo '<select name="user[]" id="members" size="15" multiple="multiple" class="select">'."\n";
|
||||
|
||||
if (isset($sel_groupid)) {
|
||||
$userids = groups_get_members($sel_groupid);
|
||||
}
|
||||
@@ -268,22 +287,28 @@ if ($success) {
|
||||
foreach ($user_names as $user) {
|
||||
echo "<option value=\"{$user->id}\">{$user->name}</option>\n";
|
||||
}
|
||||
} else {
|
||||
// Print an empty option to avoid the XHTML error of having an empty select element
|
||||
echo '<option> </option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
echo '</select>'."\n";
|
||||
|
||||
<?php if ($shownotdone) { ?>
|
||||
<p><input type="submit" disabled="disabled" name="act_removemembers" id="removemembers" value="<?php print_string('removeselectedusers', 'group'); ?>"/></p>
|
||||
<?php } ?>
|
||||
<p><input type="submit" name="act_showaddmembersform" id="showaddmembersform" value="<?php print_string('adduserstogroup', 'group'); ?>" /></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
if ($shownotdone) {
|
||||
echo '<p><input type="submit" disabled="disabled" name="act_removemembers" '
|
||||
. 'id="removemembers" value="' . get_string('removeselectedusers', 'group') . '"/></p>'."\n";
|
||||
}
|
||||
|
||||
echo '<p><input type="submit" name="act_showaddmembersform" '
|
||||
. 'id="showaddmembersform" value="' . get_string('adduserstogroup', 'group'). '" /></p>'."\n";
|
||||
echo '</td>'."\n";
|
||||
echo '</tr>'."\n";
|
||||
echo '</table>'."\n";
|
||||
|
||||
<?php //<input type="hidden" name="rand" value="om" /> ?>
|
||||
</div>
|
||||
</form>
|
||||
<?php
|
||||
//<input type="hidden" name="rand" value="om" />
|
||||
echo '</div>'."\n";
|
||||
echo '</form>'."\n";
|
||||
|
||||
echo '<script type="text/javascript">'."\n";
|
||||
echo '//<![CDATA['."\n";
|
||||
echo 'var groupsCombo = new UpdatableGroupsCombo("'.$CFG->wwwroot.'", '.$course->id.');'."\n";
|
||||
|
||||
Reference in New Issue
Block a user