MDL-59893 assign: don't prefix file links when downloading as folders
Change to download_rewrite_pluginfile_urls() ensuring prefix isn't added to file links when downloading with the downloadasfolders user preference set to true. Links to files in onlinetext now work when downloading as folders.
This commit is contained in:
@@ -2965,10 +2965,14 @@ class assign {
|
||||
$prefix = clean_filename($prefix . '_' . $this->get_uniqueid_for_user($user->id) . '_');
|
||||
}
|
||||
|
||||
$subtype = $plugin->get_subtype();
|
||||
$type = $plugin->get_type();
|
||||
$prefix = $prefix . $subtype . '_' . $type . '_';
|
||||
|
||||
// Only prefix files if downloadasfolders user preference is NOT set.
|
||||
if (!get_user_preferences('assign_downloadasfolders', 1)) {
|
||||
$subtype = $plugin->get_subtype();
|
||||
$type = $plugin->get_type();
|
||||
$prefix = $prefix . $subtype . '_' . $type . '_';
|
||||
} else {
|
||||
$prefix = "";
|
||||
}
|
||||
$result = str_replace('@@PLUGINFILE@@/', $prefix, $text);
|
||||
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user