Merge branch 'MDL-30982-docblock-backup' of git://github.com/mudrd8mz/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2012-02-29 00:47:10 +01:00
65 changed files with 768 additions and 494 deletions
+67 -17
View File
@@ -16,17 +16,23 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_activity_task class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* abstract activity task that provides all the properties and common tasks to be performed
* when one activity is being backup
* Provides all the settings and steps to perform one complete backup of the activity
*
* TODO: Finish phpdocs
* Activities are supposed to provide the subclass of this class in their file
* mod/MODULENAME/backup/moodle2/backup_MODULENAME_activity_task.class.php
* The expected name of the subclass is backup_MODULENAME_activity_task
*/
abstract class backup_activity_task extends backup_task {
@@ -38,6 +44,10 @@ abstract class backup_activity_task extends backup_task {
/**
* Constructor - instantiates one object of this class
*
* @param string $name the task identifier
* @param int $moduleid course module id (id in course_modules table)
* @param backup_plan|null $plan the backup plan instance this task is part of
*/
public function __construct($name, $moduleid, $plan = null) {
@@ -59,28 +69,43 @@ abstract class backup_activity_task extends backup_task {
parent::__construct($name, $plan);
}
/**
* @return int the course module id (id in the course_modules table)
*/
public function get_moduleid() {
return $this->moduleid;
}
/**
* @return int the course section id (id in the course_sections table)
*/
public function get_sectionid() {
return $this->sectionid;
}
/**
* @return string the name of the module, eg 'workshop' (from the modules table)
*/
public function get_modulename() {
return $this->modulename;
}
/**
* @return int the id of the activity instance (id in the activity's instances table)
*/
public function get_activityid() {
return $this->activityid;
}
/**
* @return int the id of the associated CONTEXT_MODULE instance
*/
public function get_contextid() {
return $this->contextid;
}
/**
* Activity tasks have their own directory to write files
* @return string full path to the directory where this task writes its files
*/
public function get_taskbasepath() {
return $this->get_basepath() . '/activities/' . $this->modulename . '_' . $this->moduleid;
@@ -184,9 +209,11 @@ abstract class backup_activity_task extends backup_task {
/**
* Specialisation that, first of all, looks for the setting within
* the task with the the prefix added and later, delegates to parent
* without adding anything
* Tries to look for the instance specific setting value, task specific setting value or the
* common plan setting value - in that order
*
* @param string $name the name of the setting
* @return mixed|null the value of the setting or null if not found
*/
public function get_setting($name) {
$namewithprefix = $this->modulename . '_' . $this->moduleid . '_' . $name;
@@ -211,7 +238,7 @@ abstract class backup_activity_task extends backup_task {
// Protected API starts here
/**
* Define the common setting that any backup activity will have
* Defines the common setting that any backup activity will have
*/
protected function define_settings() {
@@ -264,21 +291,44 @@ abstract class backup_activity_task extends backup_task {
}
/**
* Define (add) particular settings that each activity can have
* Defines activity specific settings to be added to the common ones
*
* This method is called from {@link self::define_settings()}. The activity module
* author may use it to define additional settings that influence the execution of
* the backup.
*
* Most activities just leave the method empty.
*
* @see self::define_settings() for the example how to define own settings
*/
abstract protected function define_my_settings();
/**
* Define (add) particular steps that each activity can have
* Defines activity specific steps for this task
*
* This method is called from {@link self::build()}. Activities are supposed
* to call {self::add_step()} in it to include their specific steps in the
* backup plan.
*/
abstract protected function define_my_steps();
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* Encodes URLs to the activity instance's scripts into a site-independent form
*
* The current instance of the activity may be referenced from other places in
* the course by URLs like http://my.moodle.site/mod/workshop/view.php?id=42
* Obvisouly, such URLs are not valid any more once the course is restored elsewhere.
* For this reason the backup file does not store the original URLs but encodes them
* into a transportable form. During the restore, the reverse process is applied and
* the encoded URLs are replaced with the new ones valid for the target site.
*
* Every plugin must override this method in its subclass.
*
* @see backup_xml_transformer class that actually runs the transformation
* @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) {
throw new coding_exception('encode_content_links() method needs to be overridden in each subclass of backup_activity_task');
}
}
+7 -4
View File
@@ -16,12 +16,15 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define('MOODLE_INTERNAL') || die();
/**
* abstract block task that provides all the properties and common steps to be performed
* when one block is being backup
+7 -4
View File
@@ -16,10 +16,13 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_course_task
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
@@ -24,10 +24,11 @@ defined('MOODLE_INTERNAL') || die();
* backed up, a course report should make use of the second and third
* parameters in get_plugin_element().
*
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2011 onwards The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2011 onwards The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class backup_coursereport_plugin extends backup_plugin {
// Use default parent behaviour
+9 -4
View File
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines various element classes used in specific areas
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Implementation of backup_final_element that provides one interceptor for anonymization of data
*
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_default_block_task class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Default block task to backup blocks that haven't own DB structures to be added
* when one block is being backup
+9 -4
View File
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_final_task class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Final task that provides all the final steps necessary in order to finish one
* backup (mainly gathering references and creating the main xml) apart from
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_format_plugin class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Class extending standard backup_plugin in order to implement some
* helper methods related with the course formats (format plugin)
@@ -16,10 +16,13 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package core
* @subpackage backup-moodle2
* @copyright 2011 David Mudrak <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_gradingform_plugin class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2011 David Mudrak <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
@@ -28,5 +31,4 @@ defined('MOODLE_INTERNAL') || die();
* Base class for all advanced grading form plugins
*/
abstract class backup_gradingform_plugin extends backup_plugin {
}
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_plagiarism_plugin class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Class extending standard backup_plugin in order to implement some
* helper methods related with the plagiarism plugins (plagiarism plugin)
+7 -4
View File
@@ -16,10 +16,13 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_plan_builder class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+9 -4
View File
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_plugin class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Class implementing the plugins support for moodle2 backups
*
+9 -4
View File
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_qtype_plugin class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Class extending standard backup_plugin in order to implement some
* helper methods related with the questions (qtype plugin)
@@ -24,10 +24,11 @@ defined('MOODLE_INTERNAL') || die();
* backed up, a report should make use of the second and third
* parameters in get_plugin_element().
*
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2011 Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2011 Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class backup_report_plugin extends backup_plugin {
// Use default parent behaviour
+9 -4
View File
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_root_task class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Start task that provides all the settings common to all backups and some initialization steps
*
+9 -4
View File
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_section_task class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* section task that provides all the properties and common steps to be performed
* when one section is being backup
+16 -4
View File
@@ -16,10 +16,13 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines classes used to handle backup settings
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// TODO: Reduce these to the minimum because ui/dependencies are 100% separated
@@ -36,6 +39,15 @@ class backup_generic_setting extends root_backup_setting {}
*/
class backup_filename_setting extends backup_generic_setting {
/**
* Instantiates a setting object
*
* @param string $name Name of the setting
* @param string $vtype Type of the setting, eg {@link base_setting::IS_TEXT}
* @param mixed $value Value of the setting
* @param bool $visibility Is the setting visible in the UI, eg {@link base_setting::VISIBLE}
* @param int $status Status of the setting with regards to the locking, eg {@link base_setting::NOT_LOCKED}
*/
public function __construct($name, $vtype, $value = null, $visibility = self::VISIBLE, $status = self::NOT_LOCKED) {
parent::__construct($name, $vtype, $value, $visibility, $status);
}
+14 -7
View File
@@ -16,15 +16,16 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines various backup steps that will be used by common tasks in backup
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Define all the backup steps that will be used by common tasks in backup
*/
defined('MOODLE_INTERNAL') || die();
/**
* create the temp dir where backup/restore will happen,
@@ -98,6 +99,7 @@ abstract class backup_activity_structure_step extends backup_structure_step {
* we are going to add subplugin information to
* @param bool $multiple to define if multiple subplugins can produce information
* for each instance of $element (true) or no (false)
* @return void
*/
protected function add_subplugin_structure($subplugintype, $element, $multiple) {
@@ -135,6 +137,8 @@ abstract class backup_activity_structure_step extends backup_structure_step {
/**
* As far as activity backup steps are implementing backup_subplugin stuff, they need to
* have the parent task available for wrapping purposes (get course/context....)
*
* @return backup_activity_task
*/
public function get_task() {
return $this->task;
@@ -143,6 +147,9 @@ abstract class backup_activity_structure_step extends backup_structure_step {
/**
* Wraps any activity backup structure within the common 'activity' element
* that will include common to all activities information like id, context...
*
* @param backup_nested_element $activitystructure the element to wrap
* @return backup_nested_element the $activitystructure wrapped by the common 'activity' element
*/
protected function prepare_activity_structure($activitystructure) {
+8 -4
View File
@@ -16,12 +16,16 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_subplugin class
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Class implementing the subplugins support for moodle2 backups
*
+9 -4
View File
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2011 onwards The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_theme_plugin class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2011 onwards The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Base class for theme backup plugins.
*
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_xml_transformer class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Class implementing the @xml_contenttrasnformed logic to be applied in moodle2 backups
*
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines restore_activity_task class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* abstract activity task that provides all the properties and common tasks to be performed
* when one activity is being restored
+9 -4
View File
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines restore_block_task class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* abstract block task that provides all the properties and common steps to be performed
* when one block is being restored
+9 -4
View File
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines restore_course_task class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* course task that provides all the properties and common steps to be performed
* when one course is being restored
@@ -19,10 +19,11 @@ defined('MOODLE_INTERNAL') || die();
/**
* Restore for course plugin: course report.
*
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class restore_coursereport_plugin extends restore_plugin {
// Use default parent behaviour
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines restore_default_block_task class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Default block task to restore blocks not having own DB structures to be added
*
+9 -4
View File
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines restore_final_task class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Final task that provides all the final steps necessary in order to finish one
* restore like gradebook, interlinks... apart from some final cleaning
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines restore_format_plugin class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Class extending standard restore_plugin in order to implement some
* helper methods related with the course formats (format plugin)
@@ -16,10 +16,12 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package core
* @subpackage backup-moodle2
* @copyright 2011 David Mudrak <david@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines restore_gradingform_plugin class
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2011 David Mudrak <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines restore_plagiarism_plugin class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2011 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Class extending standard restore_plugin in order to implement some
* helper methods related with the plagiarism plugins
@@ -16,10 +16,13 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines restore_plan_builder class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
+9 -4
View File
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines restore_plugin class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Class implementing the plugins support for moodle2 restore
*
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines restore_qtype_plugin class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Class extending standard restore_plugin in order to implement some
* helper methods related with the questions (qtype plugin)
@@ -19,10 +19,11 @@ defined('MOODLE_INTERNAL') || die();
/**
* Restore for plugin report.
*
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2011 Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2011 Petr Skoda
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class restore_report_plugin extends restore_plugin {
// Use default parent behaviour
+8 -4
View File
@@ -16,12 +16,16 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines restore_root_task class
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Start task that provides all the settings common to all restores and other initial steps
*
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines restore_section_task class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* section task that provides all the properties and common steps to be performed
* when one section is being restored
+9 -4
View File
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines classes used to handle restore settings
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
// TODO: Reduce these to the minimum because ui/dependencies are 100% separated
// Root restore settings
+8 -7
View File
@@ -16,15 +16,16 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines various restore steps that will be used by common tasks in restore
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Define all the restore steps that will be used by common tasks in restore
*/
defined('MOODLE_INTERNAL') || die();
/**
* delete old directories and conditionally create backup_temp_ids table
+9 -4
View File
@@ -16,12 +16,17 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines restore_subplugin class
*
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Class implementing the subplugins support for moodle2 restore
*
@@ -19,10 +19,11 @@ defined('MOODLE_INTERNAL') || die();
/**
* Restore for course plugin: theme.
*
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package core_backup
* @subpackage moodle2
* @category backup
* @copyright 2011 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class restore_theme_plugin extends restore_plugin {
// Use default parent behaviour
+16 -16
View File
@@ -16,16 +16,18 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-settings
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_setting class
*
* @package core_backup
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* This abstract class defines one backup_setting
*
* TODO: Finish phpdocs
* Parent class for all backup settings
*/
abstract class backup_setting extends base_setting implements checksumable {
@@ -35,12 +37,12 @@ abstract class backup_setting extends base_setting implements checksumable {
const SECTION_LEVEL = 9;
const ACTIVITY_LEVEL = 13;
/**
* One of the above constants
* @var {int}
*/
protected $level; // level of the setting
/** @var int Level of the setting, eg {@link self::ROOT_LEVEL} */
protected $level;
/**
* {@inheritdoc}
*/
public function __construct($name, $vtype, $value = null, $visibility = self::VISIBLE, $status = self::NOT_LOCKED) {
parent::__construct($name, $vtype, $value, $visibility, $status);
// Generate a default ui
@@ -48,9 +50,7 @@ abstract class backup_setting extends base_setting implements checksumable {
}
/**
* Returns the level of the setting
*
* @return {int} One of the above constants
* @return int Level of the setting, eg {@link self::ROOT_LEVEL}
*/
public function get_level() {
return $this->level;
@@ -112,7 +112,7 @@ abstract class backup_setting extends base_setting implements checksumable {
}
}
/*
/**
* Exception class used by all the @backup_setting stuff
*/
class backup_setting_exception extends base_setting_exception {
@@ -86,6 +86,15 @@ abstract class base_setting {
*/
protected $help = array();
/**
* Instantiates a setting object
*
* @param string $name Name of the setting
* @param string $vtype Type of the setting, eg {@link self::IS_TEXT}
* @param mixed $value Value of the setting
* @param bool $visibility Is the setting visible in the UI, eg {@link self::VISIBLE}
* @param int $status Status of the setting with regards to the locking, eg {@link self::NOT_LOCKED}
*/
public function __construct($name, $vtype, $value = null, $visibility = self::VISIBLE, $status = self::NOT_LOCKED) {
// Check vtype
if ($vtype !== self::IS_BOOLEAN && $vtype !== self::IS_INTEGER &&
@@ -16,19 +16,24 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-settings
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines root_backup_setting class
*
* @package core_backup
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
/**
* Abstract class containing all the common stuff for root backup settings
*
* TODO: Finish phpdocs
*/
abstract class root_backup_setting extends backup_setting {
/**
* {@inheritdoc}
*/
public function __construct($name, $vtype, $value = null, $visibility = self::VISIBLE, $status = self::NOT_LOCKED) {
$this->level = self::ROOT_LEVEL;
parent::__construct($name, $vtype, $value, $visibility, $status);
@@ -16,38 +16,41 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_assignment_activity_task class
*
* @package mod_assignment
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->dirroot . '/mod/assignment/backup/moodle2/backup_assignment_stepslib.php'); // Because it exists (must)
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot.'/mod/assignment/backup/moodle2/backup_assignment_stepslib.php');
/**
* assignment backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides the steps to perform one complete backup of the Assignment instance
*/
class backup_assignment_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the assignment.xml file
*/
protected function define_my_steps() {
// Choice only has one structure step
$this->add_step(new backup_assignment_activity_structure_step('assignment_structure', 'assignment.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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;
@@ -16,56 +16,41 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This is the "graphical" structure of the chat mod:
* Defines backup_chat_activity_task class
*
* chat
* (CL,pk->id)
* |
* |
* |
* chat_messages
* (UL,pk->id, fk->chatid)
*
* Meaning: pk->primary key field of the table
* fk->foreign key to link with parent
* nt->nested field (recursive data)
* CL->course level info
* UL->user level info
*
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Dongsheng Cai <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package mod_chat
* @category backup
* @copyright 2010 onwards Dongsheng Cai <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->dirroot . '/mod/chat/backup/moodle2/backup_chat_stepslib.php'); // Because it exists (must)
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/chat/backup/moodle2/backup_chat_stepslib.php');
/**
* chat backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides the steps to perform one complete backup of the Chat instance
*/
class backup_chat_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the chat.xml file
*/
protected function define_my_steps() {
// chat only has one structure step
$this->add_step(new backup_chat_activity_structure_step('chat_structure', 'chat.xml'));
}
/**
* Code the transformations to perform in the chat activity in
* order to get transportable (encoded) links
* Encodes URLs to the index.php and view.php scripts
*
* @param string $content
* @return string
* @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;
@@ -16,39 +16,42 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_choice_activity_task class
*
* @package mod_choice
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->dirroot . '/mod/choice/backup/moodle2/backup_choice_stepslib.php'); // Because it exists (must)
require_once($CFG->dirroot . '/mod/choice/backup/moodle2/backup_choice_settingslib.php'); // Because it exists (optional)
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/choice/backup/moodle2/backup_choice_stepslib.php');
require_once($CFG->dirroot . '/mod/choice/backup/moodle2/backup_choice_settingslib.php');
/**
* choice backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides the steps to perform one complete backup of the Choice instance
*/
class backup_choice_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the choice.xml file
*/
protected function define_my_steps() {
// Choice only has one structure step
$this->add_step(new backup_choice_activity_structure_step('choice_structure', 'choice.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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;
@@ -16,38 +16,41 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_data_activity_task
*
* @package mod_data
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->dirroot . '/mod/data/backup/moodle2/backup_data_stepslib.php'); // Because it exists (must)
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/data/backup/moodle2/backup_data_stepslib.php');
/**
* data backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides the steps to perform one complete backup of the Database instance
*/
class backup_data_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the data.xml file
*/
protected function define_my_steps() {
// Data only has one structure step
$this->add_step(new backup_data_activity_structure_step('data_structure', 'data.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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;
@@ -1,4 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -15,30 +16,32 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_feedback_activity_task class
*
* @package mod_feedback
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->dirroot . '/mod/feedback/backup/moodle2/backup_feedback_stepslib.php'); // Because it exists (must)
require_once($CFG->dirroot . '/mod/feedback/backup/moodle2/backup_feedback_settingslib.php'); // Because it exists (optional)
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/feedback/backup/moodle2/backup_feedback_stepslib.php');
require_once($CFG->dirroot . '/mod/feedback/backup/moodle2/backup_feedback_settingslib.php');
/**
* feedback backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides the steps to perform one complete backup of the Feedback instance
*/
class backup_feedback_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the feedback.xml file
*/
protected function define_my_steps() {
// feedback only has one structure step
@@ -46,8 +49,10 @@ class backup_feedback_activity_task extends backup_activity_task {
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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;
@@ -16,40 +16,41 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package mod
* @subpackage folder
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_folder_activity_task class
*
* @package mod_folder
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/folder/backup/moodle2/backup_folder_stepslib.php'); // Because it exists (must)
require_once($CFG->dirroot . '/mod/folder/backup/moodle2/backup_folder_stepslib.php');
/**
* folder backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides the steps to perform one complete backup of the Folder instance
*/
class backup_folder_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the folder.xml file
*/
protected function define_my_steps() {
// Choice only has one structure step
$this->add_step(new backup_folder_activity_structure_step('folder_structure', 'folder.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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;
@@ -16,39 +16,42 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_forum_activity_task class
*
* @package mod_forum
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->dirroot . '/mod/forum/backup/moodle2/backup_forum_stepslib.php'); // Because it exists (must)
require_once($CFG->dirroot . '/mod/forum/backup/moodle2/backup_forum_settingslib.php'); // Because it exists (optional)
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/forum/backup/moodle2/backup_forum_stepslib.php');
require_once($CFG->dirroot . '/mod/forum/backup/moodle2/backup_forum_settingslib.php');
/**
* forum backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides the steps to perform one complete backup of the Forum instance
*/
class backup_forum_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the forum.xml file
*/
protected function define_my_steps() {
// Forum only has one structure step
$this->add_step(new backup_forum_activity_structure_step('forum structure', 'forum.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* Encodes URLs to the index.php, view.php and discuss.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;
@@ -16,38 +16,41 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_glossary_activity_task class
*
* @package mod_glossary
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->dirroot . '/mod/glossary/backup/moodle2/backup_glossary_stepslib.php'); // Because it exists (must)
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/glossary/backup/moodle2/backup_glossary_stepslib.php');
/**
* glossary backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides the steps to perform one complete backup of the Glossary instance
*/
class backup_glossary_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the glossary.xml file
*/
protected function define_my_steps() {
// Choice only has one structure step
$this->add_step(new backup_glossary_activity_structure_step('glossary_structure', 'glossary.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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;
@@ -16,40 +16,41 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package mod
* @subpackage imscp
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_imscp_activity_task class
*
* @package mod_imscp
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/imscp/backup/moodle2/backup_imscp_stepslib.php'); // Because it exists (must)
require_once($CFG->dirroot . '/mod/imscp/backup/moodle2/backup_imscp_stepslib.php');
/**
* imscp backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides the steps to perform one complete backup of the IMSCP instance
*/
class backup_imscp_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the imscp.xml file
*/
protected function define_my_steps() {
// Choice only has one structure step
$this->add_step(new backup_imscp_activity_structure_step('imscp_structure', 'imscp.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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;
@@ -16,40 +16,41 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package mod
* @subpackage label
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_label_activity_task class
*
* @package mod_label
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
require_once($CFG->dirroot . '/mod/label/backup/moodle2/backup_label_stepslib.php'); // Because it exists (must)
require_once($CFG->dirroot . '/mod/label/backup/moodle2/backup_label_stepslib.php');
/**
* label backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides the steps to perform one complete backup of the Label instance
*/
class backup_label_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the label.xml file
*/
protected function define_my_steps() {
// Choice only has one structure step
$this->add_step(new backup_label_activity_structure_step('label_structure', 'label.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* No content encoding needed for this activity
*
* @param string $content some HTML text that eventually contains URLs to the activity instance scripts
* @return string the same content with no changes
*/
static public function encode_content_links($content) {
return $content;
@@ -18,38 +18,42 @@
/**
* This file contains the backup task for the lesson module
*
* @package mod
* @subpackage lesson
* @copyright 2010 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package mod_lesson
* @category backup
* @copyright 2010 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Require the backup lesson steps lib
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/lesson/backup/moodle2/backup_lesson_stepslib.php');
/**
* The backup task class for the lesson module
* Provides the steps to perform one complete backup of the Lesson instance
*
* @copyright 2010 Sam Hemelryk
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class backup_lesson_activity_task extends backup_activity_task {
/**
* No specific settings for this activity
*/
protected function define_my_settings() {
// There are no settings
}
/**
* Defines a backup step to store the instance data in the lesson.xml file
*/
protected function define_my_steps() {
$this->add_step(new backup_lesson_activity_structure_step('lesson structure', 'lesson.xml'));
}
/**
* Replaces links within the content with links that can be corrected during
* restore
* Encodes URLs to various Lesson scripts
*
* @param string $content
* @return string
* @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;
@@ -104,5 +108,4 @@ class backup_lesson_activity_task extends backup_activity_task {
// Return the now encoded content
return $content;
}
}
@@ -33,17 +33,16 @@
// Contact info: Marc Alier Forment granludo @ gmail.com or marc.alier @ upc.edu
/**
* This file contains the lti module backup class
* Defines backup_lti_activity_task class
*
* @package mod
* @subpackage lti
* @copyright 2009 Marc Alier, Jordi Piguillem, Nikolas Galanis
* marc.alier@upc.edu
* @copyright 2009 Universitat Politecnica de Catalunya http://www.upc.edu
* @author Marc Alier
* @author Jordi Piguillem
* @author Nikolas Galanis
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package mod_lti
* @category backup
* @copyright 2009 Marc Alier <[email protected]>, Jordi Piguillem, Nikolas Galanis
* @copyright 2009 Universitat Politecnica de Catalunya http://www.upc.edu
* @author Marc Alier
* @author Jordi Piguillem
* @author Nikolas Galanis
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
@@ -51,29 +50,28 @@ defined('MOODLE_INTERNAL') || die;
require_once($CFG->dirroot . '/mod/lti/backup/moodle2/backup_lti_stepslib.php');
/**
* lti backup task that provides all the settings and steps to perform one
* complete backup of the module
* Provides the steps to perform one complete backup of the LTI instance
*/
class backup_lti_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the lti.xml file
*/
protected function define_my_steps() {
// Choice only has one structure step
$this->add_step(new backup_lti_activity_structure_step('lti_structure', 'lti.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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;
@@ -16,40 +16,41 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package mod
* @subpackage page
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_page_activity_task class
*
* @package mod_page
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
require_once($CFG->dirroot . '/mod/page/backup/moodle2/backup_page_stepslib.php'); // Because it exists (must)
require_once($CFG->dirroot . '/mod/page/backup/moodle2/backup_page_stepslib.php');
/**
* page backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides the steps to perform one complete backup of the Page instance
*/
class backup_page_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the page.xml file
*/
protected function define_my_steps() {
// Choice only has one structure step
$this->add_step(new backup_page_activity_structure_step('page_structure', 'page.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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;
@@ -15,21 +15,20 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_quiz_activity_task class
*
* @package mod_quiz
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/quiz/backup/moodle2/backup_quiz_stepslib.php');
/**
* quiz backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides the steps to perform one complete backup of the Quiz instance
*
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
@@ -37,14 +36,13 @@ require_once($CFG->dirroot . '/mod/quiz/backup/moodle2/backup_quiz_stepslib.php'
class backup_quiz_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines backup steps to store the instance data and required questions
*/
protected function define_my_steps() {
// Generate the quiz.xml file containing all the quiz information
@@ -67,8 +65,10 @@ class backup_quiz_activity_task extends backup_activity_task {
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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
*/
public static function encode_content_links($content) {
global $CFG;
@@ -16,40 +16,41 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package mod
* @subpackage resource
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_resource_activity_task class
*
* @package mod_resource
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
require_once($CFG->dirroot . '/mod/resource/backup/moodle2/backup_resource_stepslib.php'); // Because it exists (must)
require_once($CFG->dirroot . '/mod/resource/backup/moodle2/backup_resource_stepslib.php');
/**
* resource backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides the steps to perform one complete backup of the Resource instance
*/
class backup_resource_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the resource.xml file
*/
protected function define_my_steps() {
// Choice only has one structure step
$this->add_step(new backup_resource_activity_structure_step('resource_structure', 'resource.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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;
@@ -15,38 +15,41 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_scorm_activity_task class
*
* @package mod_scorm
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->dirroot . '/mod/scorm/backup/moodle2/backup_scorm_stepslib.php'); // Because it exists (must)
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/scorm/backup/moodle2/backup_scorm_stepslib.php');
/**
* scorm backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides the steps to perform one complete backup of the SCORM instance
*/
class backup_scorm_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the scorm.xml file
*/
protected function define_my_steps() {
// SCORM only has one structure step
$this->add_step(new backup_scorm_activity_structure_step('scorm_structure', 'scorm.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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;
@@ -16,38 +16,41 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package moodlecore
* @subpackage backup-moodle2
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_survey_activity_task class
*
* @package mod_survey
* @category backup
* @copyright 2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->dirroot . '/mod/survey/backup/moodle2/backup_survey_stepslib.php'); // Because it exists (must)
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/survey/backup/moodle2/backup_survey_stepslib.php');
/**
* survey backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides all the settings and steps to perform one complete backup of the activity
*/
class backup_survey_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the survey.xml file
*/
protected function define_my_steps() {
// Choice only has one structure step
$this->add_step(new backup_survey_activity_structure_step('survey_structure', 'survey.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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;
@@ -16,43 +16,41 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* @package mod
* @subpackage url
* @copyright 2010 onwards Andrew Davis
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* Defines backup_url_activity_task class
*
* @package mod_url
* @category backup
* @copyright 2010 onwards Andrew Davis
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
// This activity has not particular settings but the inherited from the generic
// backup_activity_task so here there isn't any class definition, like the ones
// existing in /backup/moodle2/backup_settingslib.php (activities section)
require_once($CFG->dirroot . '/mod/url/backup/moodle2/backup_url_stepslib.php'); // Because it exists (must)
require_once($CFG->dirroot . '/mod/url/backup/moodle2/backup_url_stepslib.php');
/**
* URL backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Provides all the settings and steps to perform one complete backup of the activity
*/
class backup_url_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the url.xml file
*/
protected function define_my_steps() {
$this->add_step(new backup_url_activity_structure_step('url_structure', 'url.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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;
@@ -1,32 +1,57 @@
<?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)
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* wiki backup task that provides all the settings and steps to perform one
* complete backup of the activity
* Defines backup_wiki_activity_task class
*
* @package mod_wiki
* @category backup
* @copyright 2010 Jordi Piguillem <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/wiki/backup/moodle2/backup_wiki_stepslib.php');
require_once($CFG->dirroot . '/mod/wiki/backup/moodle2/backup_wiki_settingslib.php');
/**
* 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
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the wiki.xml file
*/
protected function define_my_steps() {
// Wiki only has one structure step
$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
* 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;
@@ -16,12 +16,12 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Class {@link backup_workshop_activity_task} definition
* Defines {@link backup_workshop_activity_task} class
*
* @package mod
* @subpackage workshop
* @copyright 2010 David Mudrak <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package mod_workshop
* @category backup
* @copyright 2010 David Mudrak <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
@@ -35,22 +35,23 @@ require_once($CFG->dirroot . '/mod/workshop/backup/moodle2/backup_workshop_steps
class backup_workshop_activity_task extends backup_activity_task {
/**
* Define (add) particular settings this activity can have
* No specific settings for this activity
*/
protected function define_my_settings() {
// No particular settings for this activity
}
/**
* Define (add) particular steps this activity can have
* Defines a backup step to store the instance data in the workshop.xml file
*/
protected function define_my_steps() {
$this->add_step(new backup_workshop_activity_structure_step('workshop_structure', 'workshop.xml'));
}
/**
* Code the transformations to perform in the activity in
* order to get transportable (encoded) links
* 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;
@@ -21,10 +21,10 @@
* Workshop has no particular settings but the inherited from the generic
* {@link backup_activity_task}.
*
* @package mod
* @subpackage workshop
* @copyright 2010 David Mudrak <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package mod_workshop
* @category backup
* @copyright 2010 David Mudrak <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
@@ -18,10 +18,10 @@
/**
* Defines all the backup steps that will be used by {@link backup_workshop_activity_task}
*
* @package mod
* @subpackage workshop
* @copyright 2010 David Mudrak <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package mod_workshop
* @category backup
* @copyright 2010 David Mudrak <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
@@ -29,10 +29,15 @@ defined('MOODLE_INTERNAL') || die();
/**
* Defines the complete workshop structure for backup, with file and id annotations
*
* @see http://docs.moodle.org/dev/Workshop for XML structure diagram
* @link http://docs.moodle.org/dev/Workshop for XML structure diagram
*/
class backup_workshop_activity_structure_step extends backup_activity_structure_step {
/**
* Defines the structure of the 'workshop' element inside the workshop.xml file
*
* @return backup_nested_element
*/
protected function define_structure() {
// are we including userinfo?