Skip to content

Loading…

Last bit of changes for the validation star options. #256

Closed
wants to merge 1 commit into from

2 participants

@syn3rgy

With this change as well as the additions to administrator/components/com_fabrik/language/en-GB/en-GB.com_fabrik.ini and administrator/components/com_fabrik/models/forms/element.xml there now exists the possibility to:

Disable hover tips entirely on the validation stars
Change the star color from red to grey (Download: http://www.dbctemp.dreamhosters.com/media/com_fabrik/images/notempty-grey.png)
Enable the use of a custom message to override the plugin default.

Been testing all day, seems to work ok for me.

@syn3rgy

Oh forgot to mention I added a css class fabrikRequired to the star when tips are disabled to allow easy matching of styles, as I had to take off the fabrikTip class to stop the hovers.

@pollen8
Fabrik member

I'm still not convinced that this is something that the majority of users will need, so Im closing the pull request. If you can expalin further as to why this is needed we'll consider re-opening it

@pollen8 pollen8 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 17, 2012
  1. @syn3rgy
This page is out of date. Refresh to see the latest.
Showing with 17 additions and 3 deletions.
  1. +17 −3 components/com_fabrik/models/element.php
View
20 components/com_fabrik/models/element.php
@@ -958,21 +958,35 @@ function getLabel($repeatCounter, $tmpl = '')
if ($this->_editable)
{
$validations = array_unique($this->getValidations());
- if (count($validations) > 0)
+ if (count($validations) > 0 && $params->get('validationstartip'))
{
$validationHovers = array('<div><ul class="validation-notices" style="list-style:none">');
- foreach ($validations as $validation)
+ if($params->get('validationstartipmsg')){
+ foreach ($validations as $validation)
+ {
+ $validationHovers[] = '<li>' . $params->get('validationstartipcustommsg') . '</li>';
+ }
+ }else{
+ foreach ($validations as $validation)
{
$validationHovers[] = '<li>' . $validation->getHoverText($this, $repeatCounter, $tmpl) . '</li>';
}
+ }
$validationHovers[] = '</ul></div>';
$validationHovers = implode('', $validationHovers);
$title = htmlspecialchars($validationHovers, ENT_QUOTES);
$opts = new stdClass();
$opts->position = 'top';
$opts = json_encode($opts);
+ if($params->get('validationstartipcolor')){
+ $l .= FabrikHelperHTML::image('notempty-grey.png', 'form', $tmpl, array('class' => 'fabrikTip', 'opts' => $opts, 'title' => $title));
+ }else{
$l .= FabrikHelperHTML::image('notempty.png', 'form', $tmpl, array('class' => 'fabrikTip', 'opts' => $opts, 'title' => $title));
- }
+ }
+ }elseif (count($validations) > 0) {
+ if($params->get('validationstartipcolor')){$l .= FabrikHelperHTML::image('notempty-grey.png', 'form', $tmpl, array('class' => 'fabrikRequired'));}
+ else $l .= FabrikHelperHTML::image('notempty.png', 'form', $tmpl, array('class' => 'fabrikRequired'));
+ }
}
$model = $this->getFormModel();
$str .= $this->rollover($l, $model->_data);
Something went wrong with that request. Please try again.