Permalink
Browse files

MDL-32480 fix display of IMS content packages with external links

  • Loading branch information...
ndunand authored and skodak committed Jun 3, 2013
1 parent 969e5b5 commit f3369f1607f919f3e448f2bdc0a572c8c099447f
Showing with 9 additions and 4 deletions.
  1. +9 −4 mod/imscp/locallib.php
@@ -61,10 +61,15 @@ function imscp_print_content($imscp, $cm, $course) {
function imscp_htmllize_item($item, $imscp, $cm) {
global $CFG;
$context = get_context_instance(CONTEXT_MODULE, $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 (strpos($item['href'], 'http://') === 0) {
$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>';

0 comments on commit f3369f1

Please sign in to comment.