Skip to content

Commit

Permalink
Tweaked labelIcons() in elementvalidations.php model, so if no
Browse files Browse the repository at this point in the history
validations and no empty icon, just return blank string rather than
malfrmed Bootstrap icon classes.
  • Loading branch information
cheesegrits committed Aug 17, 2014
1 parent d8fd42b commit 0e8a98a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/com_fabrik/models/elementvalidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ public function labelIcons()
$tmpl = $this->elementModel->getFormModel()->getTmpl();
$validations = array_unique($this->findAll());
$emptyIcon = $this->getIcon();
$icon = FabrikHelperHTML::image($emptyIcon, 'form', $tmpl, $this->iconOpts) . ' ';

$icon = empty($emptyIcon) && empty($validations) ? "" : FabrikHelperHTML::image($emptyIcon, 'form', $tmpl, $this->iconOpts) . ' ';
return $icon;
}

Expand Down

1 comment on commit 0e8a98a

@cheesegrits
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See:

http://fabrikar.com/forums/index.php?threads/space-at-the-front-of-labels.38390/#post-197154

Without this, we end up with an icon of class icon-, with no name. Not sure if we want to solve this here, or tweak the image() helper to return an empty string if there is no icon to show.

-- hugh

Please sign in to comment.