The "Add" block is now called "Blocks" ... other block admin stuff can
go in this block later.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
@@ -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 = '<div align="center">'.$content.'</div>';
|
||||
print_side_block($title, $content, NULL, NULL, NULL);
|
||||
print_side_block($strblocks, $content, NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user