Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MDL-35587' of git://github.com/rlorenzo/moodle

  • Loading branch information...
commit 832e5f59572b11d4acb69840af22bbdae0809ef8 2 parents cbc15c7 + bc3f5bc
@nebgor nebgor authored
Showing with 24 additions and 0 deletions.
  1. +18 −0 course/dndupload.js
  2. +6 −0 course/dnduploadlib.php
View
18 course/dndupload.js
@@ -445,6 +445,7 @@ M.course_dndupload = {
a: document.createElement('a'),
icon: document.createElement('img'),
namespan: document.createElement('span'),
+ groupingspan: document.createElement('span'),
progressouter: document.createElement('span'),
progress: document.createElement('span')
};
@@ -469,6 +470,9 @@ M.course_dndupload = {
resel.div.appendChild(document.createTextNode(' '));
+ resel.groupingspan.className = 'groupinglabel';
+ resel.div.appendChild(resel.groupingspan);
+
resel.progressouter.className = 'dndupload-progress-outer';
resel.progress.className = 'dndupload-progress-inner';
resel.progress.innerHTML = ' ';
@@ -724,6 +728,13 @@ M.course_dndupload = {
resel.icon.src = result.icon;
resel.a.href = result.link;
resel.namespan.innerHTML = result.name;
+
+ if (result.groupingname) {
+ resel.groupingspan.innerHTML = '(' + result.groupingname + ')';
+ } else {
+ resel.div.removeChild(resel.groupingspan);
+ }
+
resel.div.removeChild(resel.progressouter);
resel.li.id = result.elementid;
resel.div.innerHTML += result.commands;
@@ -904,6 +915,13 @@ M.course_dndupload = {
resel.icon.src = result.icon;
resel.a.href = result.link;
resel.namespan.innerHTML = result.name;
+
+ if (result.groupingname) {
+ resel.groupingspan.innerHTML = '(' + result.groupingname + ')';
+ } else {
+ resel.div.removeChild(resel.groupingspan);
+ }
+
resel.div.removeChild(resel.progressouter);
resel.li.id = result.elementid;
resel.div.innerHTML += result.commands;
View
6 course/dnduploadlib.php
@@ -667,6 +667,12 @@ protected function send_response($mod) {
$resp->commands = make_editing_buttons($mod, true, true, 0, $mod->sectionnum);
$resp->onclick = $mod->get_on_click();
+ // if using groupings, then display grouping name
+ if (!empty($mod->groupingid) && has_capability('moodle/course:managegroups', $this->context)) {
+ $groupings = groups_get_all_groupings($this->course->id);
+ $resp->groupingname = format_string($groupings[$mod->groupingid]->name);
+ }
+
echo $OUTPUT->header();
echo json_encode($resp);
die();
Please sign in to comment.
Something went wrong with that request. Please try again.