/** * Gets the hover/alt text that appears over the validation rule icon in the form * * @param object $elementModel element model * @param int $pluginc plugin render order * * @return string label */ protected function getLabel($elementModel, $pluginc) { $otherElementModel = $this->getOtherElement($elementModel, $pluginc); $params = $this->getParams(); $otherfield = (array) $params->get('areuniquevalues-otherfield'); $otherfield = $otherfield[$pluginc]; if ((int) $otherfield !== 0) { return JText::sprintf('PLG_VALIDATIONRULE_AREUNIQUEVALUES_ADDITIONAL_LABEL', $otherElementModel->getElement()->label); } else { return parent::getLabel($elementModel, $pluginc); } }
/** * gets the hover/alt text that appears over the validation rule icon in the form * @param object element model * @param int repeat group counter * @return string label */ protected function getLabel($elementModel, $c) { $params = $this->getParams(); //as ornot is a radio button it gets json encoded/decoded as an object $ornot = (object) $params->get('emailexists_or_not'); $c = (int) $c; $cond = ''; foreach ($ornot as $k => $v) { if ($k == $c) { $cond = $v; } } if ($cond == 'fail_if_not_exists') { return JText::_('PLG_VALIDATIONRULE_EMAILEXISTS_LABEL_NOT'); } else { return parent::getLabel($elementModel, $c); } }