From 75766456f90d87d6791c97f2506413af2a78411e Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 12 Apr 2005 23:40:40 +0000 Subject: [PATCH] Now all the wiki formated texts are converted to markdown by the restore process. Such conversion is performed for every backup file prior to 2005041100. Wiki internal links are dinamically changed and then, converted to Markdown. --- backup/CHANGES_14_15.txt | 3 + backup/restore.php | 1 + backup/restorelib.php | 120 +-------------------------------------- backup/version.php | 2 +- 4 files changed, 7 insertions(+), 119 deletions(-) diff --git a/backup/CHANGES_14_15.txt b/backup/CHANGES_14_15.txt index bc423ceb9e8..068e0835f7f 100644 --- a/backup/CHANGES_14_15.txt +++ b/backup/CHANGES_14_15.txt @@ -58,6 +58,9 @@ Now I show the specific detailed status of every item in the process: 34. DONE: Group images aren't included at all in backup/restore. Bug 2674. 35. DONE: New glossary log action: "view_entry". 36. PROG: Add support for quiz log action: "editquestions". Bug 2778 pending! +37. DONE: Convert module ids in every Wiki reference to other activities. +38. DONE: Convert every wiki formatted text to markdown. Bye, wikies! ;-) +39. TODO: Add backup/restore of new grade tables. Eloy (stronk7) 23-01-2004 diff --git a/backup/restore.php b/backup/restore.php index 5ec5769ec5f..c0ac5827fec 100644 --- a/backup/restore.php +++ b/backup/restore.php @@ -11,6 +11,7 @@ require_once ("restorelib.php"); require_once ("bb/restore_bb.php"); require_once("$CFG->libdir/blocklib.php"); + require_once("$CFG->libdir/wiki_to_markdown.php" ); //Optional optional_variable($id); diff --git a/backup/restorelib.php b/backup/restorelib.php index 0d11c8b93f2..653b13e7c99 100644 --- a/backup/restorelib.php +++ b/backup/restorelib.php @@ -81,15 +81,7 @@ } } } - - //Now I'm going to decode to their new location all the links in wiki texts - //having the syntax " modulename:moduleid". - echo "
  • Wiki"; - $status = restore_decode_wiki_texts($restore); - echo '
  • '; - echo ""; - return $status; } @@ -104,8 +96,8 @@ foreach ($restore->mods as $name => $info) { //If the module is being restored if ($info->restore == 1) { - //Check if the xxxx_convert_wiki2markdown exists - $function_name = $name."_convert_wiki2markdown"; + //Check if the xxxx_restore_wiki2markdown exists + $function_name = $name."_restore_wiki2markdown"; if (function_exists($function_name)) { echo "
  • ".get_string("modulenameplural",$name); $status = $function_name($restore); @@ -113,116 +105,8 @@ } } } - - return $status; - } - - //This function search for some wiki texts in differenct parts of Moodle to - //decode them to their new ids. - function restore_decode_wiki_texts($restore) { - - global $CFG; - - $status = true; - - echo ""; - return $status; - } //This function receives a wiki text in the restore process and diff --git a/backup/version.php b/backup/version.php index 3b2f60130ac..60c3e32be56 100644 --- a/backup/version.php +++ b/backup/version.php @@ -5,6 +5,6 @@ // database (backup_version) to determine whether upgrades should // be performed (see db/backup_*.php) -$backup_version = 2005032100; // The current version is a date (YYYYMMDDXX) +$backup_version = 2005041100; // The current version is a date (YYYYMMDDXX) $backup_release = "1.5 development"; // User-friendly version number