forked from yakamara/yform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.php
36 lines (26 loc) · 1.22 KB
/
update.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
<?php
/**
* @var rex_addon $this
*/
rex_extension::register('OUTPUT_FILTER', function () {
rex_dir::copy($this->getPath('data'),$this->getDataPath());
});
if ($this->getPlugin('manager')->isInstalled()) {
// use path relative to __DIR__ to get correct path in update temp dir
$this->getPlugin('manager')->includeFile(__DIR__.'/plugins/manager/install.php');
}
if (rex_string::versionCompare($this->getVersion(), '1.9', '<')) {
$fields_removed[] = ['submits'];
$fields_change = ['html','php','date','datetime','fieldset','time','upload', 'google_geocode', 'submit'];
$actions_removed = ['fulltext_value', 'wrapper_value'];
foreach($fields_removed as $field) {
rex_sql::factory()->setQuery('delete from '.rex_yform_manager_field::table().' where type_id="value" and type_name = ?',[$field]);
}
foreach($fields_change as $field) {
rex_sql::factory()->setQuery('delete from '.rex_yform_manager_field::table().' where type_id="value" and type_name = ?',[$field]);
}
foreach($actions_removed as $action) {
rex_sql::factory()->setQuery('delete from '.rex_yform_manager_field::table().' where type_id="action" and type_name = ?',[$action]);
}
}
rex_autoload::removeCache();