Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
backup_ui Class Reference

This file contains the backup user interface class. More...

Inheritance diagram for backup_ui:

Public Member Functions

 cancel_process ()
 Cancels the current backup/restore and redirects the user back to the relevant place.
 
 destroy ()
 Destorys the backup controller and the loaded stage.
 
 display (core_backup_renderer $renderer)
 Displays the UI for the backup!
 
 enforce_changed_dependencies ()
 Returns true if enforce_dependencies changed any settings.
 
 execute ()
 Executes the backup plan.
 
 get_backupid ()
 Gets the backup id from the controller.
 
 get_controller ()
 Returns the controller object.
 
 get_controller_id ()
 Gets the ID used in creating the controller.
 
 get_first_stage_id ()
 Gets the id of the first stage this UI is reponsible for.
 
 get_format ()
 Gets the format for the backup.
 
 get_name ()
 Gets the name related to the operation of this UI.
 
 get_progress_bar ()
 Gets an array of progress bar items that can be displayed through the backup renderer.
 
 get_setting ($name, $default=false)
 Gets the requested setting.
 
 get_setting_value ($name, $default=false)
 Gets the value for the requested setting.
 
 get_stage ()
 Gets the stage we are on.
 
 get_stage_name ()
 Gets the name of the stage we are on.
 
 get_tasks ()
 Gets all backup tasks from the controller.
 
 get_type ()
 Gets the type of the backup.
 
 get_uniqueid ()
 Returns the backup id.
 
 process ()
 This processes the current stage of the backup.
 
 save_controller ()
 Saves the backup controller.
 

Static Public Member Functions

static load_controller ($backupid=false)
 Loads the backup controller if we are tracking one.
 
static skip_current_stage ($setting=true)
 If called with default arg the current stage gets skipped.
 

Public Attributes

const PROGRESS_EXECUTED = 3
 The progress of this instance of the backup ui class It has been executed.
 
const PROGRESS_INTIAL = 0
 The progress of this instance of the backup ui class It is in the initial stage.
 
const PROGRESS_PROCESSED = 1
 The progress of this instance of the backup ui class It is processed.
 
const PROGRESS_SAVED = 2
 The progress of this instance of the backup ui class It is saved.
 
const STAGE_COMPLETE = 16
 The stages of the backup user interface.
 
const STAGE_CONFIRMATION = 4
 The stages of the backup user interface.
 
const STAGE_FINAL = 8
 The stages of the backup user interface.
 
const STAGE_INITIAL = 1
 The stages of the backup user interface.
 
const STAGE_SCHEMA = 2
 The stages of the backup user interface.
 

Protected Member Functions

 enforce_dependencies ()
 Enforces dependencies on all settings.
 
 initialise_stage ($stage=null, array $params=null)
 Intialises what ever stage is requested.
 

Protected Attributes

backup_controller restore_controller $controller
 The controller.
 
int $dependencychanges = 0
 The number of changes made by dependency enforcement.
 
int $progress
 The current progress of the UI One of self\PROGRESS_*.
 
base_ui_stage $stage
 The current stage.
 

Static Protected Attributes

static bool $skipcurrentstage = false
 If set to true the current stage is skipped.
 

Detailed Description

This file contains the backup user interface class.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later This is the backup user interface class

The backup user interface class manages the user interface and backup for Moodle.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ cancel_process()

base_ui::cancel_process ( )
inherited

Cancels the current backup/restore and redirects the user back to the relevant place.

Reimplemented in restore_ui.

◆ display()

base_ui::display ( core_backup_renderer $renderer)
inherited

Displays the UI for the backup!

Exceptions
base_ui_exception
Parameters
core_backup_renderer$renderer
Return values
stringHTML code to echo

Reimplemented in restore_ui.

◆ enforce_changed_dependencies()

base_ui::enforce_changed_dependencies ( )
inherited

Returns true if enforce_dependencies changed any settings.

Return values
bool

Reimplemented in restore_ui.

◆ enforce_dependencies()

base_ui::enforce_dependencies ( )
protectedinherited

Enforces dependencies on all settings.

Call before save

Return values
boolTrue if dependencies were enforced and changes were made

◆ execute()

backup_ui::execute ( )

Executes the backup plan.

