mirrored from git://git.moodle.org/moodle.git
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Formatting the code
- Loading branch information
Jordi Piguillem
committed
May 14, 2010
1 parent
3e12336
commit ab6df97
Showing
2 changed files
with
46 additions
and
59 deletions.
There are no files selected for viewing
34 changes: 17 additions & 17 deletions
34
mod/wiki/backup/moodle2/backup_wiki_activity_task.class.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,50 @@ | ||
<?php | ||
|
||
require_once($CFG->dirroot . '/mod/wiki/backup/moodle2/backup_wiki_stepslib.php'); // Because it exists (must) | ||
require_once($CFG->dirroot . '/mod/wiki/backup/moodle2/backup_wiki_settingslib.php'); // Because it exists (optional) | ||
|
||
/** | ||
* wiki backup task that provides all the settings and steps to perform one | ||
* complete backup of the activity | ||
*/ | ||
class backup_wiki_activity_task extends backup_activity_task { | ||
|
||
/** | ||
* Define (add) particular settings this activity can have | ||
*/ | ||
protected function define_my_settings() { | ||
// No particular settings for this activity | ||
} | ||
} | ||
|
||
/** | ||
* Define (add) particular steps this activity can have | ||
*/ | ||
protected function define_my_steps() { | ||
// Wiki only has one structure step | ||
$this->add_step(new backup_wiki_activity_structure_step('wiki_structure', 'wiki.xml')); | ||
$this->add_step(new backup_wiki_activity_structure_step('wiki_structure', 'wiki.xml')); | ||
} | ||
|
||
/** | ||
* Code the transformations to perform in the activity in | ||
* order to get transportable (encoded) links | ||
*/ | ||
static public function encode_content_links($content) { | ||
global $CFG; | ||
global $CFG; | ||
|
||
$base = preg_quote($CFG->wwwroot, "/"); | ||
|
||
$base = preg_quote($CFG->wwwroot,"/"); | ||
|
||
// Link to the list of wikis | ||
$search="/(".$base."\/mod\/wiki\/index.php\?id\=)([0-9]+)/"; | ||
$content= preg_replace($search, '$@WIKIINDEX*$2@$', $content); | ||
$search = "/(" . $base . "\/mod\/wiki\/index.php\?id\=)([0-9]+)/"; | ||
$content = preg_replace($search, '$@WIKIINDEX*$2@$', $content); | ||
|
||
// Link to wiki view by moduleid | ||
$search="/(".$base."\/mod\/wiki\/view.php\?id\=)([0-9]+)/"; | ||
$content= preg_replace($search, '$@WIKIVIEWBYID*$2@$', $content); | ||
$search = "/(" . $base . "\/mod\/wiki\/view.php\?id\=)([0-9]+)/"; | ||
$content = preg_replace($search, '$@WIKIVIEWBYID*$2@$', $content); | ||
|
||
// Link to wiki view by pageid | ||
$search="/(".$base."\/mod\/wiki\/view.php\?pageid\=)([0-9]+)/"; | ||
$content= preg_replace($search, '$@WIKIPAGEBYID*$2@$', $content); | ||
$search = "/(" . $base . "\/mod\/wiki\/view.php\?pageid\=)([0-9]+)/"; | ||
$content = preg_replace($search, '$@WIKIPAGEBYID*$2@$', $content); | ||
|
||
return $content; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters