mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Merge branch 'w24_MDL-32480_m26_imscp' of git://github.com/skodak/moodle
This commit is contained in:
commit
bf0cdbcf8a
@ -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>';
|
||||
|
Loading…
x
Reference in New Issue
Block a user