private function findSubDeletedDiffs()
 {
     $oNode = $this->oNode;
     if (AnwXml::xmlIsTextNode($oNode) || AnwXml::xmlIsPhpNode($oNode) || AnwXml::xmlIsCommentNode($oNode)) {
         return;
     }
     $oChilds = $oNode->childNodes;
     if ($oChilds) {
         $this->aoSubDeletedDiffs = array();
         for ($i = 0; $i < $oChilds->length; $i++) {
             $oChild = $oChilds->item($i);
             $oSubDiff = new AnwDiffDeleted($oChild, $this);
             $this->aoSubDeletedDiffs[] = $oSubDiff;
         }
     }
 }
Beispiel #2
0
 static function runCallbacksOnTranslatableValue($oInstance, $oRootNode, $sFieldInput, $fOnTextValue, $fBeforeChilds = null, $fAfterChilds = null, $fOnUntranslatableNode = null, $bFirstCall = true)
 {
     static $j = 0;
     if ($bFirstCall) {
         $j = 0;
     }
     //reset
     if (AnwXml::xmlIsTranslatableParent($oRootNode)) {
         if (AnwXml::xmlIsTextNode($oRootNode)) {
             if (!AnwXml::xmlIsEmptyNode($oRootNode)) {
                 if ($fOnTextValue) {
                     $oInstance->{$fOnTextValue}($oRootNode, $sFieldInput);
                 }
             }
         } else {
             if (AnwXml::xmlIsCommentNode($oRootNode)) {
             } else {
                 if (AnwXml::xmlIsPhpNode($oRootNode)) {
                     //do nothing
                 } else {
                     if ($fBeforeChilds && !AnwXml::xmlIsRootNode($oRootNode)) {
                         $oInstance->{$fBeforeChilds}($oRootNode);
                     }
                     $oChildNodes = $oRootNode->childNodes;
                     if ($oChildNodes) {
                         //WARNING - don't use foreach here ! bug on some servers, as childs are getting modified...
                         for ($i = 0; $i < $oChildNodes->length; $i++) {
                             $oChild = $oChildNodes->item($i);
                             $sFieldInputNew = self::runCallbacks_getInputName($sFieldInput, $j, '-');
                             self::runCallbacksOnTranslatableValue($oInstance, $oChild, $sFieldInputNew, $fOnTextValue, $fBeforeChilds, $fAfterChilds, $fOnUntranslatableNode, false);
                             //recursive
                             $j++;
                         }
                     }
                     if ($fAfterChilds && !AnwXml::xmlIsRootNode($oRootNode)) {
                         $oInstance->{$fAfterChilds}($oRootNode);
                     }
                 }
             }
         }
     } else {
         if ($fOnUntranslatableNode) {
             $oInstance->{$fOnUntranslatableNode}($oRootNode);
         }
     }
 }