mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Pass the whole $course variable to block_print_blocks_admin()
so we have more information.
This commit is contained in:
parent
a2ebe6a55c
commit
6236ed990d
5 changed files with 8 additions and 8 deletions
|
@ -57,7 +57,7 @@
|
||||||
echo '<td style="vertical-align: top; width: '.$preferred_width_right.'px;">';
|
echo '<td style="vertical-align: top; width: '.$preferred_width_right.'px;">';
|
||||||
print_course_blocks($course, $rightblocks, BLOCK_RIGHT);
|
print_course_blocks($course, $rightblocks, BLOCK_RIGHT);
|
||||||
if ($editing && !empty($missingblocks)) {
|
if ($editing && !empty($missingblocks)) {
|
||||||
block_print_blocks_admin($course->id, $missingblocks);
|
block_print_blocks_admin($course, $missingblocks);
|
||||||
}
|
}
|
||||||
print_spacer(1, 120, true);
|
print_spacer(1, 120, true);
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
|
|
|
@ -281,7 +281,7 @@
|
||||||
echo '<td style="vertical-align: top; width: '.$preferred_width_right.'px;">';
|
echo '<td style="vertical-align: top; width: '.$preferred_width_right.'px;">';
|
||||||
print_course_blocks($course, $rightblocks, BLOCK_RIGHT);
|
print_course_blocks($course, $rightblocks, BLOCK_RIGHT);
|
||||||
if ($editing && !empty($missingblocks)) {
|
if ($editing && !empty($missingblocks)) {
|
||||||
block_print_blocks_admin($course->id, $missingblocks);
|
block_print_blocks_admin($course, $missingblocks);
|
||||||
}
|
}
|
||||||
print_spacer(1, 120, true);
|
print_spacer(1, 120, true);
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
|
|
|
@ -267,7 +267,7 @@
|
||||||
echo '<td style="vertical-align: top; width: '.$preferred_width_right.'px;">';
|
echo '<td style="vertical-align: top; width: '.$preferred_width_right.'px;">';
|
||||||
print_course_blocks($course, $rightblocks, BLOCK_RIGHT);
|
print_course_blocks($course, $rightblocks, BLOCK_RIGHT);
|
||||||
if ($editing && !empty($missingblocks)) {
|
if ($editing && !empty($missingblocks)) {
|
||||||
block_print_blocks_admin($course->id, $missingblocks);
|
block_print_blocks_admin($course, $missingblocks);
|
||||||
}
|
}
|
||||||
print_spacer(1, 120, true);
|
print_spacer(1, 120, true);
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
|
|
|
@ -216,7 +216,7 @@
|
||||||
}
|
}
|
||||||
print_course_blocks($site, $rightblocks, BLOCK_RIGHT);
|
print_course_blocks($site, $rightblocks, BLOCK_RIGHT);
|
||||||
if ($editing && !empty($missingblocks)) {
|
if ($editing && !empty($missingblocks)) {
|
||||||
block_print_blocks_admin($site->id, $missingblocks);
|
block_print_blocks_admin($site, $missingblocks);
|
||||||
}
|
}
|
||||||
echo '</td>';
|
echo '</td>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -355,8 +355,8 @@ function block_find($blockid, $leftblocks, $rightblocks) {
|
||||||
}
|
}
|
||||||
|
|
||||||
//This function prints the block to admin blocks as necessary
|
//This function prints the block to admin blocks as necessary
|
||||||
function block_print_blocks_admin($courseid, $missingblocks) {
|
function block_print_blocks_admin($course, $missingblocks) {
|
||||||
if (isediting($courseid)) {
|
if (isediting($course->id)) {
|
||||||
$strblocks = get_string('blocks');
|
$strblocks = get_string('blocks');
|
||||||
$stradd = get_string('add');
|
$stradd = get_string('add');
|
||||||
if (!empty($missingblocks)) {
|
if (!empty($missingblocks)) {
|
||||||
|
@ -370,13 +370,13 @@ function block_print_blocks_admin($courseid, $missingblocks) {
|
||||||
$menu[$block->id] = $blockobject->get_title();
|
$menu[$block->id] = $blockobject->get_title();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($courseid == 1) {
|
if($course->id == 1) {
|
||||||
$target = 'index.php';
|
$target = 'index.php';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$target = 'view.php';
|
$target = 'view.php';
|
||||||
}
|
}
|
||||||
$content = popup_form($target.'?id='.$courseid.'&blockaction=add&blockid=',
|
$content = popup_form($target.'?id='.$course->id.'&blockaction=add&blockid=',
|
||||||
$menu, 'add_block', '', "$stradd...", '', '', true);
|
$menu, 'add_block', '', "$stradd...", '', '', true);
|
||||||
$content = '<div align="center">'.$content.'</div>';
|
$content = '<div align="center">'.$content.'</div>';
|
||||||
print_side_block($strblocks, $content, NULL, NULL, NULL);
|
print_side_block($strblocks, $content, NULL, NULL, NULL);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue