Merge branch 'MDL-32652_master' of git://github.com/pauln/moodle
authorDan Poltawski <dan@moodle.com>
Mon, 4 Feb 2013 03:29:22 +0000 (11:29 +0800)
committerDan Poltawski <dan@moodle.com>
Mon, 4 Feb 2013 03:29:22 +0000 (11:29 +0800)
1  2 
course/lib.php

diff --combined course/lib.php
@@@ -356,7 -356,7 +356,7 @@@ function print_log($course, $user=0, $d
      echo $OUTPUT->paging_bar($totalcount, $page, $perpage, "$url&perpage=$perpage");
  
      $table = new html_table();
 -    $table->classes = array('logtable','generalbox');
 +    $table->classes = array('logtable','generaltable');
      $table->align = array('right', 'left', 'left');
      $table->head = array(
          get_string('time'),
@@@ -1144,8 -1144,7 +1144,8 @@@ function get_module_metadata($course, $
          // NOTE: this is legacy stuff, module subtypes are very strongly discouraged!!
          $gettypesfunc =  $modname.'_get_types';
          if (function_exists($gettypesfunc)) {
 -            if ($types = $gettypesfunc()) {
 +            $types = $gettypesfunc();
 +            if (is_array($types) && count($types) > 0) {
                  $group = new stdClass();
                  $group->name = $modname;
                  $group->icon = $OUTPUT->pix_icon('icon', '', $modname, array('class' => 'icon'));
              $module->archetype = plugin_supports('mod', $modname, FEATURE_MOD_ARCHETYPE, MOD_ARCHETYPE_OTHER);
              $modlist[$course->id][$modname] = $module;
          }
 -        $return[$modname] = $modlist[$course->id][$modname];
 +        if (isset($modlist[$course->id][$modname])) {
 +            $return[$modname] = $modlist[$course->id][$modname];
 +        } else {
 +            debugging("Invalid module metadata configuration for {$modname}");
 +        }
      }
  
      return $return;
@@@ -3837,16 -3832,6 +3837,6 @@@ function include_course_ajax($course, $
              )), null, true);
      }
  
-     // Include blocks dragdrop
-     $params = array(
-         'courseid' => $course->id,
-         'pagetype' => $PAGE->pagetype,
-         'pagelayout' => $PAGE->pagelayout,
-         'subpage' => $PAGE->subpage,
-         'regions' => $PAGE->blocks->get_regions(),
-     );
-     $PAGE->requires->yui_module('moodle-core-blocks', 'M.core_blocks.init_dragdrop', array($params), null, true);
      // Require various strings for the command toolbox
      $PAGE->requires->strings_for_js(array(
              'moveleft',