Code Duplication    Length = 6-6 lines in 4 locations

manager/includes/functions/nodes.php 4 locations

@@ 346-351 (lines=6) @@
343
                        $ph['node_toggle'] = 1;
344
                        $ph['subMenuState'] = ' open';
345
346
                        if ($ph['donthit'] == 1) {
347
                            $ph['tree_page_click'] = 3;
348
                            $ph['icon_node_toggle'] = '';
349
                            $ph['icon'] = $ph['icon_folder_close'];
350
                            $ph['showChildren'] = 0;
351
                        }
352
353
                        // invoke OnManagerNodePrerender event
354
                        $prenode = $modx->invokeEvent("OnManagerNodePrerender", array(
@@ 371-376 (lines=6) @@
368
                            }
369
                        }
370
371
                        if ($ph['showChildren'] == 0) {
372
                            $ph['icon_node_toggle'] = '';
373
                            $ph['donthit'] = 1;
374
                            $ph['icon'] = $ph['icon_folder_close'];
375
                            $tpl = getTplFolderNodeNotChildren();
376
                        }
377
378
                        if ($ph['contextmenu']) {
379
                            $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';
@@ 393-398 (lines=6) @@
390
                        $ph['icon_node_toggle'] = $ph['tree_plusnode'];
391
                        $ph['node_toggle'] = 0;
392
393
                        if ($ph['donthit'] == 1) {
394
                            $ph['tree_page_click'] = 3;
395
                            $ph['icon_node_toggle'] = '';
396
                            $ph['icon'] = $ph['icon_folder_close'];
397
                            $ph['showChildren'] = 0;
398
                        }
399
400
                        // invoke OnManagerNodePrerender event
401
                        $prenode = $modx->invokeEvent("OnManagerNodePrerender", array(
@@ 413-418 (lines=6) @@
410
                            $ph = (count($phnew) > 0) ? $phnew : $ph;
411
                        }
412
413
                        if ($ph['showChildren'] == 0) {
414
                            $ph['icon_node_toggle'] = '';
415
                            $ph['donthit'] = 1;
416
                            $ph['icon'] = $ph['icon_folder_close'];
417
                            $tpl = getTplFolderNodeNotChildren();
418
                        }
419
420
                        if ($ph['contextmenu']) {
421
                            $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"';