Skip to content

Commit

Permalink
Merge branch 'wip-MDL-36967-master' of git://github.com/marinaglancy/…
Browse files Browse the repository at this point in the history
…moodle

Conflicts:
	lib/deprecatedlib.php
  • Loading branch information
Sam Hemelryk committed Jan 15, 2013
2 parents d9b9d22 + ff23385 commit 00ba185
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 48 deletions.
48 changes: 0 additions & 48 deletions course/lib.php
Expand Up @@ -847,54 +847,6 @@ function print_log_ods($course, $user, $date, $order='l.time DESC', $modname,
return true;
}


function print_overview($courses, array $remote_courses=array()) {
global $CFG, $USER, $DB, $OUTPUT;

$htmlarray = array();
if ($modules = $DB->get_records('modules')) {
foreach ($modules as $mod) {
if (file_exists(dirname(dirname(__FILE__)).'/mod/'.$mod->name.'/lib.php')) {
include_once(dirname(dirname(__FILE__)).'/mod/'.$mod->name.'/lib.php');
$fname = $mod->name.'_print_overview';
if (function_exists($fname)) {
$fname($courses,$htmlarray);
}
}
}
}
foreach ($courses as $course) {
$fullname = format_string($course->fullname, true, array('context' => context_course::instance($course->id)));
echo $OUTPUT->box_start('coursebox');
$attributes = array('title' => s($fullname));
if (empty($course->visible)) {
$attributes['class'] = 'dimmed';
}
echo $OUTPUT->heading(html_writer::link(
new moodle_url('/course/view.php', array('id' => $course->id)), $fullname, $attributes), 3);
if (array_key_exists($course->id,$htmlarray)) {
foreach ($htmlarray[$course->id] as $modname => $html) {
echo $html;
}
}
echo $OUTPUT->box_end();
}

if (!empty($remote_courses)) {
echo $OUTPUT->heading(get_string('remotecourses', 'mnet'));
}
foreach ($remote_courses as $course) {
echo $OUTPUT->box_start('coursebox');
$attributes = array('title' => s($course->fullname));
echo $OUTPUT->heading(html_writer::link(
new moodle_url('/auth/mnet/jump.php', array('hostid' => $course->hostid, 'wantsurl' => '/course/view.php?id='.$course->remoteid)),
format_string($course->shortname),
$attributes) . ' (' . format_string($course->hostname) . ')', 3);
echo $OUTPUT->box_end();
}
}


/**
* This function trawls through the logs looking for
* anything new since the user's last login
Expand Down
57 changes: 57 additions & 0 deletions lib/deprecatedlib.php
Expand Up @@ -3215,3 +3215,60 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false,
$courserenderer = $PAGE->get_renderer('core', 'course');
echo $courserenderer->course_section_cm_list($course, $section, $sectionreturn, $displayoptions);
}

/**
* Displays the list of courses with user notes
*
* This function is not used in core. It was replaced by block course_overview
*
* @deprecated since 2.5
*
* @param array $courses
* @param array $remote_courses
*/
function print_overview($courses, array $remote_courses=array()) {
global $CFG, $USER, $DB, $OUTPUT;
debugging('Function print_overview() is deprecated. Use block course_overview to display this information', DEBUG_DEVELOPER);

$htmlarray = array();
if ($modules = $DB->get_records('modules')) {
foreach ($modules as $mod) {
if (file_exists(dirname(dirname(__FILE__)).'/mod/'.$mod->name.'/lib.php')) {
include_once(dirname(dirname(__FILE__)).'/mod/'.$mod->name.'/lib.php');
$fname = $mod->name.'_print_overview';
if (function_exists($fname)) {
$fname($courses,$htmlarray);
}
}
}
}
foreach ($courses as $course) {
$fullname = format_string($course->fullname, true, array('context' => context_course::instance($course->id)));
echo $OUTPUT->box_start('coursebox');
$attributes = array('title' => s($fullname));
if (empty($course->visible)) {
$attributes['class'] = 'dimmed';
}
echo $OUTPUT->heading(html_writer::link(
new moodle_url('/course/view.php', array('id' => $course->id)), $fullname, $attributes), 3);
if (array_key_exists($course->id,$htmlarray)) {
foreach ($htmlarray[$course->id] as $modname => $html) {
echo $html;
}
}
echo $OUTPUT->box_end();
}

if (!empty($remote_courses)) {
echo $OUTPUT->heading(get_string('remotecourses', 'mnet'));
}
foreach ($remote_courses as $course) {
echo $OUTPUT->box_start('coursebox');
$attributes = array('title' => s($course->fullname));
echo $OUTPUT->heading(html_writer::link(
new moodle_url('/auth/mnet/jump.php', array('hostid' => $course->hostid, 'wantsurl' => '/course/view.php?id='.$course->remoteid)),
format_string($course->shortname),
$attributes) . ' (' . format_string($course->hostname) . ')', 3);
echo $OUTPUT->box_end();
}
}

0 comments on commit 00ba185

Please sign in to comment.