-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaintain.class.php
More file actions
82 lines (70 loc) · 1.69 KB
/
maintain.class.php
File metadata and controls
82 lines (70 loc) · 1.69 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
class export_formats_maintain extends PluginMaintain
{
private $table;
// permission : 'admin' or groud_id
// show_as : above, below, inside or link
private $default_conf = array(
'permission' => 'admin',
'show_as' => 'above',
);
function __construct($plugin_id)
{
parent::__construct($plugin_id);
global $prefixeTable;
$this->table = $prefixeTable . 'auto_formats';
}
/**
* Plugin install
*/
function install($plugin_version, &$errors = array())
{
// TODO: convert auto_formats table into conf_params
global $conf;
if (empty($conf['af_config']))
{
conf_update_param('af_config', $this->default_conf, true);
}
pwg_query('
CREATE TABLE IF NOT EXISTS `'. $this->table .'` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`ext` char(4) NOT NULL,
`type` enum(\'one\',\'both\',\'custom\') NOT NULL default \'one\',
`width` int(5) unsigned NULL,
`height` int(5) unsigned NULL,
`crop` enum(\'true\',\'false\') NOT NULL default \'false\',
`activated` enum(\'true\',\'false\') NOT NULL default \'true\',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
;');
}
/**
* Plugin activate
*/
function activate($plugin_version, &$errors = array())
{
}
/**
* Plugin deactivate
*/
function deactivate()
{
}
/**
* Plugin update
*/
function update($old_version, $new_version, &$errors = array())
{
$this->install($new_version, $errors);
}
/**
* Plugin uninstallation
*/
function uninstall()
{
conf_delete_param('af_config');
pwg_query('DROP TABLE `'. $this->table .'`;');
}
}