Code Duplication    Length = 19-19 lines in 2 locations

class/dbupdater.php 1 location

@@ 390-408 (lines=19) @@
387
     * @return bool true if success, false if an error occured
388
     *
389
     */
390
    public function dropFields()
391
    {
392
        global $xoopsDB;
393
394
        $ret = true;
395
396
        foreach ($this->getDroppedFields() as $droppedField) {
397
            $query = sprintf('ALTER TABLE %s DROP %s', $this->name(), $droppedField);
398
399
            $ret = $ret && $xoopsDB->query($query);
400
            if (!$ret) {
401
                echo "<li class='err'>" . sprintf(_AM_SPARTNER_DB_MSG_DROPFIELD_ERR, $droppedField, $this->name()) . '</li>';
402
            } else {
403
                echo "<li class='ok'>" . sprintf(_AM_SPARTNER_DB_MSG_DROPFIELD, $droppedField, $this->name()) . '</li>';
404
            }
405
        }
406
407
        return $ret;
408
    }
409
}
410
411
/**

class/smartdbupdater.php 1 location

@@ 537-555 (lines=19) @@
534
     * @return bool true if success, false if an error occured
535
     *
536
     */
537
    public function dropFields()
538
    {
539
        global $xoopsDB;
540
541
        $ret = true;
542
543
        foreach ($this->getDroppedFields() as $droppedField) {
544
            $query = sprintf('ALTER TABLE %s DROP %s', $this->name(), $droppedField);
545
546
            $ret = $ret && $xoopsDB->query($query);
547
            if (!$ret) {
548
                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_DROPFIELD_ERR, $droppedField, $this->name()) . '<br>';
549
            } else {
550
                echo '&nbsp;&nbsp;' . sprintf(_SDU_MSG_DROPFIELD, $droppedField, $this->name()) . '<br>';
551
            }
552
        }
553
554
        return $ret;
555
    }
556
}
557
558
/**