Code Duplication    Length = 31-33 lines in 2 locations

application/modules/star_rating/star_rating.php 1 location

@@ 185-217 (lines=33) @@
182
    /**
183
     * Install module
184
     */
185
    public function _install() {
186
187
        $this->load->dbforge();
188
        ($this->dx_auth->is_admin()) OR exit;
189
        $fields = [
190
            'id' => [
191
                'type' => 'INT',
192
                'auto_increment' => TRUE
193
            ],
194
            'id_type' => [
195
                'type' => 'VARCHAR',
196
                'constraint' => '25',
197
                'null' => TRUE,
198
            ],
199
            'type' => [
200
                'type' => 'VARCHAR',
201
                'constraint' => '25',
202
                'null' => TRUE,
203
            ],
204
            'votes' => [
205
                'type' => 'INT',
206
            ],
207
            'rating' => [
208
                'type' => 'INT',
209
            ],
210
        ];
211
212
        $this->dbforge->add_field($fields);
213
        $this->dbforge->add_key('id', TRUE);
214
        $this->dbforge->create_table('rating');
215
216
        $this->db->where('name', 'star_rating');
217
        $this->db->update('components', ['enabled' => 1]);
218
    }
219
220
    /**

application/modules/template_manager/template_manager.php 1 location

@@ 107-137 (lines=31) @@
104
    /**
105
     * Install module
106
     */
107
    public function _install() {
108
        $this->load->dbforge();
109
        ($this->dx_auth->is_admin()) OR exit;
110
111
        $fields = [
112
            'id' => [
113
                'type' => 'INT',
114
                'auto_increment' => TRUE
115
            ],
116
            'component' => [
117
                'type' => 'VARCHAR',
118
                'constraint' => '255',
119
                'null' => FALSE
120
            ],
121
            'key' => [
122
                'type' => 'Text',
123
                'null' => TRUE
124
            ],
125
            'data' => [
126
                'type' => 'TEXT',
127
                'null' => TRUE
128
            ]
129
        ];
130
131
        $this->dbforge->add_field($fields);
132
        $this->dbforge->add_key('id', TRUE);
133
        $this->dbforge->create_table('template_settings');
134
135
        $this->db->where('name', 'template_manager');
136
        $this->db->update('components', ['enabled' => 1, 'autoload' => 1]);
137
    }
138
139
    /**
140
     * Deinstall module