-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfig.php
108 lines (100 loc) · 3.56 KB
/
config.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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<?php
class FileDriveConfig extends PluginConfig
{
public function getOptions()
{
// if (!file_exists(ROOT_DIR."fd/index.php")){
// die("<br>FD Dir do not exist<br>");
// }
/* $_configs['FileDrive_root'] = new TextboxField(
[
'configuration' => array('size' => 60, 'length' => 255),
'required' => true,
'label' => __('Root path'),
'default' => 'fd/DirRoot',
'hint' => __('Enter the path of root folder'),
]);
$_configs['FileDrive_lang'] = new ChoiceField(
[
'configuration' => array('size' => 60, 'length' => 255),
'required' => true,
'label' => __('Language'),
'hint' => __('Language'),
'default' => 'en',
'choices' => [
'en' => 'English',
],
]);
*/
$_configs['FileDrive_Admin_enable'] = new BooleanField(
[
'label' => __('Admin panel'),
'default' => '1',
'hint' => __('Enable in Admin panel'),
]);
$_configs['FileDrive_Staff_enable'] = new BooleanField(
[
'label' => __('staff panel'),
'default' => '1',
'hint' => __('Enable in staff panel'),
]);
$_configs['FileDrive_client_enable'] = new BooleanField(
[
'label' => __('client panel'),
'default' => '1',
'hint' => __('Enable in client panel'),
]);
$_configs['FileDrive_guest_enable'] = new BooleanField(
[
'label' => __('Guest panel'),
'default' => '1',
'hint' => __('Enable in guest panel'),
]);
/*
$_configs['FileDrive_show_hidden'] = new BooleanField(
[
'label' => __('Hidden Files'),
'default' => '1',
'hint' => __('Show Hidden Files'),
]);
$_configs['FileDrive_error_reporting'] = new BooleanField(
[
'label' => __('error reporting'),
'default' => '1',
'hint' => __('Enable error reporting'),
]);
$_configs['FileDrive_hide_Cols'] = new BooleanField(
[
'label' => __('hide Cols'),
'default' => '1',
'hint' => __('Enable in atribute preiview in File Browser'),
]);
$_configs['FileDrive_calc_folder'] = new BooleanField(
[
'label' => __('Calc folder Size'),
'default' => '1',
'hint' => __('calculate folder size when browsing folders'),
]);
*/
return $_configs;
}
/// A chance to check the settings before saving
public function pre_save(&$config, &$errors)
{
global $msg;
/*
if ($config['FileDrive_root'] === "") {
// Validate the settings ?
$errors['err'] = 'Root path can not be Empty'; // example only
return false;
} elseif (!is_dir(dirname(__file__) . $config['FileDrive_root'])) {
$errors['err'] = 'Root Directory ( ' .dirname(__file__) . $config['FileDrive_root'] . ' ) does not exist.'; // example only
return false;
}
*/
if (!$errors) {
$msg = 'Configuration updated successfully'; // This is the default, and doesn't need to be set.
}
return true;
}
}