fm_close_progress_bar
bool fm_close_progress_bar ( string $progress_bar_name
)
Description
Allows you to close a progress bar. If the progress bar is a parent, the dialog will be closed. If the progress bar is a child, it will be removed from the parent but the parent and any sibling progress bars will remain open.
Parameters
progress_bar_name
(required)
The name of the progress bar to close.
Return
Returns true if the progress bar was closed or false if the progress bar doesn’t exist.
Errors
315 Function not supported on server
904 Progress bar doesn’t exist
Example 1 - Display a progress bar with 10 steps
$name = 'Test'; $steps = 10; $message = 'Testing, one moment please...'; $left = 25; $top = 50; $enableCancelButton = true; $cancelButtonLabel = 'Stop'; fm_new_progress_bar($name, $steps, $message, $left, $top, $enableCancelButton, $cancelButtonLabel); for ($i = 0; $i < $steps ; $i++) { sleep(1); // this is where you would do your processing fm_update_progress_bar($name, 1, $message . " step " . ($i + 1)); if (fm_user_cancelled() === true) break; } // Make sure to close the progress bar. fm_close_progress_bar($name);
Change Log
Version | Description |
---|---|
3.0.0 | Added support for closing child progress bars. |