Source of file EditableAncestryField.php
Size: 1,749 Bytes - Last Modified: 2021-12-23T10:47:29+00:00
/var/www/docs.ssmods.com/process/src/code/forms/EditableAncestryField.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 | <?php /** * * @package userforms * @subpackage relatives */ class EditableAncestryField extends EditableFormField { public static $singular_name = 'Ancestry field'; public static $plural_name = 'Ancestry fields'; public function getFieldConfiguration() { $fields = parent::getFieldConfiguration(); return $fields; } public function getFormField() { return new AncestryField($this->Name, $this->Title); } /** * Return the validation information related to this field. This is * interrupted as a JSON object for validate plugin and used in the * PHP. * * @see http://docs.jquery.com/Plugins/Validation/Methods * @return Array */ public function getValidation() { $options = array(); return $options; } /** * Return the Value of this Field * * @return String */ public function getValueFromData($data) { $returnValue = ""; $value = (isset($data[$this->Name])) ? $data[$this->Name] : false; if ($value) { if (is_array($value)) { foreach ($value as $key => $dataEntered) { $key = str_replace("Field", "", $key); $key = str_replace("m", "mother-", $key); $key = str_replace("f", "father-", $key); if (!$dataEntered) { $dataEntered = "---"; } $returnValue .= "<br />$key: $dataEntered "; } } } return $returnValue; } public function Icon() { return 'userforms_relatives/images/icons/' . strtolower($this->class) . '.png'; } } |