コード例 #1
0
 /**
  * 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);
         }
     }
 }
コード例 #2
0
 /**
  * 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);
     }
 }
コード例 #3
0
 /**
  * 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);
         }
     }
 }