The "Add" block is now called "Blocks" ... other block admin stuff can

go in this block later.
This commit is contained in:
moodler
2004-04-27 09:30:44 +00:00
parent 5bb18f6835
commit c598d270de
5 changed files with 15 additions and 12 deletions
+1 -1
View File
@@ -56,7 +56,7 @@
if(block_have_active($rightblocks) || $editing) {
echo '<td style="vertical-align: top; width: '.$preferred_width_right.'px;">';
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);
+1 -1
View File
@@ -276,7 +276,7 @@
if(block_have_active($rightblocks) || $editing) {
echo '<td style="vertical-align: top; width: '.$preferred_width_right.'px;">';
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);
+1 -1
View File
@@ -261,7 +261,7 @@
if(block_have_active($rightblocks) || $editing) {
echo '<td style="vertical-align: top; width: '.$preferred_width_right.'px;">';
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);
+1
View File
@@ -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';
+11 -9
View File
@@ -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.'&amp;blockaction=add&amp;blockid=',$menu,'add_block','','choose','','',true);
$content = popup_form('view.php?id='.$courseid.'&amp;blockaction=add&amp;blockid=',
$menu, 'add_block', '', "$stradd...", '', '', true);
$content = '<div align="center">'.$content.'</div>';
print_side_block($title, $content, NULL, NULL, NULL);
print_side_block($strblocks, $content, NULL, NULL, NULL);
}
}
}