Skip to content

Commit

Permalink
MDL-58592 group: Remove group description on the groups overview page
Browse files Browse the repository at this point in the history
  • Loading branch information
HuongNV13 committed Jun 2, 2021
1 parent 30b8ad5 commit 36d5b91
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 45 deletions.
31 changes: 0 additions & 31 deletions group/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,6 @@ M.core_group = {
hoveroverlay : null
};

M.core_group.init_hover_events = function(Y, events) {
// Prepare the overlay if it hasn't already been created
this.hoveroverlay = this.hoveroverlay || (function(){
// New Y.Overlay
var overlay = new Y.Overlay({
bodyContent : 'Loading',
visible : false,
zIndex : 2
});
// Render it against the page
overlay.render(Y.one('#page'));
return overlay;
})();

Y.all('.group_hoverdescription').each(function() {
var node = this.ancestor();
var id = this.getAttribute('data-groupid');

node.on('mouseenter', function(){
M.core_group.hoveroverlay.set('xy', [this.getX()+(this.get('offsetWidth')/2),this.getY()+this.get('offsetHeight')-5]);
M.core_group.hoveroverlay.set("bodyContent", events[id]);
M.core_group.hoveroverlay.show();
M.core_group.hoveroverlay.get('boundingBox').setStyle('visibility', 'visible');
});
node.on('mouseleave', function(){
M.core_group.hoveroverlay.hide();
M.core_group.hoveroverlay.get('boundingBox').setStyle('visibility', 'hidden');
});
});
};

M.core_group.init_index = function(Y, wwwroot, courseid) {
M.core_group.groupsCombo = new UpdatableGroupsCombo(wwwroot, courseid);
M.core_group.membersCombo = new UpdatableMembersCombo(wwwroot, courseid);
Expand Down
14 changes: 1 addition & 13 deletions group/overview.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@

/// Print table
$printed = false;
$hoverevents = array();
foreach ($members as $gpgid=>$groupdata) {
if ($groupingid and $groupingid != $gpgid) {
if ($groupingid > 0 || $gpgid > 0) { // Still show 'not in group' when 'no grouping' selected.
Expand All @@ -251,13 +250,7 @@
$options = new stdClass;
$options->noclean = true;
$options->overflowdiv = true;
$jsdescription = trim(format_text($description, $groups[$gpid]->descriptionformat, $options));
if (empty($jsdescription)) {
$line[] = $name;
} else {
$line[] = html_writer::tag('span', $name, array('class' => 'group_hoverdescription', 'data-groupid' => $gpid));
$hoverevents[$gpid] = get_string('descriptiona', null, $jsdescription);
}
$line[] = $name;
$viewfullnames = has_capability('moodle/site:viewfullnames', $context);
$fullnames = array();
foreach ($users as $user) {
Expand Down Expand Up @@ -298,9 +291,4 @@
$printed = true;
}

if (count($hoverevents)>0) {
$PAGE->requires->string_for_js('description', 'moodle');
$PAGE->requires->js_init_call('M.core_group.init_hover_events', array($hoverevents));
}

echo $OUTPUT->footer();
4 changes: 3 additions & 1 deletion lang/en/moodle.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,6 @@
$string['department'] = 'Department';
$string['desc'] = 'Descending';
$string['description'] = 'Description';
$string['descriptiona'] = 'Description: {$a}';
$string['deselectall'] = 'Deselect all';
$string['deselectnos'] = 'Deselect all \'No\'';
$string['details'] = 'Details';
Expand Down Expand Up @@ -2324,3 +2323,6 @@
$string['msnid'] = 'MSN ID';
$string['coursepreferences'] = 'Course preferences';
$string['registrationno'] = 'No, I do not wish to receive any emails';

// Deprecated since Moodle 4.0.
$string['descriptiona'] = 'Description: {$a}';

0 comments on commit 36d5b91

Please sign in to comment.