Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | List of all members
progress_bar Class Reference
Inheritance diagram for progress_bar:
renderable templatable

Public Member Functions

 __construct ($htmlid='', $width=500, $autostart=false)
 Constructor. More...
 
 create ()
 Create a new progress bar, this function will output html. More...
 
 export_for_template (renderer_base $output)
 Export for template. More...
 
 restart ()
 Restart the progress bar.
 
 update ($cur, $total, $msg)
 Update progress bar according the number of tasks. More...
 
 update_full ($percent, $msg)
 Update progress bar according percent. More...
 

Constructor & Destructor Documentation

◆ __construct()

progress_bar::__construct (   $htmlid = '',
  $width = 500,
  $autostart = false 
)

Constructor.

Prints JS code if $autostart true.

Parameters
string$htmlidThe container ID.
int$widthThe suggested width.
bool$autostartWhether to start the progress bar right away.

Member Function Documentation

◆ create()

progress_bar::create ( )

Create a new progress bar, this function will output html.

Return values
voidEcho's output

◆ export_for_template()

progress_bar::export_for_template ( renderer_base  $output)

Export for template.

Parameters
renderer_base$outputThe renderer.
Return values
array

Implements templatable.

◆ update()

progress_bar::update (   $cur,
  $total,
  $msg 
)

Update progress bar according the number of tasks.

Parameters
int$curCurrent task number.
int$totalTotal task number.
string$msgThe message needed to be shown.

◆ update_full()

progress_bar::update_full (   $percent,
  $msg 
)

Update progress bar according percent.

Parameters
int$percentFrom 1-100.
string$msgThe message needed to be shown.

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