Skip to content

Commit

Permalink
[4.0] Fixing switcher label joomla#2649
Browse files Browse the repository at this point in the history
  • Loading branch information
infograf768 committed Nov 2, 2019
1 parent 0fa8282 commit fe97446
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions layouts/joomla/form/field/radio/switcher.php
Expand Up @@ -69,8 +69,17 @@
<?php foreach ($options as $i => $option) : ?>
<?php
// Initialize some option attributes.
$checked = ((string) $option->value == $value) ? 'checked="checked"' : '';
$active = ((string) $option->value == $value) ? 'class="active"' : '';
if (is_numeric($option->value))
{
$checked = ((int) $option->value == $value) ? 'checked="checked"' : '';
$active = ((int) $option->value == $value) ? 'class="active"' : '';
}
else
{
$checked = ((string) $option->value == $value) ? 'checked="checked"' : '';
$active = ((string) $option->value == $value) ? 'class="active"' : '';
}

$oid = $id . $i;
$ovalue = htmlspecialchars($option->value, ENT_COMPAT, 'UTF-8');
$attributes = array_filter(array($checked, $active, null));
Expand Down

0 comments on commit fe97446

Please sign in to comment.