Ejemplo n.º 1
0
 /**
  * @param string $sTagName
  * @param string $sValue = null
  * @param bool $bIsCDATA = false
  * @param bool $bIsSimpleCharsCode = false
  * @param string $sNodeComment = ''
  */
 public function __construct($sTagName, $sValue = null, $bIsCDATA = false, $bIsSimpleCharsCode = false, $sNodeComment = '')
 {
     $this->Attributes = array();
     $this->Children = array();
     $this->TagName = $sTagName;
     $this->Value = $bIsCDATA && null !== $sValue ? '<![CDATA[' . ($bIsSimpleCharsCode ? api_Utils::EncodeSimpleSpecialXmlChars($sValue) : api_Utils::EncodeSpecialXmlChars($sValue)) . ']]>' : $sValue;
     $this->Comment = $sNodeComment;
 }
Ejemplo n.º 2
0
 /**
  * @param string $sName
  */
 function PrintEncodedHtmlValue($sName)
 {
     echo api_Utils::EncodeSpecialXmlChars($this->GetValueAsString($sName));
 }
Ejemplo n.º 3
0
 /**
  * @param string $sKey
  *
  * @return mixed
  */
 protected function parseGetConf($sKey)
 {
     $mValue = null;
     $sKey = strtolower($sKey);
     if (isset($this->aLowerMap[$sKey])) {
         if (array_key_exists($sKey, $this->aContainer)) {
             $mValue = $this->aContainer[$sKey];
         } else {
             $mValue = $this->aLowerMap[$sKey][0];
         }
         $aType = $this->aLowerMap[$sKey];
         switch ($aType[1]) {
             case 'string':
                 $mValue = api_Utils::EncodeSpecialXmlChars((string) $mValue);
                 break;
             case 'int':
                 $mValue = (int) $mValue;
                 break;
             case 'bool':
                 $mValue = (bool) $mValue ? 'On' : 'Off';
                 break;
             case 'spec':
                 $mValue = $this->specBackConver($sKey, $mValue);
                 break;
         }
     }
     return $mValue;
 }
Ejemplo n.º 4
0
 /**
  * @param string $sKey
  *
  * @return mixed
  */
 protected function parseGetArrayConf($sKey, $oNode)
 {
     $sKey = strtolower($sKey);
     if (isset($this->aLowerMap[$sKey])) {
         $oNode->Value = '';
         if (array_key_exists($sKey, $this->aContainer) && is_array($this->aContainer[$sKey])) {
             $aNodeItems = array();
             foreach ($this->aContainer[$sKey] as $sArrayKey => $aValue) {
                 $aNodeItems[$sArrayKey] = new CXmlDomNode($sArrayKey);
                 if (is_array($aValue)) {
                     foreach ($aValue as $sSubKey => $sSubValue) {
                         $aNodeItems[$sArrayKey]->AppendChild(new CXmlDomNode($sSubKey, api_Utils::EncodeSpecialXmlChars((string) $sSubValue)));
                     }
                 }
                 $oNode->AppendChild($aNodeItems[$sArrayKey]);
             }
         }
     }
 }