forked from grinchenkoedu/local_cleanup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.php
More file actions
117 lines (104 loc) · 3.19 KB
/
settings.php
File metadata and controls
117 lines (104 loc) · 3.19 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
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
109
110
111
112
113
114
115
116
117
<?php
/**
* @var bool $hassiteconfig
* @var admin_root $ADMIN
*/
defined('MOODLE_INTERNAL') || die;
if ($hassiteconfig) {
$ADMIN->add(
'root',
new admin_category('local_cleanup', get_string('pluginname', 'local_cleanup'))
);
$ADMIN->add(
'local_cleanup',
new admin_externalpage(
'local_cleanup_userfiles',
get_string('files'),
new moodle_url('/local/cleanup/files.php')
)
);
$ADMIN->add(
'local_cleanup',
new admin_externalpage(
'local_cleanup_ghostfiles',
get_string('ghostfiles', 'local_cleanup'),
new moodle_url('/local/cleanup/ghost.php')
)
);
$settings = new admin_settingpage(
'local_cleanup_admin',
get_string('settingspage', 'local_cleanup')
);
$ADMIN->add('localplugins', $settings);
$settings->add(
new admin_setting_configtext(
'cleanup_items_per_page',
get_string('itemsperpage', 'local_cleanup'),
get_string('itemsperpagedesc', 'local_cleanup'),
local_cleanup\finder::LIMIT_DEFAULT,
PARAM_INT
)
);
$settings->add(
new admin_setting_configtext(
'cleanup_backup_timeout_days',
get_string('backuplifetime', 'local_cleanup'),
get_string('backuplifetimedesc', 'local_cleanup'),
30,
PARAM_INT
)
);
$settings->add(
new admin_setting_configtext(
'cleanup_draft_timeout',
get_string('draftlifetime', 'local_cleanup'),
get_string('draftlifetimedesc', 'local_cleanup'),
30,
PARAM_INT
)
);
$settings->add(
new admin_setting_configtext(
'cleanup_logs_timeout_days',
get_string('logslifetime', 'local_cleanup'),
get_string('logslifetimedesc', 'local_cleanup'),
500,
PARAM_INT
)
);
$settings->add(
new admin_setting_configtext(
'cleanup_component_files_days',
get_string('componentfileslifetime', 'local_cleanup'),
get_string('componentfileslifetimedesc', 'local_cleanup'),
180,
PARAM_INT
)
);
$settings->add(
new admin_setting_configtext(
'cleanup_grades_days',
get_string('gradeslifetime', 'local_cleanup'),
get_string('gradeslifetimedesc', 'local_cleanup'),
500,
PARAM_INT
)
);
$settings->add(
new admin_setting_configtext(
'cleanup_course_modules_days',
get_string('coursemoduleslifetime', 'local_cleanup'),
get_string('coursemoduleslifetimedesc', 'local_cleanup'),
7,
PARAM_INT
)
);
$settings->add(
new admin_setting_configcheckbox(
'cleanup_run_autoremove',
get_string('autoremove', 'local_cleanup'),
get_string('autoremovedesc', 'local_cleanup'),
0 //disabled by default.
)
);
}