Merge branch 'w24_MDL-32480_m26_imscp' of git://github.com/skodak/moodle

This commit is contained in:
Sam Hemelryk 2013-06-10 14:41:21 +12:00
commit bf0cdbcf8a

View File

@ -61,10 +61,14 @@ function imscp_print_content($imscp, $cm, $course) {
function imscp_htmllize_item($item, $imscp, $cm) {
global $CFG;
$context = context_module::instance($cm->id);
$urlbase = "$CFG->wwwroot/pluginfile.php";
$path = '/'.$context->id.'/mod_imscp/content/'.$imscp->revision.'/'.$item['href'];
$url = file_encode_url($urlbase, $path, false);
if (preg_match('|^https?://|', $item['href'])) {
$url = $item['href'];
} else {
$context = context_module::instance($cm->id);
$urlbase = "$CFG->wwwroot/pluginfile.php";
$path = '/'.$context->id.'/mod_imscp/content/'.$imscp->revision.'/'.$item['href'];
$url = file_encode_url($urlbase, $path, false);
}
$result = "<li><a href=\"$url\">".$item['title'].'</a>';
if ($item['subitems']) {
$result .= '<ul>';