From c598d270dea7ecf2fa4046f9b6ac3c38770a1fa3 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 27 Apr 2004 09:30:44 +0000 Subject: [PATCH] The "Add" block is now called "Blocks" ... other block admin stuff can go in this block later. --- course/format/social/format.php | 2 +- course/format/topics/format.php | 2 +- course/format/weeks/format.php | 2 +- lang/en/moodle.php | 1 + lib/blocklib.php | 20 +++++++++++--------- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/course/format/social/format.php b/course/format/social/format.php index 4cf2474320..47d8dce411 100644 --- a/course/format/social/format.php +++ b/course/format/social/format.php @@ -56,7 +56,7 @@ if(block_have_active($rightblocks) || $editing) { echo ''; if ($editing && !empty($missingblocks)) { - block_print_add_block($course->id, $missingblocks); + block_print_blocks_admin($course->id, $missingblocks); } print_course_blocks($course, $rightblocks, BLOCK_RIGHT); print_spacer(1, 120, true); diff --git a/course/format/topics/format.php b/course/format/topics/format.php index 29b83a25e4..12b303f77c 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -276,7 +276,7 @@ if(block_have_active($rightblocks) || $editing) { echo ''; if ($editing && !empty($missingblocks)) { - block_print_add_block($course->id, $missingblocks); + block_print_blocks_admin($course->id, $missingblocks); } print_course_blocks($course, $rightblocks, BLOCK_RIGHT); print_spacer(1, 120, true); diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index 921b8ea84a..2ddec0a01a 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -261,7 +261,7 @@ if(block_have_active($rightblocks) || $editing) { echo ''; if ($editing && !empty($missingblocks)) { - block_print_add_block($course->id, $missingblocks); + block_print_blocks_admin($course->id, $missingblocks); } print_course_blocks($course, $rightblocks, BLOCK_RIGHT); print_spacer(1, 120, true); diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 63c9f24641..7c2e874edb 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -100,6 +100,7 @@ $string['backupsavetohelp'] = 'Full path to the directory where you want to save $string['backupuserfileshelp'] = 'Choose whether user files (eg profile images) should be included in automated backups'; $string['backupusershelp'] = 'Select whether you want to include all the users in the server or only the needed users for each course'; $string['backupversion'] = 'Backup Version'; +$string['blocks'] = 'Blocks'; $string['blocksetup'] = 'Setting up block tables'; $string['blocksuccess'] = '$a tables have been set up correctly'; $string['bycourseorder'] = 'By course order'; diff --git a/lib/blocklib.php b/lib/blocklib.php index 7453f1ba66..29f1c54c89 100644 --- a/lib/blocklib.php +++ b/lib/blocklib.php @@ -312,23 +312,25 @@ function block_find($blockid, $leftblocks, $rightblocks) { return false; } -//This function prints the add_block popup as necessary -function block_print_add_block($courseid, $missingblocks) { +//This function prints the block to admin blocks as necessary +function block_print_blocks_admin($courseid, $missingblocks) { if (isediting($courseid)) { - $title = get_string('add'); - if(!empty($missingblocks)) { + $strblocks = get_string('blocks'); + $stradd = get_string('add'); + if (!empty($missingblocks)) { $blockdata = get_records_list('blocks', 'id', implode(',', $missingblocks)); - if($blockdata !== false) { - foreach($blockdata as $block) { + if ($blockdata !== false) { + foreach ($blockdata as $block) { $blockobject = block_instance($block->name, NULL); - if($blockobject === false) { + if ($blockobject === false) { continue; } $menu[$block->id] = $blockobject->get_title(); } - $content = popup_form('view.php?id='.$courseid.'&blockaction=add&blockid=',$menu,'add_block','','choose','','',true); + $content = popup_form('view.php?id='.$courseid.'&blockaction=add&blockid=', + $menu, 'add_block', '', "$stradd...", '', '', true); $content = '
'.$content.'
'; - print_side_block($title, $content, NULL, NULL, NULL); + print_side_block($strblocks, $content, NULL, NULL, NULL); } } } -- 2.39.5