| @@ 36-62 (lines=27) @@ | ||
| 33 | $bodyScripts && CI_Controller::get_instance()->template->registerString($bodyScripts, 'after'); |
|
| 34 | } |
|
| 35 | ||
| 36 | public function _install() { |
|
| 37 | ||
| 38 | $this->load->dbforge(); |
|
| 39 | $fields = [ |
|
| 40 | 'id' => [ |
|
| 41 | 'type' => 'INT', |
|
| 42 | 'constraint' => 11, |
|
| 43 | 'auto_increment' => TRUE, |
|
| 44 | ], |
|
| 45 | 'name' => ['type' => 'TEXT'], |
|
| 46 | 'value' => ['type' => 'TEXT'], |
|
| 47 | 'position' => [ |
|
| 48 | 'type' => 'INT', |
|
| 49 | 'constraint' => 5, |
|
| 50 | 'unsigned' => false, |
|
| 51 | 'null' => false, |
|
| 52 | ], |
|
| 53 | ]; |
|
| 54 | ||
| 55 | $this->dbforge->add_key('id', TRUE); |
|
| 56 | $this->dbforge->add_field($fields); |
|
| 57 | $this->dbforge->create_table('custom_scripts', TRUE); |
|
| 58 | ||
| 59 | $this->db->where('name', 'custom_scripts') |
|
| 60 | ->update('components', ['autoload' => '1']); |
|
| 61 | ||
| 62 | } |
|
| 63 | ||
| 64 | public function _deinstall() { |
|
| 65 | $this->load->dbforge(); |
|
| @@ 192-222 (lines=31) @@ | ||
| 189 | /** |
|
| 190 | * module install function |
|
| 191 | */ |
|
| 192 | public function _install() { |
|
| 193 | ||
| 194 | $this->load->dbforge(); |
|
| 195 | ($this->dx_auth->is_admin()) or exit; |
|
| 196 | $fields = [ |
|
| 197 | 'id' => [ |
|
| 198 | 'type' => 'INT', |
|
| 199 | 'auto_increment' => true, |
|
| 200 | ], |
|
| 201 | 'external_id' => [ |
|
| 202 | 'type' => 'VARCHAR', |
|
| 203 | 'constraint' => '255', |
|
| 204 | 'null' => true, |
|
| 205 | ], |
|
| 206 | 'property_id' => [ |
|
| 207 | 'type' => 'VARCHAR', |
|
| 208 | 'constraint' => '255', |
|
| 209 | 'null' => true, |
|
| 210 | ], |
|
| 211 | 'value' => [ |
|
| 212 | 'type' => 'VARCHAR', |
|
| 213 | 'constraint' => '20', |
|
| 214 | 'null' => true, |
|
| 215 | ], |
|
| 216 | ]; |
|
| 217 | ||
| 218 | $this->dbforge->add_field($fields); |
|
| 219 | $this->dbforge->add_key('id', true); |
|
| 220 | $this->dbforge->create_table('mod_exchange'); |
|
| 221 | ModuleSettings::ofModule('exchange')->set($this->my_config); |
|
| 222 | } |
|
| 223 | ||
| 224 | public function _deinstall() { |
|
| 225 | ||
| @@ 208-236 (lines=29) @@ | ||
| 205 | * |
|
| 206 | * @return bool |
|
| 207 | */ |
|
| 208 | public function _install() { |
|
| 209 | ||
| 210 | $this->load->dbforge(); |
|
| 211 | ||
| 212 | $fields = [ |
|
| 213 | 'id' => [ |
|
| 214 | 'type' => 'INT', |
|
| 215 | 'constraint' => 11, |
|
| 216 | 'auto_increment' => TRUE, |
|
| 217 | ], |
|
| 218 | 'email' => [ |
|
| 219 | 'type' => 'VARCHAR', |
|
| 220 | 'constraint' => 255, |
|
| 221 | 'default' => NULL, |
|
| 222 | ], |
|
| 223 | 'date' => [ |
|
| 224 | 'type' => 'int', |
|
| 225 | 'constraint' => 15, |
|
| 226 | 'default' => NULL, |
|
| 227 | ], |
|
| 228 | ]; |
|
| 229 | ||
| 230 | $this->dbforge->add_key('id', TRUE); |
|
| 231 | $this->dbforge->add_field($fields); |
|
| 232 | $this->dbforge->create_table('mail', TRUE); |
|
| 233 | ||
| 234 | $this->db->where('name', 'mailer') |
|
| 235 | ->update('components', ['autoload' => '1', 'enabled' => '1']); |
|
| 236 | } |
|
| 237 | ||
| 238 | public function _deinstall() { |
|
| 239 | ||