Code Duplication    Length = 5-7 lines in 2 locations

manager/actions/mutate_content.dynamic.php 2 locations

@@ 94-98 (lines=5) @@
91
} else {
92
    $content = array();
93
94
    if(isset($_REQUEST['newtemplate'])) {
95
        $content['template'] = $_REQUEST['newtemplate'];
96
    } else {
97
        $content['template'] = getDefaultTemplate();
98
    }
99
100
    $_SESSION['itemname'] = $_lang["new_resource"];
101
}
@@ 916-922 (lines=7) @@
913
                            if (($content['type'] == 'document' || $modx->getManagerApi()->action == '4') || ($content['type'] == 'reference' || $modx->getManagerApi()->action == 72)) {
914
                                $template = $default_template;
915
                                $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int)$modx->config['group_tvs'];
916
                                if (isset ($_REQUEST['newtemplate'])) {
917
                                    $template = $_REQUEST['newtemplate'];
918
                                } else {
919
                                    if (isset ($content['template'])) {
920
                                        $template = $content['template'];
921
                                    }
922
                                }
923
924
                                $field = "DISTINCT tv.*,  IF(tvc.value!='',tvc.value,tv.default_text) as value, tvtpl.rank as tvrank";
925
                                $vs = array(