Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402]

This file contains extension of the backup classes that override some methods and functionality in order to customise the backup UI for the purposes of import.

Copyright: 2010 Sam Hemelryk
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 279 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 7 classes

import_ui:: (2 methods):
  get_progress_bar()
  initialise_stage()

import_ui_stage_inital:: (0 methods):

import_ui_stage_precheck:: (4 methods):
  __construct()
  process()
  get_next_stage()
  initialise_stage_form()

import_ui_stage_schema:: (0 methods):

import_ui_stage_confirmation:: (2 methods):
  initialise_stage_form()
  display()

import_ui_stage_final:: (0 methods):

import_course_search:: (1 method):
  setup_restrictions()


Class: import_ui  - X-Ref

Import UI class

get_progress_bar()   X-Ref
Customises the backup progress bar

return: array[] An array of arrays

initialise_stage($stage = null, array $params = null)   X-Ref
Intialises what ever stage is requested. If none are requested we check
params for 'stage' and default to initial

param: int|null $stage The desired stage to intialise or null for the default
param: array $params
return: backup_ui_stage_initial|backup_ui_stage_schema|backup_ui_stage_confirmation|backup_ui_stage_final

Class: import_ui_stage_inital  - X-Ref

Extends the initial stage

Class: import_ui_stage_precheck  - X-Ref

Class representing the precheck/selection stage of a import.

In this stage the user is required to perform initial selections.
That is a choice of which course to import from.

__construct(backup_ui $ui, array $params = null)   X-Ref
Precheck/selection import stage constructor

param: backup_ui $ui
param: array $params

process(base_moodleform $form = null)   X-Ref
Processes the precheck/selection import stage

param: base_moodleform|null $form

get_next_stage()   X-Ref
Gets the next stage for the import.

return: int

initialise_stage_form()   X-Ref
Initialises the backup_moodleform instance for this stage

return: backup_moodleform|void

Class: import_ui_stage_schema  - X-Ref

Extends the schema stage

Class: import_ui_stage_confirmation  - X-Ref

Extends the confirmation stage.

This overides the initialise stage form to remove the filenamesetting heading
as it is always hidden.

initialise_stage_form()   X-Ref
Initialises the stages moodleform

return: base_moodleform

display(core_backup_renderer $renderer)   X-Ref
Displays the stage

This function is overriden so that we can manipulate the strings on the
buttons.

param: core_backup_renderer $renderer
return: string HTML code to echo

Class: import_ui_stage_final  - X-Ref

Overrides the final stage.

Class: import_course_search  - X-Ref

Extends the restore course search to search for import courses.

setup_restrictions()   X-Ref
Sets up any access restrictions for the courses to be displayed in the search.

This will typically call $this->require_capability().