Code Duplication    Length = 21-21 lines in 2 locations

install/cli-install.php 1 location

@@ 521-541 (lines=21) @@
518
519
// check status of Inherit Parent Template plugin
520
$auto_template_logic = 'parent';
521
if ($installMode != 0) {
522
    $rs = mysqli_query($conn, "SELECT properties, disabled FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='Inherit Parent Template'");
523
    $row = mysqli_fetch_row($rs);
524
    if(!$row) {
525
        // not installed
526
        $auto_template_logic = 'system';
527
    } else {
528
        if($row[1] == 1) {
529
            // installed but disabled
530
            $auto_template_logic = 'system';
531
        } else {
532
            // installed, enabled .. see how it's configured
533
            $properties = parseProperties($row[0]);
534
            if(isset($properties['inheritTemplate'])) {
535
                if($properties['inheritTemplate'] == 'From First Sibling') {
536
                    $auto_template_logic = 'sibling';
537
                }
538
            }
539
        }
540
    }
541
}
542
543
544

install/instprocessor.php 1 location

@@ 158-178 (lines=21) @@
155
156
// check status of Inherit Parent Template plugin
157
$auto_template_logic = 'parent';
158
if ($installMode != 0) {
159
    $rs = mysqli_query($conn, "SELECT properties, disabled FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='Inherit Parent Template'");
160
    $row = mysqli_fetch_row($rs);
161
    if(!$row) {
162
        // not installed
163
        $auto_template_logic = 'system';
164
    } else {
165
        if($row[1] == 1) {
166
            // installed but disabled
167
            $auto_template_logic = 'system';
168
        } else {
169
            // installed, enabled .. see how it's configured
170
            $properties = parseProperties($row[0]);
171
            if(isset($properties['inheritTemplate'])) {
172
                if($properties['inheritTemplate'] == 'From First Sibling') {
173
                    $auto_template_logic = 'sibling';
174
                }
175
            }
176
        }
177
    }
178
}
179
180
// open db connection
181
$setupPath = realpath(dirname(__FILE__));