echo '</div>';
}
- print_simple_box_end();
-
if (optional_param('dbmigrate')) { // ??? Is this actually used?
print_simple_box_start('center','60%');
-?>
\ No newline at end of file
+?>
define('PAGE_ADMIN', 'admin');
+define('BLOCK_L_MIN_WIDTH',160);
+define('BLOCK_L_MAX_WIDTH',210);
+define('BLOCK_R_MIN_WIDTH',160);
+define('BLOCK_R_MAX_WIDTH',210);
+
page_map_class(PAGE_ADMIN, 'page_admin');
class page_admin extends page_base {
}
function blocks_get_positions() {
- return array(BLOCK_POS_LEFT);
+ return array(BLOCK_POS_LEFT, BLOCK_POS_RIGHT);
}
function blocks_default_position() {
return BLOCK_POS_LEFT;
}
+ function blocks_move_position(&$instance, $move) {
+ if($instance->position == BLOCK_POS_LEFT && $move == BLOCK_MOVE_RIGHT) {
+ return BLOCK_POS_RIGHT;
+ } else if ($instance->position == BLOCK_POS_RIGHT && $move == BLOCK_MOVE_LEFT) {
+ return BLOCK_POS_LEFT;
+ }
+ return $instance->position;
+ }
+
// does anything need to be done here?
function init_quick($data) {
parent::init_quick($data);
$buttons = ' ';
}
- print_header("$SITE->shortname: " . implode(": ",$this->visiblepathtosection), $SITE->fullname, implode(" -> ",$this->visiblepathtosection),'', '', true, $buttons, '');
+ print_header("$SITE->shortname: " . implode(": ",$this->visiblepathtosection), $SITE->fullname,
+ implode(" -> ",$this->visiblepathtosection),'', '', true, $buttons, '');
}
function get_type() {
}
}
-?>
\ No newline at end of file
+?>
require_login();
}
-define('BLOCK_L_MIN_WIDTH',160);
-define('BLOCK_L_MAX_WIDTH',210);
page_map_class(PAGE_ADMIN, 'page_admin');
// ---------------------------------------------------------------------------------------------------------------
-$pageblocks = blocks_setup($PAGE);
-$preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), BLOCK_L_MAX_WIDTH);
+if (!empty($SITE->fullname)) {
+ $pageblocks = blocks_setup($PAGE);
+
+ $preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),
+ BLOCK_L_MAX_WIDTH);
+ $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
+ BLOCK_R_MAX_WIDTH);
+
+ // print header stuff
+ $PAGE->print_header();
+
+ echo '<table id="layout-table"><tr>';
+ echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
+ blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
+ echo '</td>';
+ echo '<td id="middle-column" width="*">';
+} else {
+
+ print_header();
+ print_simple_box(get_string('configintrosite', 'admin'), 'center', '50%');
+
+}
-// print header stuff
-$PAGE->print_header();
-echo '<table id="layout-table"><tr>';
-echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
-blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
-echo '</td>';
-echo '<td id="middle-column" width="*">';
echo '<form action="settings.php" method="post" name="mainform">';
echo '<input type="hidden" name="section" value="' . $PAGE->section . '" />';
echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
echo '<center><input type="submit" value="' . get_string('savechanges','admin') . '" /></center>';
print_simple_box_end();
echo '</form>';
-echo '</td></tr></table>';
+
+if (!empty($SITE->fullname)) {
+ echo '</td>';
+ echo '<td style="width: ' . $preferred_width_right . 'px;" id="right-column">';
+ blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
+ echo '</td></tr></table>';
+}
print_footer();
function admin_externalpage_print_header($adminroot) {
- global $CFG, $PAGE;
+ global $CFG, $PAGE, $SITE;
- $pageblocks = blocks_setup($PAGE);
+ if (!empty($SITE->fullname)) {
+ $pageblocks = blocks_setup($PAGE);
- $preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), BLOCK_L_MAX_WIDTH);
-
- $PAGE->print_header();
- echo '<table id="layout-table"><tr>';
- echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
- blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
- echo '</td>';
- echo '<td id="middle-column" width="*">';
+ $preferred_width_left = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),
+ BLOCK_L_MAX_WIDTH);
+
+ $PAGE->print_header();
+ echo '<table id="layout-table"><tr>';
+ echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
+ blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
+ echo '</td>';
+ echo '<td id="middle-column" width="*">';
+ } else {
+ print_header();
+ }
}
function admin_externalpage_print_footer($adminroot) {
- echo '</td></tr></table>';
+ global $CFG, $PAGE, $SITE;
+
+ if (!empty($SITE->fullname)) {
+ $pageblocks = blocks_setup($PAGE);
+ $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
+ BLOCK_R_MAX_WIDTH);
+ echo '</td>';
+ echo '<td style="width: ' . $preferred_width_right . 'px;" id="right-column">';
+ blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
+ echo '</td></tr></table>';
+ }
+
print_footer();
-
}
function admin_get_root() {