Diferencia entre revisiones de «Diseño de bloque»

De MoodleDocs
m (tidy up)
m (tidy up)
Línea 1: Línea 1:
{{chafa}}
{{Bloques}}
{{Bloques}}
==Default block layout for new courses==
==Diseño de bloques por defecto para cursos nuevos==


To amend the default block layout for new courses, one or more of the following lines (omitting the forward slashes) from ''config-dist.php'' may be added to ''[[config.php]]'', amending the block names as required.
To amend the default block layout for new courses, one or more of the following lines (omitting the forward slashes) from ''config-dist.php'' may be added to ''[[config.php]]'', amending the block names as required.
Línea 23: Línea 24:
Note how the colon is used to separate those blocks appearing on the left, from those appearing on the right.
Note how the colon is used to separate those blocks appearing on the left, from those appearing on the right.


==Resetting the block layout for existing courses==
==Reiniciando el diseño de bloque para cursos existentes==


The block layout for existing courses may be reset by copying the following script into a text file, saving it as ''resetblocks.php'', copying it into the Moodle root directory, then visiting <code><nowiki>http://yourmoodlesite.org/resetblocks.php</nowiki></code>.  
The block layout for existing courses may be reset by copying the following script into a text file, saving it as ''resetblocks.php'', copying it into the Moodle root directory, then visiting <code><nowiki>http://yourmoodlesite.org/resetblocks.php</nowiki></code>.  


'''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.php 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''.
'''Advertencia''': 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.php 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
  <?php

Revisión del 19:09 24 feb 2013

Nota: Pendiente de ACTUALIZAR esta traducción respecto a la página original en inglés (ver enlace hacia English en el cuadro abajo a la derecha).     (otras páginas pendientes)

Diseño de bloques por defecto para cursos nuevos

To amend the default block layout for new courses, one or more of the following lines (omitting the forward slashes) from config-dist.php may be added to config.php, amending the block names as required.

// 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';

For example, to set the default block layout for topics format courses to People, Tags and Administration on the left, and Messages, Online users and Recent activity on the right, simply add the following line to your config.php file:

$CFG->defaultblocks_topics =  'participants,tags,admin:messages,online_users,recent_activity';

Note how the colon is used to separate those blocks appearing on the left, from those appearing on the right.

Reiniciando el diseño de bloque para cursos existentes

The block layout for existing courses may be reset by copying the following script into a text file, saving it as resetblocks.php, copying it into the Moodle root directory, then visiting http://yourmoodlesite.org/resetblocks.php.

Advertencia: 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.php 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
//moodle 2.x
require_once('config.php');
require_once($CFG->libdir.'/blocklib.php');
$courses = get_courses();//can be feed categoryid to just effect one category
foreach($courses as $course) {
   $context = get_context_instance(CONTEXT_COURSE,$course->id);
   blocks_delete_all_for_context($context->id);
   blocks_add_default_course_blocks($course);
} 
?>

Vea también

Using Moodle Default Block Layout for moodle 1.9 forum discussion