|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 // This file is part of Moodle - http://moodle.org/ 00004 // 00005 // Moodle is free software: you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation, either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // Moodle is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00017 00025 require_once($CFG->dirroot . '/mod/choice/backup/moodle2/backup_choice_stepslib.php'); // Because it exists (must) 00026 require_once($CFG->dirroot . '/mod/choice/backup/moodle2/backup_choice_settingslib.php'); // Because it exists (optional) 00027 00032 class backup_choice_activity_task extends backup_activity_task { 00033 00037 protected function define_my_settings() { 00038 // No particular settings for this activity 00039 } 00040 00044 protected function define_my_steps() { 00045 // Choice only has one structure step 00046 $this->add_step(new backup_choice_activity_structure_step('choice_structure', 'choice.xml')); 00047 } 00048 00053 static public function encode_content_links($content) { 00054 global $CFG; 00055 00056 $base = preg_quote($CFG->wwwroot,"/"); 00057 00058 // Link to the list of choices 00059 $search="/(".$base."\/mod\/choice\/index.php\?id\=)([0-9]+)/"; 00060 $content= preg_replace($search, '$@CHOICEINDEX*$2@$', $content); 00061 00062 // Link to choice view by moduleid 00063 $search="/(".$base."\/mod\/choice\/view.php\?id\=)([0-9]+)/"; 00064 $content= preg_replace($search, '$@CHOICEVIEWBYID*$2@$', $content); 00065 00066 return $content; 00067 } 00068 }