Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
base_ui Class Reference

This is the backup user interface class. More...

Inheritance diagram for base_ui:
backup_ui restore_ui import_ui

Public Member Functions

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

Static Public Member Functions

static load_controller ($uniqueid=false)
 Loads the backup controller if we are tracking one. More...
 

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.
 

Protected Member Functions

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

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.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

base_ui::__construct (   $controller,
array  $params = null 
)

Yay for constructors.

Parameters
backup_controller$controller
array$params

Member Function Documentation

◆ cancel_process()

base_ui::cancel_process ( )

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)

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 ( )

Returns true if enforce_dependencies changed any settings.

Return values
bool

Reimplemented in restore_ui.

◆ enforce_dependencies()

base_ui::enforce_dependencies ( )
protected

Enforces dependencies on all settings.

Call before save

Return values
boolTrue if dependencies were enforced and changes were made

◆ execute()

base_ui::execute ( )
abstract

Executes the backup plan.

Return values
bool

Reimplemented in backup_ui, and restore_ui.

◆ get_controller()

base_ui::get_controller ( )

Returns the controller object.

Return values
backup_controller|restore_controller

◆ get_controller_id()

base_ui::get_controller_id ( )

Gets the ID used in creating the controller.

Relates to course/section/cm

Return values
int

◆ get_first_stage_id()

base_ui::get_first_stage_id ( )
abstract

Returns the first stage ID.

Return values
mixed

Reimplemented in backup_ui, and restore_ui.

◆ get_format()

base_ui::get_format ( )

Gets the format for the backup.

Return values
int

◆ get_name()

base_ui::get_name ( )
abstract

Returns the name of this stage.

Return values
mixed

Reimplemented in backup_ui, and restore_ui.

◆ get_progress_bar()

base_ui::get_progress_bar ( )
abstract

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 in backup_ui, import_ui, and restore_ui.

◆ get_setting()

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

Gets the requested setting.

Parameters
string$name
bool$default
Return values
base_setting

◆ get_setting_value()

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

Gets the value for the requested setting.

Parameters
string$name
bool$default
Return values
mixed

◆ get_stage()

base_ui::get_stage ( )

Gets the stage we are on.

Return values
int

◆ get_stage_name()

base_ui::get_stage_name ( )

Gets the name of the stage we are on.

Return values
string

◆ get_tasks()

base_ui::get_tasks ( )

Gets all backup tasks from the controller.

Return values
arrayArray of backup_task

◆ get_type()

base_ui::get_type ( )

Gets the type of the backup.

Return values
int

◆ get_uniqueid()

base_ui::get_uniqueid ( )
abstract

Gets the backup id from the controller.

Return values
string

Reimplemented in backup_ui, and restore_ui.

◆ initialise_stage()

base_ui::initialise_stage (   $stage = null,
array  $params = null 
)
abstractprotected

Intialises what ever stage is requested.

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

Parameters
int | null$stageThe desired stage to intialise or null for the default
array$params
Return values
base_ui_stage

Reimplemented in backup_ui, import_ui, and restore_ui.

◆ load_controller()

static base_ui::load_controller (   $uniqueid = false)
static

Loads the backup controller if we are tracking one.

Exceptions
coding_exception
Parameters
string | bool$uniqueid
Return values
backup_controller|false

Reimplemented in backup_ui, and restore_ui.

◆ process()

base_ui::process ( )

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 ( )

Saves the backup controller.

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

Exceptions
base_ui_exception
Return values
bool

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