/** * @param interface_formentry $formentry * @return class_formentry_base|interface_formentry */ public function addField(class_formentry_base $objField, $strKey = "") { if ($strKey == "") { $strKey = $objField->getStrEntryName(); } $this->arrFields[$strKey] = $objField; return $objField; }
/** * Overwritten in order to load key-value pairs declared by annotations */ protected function updateValue() { parent::updateValue(); if ($this->getObjSourceObject() != null && $this->getStrSourceProperty() != "") { $objReflection = new class_reflection($this->getObjSourceObject()); //try to find the matching source property $arrProperties = $objReflection->getPropertiesWithAnnotation(self::STR_TEMPLATEDIR_ANNOTATION); $strSourceProperty = null; foreach ($arrProperties as $strPropertyName => $strValue) { if (uniSubstr(uniStrtolower($strPropertyName), uniStrlen($this->getStrSourceProperty()) * -1) == $this->getStrSourceProperty()) { $strSourceProperty = $strPropertyName; } } if ($strSourceProperty == null) { return; } $strTemplateDir = $objReflection->getAnnotationValueForProperty($strSourceProperty, self::STR_TEMPLATEDIR_ANNOTATION); //load templates $arrTemplates = class_resourceloader::getInstance()->getTemplatesInFolder($strTemplateDir); $arrTemplatesDD = array(); if (count($arrTemplates) > 0) { foreach ($arrTemplates as $strTemplate) { $arrTemplatesDD[$strTemplate] = $strTemplate; } } $this->setArrKeyValues($arrTemplatesDD); } }
/** * Overwritten in order to load key-value pairs declared by annotations */ protected function updateValue() { parent::updateValue(); if ($this->getObjSourceObject() != null && $this->getStrSourceProperty() != "") { $objReflection = new class_reflection($this->getObjSourceObject()); //try to find the matching source property $arrProperties = $objReflection->getPropertiesWithAnnotation(self::STR_DDVALUES_ANNOTATION); $strSourceProperty = null; foreach ($arrProperties as $strPropertyName => $strValue) { if (uniSubstr(uniStrtolower($strPropertyName), uniStrlen($this->getStrSourceProperty()) * -1) == $this->getStrSourceProperty()) { $strSourceProperty = $strPropertyName; } } if ($strSourceProperty == null) { return; } $strDDValues = $objReflection->getAnnotationValueForProperty($strSourceProperty, self::STR_DDVALUES_ANNOTATION); if ($strDDValues !== null && $strDDValues != "") { $arrDDValues = array(); foreach (explode(",", $strDDValues) as $strOneKeyVal) { $strOneKeyVal = uniSubstr(trim($strOneKeyVal), 1, -1); $arrOneKeyValue = explode("=>", $strOneKeyVal); $strKey = trim($arrOneKeyValue[0]) == "" ? " " : trim($arrOneKeyValue[0]); if (count($arrOneKeyValue) == 2) { $strValue = class_carrier::getInstance()->getObjLang()->getLang(trim($arrOneKeyValue[1]), $this->getObjSourceObject()->getArrModule("modul")); if ($strValue == "!" . trim($arrOneKeyValue[1]) . "!") { $strValue = $arrOneKeyValue[1]; } $arrDDValues[$strKey] = $strValue; } } $this->setArrKeyValues($arrDDValues); } } }
public function validateValue() { $strOldValue = $this->getStrValue(); $this->convertValueToFloat(); $bitReturn = parent::validateValue(); $this->setStrValue($strOldValue); return $bitReturn; }
public function setValueToObject() { $strOldValue = $this->getStrValue(); $this->setStrValue(processWysiwygHtmlContent($this->getStrValue())); $bitReturn = parent::setValueToObject(); $this->setStrValue($strOldValue); return $bitReturn; }
public function setValueToObject() { $objReflection = new class_reflection($this->getObjSourceObject()); $strSetter = $objReflection->getSetter($this->getStrSourceProperty()); if ($strSetter !== null && uniStrtolower(uniSubstr($strSetter, 0, 6)) == "setobj" && !$this->getStrValue() instanceof class_date && $this->getStrValue() > 0) { $this->setStrValue(new class_date($this->getStrValue())); } return parent::setValueToObject(); }
public function __construct($strForm = "", $strName = "", $objSourceObject = null) { if ($strName == "") { $strName = generateSystemid(); } class_formentry_base::__construct($strForm, $strName, $objSourceObject); //set the default validator $this->setObjValidator(new class_dummy_validator()); }
public function __construct($strName = "") { if ($strName == "") { $strName = generateSystemid(); } parent::__construct("", $strName); //set the default validator $this->setObjValidator(new class_dummy_validator()); }
public function setStrValue($strValue) { $arrValuesIds = array(); if (is_array($strValue) || $strValue instanceof Traversable) { foreach ($strValue as $objValue) { if ($objValue instanceof class_model) { $arrValuesIds[] = $objValue->getStrSystemid(); } else { $arrValuesIds[] = $objValue; } } } $strValue = implode(",", $arrValuesIds); $objReturn = parent::setStrValue($strValue); $this->setArrKeyValues($this->toObjectArray()); return $objReturn; }
/** * @param $strValue * @return class_formentry_base */ public function setStrValue($strValue) { $arrTargetValues = array(); if ((is_array($strValue) || $strValue instanceof ArrayObject) && count($strValue) > 0) { foreach ($strValue as $strKey => $strSingleValue) { //DB vals if (is_object($strSingleValue)) { $arrTargetValues[] = $strSingleValue->getSystemid(); } else { if ($strSingleValue == "checked") { $arrTargetValues[] = $strKey; } } } } return parent::setStrValue($arrTargetValues); }
public function __construct($strFormName, $strSourceProperty, $objSourceObject = null) { parent::__construct($strFormName, $strSourceProperty, $objSourceObject); //set the default validator $this->setObjValidator(new class_text_validator()); }
/** * Moves a single field to the list of hidden elements * * @param class_formentry_base $objField * @return class_formentry_base */ public function addFieldToHiddenGroup(class_formentry_base $objField) { $this->arrHiddenElements[] = $objField->getStrEntryName(); if (!isset($this->arrFields[$objField->getStrEntryName()]) && !isset($this->arrFields[$objField->getStrSourceProperty()])) { $this->addField($objField); } return $objField; }
/** * Calls the source-objects setter and stores the value. * If you want to skip a single setter, remove the field before. * * @throws class_exception * @return mixed */ public function setValueToObject() { if ($this->getBitReadonly() == true) { return true; } return parent::setValueToObject(); }
public function getStrValue() { return uniStrReplace(_webpath_, "", parent::getStrValue()); }
public function __construct() { parent::__construct("", generateSystemid()); //set the default validator $this->setObjValidator(new class_dummy_validator()); }
/** * Overwritten in order to load key-value pairs declared by annotations */ protected function updateValue() { parent::updateValue(); //load all matching and possible values based on the prefix if ($this->getObjSourceObject() != null && $this->getStrSourceProperty() != "") { $strPrefix = ""; $arrDepends = array(); $this->getValueForAnnotations($strPrefix, $arrDepends); if ($strPrefix == "" || count($arrDepends) == 0) { return; } $this->arrDepends = $arrDepends; //load all language entries $this->arrLabels = array($this->getStrSourceProperty() => array("" => class_carrier::getInstance()->getObjLang()->getLang("commons_dropdown_dataplaceholder", "system"))); foreach ($this->arrDepends as $strOneDepend) { $this->arrLabels[$strOneDepend] = array("" => class_carrier::getInstance()->getObjLang()->getLang("commons_dropdown_dataplaceholder", "system")); } $intI = 1; $strText = $this->getObjSourceObject()->getLang($strPrefix . "_" . $intI); while ($strText != "!" . $strPrefix . "_" . $intI . "!") { $this->arrLabels[$this->getStrSourceProperty()][$intI] = $this->getObjSourceObject()->getLang($strPrefix . "_" . $intI); //search sub keys $this->getSublevel($strPrefix, "_" . $intI, 0); $strText = $this->getObjSourceObject()->getLang($strPrefix . "_" . ++$intI); } } }