Skip to content

Commit

Permalink
Included one more translation of links from
Browse files Browse the repository at this point in the history
assignments to resources. Required in bug 2027.
Easy and not risky.

Merged from MOODLE_14_STABLE
  • Loading branch information
stronk7 committed Oct 1, 2004
1 parent 6f84a9d commit 6446885
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions mod/resource/restorelib.php
Expand Up @@ -179,6 +179,42 @@ function resource_decode_content_links_caller($restore) {
$status = true;

echo "<ul>";

//ASSIGNMENT: Decode every ASSIGNMENT (description) in the coure

//Check we are restoring assignments
if ($restore->mods['assignment']->restore == 1) {
echo "<li>".get_string("from")." ".get_string("modulenameplural","assignment");
//Get all course assignments
if ($assignments = get_records_sql ("SELECT a.id, a.description
FROM {$CFG->prefix}assignment a
WHERE a.course = $restore->course_id")) {
//Iterate over each assignment->description
$i = 0; //Counter to send some output to the browser to avoid timeouts
foreach ($assignments as $assignment) {
//Increment counter
$i++;
$content = $assignment->description;
$result = resource_decode_content_links($content,$restore);
if ($result != $content) {
//Update record
$assignment->description = addslashes($result);
$status = update_record("assignment",$assignment);
if ($CFG->debug>7) {
echo "<br><hr>".$content."<br>changed to</br>".$result."<hr><br>";
}
}
//Do some output
if (($i+1) % 5 == 0) {
echo ".";
if (($i+1) % 100 == 0) {
echo "<br>";
}
backup_flush(300);
}
}
}
}

//FORUM: Decode every POST (message) in the coure

Expand Down

0 comments on commit 6446885

Please sign in to comment.