-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodule.php
47 lines (36 loc) · 1.32 KB
/
module.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
class BulkImportModule extends OBFModule {
public $name = "Bulk Import v1.0";
public $description = "Imports bulk media items from predetermined folders.";
public function callbacks () {
}
public function install () {
$this->db->insert('users_permissions', [
'category' => 'administration',
'description' => 'manage bulk import settings',
'name' => 'bulk_import_module'
]);
$this->db->query('CREATE TABLE IF NOT EXISTS `module_bulk_import` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` text,
`dir_source` varchar(255) NOT NULL,
`dir_failed` varchar(255) NOT NULL,
`dir_target` varchar(255) NOT NULL,
`settings` text,
`id3` text,
`owner_id` int(10) UNSIGNED NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;');
return true;
}
public function uninstall () {
$this->db->where('name', 'bulk_import_module');
$permission = $this->db->get_one('users_permissions');
$this->db->where('permission_id', $permission['id']);
$this->db->delete('users_permissions_to_groups');
$this->db->where('id', $permission['id']);
$this->db->delete('users_permissions');
return true;
}
}