1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-13 01:54:12 +02:00

Type checks involving e_formTest

- MOD: e107::getTemplate() now accepts blank strings for the plugin name to mean
       that a core template should be loaded
- FIX: e_form::progressBar() now supports input values that already have % at the end
- FIX: Null check for $options['list'] in e_form::progressBar()
- NEW: Test rounding in e_formTest::testProgressBar()
This commit is contained in:
Nick Liu
2020-01-18 11:00:18 +01:00
parent 46b541889f
commit 622be85140
3 changed files with 6 additions and 4 deletions

View File

@@ -2257,11 +2257,11 @@ class e_form
$value = ((int) $score / (int) $denom) * 100;
// $value = (int) $score * (int) $multiplier;
$percVal = number_format($value,0).'%';
$percVal = round(floatval($value)).'%';
}
else
{
$percVal = number_format($value,0).'%';
$percVal = round(floatval($value)).'%';
$label = $percVal;
}
@@ -2597,7 +2597,7 @@ class e_form
$id = empty($options['id']) ? $this->name2id($name).'-container' : $options['id'];
// return print_a($checked,true);
if($options['list'])
if(isset($options['list']) && $options['list'])
{
return "<ul id='".$id."' class='checkboxes'><li>".implode("</li><li>",$text)."</li></ul>";
}