Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 1... Línea 1...
1
<?php
1
<?php
Línea 2... Línea 2...
2
 
2
 
Línea -... Línea 3...
-
 
3
// This file defines settingpages and externalpages under the "grades" section
-
 
4
 
-
 
5
use core\plugininfo\gradepenalty;
-
 
6
 
-
 
7
$ADMIN->add('grades', new admin_category('gradereports', new lang_string('reportsettings', 'grades')));
-
 
8
$ADMIN->add('grades', new admin_category('gradeimports', new lang_string('importsettings', 'grades')));
-
 
9
$ADMIN->add('grades', new admin_category('gradeexports', new lang_string('exportsettings', 'grades')));
3
// This file defines settingpages and externalpages under the "grades" section
10
$ADMIN->add('grades', new admin_category('gradepenalty', new lang_string('gradepenalty', 'grades')));
4
 
11
 
Línea 5... Línea 12...
5
if (has_capability('moodle/grade:manage', $systemcontext)
12
if (has_capability('moodle/grade:manage', $systemcontext)
6
 or has_capability('moodle/grade:manageletters', $systemcontext)) { // speedup for non-admins, add all caps used on this page
13
 or has_capability('moodle/grade:manageletters', $systemcontext)) { // speedup for non-admins, add all caps used on this page
Línea 89... Línea 96...
89
        $temp->add(new admin_setting_special_grademinmaxtouse());
96
        $temp->add(new admin_setting_special_grademinmaxtouse());
Línea 90... Línea 97...
90
 
97
 
Línea 91... Línea 98...
91
        $temp->add(new admin_setting_my_grades_report());
98
        $temp->add(new admin_setting_my_grades_report());
92
 
99
 
93
        $temp->add(new admin_setting_configtext('gradereport_mygradeurl', new lang_string('externalurl', 'grades'),
100
        $temp->add(new admin_setting_configtext('gradereport_mygradeurl', new lang_string('externalurl', 'grades'),
94
                new lang_string('externalurl_desc', 'grades'), ''));
101
            new lang_string('externalurl_desc', 'grades'), ''));
Línea 95... Línea 102...
95
    }
102
    }
96
    $ADMIN->add('grades', $temp);
103
    $ADMIN->add('grades', $temp);
Línea 179... Línea 186...
179
    $ADMIN->add('grades', $letters);
186
    $ADMIN->add('grades', $letters);
Línea 180... Línea 187...
180
 
187
 
Línea 181... Línea 188...
181
    // The plugins must implement a settings.php file that adds their admin settings to the $settings object
188
    // The plugins must implement a settings.php file that adds their admin settings to the $settings object
182
 
-
 
183
    // Reports
189
 
184
    $ADMIN->add('grades', new admin_category('gradereports', new lang_string('reportsettings', 'grades')));
190
    // Reports
185
    foreach (core_component::get_plugin_list('gradereport') as $plugin => $plugindir) {
191
    foreach (core_component::get_plugin_list('gradereport') as $plugin => $plugindir) {
186
     // Include all the settings commands for this plugin if there are any
192
     // Include all the settings commands for this plugin if there are any
187
        if (file_exists($plugindir.'/settings.php')) {
193
        if (file_exists($plugindir.'/settings.php')) {
Línea 192... Línea 198...
192
            }
198
            }
193
        }
199
        }
194
    }
200
    }
Línea 195... Línea 201...
195
 
201
 
196
    // Imports
-
 
197
    $ADMIN->add('grades', new admin_category('gradeimports', new lang_string('importsettings', 'grades')));
202
    // Imports
Línea 198... Línea 203...
198
    foreach (core_component::get_plugin_list('gradeimport') as $plugin => $plugindir) {
203
    foreach (core_component::get_plugin_list('gradeimport') as $plugin => $plugindir) {
199
 
204
 
200
     // Include all the settings commands for this plugin if there are any
205
     // Include all the settings commands for this plugin if there are any
Línea 207... Línea 212...
207
        }
212
        }
208
    }
213
    }
Línea 209... Línea 214...
209
 
214
 
210
 
-
 
211
    // Exports
215
 
212
    $ADMIN->add('grades', new admin_category('gradeexports', new lang_string('exportsettings', 'grades')));
216
    // Exports
213
    foreach (core_component::get_plugin_list('gradeexport') as $plugin => $plugindir) {
217
    foreach (core_component::get_plugin_list('gradeexport') as $plugin => $plugindir) {
214
     // Include all the settings commands for this plugin if there are any
218
     // Include all the settings commands for this plugin if there are any
215
        if (file_exists($plugindir.'/settings.php')) {
219
        if (file_exists($plugindir.'/settings.php')) {
Línea 219... Línea 223...
219
                $ADMIN->add('gradeexports', $settings);
223
                $ADMIN->add('gradeexports', $settings);
220
            }
224
            }
221
        }
225
        }
222
    }
226
    }
Línea 223... Línea 227...
223
 
227
 
Línea -... Línea 228...
-
 
228
    // Penalty.
-
 
229
 
-
 
230
    // Supported modules.
-
 
231
    $modules = core_grades\penalty_manager::get_supported_modules();
-
 
232
    if (!empty($modules)) {
-
 
233
        $temp = new admin_settingpage('supportedplugins', new lang_string('gradepenalty_supportedplugins', 'grades'),
-
 
234
            'moodle/grade:manage');
-
 
235
 
-
 
236
        $options = [];
-
 
237
        foreach ($modules as $module) {
-
 
238
            $options[$module] = new lang_string('modulename', $module);
-
 
239
        }
-
 
240
        $temp->add(new admin_setting_configmultiselect('gradepenalty_enabledmodules',
-
 
241
            new lang_string('gradepenalty_enabledmodules', 'grades'),
-
 
242
            new lang_string('gradepenalty_enabledmodules_help', 'grades'), [], $options));
-
 
243
 
-
 
244
        $ADMIN->add('gradepenalty', $temp);
-
 
245
    }
-
 
246
 
-
 
247
    // External page to manage the penalty plugins.
-
 
248
    $temp = new admin_externalpage(
-
 
249
        'managepenaltyplugins',
-
 
250
        get_string('managepenaltyplugins', 'grades'),
-
 
251
        new moodle_url('/grade/penalty/manage_penalty_plugins.php'),
-
 
252
        'moodle/grade:manage'
-
 
253
    );
-
 
254
    $ADMIN->add('gradepenalty', $temp);
-
 
255
 
-
 
256
    // Settings from each penalty plugin.
-
 
257
    foreach (core_component::get_plugin_list('gradepenalty') as $plugin => $plugindir) {
-
 
258
        // Check if the plugin is enabled.
-
 
259
        if (gradepenalty::is_plugin_enabled($plugin)) {
-
 
260
            // Include all the settings commands for this plugin if there are any.
-
 
261
            if (file_exists($plugindir . '/settings.php')) {
-
 
262
                include($plugindir . '/settings.php');
-
 
263
            }
-
 
264
        }