This commit is contained in:
Eloy Lafuente (stronk7) 2016-10-11 20:24:13 +02:00
commit c405d31bef
3 changed files with 5 additions and 5 deletions

View File

@ -381,7 +381,7 @@ class cc2moodle {
if (!empty($format['defaultblocks'])) {
$blocknames = $format['defaultblocks'];
} else {
if (!empty($CFG->defaultblocks)) {
if (isset($CFG->defaultblocks)) {
$blocknames = $CFG->defaultblocks;
} else {
$blocknames = 'participants,activity_modules,search_forums,course_list:news_items,calendar_upcoming,recent_activity';

View File

@ -477,7 +477,7 @@ abstract class format_base {
*/
public function get_default_blocks() {
global $CFG;
if (!empty($CFG->defaultblocks)){
if (isset($CFG->defaultblocks)) {
return blocks_parse_default_blocks_list($CFG->defaultblocks);
}
$blocknames = array(

View File

@ -2221,7 +2221,7 @@ function blocks_parse_default_blocks_list($blocksstr) {
function blocks_get_default_site_course_blocks() {
global $CFG;
if (!empty($CFG->defaultblocks_site)) {
if (isset($CFG->defaultblocks_site)) {
return blocks_parse_default_blocks_list($CFG->defaultblocks_site);
} else {
return array(
@ -2239,13 +2239,13 @@ function blocks_get_default_site_course_blocks() {
function blocks_add_default_course_blocks($course) {
global $CFG;
if (!empty($CFG->defaultblocks_override)) {
if (isset($CFG->defaultblocks_override)) {
$blocknames = blocks_parse_default_blocks_list($CFG->defaultblocks_override);
} else if ($course->id == SITEID) {
$blocknames = blocks_get_default_site_course_blocks();
} else if (!empty($CFG->{'defaultblocks_' . $course->format})) {
} else if (isset($CFG->{'defaultblocks_' . $course->format})) {
$blocknames = blocks_parse_default_blocks_list($CFG->{'defaultblocks_' . $course->format});
} else {