Skip to content

Commit

Permalink
Fixes for folder element.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Feb 1, 2017
1 parent 46e2a40 commit 0d3a722
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions plugins/fabrik_element/folder/folder.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function render($data, $repeatCounter = 0)
{
$opts[] = JHTML::_('select.option', $folder, $folder);

if (is_array($selected) and in_array($folder, $selected))
if ($selected === $folder)
{
$aRoValues[] = $folder;
}
Expand All @@ -71,7 +71,7 @@ public function render($data, $repeatCounter = 0)
{
$opts[] = JHTML::_('select.option', $file, $file);

if (is_array($selected) and in_array($file, $selected))
if ($selected === $folder)
{
$aRoValues[] = $file;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

?>
<select id="<?php echo $d->id?>" class="fabrikinput inputbox <?php echo $d->errorCss;?>" name="<?php echo $d->name;?>">
<?php foreach ($d->options as $option) : ?>
<option value="<?php echo $option->value;?>">
<?php foreach ($d->options as $option) :
$selected = $option->value === $d->selected ? ' selected="selected" ' : ''; ?>
<option value="<?php echo $option->value;?>" <?php echo $selected; ?>>
<?php echo $option->text;?>
</option>
<?php endforeach; ?>
Expand Down

0 comments on commit 0d3a722

Please sign in to comment.