Code Duplication    Length = 22-22 lines in 2 locations

src/intraface.dk/tools/index.php 2 locations

@@ 46-67 (lines=22) @@
43
        return new DB_Sql;
44
    }
45
46
    function new_Translation2_Admin()
47
    {
48
        $driver = "mdb2";
49
        $options = array(
50
            "hostspec" => DB_HOST,
51
            "database" => DB_NAME,
52
            "phptype" => "mysql",
53
            "username" => DB_USER,
54
            "password" => DB_PASS
55
        );
56
        $params = array(
57
            "langs_avail_table" => "core_translation_langs",
58
            "strings_default_table" => "core_translation_i18n"
59
        );
60
61
        $translation = Translation2_Admin::factory($driver, $options, $params);
62
        if (PEAR::isError($translation)) {
63
            exit($translation->getMessage());
64
        }
65
        return $translation;
66
67
    }
68
69
    function new_Translation2()
70
    {
@@ 69-90 (lines=22) @@
66
67
    }
68
69
    function new_Translation2()
70
    {
71
        $driver = "mdb2";
72
        $options = array(
73
            "hostspec" => DB_HOST,
74
            "database" => DB_NAME,
75
            "phptype" => "mysql",
76
            "username" => DB_USER,
77
            "password" => DB_PASS
78
        );
79
        $params = array(
80
            "langs_avail_table" => "core_translation_langs",
81
            "strings_default_table" => "core_translation_i18n"
82
        );
83
84
        $translation = Translation2::factory($driver, $options, $params);
85
        if (PEAR::isError($translation)) {
86
            throw new Exception($translation->getMessage());
87
        }
88
        $translation->setLang("dk");
89
        return $translation;
90
    }
91
92
    function new_k_TemplateFactory($c)
93
    {