Merge branch 'MDL-39661-master' of git://github.com/FMCorz/moodle

This commit is contained in:
Dan Poltawski 2014-01-13 08:54:22 +08:00
commit f6652bc750
3 changed files with 13 additions and 3 deletions

View file

@ -50,6 +50,7 @@ $string['hidepanel'] = 'Hide panel';
$string['moveblock'] = 'Move {$a} block';
$string['moveblockafter'] = 'Move block to after {$a} block';
$string['moveblockbefore'] = 'Move block to before {$a} block';
$string['moveblockinregion'] = 'Move block to {$a} region';
$string['movingthisblockcancel'] = 'Moving this block ({$a})';
$string['onthispage'] = 'On this page';
$string['pagetypes'] = 'Page types';

View file

@ -1413,7 +1413,7 @@ class core_renderer extends renderer_base {
$output .= $this->block($bc, $region);
$lastblock = $bc->title;
} else if ($bc instanceof block_move_target) {
$output .= $this->block_move_target($bc, $zones, $lastblock);
$output .= $this->block_move_target($bc, $zones, $lastblock, $region);
} else {
throw new coding_exception('Unexpected type of thing (' . get_class($bc) . ') found in list of block contents.');
}
@ -1427,11 +1427,18 @@ class core_renderer extends renderer_base {
* @param block_move_target $target with the necessary details.
* @param array $zones array of areas where the block can be moved to
* @param string $previous the block located before the area currently being rendered.
* @param string $region the name of the region
* @return string the HTML to be output.
*/
public function block_move_target($target, $zones, $previous) {
public function block_move_target($target, $zones, $previous, $region) {
if ($previous == null) {
$position = get_string('moveblockbefore', 'block', $zones[0]);
if (empty($zones)) {
// There are no zones, probably because there are no blocks.
$regions = $this->page->theme->get_all_block_regions();
$position = get_string('moveblockinregion', 'block', $regions[$region]);
} else {
$position = get_string('moveblockbefore', 'block', $zones[0]);
}
} else {
$position = get_string('moveblockafter', 'block', $previous);
}

View file

@ -3,6 +3,8 @@ information provided here is intended especially for developers.
=== 2.7 ===
* $core_renderer->block_move_target() changed to support more verbose move-block-here descriptions.
DEPRECATIONS:
* Abstract class \core\event\course_module_instances_list_viewed is deprecated now, use \core\event\instances_list_viewed instead.
* mod_book\event\instances_list_viewed has been deprecated. Please use mod_book\event\course_module_instance_list_viewed instead.