/**
  * Adds the timing point if the condition $conditionName is enabled.
  *
  * @param string $conditionName Name of the condition
  * @param string $label Optional label
  */
 static function addTimingPoint( $conditionName, $label = "" )
 {
     if ( !eZDebugSetting::isConditionTrue( $conditionName, eZDebug::LEVEL_TIMING_POINT ) )
         return false;
     eZDebug::addTimingPoint( eZDebugSetting::changeLabel( $conditionName, $label ) );
 }
Exemplo n.º 2
0
 function processNewElements($createdElements)
 {
     $debug = eZDebugSetting::isConditionTrue('kernel-datatype-ezxmltext', eZDebug::LEVEL_DEBUG);
     // Call handlers for newly created elements
     foreach ($createdElements as $element) {
         if ($debug) {
             eZDebug::writeDebug('processing new element ' . $element->nodeName, eZDebugSetting::changeLabel('kernel-datatype-ezxmltext'));
         }
         $tmp = null;
         if (!$this->processBySchemaPresence($element)) {
             if ($debug) {
                 eZDebug::writeDebug($this->Document->saveXML(), eZDebugSetting::changeLabel('kernel-datatype-ezxmltext', 'xml string after failed processBySchemaPresence for new element ' . $element->nodeName));
             }
             continue;
         }
         if ($debug) {
             eZDebug::writeDebug($this->Document->saveXML(), eZDebugSetting::changeLabel('kernel-datatype-ezxmltext', 'xml string after processBySchemaPresence for new element ' . $element->nodeName));
         }
         // Call "Structure handler"
         $this->callOutputHandler('structHandler', $element, $tmp);
         if (!$this->processBySchemaTree($element)) {
             if ($debug) {
                 eZDebug::writeDebug($this->Document->saveXML(), eZDebugSetting::changeLabel('kernel-datatype-ezxmltext', 'xml string after failed processBySchemaTree for new element ' . $element->nodeName));
             }
             continue;
         }
         if ($debug) {
             eZDebug::writeDebug($this->Document->saveXML(), eZDebugSetting::changeLabel('kernel-datatype-ezxmltext', 'xml string after processBySchemaTree for new element ' . $element->nodeName));
         }
         $tmp2 = null;
         // Call "Publish handler"
         $this->callOutputHandler('publishHandler', $element, $tmp2);
         if ($debug) {
             eZDebug::writeDebug($this->Document->saveXML(), eZDebugSetting::changeLabel('kernel-datatype-ezxmltext', 'xml string after callOutputHandler publishHandler for new element ' . $element->nodeName));
         }
         // Process attributes according to the schema
         if ($element->hasAttributes()) {
             if (!$this->XMLSchema->hasAttributes($element)) {
                 eZXMLInputParser::removeAllAttributes($element);
             } else {
                 $this->processAttributesBySchema($element);
             }
         }
     }
 }
 function inputXML()
 {
     $contentObjectAttribute = $this->ContentObjectAttribute;
     $contentObjectAttributeID = $contentObjectAttribute->attribute('id');
     $originalInput = 'originalInput_' . $contentObjectAttributeID;
     $isInputValid = 'isInputValid_' . $contentObjectAttributeID;
     if (isset($GLOBALS[$isInputValid]) and $GLOBALS[$isInputValid] == false) {
         $output = $GLOBALS[$originalInput];
     } else {
         $dom = new DOMDocument('1.0', 'utf-8');
         $success = $dom->loadXML($this->XMLData);
         $editOutput = new eZSimplifiedXMLEditOutput();
         $dom->formatOutput = true;
         if (eZDebugSetting::isConditionTrue('kernel-datatype-ezxmltext', eZDebug::LEVEL_DEBUG)) {
             eZDebug::writeDebug($dom->saveXML(), eZDebugSetting::changeLabel('kernel-datatype-ezxmltext', __METHOD__ . ' xml string stored in database'));
         }
         $output = $editOutput->performOutput($dom);
     }
     return $output;
 }