Skip to content

Commit

Permalink
fix return value use
Browse files Browse the repository at this point in the history
  • Loading branch information
cconard96 committed Apr 11, 2024
1 parent ad0832b commit 1afc8eb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions src/Html.php
Expand Up @@ -839,8 +839,8 @@ public static function getConfirmationOnActionScript($string, $additionalactions
*
* @since 0.85
*
* @param $id HTML ID of the progress bar
* @param $options array progress status
* @param string $id HTML ID of the progress bar
* @param array $options progress status options
* - create do we have to create it ?
* - message add or change the message
* - percent current level
Expand All @@ -850,7 +850,6 @@ public static function getConfirmationOnActionScript($string, $additionalactions
**/
public static function progressBar($id, array $options = [])
{

$params = [
'create' => false,
'message' => null,
Expand Down Expand Up @@ -938,17 +937,23 @@ public static function progressBar($id, array $options = [])
* Create a Dynamic Progress Bar
*
* @param string $msg initial message (under the bar)
* @param array $options See {@link Html::progressBar()} for available options (excluding message)
*
* @return void
* @return string|void
**/
public static function createProgressBar($msg = " ")
public static function createProgressBar($msg = " ", array $options = [])
{

$options = ['create' => true];
if ($msg != " ") {
$options = array_replace([
'create' => true,
'display' => true
], $options);
if ($msg !== " ") {
$options['message'] = $msg;
}

if (!$options['display']) {
return self::progressBar('doaction_progress', $options);
}
self::progressBar('doaction_progress', $options);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Software.php
Expand Up @@ -980,7 +980,7 @@ public function merge($item, $html = true)
if ($html) {
$twig_params = [
'merge_msg' => __('Merging'),
'progress' => Html::createProgressBar(__('Work in progress...'))
'progress' => Html::createProgressBar(__('Work in progress...'), ['display' => false])
];
// language=Twig
echo TemplateRenderer::getInstance()->renderFromStringTemplate(<<<TWIG
Expand Down

0 comments on commit 1afc8eb

Please sign in to comment.