function cms_print_preview($pagedata, $course) { notify(get_string('onlypreview', 'cms')); echo '<table id="layout-table" cellspacing="0">'; echo '<tr><td style="width: 210px;" id="left-column"> </td><td id="middle-column">'; print_simple_box_start('center', '100%', '', 5, 'sitetopic'); echo cms_render($pagedata, $course); print_simple_box_end(); echo '</td>'; if ($pagedata->showblocks) { echo '<td style="width: 210px;" id="right-column"> </td>'; } echo '</tr></table>'; }
$preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), BLOCK_R_MAX_WIDTH); $editing = $PAGE->user_is_editing(); echo '<table id="layout-table" cellspacing="0">' . "\n"; echo '<tr>' . "\n"; if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) { echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">'; blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); echo '</td>' . "\n"; } echo '<td id="middle-column">'; print_simple_box_start('center', '100%', '', 5, 'sitetopic'); if (!empty($pagedata->requirelogin) && (has_capability('moodle/legacy:guest', $context, $USER->id) && !$pagedata->allowguest)) { print_string('pageviewdenied', 'cms'); } else { print cms_actions($pagedata, $course, $context); print cms_render($pagedata, $course, $sections); if (!empty($pagedata->printdate)) { print '<p style="font-size: x-small;">' . get_string('lastmodified', 'cms', userdate($pagedata->modified)) . '</p>'; } if ($editing) { $stradmin = get_string('admin'); print "<p style=\"font-size: x-small;\"><a href=\"{$CFG->wwwroot}/cms"; print "/index.php?course={$courseid}&sesskey={$USER->sesskey}\">{$stradmin}</a></p>\n"; } } print_simple_box_end(); echo '</td>' . "\n"; // The right column $showblocks = $pagedata->showblocks && (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) ? 1 : 0; if (has_capability('moodle/legacy:editingteacher', $context, $USER->id)) { $showblocks = true;