Skip to content

Commit

Permalink
Fixing backup encode and restore decode rule names.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkelsh committed Feb 7, 2011
1 parent bd09452 commit 8c554c2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions backup/moodle2/backup_book_activity_task.class.php
Expand Up @@ -67,21 +67,21 @@ static public function encode_content_links($content) {


// Link to the list of books // Link to the list of books
$search = "/(".$base."\/mod\/book\/index.php\?id\=)([0-9]+)/"; $search = "/(".$base."\/mod\/book\/index.php\?id\=)([0-9]+)/";
$content = preg_replace($search, '$@bookINDEX*$2@$', $content); $content = preg_replace($search, '$@BOOKINDEX*$2@$', $content);


// Link to book view by moduleid // Link to book view by moduleid
$search = "/(".$base."\/mod\/book\/view.php\?id\=)([0-9]+)/"; $search = "/(".$base."\/mod\/book\/view.php\?id\=)([0-9]+)/";
$content = preg_replace($search, '$@bookVIEWBYID*$2@$', $content); $content = preg_replace($search, '$@BOOKVIEWBYID*$2@$', $content);


$search = "/(".$base."\/mod\/book\/view.php\?id\=)([0-9]+)&chapterid=([0-9]+)/"; $search = "/(".$base."\/mod\/book\/view.php\?id\=)([0-9]+)&chapterid=([0-9]+)/";
$content = preg_replace($search, '$@bookVIEWBYIDCH*$2*$3@$', $content); $content = preg_replace($search, '$@BOOKVIEWBYIDCH*$2*$3@$', $content);


// Link to book view by bookid // Link to book view by bookid
$search = "/(".$base."\/mod\/book\/view.php\?b\=)([0-9]+)/"; $search = "/(".$base."\/mod\/book\/view.php\?b\=)([0-9]+)/";
$content = preg_replace($search, '$@bookVIEWBYB*$2@$', $content); $content = preg_replace($search, '$@BOOKVIEWBYB*$2@$', $content);


$search = "/(".$base."\/mod\/book\/view.php\?b\=)([0-9]+)&chapterid=([0-9]+)/"; $search = "/(".$base."\/mod\/book\/view.php\?b\=)([0-9]+)&chapterid=([0-9]+)/";
$content = preg_replace($search, '$@bookVIEWBYBCH*$2*$3@$', $content); $content = preg_replace($search, '$@BOOKVIEWBYBCH*$2*$3@$', $content);


return $content; return $content;
} }
Expand Down
10 changes: 5 additions & 5 deletions backup/moodle2/restore_book_activity_task.class.php
Expand Up @@ -78,15 +78,15 @@ static public function define_decode_rules() {
$rules = array(); $rules = array();


// List of books in course // List of books in course
$rules[] = new restore_decode_rule('bookINDEX', '/mod/book/index.php?id=$1', 'course'); $rules[] = new restore_decode_rule('BOOKINDEX', '/mod/book/index.php?id=$1', 'course');


// book by cm->id // book by cm->id
$rules[] = new restore_decode_rule('bookVIEWBYID', '/mod/book/view.php?id=$1', 'course_module'); $rules[] = new restore_decode_rule('BOOKVIEWBYID', '/mod/book/view.php?id=$1', 'course_module');
$rules[] = new restore_decode_rule('bookVIEWBYIDCH', '/mod/book/view.php?id=$1&chapterid=$2', array('course_module', 'book_chapter')); $rules[] = new restore_decode_rule('BOOKVIEWBYIDCH', '/mod/book/view.php?id=$1&chapterid=$2', array('course_module', 'book_chapter'));


// book by book->id // book by book->id
$rules[] = new restore_decode_rule('bookVIEWBYB', '/mod/book/view.php?b=$1', 'book'); $rules[] = new restore_decode_rule('BOOKVIEWBYB', '/mod/book/view.php?b=$1', 'book');
$rules[] = new restore_decode_rule('bookVIEWBYBCH', '/mod/book/view.php?b=$1&chapterid=$2', array('book', 'book_chapter')); $rules[] = new restore_decode_rule('BOOKVIEWBYBCH', '/mod/book/view.php?b=$1&chapterid=$2', array('book', 'book_chapter'));


return $rules; return $rules;
} }
Expand Down

0 comments on commit 8c554c2

Please sign in to comment.