Ejemplo n.º 1
0
    admin_get_root(true, false);
    // settings not required - only pages
}
if (!empty($show) && confirm_sesskey()) {
    if (!($block = $DB->get_record('block', array('id' => $show)))) {
        print_error('blockdoesnotexist', 'error');
    }
    $DB->set_field('block', 'visible', '1', array('id' => $block->id));
    // Show block
    add_to_config_log('block_visibility', $block->visible, '1', $block->name);
    core_plugin_manager::reset_caches();
    admin_get_root(true, false);
    // settings not required - only pages
}
if (!empty($protect) && confirm_sesskey()) {
    block_manager::protect_block((int) $protect);
    admin_get_root(true, false);
    // settings not required - only pages
}
if (!empty($unprotect) && confirm_sesskey()) {
    block_manager::unprotect_block((int) $unprotect);
    admin_get_root(true, false);
    // settings not required - only pages
}
$undeletableblocktypes = block_manager::get_undeletable_block_types();
echo $OUTPUT->header();
echo $OUTPUT->heading($strmanageblocks);
/// Main display starts here
/// Get and sort the existing blocks
if (!($blocks = $DB->get_records('block', array(), 'name ASC'))) {
    print_error('noblocks', 'error');