Layout von Blöcken
Diese Seite ist noch nicht vollständig übersetzt.
Siehe en:Block layout
Voreingestellte Blockauswahl bei neuen Kursen
Feste_Blöcke können ab Moodle 1.6 verwendet werden.
Als Alternative zu festen Blöcken, verwenden Sie die nachfolgenden Code-Zeilen in Ihrer config.php. Verwenden Sie dabei die Zeilen, die für Ihr Vorhaben geeignet sind und entfernen Sie dazu die jeweiligen Kommentarzeichen. Fügen Sie ggfl. die Namen weiterer gewünschter Blöcke hinzu.
Beachten Sie bitte den Doppelpunkt als Abtrennung von linksseitig platzierten Blöcken zu rechtsseitig platzierten.
// These variables define DEFAULT block variables for new courses // If this one is set it overrides all others and is the only one used. // $CFG->defaultblocks_override = 'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity'; // // These variables define the specific settings for defined course formats. // They override any settings defined in the formats own config file. // $CFG->defaultblocks_site = 'site_main_menu,admin,course_list:course_summary,calendar_month'; // $CFG->defaultblocks_social = 'participants,search_forums,calendar_month,calendar_upcoming,social_activities,recent_activity,admin,course_list'; // $CFG->defaultblocks_topics = 'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity'; // $CFG->defaultblocks_weeks = 'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity'; // These blocks are used when no other default setting is found.
// $CFG->defaultblocks = 'participants,activity_modules,search_forums,admin,course_list:news_items,calendar_upcoming,recent_activity';
(Code aus config-dist.php kopiert)
Das Block-Layout vor bestehende Kurse zurücksetzen
Kopieren Sie dazu den folgenden Code in eine Textdatei, die Sie bspw. als resetblocks.php speichern und in das Moodle-Wurzelverzeichnis kopieren. Rufen Sie diese danach mittels http://yourmoodlesite.org/resetblocks.php
in Ihrem Browser auf.
Warning: This script may change the layout of your course pages and also remove blocks from those pages if they have not been specified in the config.php line. Check which of your courses has blocks which are not in the config.pho line and be prepared to spend time adding blocks to your course pages again. Please note that a database backup is recommended before using the script.
<?php require_once('config.php'); require_once($CFG->libdir.'/blocklib.php'); $courses = get_records('course'); foreach($courses as $course) { $page = page_create_object(PAGE_COURSE_VIEW, $course->id); blocks_repopulate_page($page); } print_heading('Done!'); ?>
See also
Using Moodle Default Block Layout for moodle 1.9 forum discussion