Skip to content

Commit

Permalink
MDL-12249 groups UI cleanup and improvements - see tracker for detail…
Browse files Browse the repository at this point in the history
…s; merged from MOODLE_19_STABLE
  • Loading branch information
skodak committed Nov 19, 2007
1 parent b9ce88c commit f16fa0a
Show file tree
Hide file tree
Showing 16 changed files with 567 additions and 470 deletions.
32 changes: 3 additions & 29 deletions group/assign.php
@@ -1,4 +1,4 @@
<?php
<?php // $Id$
/**
* Add/remove group from grouping.
* @package groups
Expand Down Expand Up @@ -31,22 +31,12 @@

} else if (isset($frm->add) and !empty($frm->addselect)) {
foreach ($frm->addselect as $groupid) {
$groupid = (int)$groupid;
if (record_exists('groupings_groups', 'groupingid', $grouping->id, 'groupid', $groupid)) {
continue;
}
$assign = new object();
$assign->groupingid = $grouping->id;
$assign->groupid = $groupid;
$assign->timeadded = time();
insert_record('groupings_groups', $assign);
groups_assign_grouping($grouping->id, (int)$groupid);
}

} else if (isset($frm->remove) and !empty($frm->removeselect)) {

foreach ($frm->removeselect as $groupid) {
$groupid = (int)$groupid;
delete_records('groupings_groups', 'groupingid', $grouping->id, 'groupid', $groupid);
groups_unassign_grouping($grouping->id, (int)$groupid);
}
}
}
Expand Down Expand Up @@ -82,20 +72,6 @@
$managers = get_role_users($roleid, $context, true, 'u.id', 'u.id ASC', $canseehidden);
}
}

if ($potentialmembers != false) {
// Put the groupings into a hash and sorts them
foreach ($potentialmembers as $user) {
if(!empty($managers[$user->id])) {
$nonmembers[$user->id] = '#'.$user->firstname.' '.$user->lastname;
}
else {
$nonmembers[$user->id] = $user->firstname.' '.$user->lastname;
}
$potentialmemberscount++;
}
natcasesort($nonmembers);
}
} else {
$currentmembersoptions .= '<option>&nbsp;</option>';
}
Expand Down Expand Up @@ -133,7 +109,6 @@
<form id="assignform" method="post" action="">
<div>
<input type="hidden" name="sesskey" value="<?php p(sesskey()); ?>" />
<input type="hidden" name="group" value="<?php echo $groupid; ?>" />

<table summary="" cellpadding="5" cellspacing="0">
<tr>
Expand All @@ -147,7 +122,6 @@
<?php echo $currentmembersoptions ?>
</select></td>
<td valign="top">
<?php // Hidden assignment? ?>

<?php check_theme_arrows(); ?>
<p class="arrow_button">
Expand Down

0 comments on commit f16fa0a

Please sign in to comment.