Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/wiki/backup/moodle2/backup_wiki_activity_task.class.php
Go to the documentation of this file.
00001 <?php
00002 
00003 require_once($CFG->dirroot . '/mod/wiki/backup/moodle2/backup_wiki_stepslib.php'); // Because it exists (must)
00004 require_once($CFG->dirroot . '/mod/wiki/backup/moodle2/backup_wiki_settingslib.php'); // Because it exists (optional)
00005 
00010 class backup_wiki_activity_task extends backup_activity_task {
00011 
00015     protected function define_my_settings() {
00016         // No particular settings for this activity
00017         }
00018 
00022     protected function define_my_steps() {
00023         // Wiki only has one structure step
00024         $this->add_step(new backup_wiki_activity_structure_step('wiki_structure', 'wiki.xml'));
00025     }
00026 
00031     static public function encode_content_links($content) {
00032         global $CFG;
00033 
00034         $base = preg_quote($CFG->wwwroot, "/");
00035 
00036         // Link to the list of wikis
00037         $search = "/(" . $base . "\/mod\/wiki\/index.php\?id\=)([0-9]+)/";
00038         $content = preg_replace($search, '$@WIKIINDEX*$2@$', $content);
00039 
00040         // Link to wiki view by moduleid
00041         $search = "/(" . $base . "\/mod\/wiki\/view.php\?id\=)([0-9]+)/";
00042         $content = preg_replace($search, '$@WIKIVIEWBYID*$2@$', $content);
00043 
00044         // Link to wiki view by pageid
00045         $search = "/(" . $base . "\/mod\/wiki\/view.php\?pageid\=)([0-9]+)/";
00046         $content = preg_replace($search, '$@WIKIPAGEBYID*$2@$', $content);
00047 
00048         return $content;
00049     }
00050 }
 All Data Structures Namespaces Files Functions Variables Enumerations