Skip to content

Commit

Permalink
Merge branch 'MDL-65448-master' of git://github.com/lucaboesch/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Oct 19, 2020
2 parents 149fdcf + 531ce52 commit 0f04928
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 25 deletions.
10 changes: 5 additions & 5 deletions blocks/site_main_menu/block_site_main_menu.php
Expand Up @@ -88,7 +88,6 @@ function get_content() {
$section = $modinfo->get_section_info(0);

if ($ismoving) {
$strmovehere = get_string('movehere');
$strmovefull = strip_tags(get_string('movefull', '', "'$USER->activitycopyname'"));
$strcancel= get_string('cancel');
} else {
Expand Down Expand Up @@ -128,8 +127,9 @@ function get_content() {
if ($mod->id == $USER->activitycopy) {
continue;
}
$this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?moveto='.$mod->id.'&amp;sesskey='.sesskey().'">'.
'<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->image_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
$movingurl = new moodle_url('/course/mod.php', array('moveto' => $mod->id, 'sesskey' => sesskey()));
$this->content->items[] = html_writer::link($movingurl, '', array('title' => $strmovefull,
'class' => 'movehere'));
$this->content->icons[] = '';
}
if ($mod->indent > 0) {
Expand All @@ -148,8 +148,8 @@ function get_content() {
}

if ($ismoving) {
$this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?movetosection='.$section->id.'&amp;sesskey='.sesskey().'">'.
'<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->image_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
$movingurl = new moodle_url('/course/mod.php', array('movetosection' => $section->id, 'sesskey' => sesskey()));
$this->content->items[] = html_writer::link($movingurl, '', array('title' => $strmovefull, 'class' => 'movehere'));
$this->content->icons[] = '';
}

Expand Down
13 changes: 7 additions & 6 deletions blocks/social_activities/block_social_activities.php
Expand Up @@ -83,7 +83,6 @@ function get_content() {
$section = $modinfo->get_section_info(0);

if ($ismoving) {
$strmovehere = get_string('movehere');
$strmovefull = strip_tags(get_string('movefull', '', "'$USER->activitycopyname'"));
$strcancel= get_string('cancel');
} else {
Expand All @@ -92,7 +91,8 @@ function get_content() {

if ($ismoving) {
$this->content->icons[] = '&nbsp;' . $OUTPUT->pix_icon('t/move', get_string('move'));
$this->content->items[] = $USER->activitycopyname.'&nbsp;(<a href="'.$CFG->wwwroot.'/course/mod.php?cancelcopy=true&amp;sesskey='.sesskey().'">'.$strcancel.'</a>)';
$cancelurl = new moodle_url('/course/mod.php', array('cancelcopy' => 'true', 'sesskey' => sesskey()));
$this->content->items[] = $USER->activitycopyname . '&nbsp;(<a href="' . $cancelurl . '">' . $strcancel . '</a>)';
}

if (!empty($modinfo->sections[0])) {
Expand Down Expand Up @@ -123,8 +123,9 @@ function get_content() {
if ($mod->id == $USER->activitycopy) {
continue;
}
$this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?moveto='.$mod->id.'&amp;sesskey='.sesskey().'">'.
'<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->image_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
$movingurl = new moodle_url('/course/mod.php', array('moveto' => $mod->id, 'sesskey' => sesskey()));
$this->content->items[] = html_writer::link($movingurl, '', array('title' => $strmovefull,
'class' => 'movehere'));
$this->content->icons[] = '';
}
if (!$mod->url) {
Expand All @@ -140,8 +141,8 @@ function get_content() {
}

if ($ismoving) {
$this->content->items[] = '<a title="'.$strmovefull.'" href="'.$CFG->wwwroot.'/course/mod.php?movetosection='.$section->id.'&amp;sesskey='.sesskey().'">'.
'<img style="height:16px; width:80px; border:0px" src="'.$OUTPUT->image_url('movehere') . '" alt="'.$strmovehere.'" /></a>';
$movingurl = new moodle_url('/course/mod.php', array('movetosection' => $section->id, 'sesskey' => sesskey()));
$this->content->items[] = html_writer::link($movingurl, '', array('title' => $strmovefull, 'class' => 'movehere'));
$this->content->icons[] = '';
}

Expand Down
5 changes: 2 additions & 3 deletions course/renderer.php
Expand Up @@ -1004,7 +1004,6 @@ public function course_section_cm_list($course, $section, $sectionreturn = null,
// check if we are currently in the process of moving a module with JavaScript disabled
$ismoving = $this->page->user_is_editing() && ismoving($course->id);
if ($ismoving) {
$movingpix = new pix_icon('movehere', get_string('movehere'), 'moodle', array('class' => 'movetarget'));
$strmovefull = strip_tags(get_string("movefull", "", "'$USER->activitycopyname'"));
}

Expand Down Expand Up @@ -1032,7 +1031,7 @@ public function course_section_cm_list($course, $section, $sectionreturn = null,
if ($ismoving) {
$movingurl = new moodle_url('/course/mod.php', array('moveto' => $modnumber, 'sesskey' => sesskey()));
$sectionoutput .= html_writer::tag('li',
html_writer::link($movingurl, $this->output->render($movingpix), array('title' => $strmovefull)),
html_writer::link($movingurl, '', array('title' => $strmovefull, 'class' => 'movehere')),
array('class' => 'movehere'));
}

Expand All @@ -1042,7 +1041,7 @@ public function course_section_cm_list($course, $section, $sectionreturn = null,
if ($ismoving) {
$movingurl = new moodle_url('/course/mod.php', array('movetosection' => $section->id, 'sesskey' => sesskey()));
$sectionoutput .= html_writer::tag('li',
html_writer::link($movingurl, $this->output->render($movingpix), array('title' => $strmovefull)),
html_writer::link($movingurl, '', array('title' => $strmovefull, 'class' => 'movehere')),
array('class' => 'movehere'));
}
}
Expand Down
4 changes: 1 addition & 3 deletions grade/edit/tree/lib.php
Expand Up @@ -233,7 +233,6 @@ public function build_html_tree($element, $totals, $parents, $level, &$row_count
if ($this->moving && $this->moving != $child_eid) {

$strmove = get_string('move');
$strmovehere = get_string('movehere');
$actions = $moveaction = ''; // no action icons when moving

$aurl = new moodle_url('index.php', array('id' => $COURSE->id, 'action' => 'move', 'eid' => $this->moving, 'moveafter' => $child_eid, 'sesskey' => sesskey()));
Expand All @@ -245,8 +244,7 @@ public function build_html_tree($element, $totals, $parents, $level, &$row_count
$cell->colspan = 12;
$cell->attributes['class'] = 'movehere level' . ($level + 1) . ' level' . ($level % 2 ? 'even' : 'odd');

$icon = new pix_icon('movehere', $strmovehere, null, array('class'=>'movetarget'));
$cell->text = $OUTPUT->action_icon($aurl, $icon);
$cell->text = html_writer::link($aurl, '', array('title' => get_string('movehere'), 'class' => 'movehere'));

$moveto = new html_table_row(array($cell));
}
Expand Down
13 changes: 13 additions & 0 deletions theme/boost/scss/moodle/core.scss
Expand Up @@ -219,6 +219,19 @@ div.dropdown-item {
padding: 0;
}

.movehere {
display: block;
width: 100%;
height: 2rem;
border: 2px dashed $gray-800;
margin: 4px 0;
}

.editing .course-content .hidden.sectionname {
visibility: hidden;
display: initial;
}

.inline,
.inline-list li {
display: inline;
Expand Down
11 changes: 11 additions & 0 deletions theme/boost/scss/moodle/grade.scss
Expand Up @@ -276,6 +276,17 @@
padding-left: 24px;
}

td.movehere {
padding: 0;
}

td.movehere a.movehere {
display: block;
width: 100%;
height: 2rem;
border: 2px dashed $gray-800;
}

.category input[type="text"],
.category .column-range,
.categoryitem,
Expand Down
4 changes: 0 additions & 4 deletions theme/boost/scss/moodle/icons.scss
Expand Up @@ -41,10 +41,6 @@ $iconsizes: map-merge((
height: $icon-big-height;
font-size: $icon-big-height;
}

&.movetarget {
width: 80px;
}
}

.navbar-dark a .icon {
Expand Down
22 changes: 20 additions & 2 deletions theme/boost/style/moodle.css
Expand Up @@ -9840,6 +9840,17 @@ div.dropdown-item:focus-within {
margin: 0;
padding: 0; }

.movehere {
display: block;
width: 100%;
height: 2rem;
border: 2px dashed #343a40;
margin: 4px 0; }

.editing .course-content .hidden.sectionname {
visibility: hidden;
display: initial; }

.inline,
.inline-list li {
display: inline; }
Expand Down Expand Up @@ -11874,8 +11885,6 @@ input[disabled] {
width: 64px;
height: 64px;
font-size: 64px; }
.icon.movetarget {
width: 80px; }

.navbar-dark a .icon {
color: rgba(255, 255, 255, 0.5) !important;
Expand Down Expand Up @@ -18351,6 +18360,15 @@ p.arrow_button {
.path-grade-edit-tree .setup-grades td.column-name {
padding-left: 24px; }

.path-grade-edit-tree .setup-grades td.movehere {
padding: 0; }

.path-grade-edit-tree .setup-grades td.movehere a.movehere {
display: block;
width: 100%;
height: 2rem;
border: 2px dashed #343a40; }

.path-grade-edit-tree .setup-grades .category input[type="text"],
.path-grade-edit-tree .setup-grades .category .column-range,
.path-grade-edit-tree .setup-grades .categoryitem,
Expand Down
22 changes: 20 additions & 2 deletions theme/classic/style/moodle.css
Expand Up @@ -10044,6 +10044,17 @@ div.dropdown-item:focus-within {
margin: 0;
padding: 0; }

.movehere {
display: block;
width: 100%;
height: 2rem;
border: 2px dashed #343a40;
margin: 4px 0; }

.editing .course-content .hidden.sectionname {
visibility: hidden;
display: initial; }

.inline,
.inline-list li {
display: inline; }
Expand Down Expand Up @@ -12087,8 +12098,6 @@ input[disabled] {
width: 64px;
height: 64px;
font-size: 64px; }
.icon.movetarget {
width: 80px; }

.navbar-dark a .icon {
color: rgba(255, 255, 255, 0.5) !important;
Expand Down Expand Up @@ -18583,6 +18592,15 @@ p.arrow_button {
.path-grade-edit-tree .setup-grades td.column-name {
padding-left: 24px; }

.path-grade-edit-tree .setup-grades td.movehere {
padding: 0; }

.path-grade-edit-tree .setup-grades td.movehere a.movehere {
display: block;
width: 100%;
height: 2rem;
border: 2px dashed #343a40; }

.path-grade-edit-tree .setup-grades .category input[type="text"],
.path-grade-edit-tree .setup-grades .category .column-range,
.path-grade-edit-tree .setup-grades .categoryitem,
Expand Down

0 comments on commit 0f04928

Please sign in to comment.