. /** * Defines backup_newmodule_activity_task class * * The AppStream Plugin does not support backup and recovery. It is disabled in lib.php. * * @package mod_appstream * @copyright 2018 Amazon.com, Inc. and its affiliates. All Rights Reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 */ defined('MOODLE_INTERNAL') || die; require_once($CFG->dirroot . '/mod/appstream/backup/moodle2/backup_appstream_stepslib.php'); class backup_appstream_activity_task extends backup_activity_task { /** * No specific settings for this activity */ protected function define_my_settings() { } /** * Defines a backup step to store the instance data in the appstream.xml file */ protected function define_my_steps() { $this->add_step(new backup_appstream_activity_structure_step('appstream_structure', 'appstream.xml')); } /** * Encodes URLs to the index.php and view.php scripts * * @param string $content some HTML text that eventually contains URLs to the activity instance scripts * @return string the content with the URLs encoded */ static public function encode_content_links($content) { global $CFG; $base = preg_quote($CFG->wwwroot, '/'); // Link to the list of appstreams. $search = '/('.$base.'\/mod\/appstream\/index.php\?id\=)([0-9]+)/'; $content = preg_replace($search, '$@APPSTREAMINDEX*$2@$', $content); // Link to appstream view by moduleid. $search = '/('.$base.'\/mod\/appstream\/view.php\?id\=)([0-9]+)/'; $content = preg_replace($search, '$@APPSTREAMVIEWBYID*$2@$', $content); return $content; } }