comparison php/save.php @ 3089:a169e79ba224

Merge branch 'master' into vnext
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Fri, 12 Jan 2018 15:40:26 +0000
parents 8a30d54bd4e2
children 385bb2e03ab7
comparison
equal deleted inserted replaced
3086:2e8bf9499e92 3089:a169e79ba224
77 $n2 = 0; 77 $n2 = 0;
78 } 78 }
79 $sn1 = findNodeByAttribute($n1, "location", "pre"); 79 $sn1 = findNodeByAttribute($n1, "location", "pre");
80 $sn2 = findNodeByAttribute($n2, "location", "pre"); 80 $sn2 = findNodeByAttribute($n2, "location", "pre");
81 if ($sn1 != 0) { 81 if ($sn1 != 0) {
82 if ($sn2 != 0 && $sn2.getAttribute("state") != "complete") { 82 if ($sn2 != 0) {
83 $saved_root->removeChild($sn2); 83 $saved_root->removeChild($sn2);
84 $sn2 = 0; 84 $sn2 = 0;
85 } 85 }
86 if ($sn2 == 0) { 86 if ($sn2 == 0) {
87 $sn1 = $doc->importNode($sn1->item(0), true); 87 $sn1 = $doc->importNode($sn1->item(0), true);
90 } 90 }
91 91
92 $sn1 = findNodeByAttribute($n1, "location", "post"); 92 $sn1 = findNodeByAttribute($n1, "location", "post");
93 $sn2 = findNodeByAttribute($n2, "location", "post"); 93 $sn2 = findNodeByAttribute($n2, "location", "post");
94 if ($sn1 != 0) { 94 if ($sn1 != 0) {
95 if ($sn2 != 0 && $sn2.getAttribute("state") != "complete") { 95 if ($sn2 != 0) {
96 $saved_root->removeChild($sn2); 96 $saved_root->removeChild($sn2);
97 $sn2 = 0; 97 $sn2 = 0;
98 } 98 }
99 if ($sn2 == 0) { 99 if ($sn2 == 0) {
100 $sn1 = $doc->importNode($sn1->item(0), true); 100 $sn1 = $doc->importNode($sn1->item(0), true);
112 } 112 }
113 foreach($n1 as $page) { 113 foreach($n1 as $page) {
114 $ref = $page->getAttribute("ref"); 114 $ref = $page->getAttribute("ref");
115 if (!empty($ref)) { 115 if (!empty($ref)) {
116 $pn2 = findNodeByAttribute($n2, "ref", $ref); 116 $pn2 = findNodeByAttribute($n2, "ref", $ref);
117 if ($pn2 != 0 && $pn2.getAttribute("state") != "complete") { 117 if ($pn2 != 0) {
118 $saved_root->removeChild($pn2); 118 $saved_root->removeChild($pn2);
119 $pn2 = 0; 119 $pn2 = 0;
120 } 120 }
121 if ($pn2 == 0) { 121 if ($pn2 == 0) {
122 $pn1 = $doc->importNode($page, true); 122 $pn1 = $doc->importNode($page, true);