Differences Between: [Versions 310 and 402] [Versions 402 and 403]
restore user interface stages This file contains the classes required to manage the stages that make up the restore user interface. These will be primarily operated a {@link restore_ui} instance.
Copyright: | 2010 Sam Hemelryk |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 1172 lines (41 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
restore_ui_stage:: (6 methods):
__construct()
get_restoreid()
is_independent()
has_sub_stages()
get_name()
is_first_stage()
restore_ui_independent_stage:: (5 methods):
get_progress_reporter()
set_progress_reporter()
get_progress_bar()
is_independent()
destroy()
restore_ui_stage_confirm:: (7 methods):
__construct()
process()
extract_file_to_dir()
progress()
display()
get_stage_name()
get_stage()
restore_ui_stage_destination:: (8 methods):
__construct()
process()
display()
get_stage_name()
get_filepath()
get_course_id()
get_stage()
get_target()
restore_ui_stage_settings:: (3 methods):
__construct()
process()
initialise_stage_form()
restore_ui_stage_schema:: (3 methods):
__construct()
process()
initialise_stage_form()
restore_ui_stage_review:: (3 methods):
__construct()
process()
initialise_stage_form()
restore_ui_stage_process:: (5 methods):
__construct()
process()
initialise_stage_form()
display()
has_sub_stages()
restore_ui_stage_complete:: (2 methods):
__construct()
display()
Class: restore_ui_stage - X-Ref
Abstract stage class__construct(restore_ui $ui, array $params = null) X-Ref |
Constructor param: restore_ui $ui param: array $params |
get_restoreid() X-Ref |
The restore id from the restore controller return: string |
is_independent() X-Ref |
This is an independent stage return: int |
has_sub_stages() X-Ref |
No sub stages for this stage return: false |
get_name() X-Ref |
The name of this stage return: string |
is_first_stage() X-Ref |
Returns true if this is the settings stage return: bool |
Class: restore_ui_independent_stage - X-Ref
Abstract class used to represent a restore stage that is indenependent.get_progress_reporter() X-Ref |
Gets the progress reporter object in use for this restore UI stage. IMPORTANT: This progress reporter is used only for UI progress that is outside the restore controller. The restore controller has its own progress reporter which is used for progress during the main restore. Use the restore controller's progress reporter to report progress during a restore operation, not this one. This extra reporter is necessary because on some restore UI screens, there are long-running tasks even though there is no restore controller in use. There is a similar function in restore_ui. but that class is not used on some stages. return: \core\progress\none |
set_progress_reporter(\core\progress\base $progressreporter) X-Ref |
Sets the progress reporter that will be returned by get_progress_reporter. param: \core\progress\base $progressreporter Progress reporter |
get_progress_bar() X-Ref |
Gets an array of progress bar items that can be displayed through the restore renderer. return: array Array of items for the progress bar |
is_independent() X-Ref |
Obviously true return: true |
destroy() X-Ref |
Handles the destruction of this object. |
Class: restore_ui_stage_confirm - X-Ref
The confirmation stage.__construct($contextid) X-Ref |
Constructor param: int $contextid |
process() X-Ref |
Processes this restore stage return: bool |
extract_file_to_dir($source) X-Ref |
Extracts the file. param: string|stored_file $source Archive file to extract return: bool |
progress($progress = file_progress::INDETERMINATE, $max = file_progress::INDETERMINATE) X-Ref |
Implementation for file_progress interface to display unzip progress. param: int $progress Current progress param: int $max Max value |
display(core_backup_renderer $renderer) X-Ref |
Renders the confirmation stage screen param: core_backup_renderer $renderer renderer instance to use return: string HTML code |
get_stage_name() X-Ref |
The restore stage name. return: string |
get_stage() X-Ref |
The restore stage this class is for. return: int |
Class: restore_ui_stage_destination - X-Ref
This is the destination stage.__construct($contextid) X-Ref |
Constructs the destination stage. param: int $contextid |
process() X-Ref |
Processes the destination stage. return: bool |
display(core_backup_renderer $renderer) X-Ref |
Renders the destination stage screen param: core_backup_renderer $renderer renderer instance to use return: string HTML code |
get_stage_name() X-Ref |
Returns the stage name. return: string |
get_filepath() X-Ref |
Returns the backup file path return: mixed|null |
get_course_id() X-Ref |
Returns the course id. return: null |
get_stage() X-Ref |
Returns the current restore stage return: int |
get_target() X-Ref |
Returns the target for this restore. One of backup::TARGET_* return: int |
Class: restore_ui_stage_settings - X-Ref
This stage is the settings stage.__construct(restore_ui $ui, array $params = null) X-Ref |
Initial restore stage constructor param: restore_ui $ui param: array $params |
process(base_moodleform $form = null) X-Ref |
Process the settings stage. param: base_moodleform $form return: bool|int |
initialise_stage_form() X-Ref |
Initialise the stage form. return: backup_moodleform|base_moodleform|restore_settings_form |
Class: restore_ui_stage_schema - X-Ref
Schema stage of backup process__construct(restore_ui $ui, array $params = null) X-Ref |
Schema stage constructor param: restore_ui $ui param: array $params |
process(base_moodleform $form = null) X-Ref |
Processes the schema stage param: base_moodleform $form return: int The number of changes the user made |
initialise_stage_form() X-Ref |
Creates the backup_schema_form instance for this stage return: backup_schema_form |
Class: restore_ui_stage_review - X-Ref
Confirmation stage__construct($ui, array $params = null) X-Ref |
Constructs the stage param: restore_ui $ui param: array $params |
process(base_moodleform $form = null) X-Ref |
Processes the confirmation stage param: base_moodleform $form return: int The number of changes the user made |
initialise_stage_form() X-Ref |
Creates the backup_confirmation_form instance this stage requires return: backup_confirmation_form |
Class: restore_ui_stage_process - X-Ref
Final stage of backup__construct(base_ui $ui, array $params = null) X-Ref |
Constructs the final stage param: base_ui $ui param: array $params |
process(base_moodleform $form = null) X-Ref |
Processes the final stage. In this case it checks to see if there is a sub stage that we need to display before execution, if there is we gear up to display the subpage, otherwise we return true which will lead to execution of the restore and the loading of the completed stage. param: base_moodleform $form |
initialise_stage_form() X-Ref |
should NEVER be called... throws an exception |
display(core_backup_renderer $renderer) X-Ref |
Renders the process stage screen param: core_backup_renderer $renderer renderer instance to use return: string HTML code |
has_sub_stages() X-Ref |
Returns true if this stage can have sub-stages. return: bool|false |
Class: restore_ui_stage_complete - X-Ref
This is the completed stage.__construct(restore_ui $ui, array $params = null, array $results = null) X-Ref |
Constructs the complete backup stage param: restore_ui $ui param: array $params param: array $results |
display(core_backup_renderer $renderer) X-Ref |
Displays the completed backup stage. Currently this just envolves redirecting to the file browser with an appropriate message. param: core_backup_renderer $renderer return: string HTML code to echo |