Skip to content

Commit

Permalink
Merge branch 'w24_MDL-32480_m26_imscp' of git://github.com/skodak/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Jun 10, 2013
2 parents 111f529 + f815e4c commit bf0cdbc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mod/imscp/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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>';
Expand Down

0 comments on commit bf0cdbc

Please sign in to comment.