Exceptions
backup_ui_exceptionwhen the steps are wrong.
Return values
bool

Reimplemented from base_ui.

◆ get_backupid()

backup_ui::get_backupid ( )

Gets the backup id from the controller.

Return values
string

◆ get_controller()

base_ui::get_controller ( )
inherited

Returns the controller object.

Return values
backup_controller|restore_controller

◆ get_controller_id()

base_ui::get_controller_id ( )
inherited

Gets the ID used in creating the controller.

Relates to course/section/cm

Return values
int

◆ get_first_stage_id()

backup_ui::get_first_stage_id ( )

Gets the id of the first stage this UI is reponsible for.

Return values
int

Reimplemented from base_ui.

◆ get_format()

base_ui::get_format ( )
inherited

Gets the format for the backup.

Return values
int

◆ get_name()

backup_ui::get_name ( )

Gets the name related to the operation of this UI.

Return values
string

Reimplemented from base_ui.

◆ get_progress_bar()

backup_ui::get_progress_bar ( )

Gets an array of progress bar items that can be displayed through the backup renderer.

Return values
arrayArray of items for the progress bar

Reimplemented from base_ui.

Reimplemented in import_ui.

◆ get_setting()

base_ui::get_setting ( $name,
$default = false )
inherited

Gets the requested setting.

Parameters
string$name
bool$default
Return values
base_setting

◆ get_setting_value()

base_ui::get_setting_value ( $name,
$default = false )
inherited

Gets the value for the requested setting.

Parameters
string$name
bool$default
Return values
mixed

◆ get_stage()

base_ui::get_stage ( )
inherited

Gets the stage we are on.

Return values
int

◆ get_stage_name()

base_ui::get_stage_name ( )
inherited

Gets the name of the stage we are on.

Return values
string

◆ get_tasks()

base_ui::get_tasks ( )
inherited

Gets all backup tasks from the controller.

Return values
arrayArray of backup_task

◆ get_type()

base_ui::get_type ( )
inherited

Gets the type of the backup.

Return values
int

◆ get_uniqueid()

backup_ui::get_uniqueid ( )

Returns the backup id.

Return values
string

Reimplemented from base_ui.

◆ initialise_stage()

backup_ui::initialise_stage ( $stage = null,
array $params = null )
protected

Intialises what ever stage is requested.

If none are requested we check params for 'stage' and default to initial

Parameters
int$stageThe desired stage to intialise or null for the default
array$params
Return values
backup_ui_stage_initial|backup_ui_stage_schema|backup_ui_stage_confirmation|backup_ui_stage_final

Reimplemented from base_ui.

Reimplemented in import_ui.

◆ load_controller()

static backup_ui::load_controller ( $backupid = false)
staticfinal

Loads the backup controller if we are tracking one.

Parameters
string$backupid
Return values
backup_controller|false

Reimplemented from base_ui.

◆ process()

base_ui::process ( )
inherited

This processes the current stage of the backup.

Exceptions
backup_ui_exception
Return values
bool

Reimplemented in restore_ui.

◆ save_controller()

base_ui::save_controller ( )
inherited

Saves the backup controller.

Once this has been called nothing else can be changed in the controller.

Exceptions
base_ui_exception
Return values
bool

◆ skip_current_stage()

static backup_ui::skip_current_stage ( $setting = true)
static

If called with default arg the current stage gets skipped.

Parameters
bool$settingSet to true (default) if you want to skip this stage, false otherwise.

Member Data Documentation

◆ STAGE_COMPLETE

const backup_ui::STAGE_COMPLETE = 16

The stages of the backup user interface.

The backup is now complete.

◆ STAGE_CONFIRMATION

const backup_ui::STAGE_CONFIRMATION = 4

The stages of the backup user interface.

The confirmation stage of the backup.

◆ STAGE_FINAL

const backup_ui::STAGE_FINAL = 8

The stages of the backup user interface.

The final stage of the backup - where it is being processed.

◆ STAGE_INITIAL

const backup_ui::STAGE_INITIAL = 1

The stages of the backup user interface.

The initial stage of the backup - settings are here.

◆ STAGE_SCHEMA

const backup_ui::STAGE_SCHEMA = 2

The stages of the backup user interface.

The schema stage of the backup - here you choose the bits you include.


The documentation for this class was generated from the following file: