Code Duplication    Length = 7-7 lines in 4 locations

manager/frames/nodes.functions.inc.php 4 locations

@@ 231-237 (lines=7) @@
228
229
			// invoke OnManagerNodePrerender event
230
			$prenode = $modx->invokeEvent("OnManagerNodePrerender", array('ph' => $ph));
231
			if(is_array($prenode)) {
232
				$phnew = array();
233
				foreach($prenode as $pnode) {
234
					$phnew = array_merge($phnew, unserialize($pnode));
235
				}
236
				$ph = (count($phnew) > 0) ? $phnew : $ph;
237
			}
238
239
			if($ph['contextmenu']) {
240
				$ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';
@@ 289-295 (lines=7) @@
286
						'ph' => $ph,
287
						'opened' => '1'
288
					));
289
					if(is_array($prenode)) {
290
						$phnew = array();
291
						foreach($prenode as $pnode) {
292
							$phnew = array_merge($phnew, unserialize($pnode));
293
						}
294
						$ph = (count($phnew) > 0) ? $phnew : $ph;
295
					}
296
297
					if($ph['contextmenu']) {
298
						$ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';
@@ 327-333 (lines=7) @@
324
						'ph' => $ph,
325
						'opened' => '0'
326
					));
327
					if(is_array($prenode)) {
328
						$phnew = array();
329
						foreach($prenode as $pnode) {
330
							$phnew = array_merge($phnew, unserialize($pnode));
331
						}
332
						$ph = (count($phnew) > 0) ? $phnew : $ph;
333
					}
334
335
					if($ph['contextmenu']) {
336
						$ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';
@@ 413-419 (lines=7) @@
410
						'ph' => $ph,
411
						'opened' => '0'
412
					));
413
					if(is_array($prenode)) {
414
						$phnew = array();
415
						foreach($prenode as $pnode) {
416
							$phnew = array_merge($phnew, unserialize($pnode));
417
						}
418
						$ph = (count($phnew) > 0) ? $phnew : $ph;
419
					}
420
421
					if($ph['showChildren'] == 0) {
422
						$ph['icon_node_toggle'] = '';