Moodle APIs  3.8
Moodle 3.8.6 (Build: 20201109)
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
restore_ui_stage_confirm Class Reference

The confirmation stage. More...

Inheritance diagram for restore_ui_stage_confirm:
restore_ui_independent_stage file_progress

Public Member Functions

 __construct ($contextid)
 Constructor. More...
 
 destroy ()
 Handles the destruction of this object.
 
 display (core_backup_renderer $renderer)
 Renders the confirmation stage screen. More...
 
 get_progress_bar ()
 Gets an array of progress bar items that can be displayed through the restore renderer. More...
 
 get_progress_reporter ()
 Gets the progress reporter object in use for this restore UI stage. More...
 
 get_stage ()
 The restore stage this class is for. More...
 
 get_stage_name ()
 The restore stage name. More...
 
 is_independent ()
 Obviously true. More...
 
 process ()
 Processes this restore stage. More...
 
 progress ($progress=file_progress::INDETERMINATE, $max=file_progress::INDETERMINATE)
 Implementation for file_progress interface to display unzip progress. More...
 
 set_progress_reporter (\core\progress\base $progressreporter)
 Sets the progress reporter that will be returned by get_progress_reporter. More...
 

Public Attributes

int const INDETERMINATE = -1
 Constant used for indeterminate progress.
 

Protected Member Functions

 extract_file_to_dir ($source)
 Extracts the file. More...
 

Protected Attributes

string $contenthash = null
 Content hash of archive file to restore (if specified by hash)
 
int $contextid
 The context ID.
 
array $details
 
string $filename = null
 The file name.
 
string $filepath = null
 The file path.
 
string $pathnamehash = null
 Pathname hash of stored_file object to restore.
 
bool $startedprogress = false
 True if we have started reporting progress.
 

Detailed Description

The confirmation stage.

This is the first stage, it is independent.

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

Constructor & Destructor Documentation

◆ __construct()

restore_ui_stage_confirm::__construct (   $contextid)

Constructor.

Parameters
int$contextid
Exceptions
coding_exception

Reimplemented from restore_ui_independent_stage.

Member Function Documentation

◆ display()

restore_ui_stage_confirm::display ( core_backup_renderer  $renderer)

Renders the confirmation stage screen.

Parameters
core_backup_renderer$rendererrenderer instance to use
Return values
stringHTML code

Reimplemented from restore_ui_independent_stage.

◆ extract_file_to_dir()

restore_ui_stage_confirm::extract_file_to_dir (   $source)
protected

Extracts the file.

Parameters
string | stored_file$sourceArchive file to extract
Return values
bool

◆ get_progress_bar()

restore_ui_independent_stage::get_progress_bar ( )
inherited

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

Return values
arrayArray of items for the progress bar

◆ get_progress_reporter()

restore_ui_independent_stage::get_progress_reporter ( )
inherited

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 values
core

◆ get_stage()

restore_ui_stage_confirm::get_stage ( )

The restore stage this class is for.

Return values
int

Reimplemented from restore_ui_independent_stage.

◆ get_stage_name()

restore_ui_stage_confirm::get_stage_name ( )

The restore stage name.

Return values
string
Exceptions
coding_exception

Reimplemented from restore_ui_independent_stage.

◆ is_independent()

restore_ui_independent_stage::is_independent ( )
finalinherited

Obviously true.

Return values
true

◆ process()

restore_ui_stage_confirm::process ( )

Processes this restore stage.

Return values
bool
Exceptions
restore_ui_exception

Reimplemented from restore_ui_independent_stage.

◆ progress()

restore_ui_stage_confirm::progress (   $progress = file_progress::INDETERMINATE,
  $max = file_progress::INDETERMINATE 
)

Implementation for file_progress interface to display unzip progress.

Parameters
int$progressCurrent progress
int$maxMax value

Implements file_progress.

◆ set_progress_reporter()

restore_ui_independent_stage::set_progress_reporter ( \core\progress\base  $progressreporter)
inherited

Sets the progress reporter that will be returned by get_progress_reporter.

Parameters
core\progress\base$progressreporterProgress reporter

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