Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/chat/backup/moodle2/backup_chat_activity_task.class.php
Go to the documentation of this file.
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 
00040 require_once($CFG->dirroot . '/mod/chat/backup/moodle2/backup_chat_stepslib.php'); // Because it exists (must)
00041 
00046 class backup_chat_activity_task extends backup_activity_task {
00047 
00051     protected function define_my_settings() {
00052         // No particular settings for this activity
00053     }
00054 
00058     protected function define_my_steps() {
00059         // chat only has one structure step
00060         $this->add_step(new backup_chat_activity_structure_step('chat_structure', 'chat.xml'));
00061     }
00062 
00070     static public function encode_content_links($content) {
00071         global $CFG;
00072 
00073         $base = preg_quote($CFG->wwwroot.'/mod/chat','#');
00074 
00075         //Link to the list of chats
00076         $pattern = "#(".$base."\/index.php\?id\=)([0-9]+)#";
00077         $content = preg_replace($pattern, '$@CHATINDEX*$2@$', $content);
00078 
00079         //Link to chat view by moduleid
00080         $pattern = "#(".$base."\/view.php\?id\=)([0-9]+)#";
00081         $content = preg_replace($pattern, '$@CHATVIEWBYID*$2@$', $content);
00082 
00083         return $content;
00084     }
00085 }
 All Data Structures Namespaces Files Functions Variables Enumerations