| Línea 26... |
Línea 26... |
| 26 |
|
26 |
|
| Línea 27... |
Línea 27... |
| 27 |
require_once($CFG->libdir . '/pdflib.php');
|
27 |
require_once($CFG->libdir . '/pdflib.php');
|
| Línea -... |
Línea 28... |
| - |
|
28 |
|
| - |
|
29 |
use core_admin\local\settings\filesize;
|
| - |
|
30 |
|
| - |
|
31 |
$ADMIN->add('courses', new admin_category('coursedefaultsettings', new lang_string('defaultsettingscategory', 'course')));
|
| - |
|
32 |
$ADMIN->add('courses', new admin_category('groups', new lang_string('groups')));
|
| 28 |
|
33 |
$ADMIN->add('courses', new admin_category('activitychooser', new lang_string('activitychoosercategory', 'course')));
|
| 29 |
use core_admin\local\settings\filesize;
|
34 |
$ADMIN->add('courses', new admin_category('backups', new lang_string('backups', 'admin')));
|
| 30 |
|
35 |
|
| 31 |
$capabilities = array(
|
36 |
$capabilities = [
|
| 32 |
'moodle/backup:backupcourse',
|
37 |
'moodle/backup:backupcourse',
|
| 33 |
'moodle/category:manage',
|
38 |
'moodle/category:manage',
|
| - |
|
39 |
'moodle/course:create',
|
| - |
|
40 |
'moodle/site:approvecourse',
|
| - |
|
41 |
'moodle/restore:restorecourse',
|
| - |
|
42 |
'moodle/course:manageactivities',
|
| 34 |
'moodle/course:create',
|
43 |
'moodle/course:configurecustomfields',
|
| 35 |
'moodle/site:approvecourse',
|
44 |
'moodle/group:configurecustomfields',
|
| 36 |
'moodle/restore:restorecourse'
|
45 |
'moodle/course:recommendactivity',
|
| 37 |
);
|
46 |
];
|
| 38 |
if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
|
47 |
if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) {
|
| 39 |
// Speedup for non-admins, add all caps used on this page.
|
48 |
// Speedup for non-admins, add all caps used on this page.
|
| Línea 102... |
Línea 111... |
| 102 |
$ADMIN->add('courses', new admin_externalpage('coursespending', new lang_string('pendingrequests'),
|
111 |
$ADMIN->add('courses', new admin_externalpage('coursespending', new lang_string('pendingrequests'),
|
| 103 |
$CFG->wwwroot . '/course/pending.php', array('moodle/site:approvecourse')));
|
112 |
$CFG->wwwroot . '/course/pending.php', array('moodle/site:approvecourse')));
|
| 104 |
}
|
113 |
}
|
| Línea 105... |
Línea 114... |
| 105 |
|
114 |
|
| 106 |
// Add a category for the course Default settings.
|
- |
|
| 107 |
$ADMIN->add('courses', new admin_category('coursedefaultsettings', new lang_string('defaultsettingscategory', 'course')));
|
115 |
// Add a category for the course Default settings.
|
| 108 |
// Course Default Settings Page.
|
116 |
// Course Default Settings Page.
|
| Línea 109... |
Línea 117... |
| 109 |
// NOTE: these settings must be applied after all other settings because they depend on them.
|
117 |
// NOTE: these settings must be applied after all other settings because they depend on them.
|
| 110 |
|
118 |
|
| Línea 296... |
Línea 304... |
| 296 |
2 => new lang_string('activitychoosertabmodethree', 'course'),
|
304 |
2 => new lang_string('activitychoosertabmodethree', 'course'),
|
| 297 |
]
|
305 |
]
|
| 298 |
)
|
306 |
)
|
| 299 |
);
|
307 |
);
|
| Línea 300... |
Línea 308... |
| 300 |
|
308 |
|
| 301 |
// Add a category for the Groups.
|
- |
|
| 302 |
$ADMIN->add('courses', new admin_category('groups', new lang_string('groups')));
|
309 |
// Add to the 'Groups' category.
|
| 303 |
$ADMIN->add(
|
310 |
$ADMIN->add(
|
| 304 |
'groups',
|
311 |
'groups',
|
| 305 |
new admin_externalpage(
|
312 |
new admin_externalpage(
|
| 306 |
'group_customfield',
|
313 |
'group_customfield',
|
| Línea 317... |
Línea 324... |
| 317 |
$CFG->wwwroot . '/group/grouping_customfield.php',
|
324 |
$CFG->wwwroot . '/group/grouping_customfield.php',
|
| 318 |
['moodle/group:configurecustomfields']
|
325 |
['moodle/group:configurecustomfields']
|
| 319 |
)
|
326 |
)
|
| 320 |
);
|
327 |
);
|
| Línea 321... |
Línea 328... |
| 321 |
|
328 |
|
| 322 |
// Add a category for the Activity Chooser.
|
- |
|
| 323 |
$ADMIN->add('courses', new admin_category('activitychooser', new lang_string('activitychoosercategory', 'course')));
|
329 |
// Add to the 'Activity Chooser' category.
|
| 324 |
$temp = new admin_settingpage('activitychoosersettings', new lang_string('activitychoosersettings', 'course'));
|
330 |
$temp = new admin_settingpage('activitychoosersettings', new lang_string('activitychoosersettings', 'course'));
|
| 325 |
// Tab mode for the activity chooser.
|
331 |
// Tab mode for the activity chooser.
|
| 326 |
$temp->add(
|
332 |
$temp->add(
|
| 327 |
new admin_setting_configselect(
|
333 |
new admin_setting_configselect(
|
| Línea 370... |
Línea 376... |
| 370 |
new moodle_url('/course/recommendations.php'),
|
376 |
new moodle_url('/course/recommendations.php'),
|
| 371 |
array('moodle/course:recommendactivity')
|
377 |
array('moodle/course:recommendactivity')
|
| 372 |
)
|
378 |
)
|
| 373 |
);
|
379 |
);
|
| Línea 374... |
Línea 380... |
| 374 |
|
380 |
|
| 375 |
// Add a category for backups.
|
- |
|
| Línea 376... |
Línea 381... |
| 376 |
$ADMIN->add('courses', new admin_category('backups', new lang_string('backups','admin')));
|
381 |
// Add to the 'Backups' category.
|
| 377 |
|
382 |
|
| Línea 378... |
Línea 383... |
| 378 |
// Create a page for general backups configuration and defaults.
|
383 |
// Create a page for general backups configuration and defaults.
|
| Línea 413... |
Línea 418... |
| 413 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_badges', new lang_string('generalbadges','backup'), new lang_string('configgeneralbadges','backup'), array('value'=>1,'locked'=>0)));
|
418 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_badges', new lang_string('generalbadges','backup'), new lang_string('configgeneralbadges','backup'), array('value'=>1,'locked'=>0)));
|
| 414 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_calendarevents', new lang_string('generalcalendarevents','backup'), new lang_string('configgeneralcalendarevents','backup'), array('value'=>1, 'locked'=>0)));
|
419 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_calendarevents', new lang_string('generalcalendarevents','backup'), new lang_string('configgeneralcalendarevents','backup'), array('value'=>1, 'locked'=>0)));
|
| 415 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_userscompletion', new lang_string('generaluserscompletion','backup'), new lang_string('configgeneraluserscompletion','backup'), array('value'=>1, 'locked'=>0)));
|
420 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_userscompletion', new lang_string('generaluserscompletion','backup'), new lang_string('configgeneraluserscompletion','backup'), array('value'=>1, 'locked'=>0)));
|
| 416 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_logs', new lang_string('generallogs','backup'), new lang_string('configgenerallogs','backup'), array('value'=>0, 'locked'=>0)));
|
421 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_logs', new lang_string('generallogs','backup'), new lang_string('configgenerallogs','backup'), array('value'=>0, 'locked'=>0)));
|
| 417 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), array('value'=>0, 'locked'=>0)));
|
422 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), array('value'=>0, 'locked'=>0)));
|
| 418 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_questionbank', new lang_string('generalquestionbank','backup'), new lang_string('configgeneralquestionbank','backup'), array('value'=>1, 'locked'=>0)));
|
- |
|
| 419 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_groups',
|
423 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_groups',
|
| 420 |
new lang_string('generalgroups', 'backup'), new lang_string('configgeneralgroups', 'backup'),
|
424 |
new lang_string('generalgroups', 'backup'), new lang_string('configgeneralgroups', 'backup'),
|
| 421 |
array('value' => 1, 'locked' => 0)));
|
425 |
array('value' => 1, 'locked' => 0)));
|
| 422 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), array('value'=>1, 'locked'=>0)));
|
426 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), array('value'=>1, 'locked'=>0)));
|
| - |
|
427 |
$temp->add(new admin_setting_configcheckbox_with_lock(
|
| - |
|
428 |
'backup/backup_general_customfield',
|
| - |
|
429 |
new lang_string('generalcustomfield', 'backup'),
|
| - |
|
430 |
new lang_string('configgeneralcustomfield', 'backup'),
|
| - |
|
431 |
['value' => 1, 'locked' => 0],
|
| - |
|
432 |
));
|
| 423 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_contentbankcontent',
|
433 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_contentbankcontent',
|
| 424 |
new lang_string('generalcontentbankcontent', 'backup'),
|
434 |
new lang_string('generalcontentbankcontent', 'backup'),
|
| 425 |
new lang_string('configgeneralcontentbankcontent', 'backup'),
|
435 |
new lang_string('configgeneralcontentbankcontent', 'backup'),
|
| 426 |
['value' => 1, 'locked' => 0])
|
436 |
['value' => 1, 'locked' => 0])
|
| 427 |
);
|
437 |
);
|
| Línea 429... |
Línea 439... |
| 429 |
new lang_string('generalxapistate', 'backup'),
|
439 |
new lang_string('generalxapistate', 'backup'),
|
| 430 |
new lang_string('configgeneralxapistate', 'backup'),
|
440 |
new lang_string('configgeneralxapistate', 'backup'),
|
| 431 |
['value' => 1, 'locked' => 0])
|
441 |
['value' => 1, 'locked' => 0])
|
| 432 |
);
|
442 |
);
|
| Línea 433... |
Línea -... |
| 433 |
|
- |
|
| 434 |
|
443 |
|
| 435 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_legacyfiles',
|
444 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_legacyfiles',
|
| 436 |
new lang_string('generallegacyfiles', 'backup'),
|
445 |
new lang_string('generallegacyfiles', 'backup'),
|
| 437 |
new lang_string('configlegacyfiles', 'backup'), array('value' => 1, 'locked' => 0)));
|
446 |
new lang_string('configlegacyfiles', 'backup'), array('value' => 1, 'locked' => 0)));
|
| Línea 452... |
Línea 461... |
| 452 |
new lang_string('configgeneralpermissions', 'backup'),
|
461 |
new lang_string('configgeneralpermissions', 'backup'),
|
| 453 |
array('value' => 0, 'locked' => 0)));
|
462 |
array('value' => 0, 'locked' => 0)));
|
| 454 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_activities', new lang_string('generalactivities','backup'), new lang_string('configgeneralactivities','backup'), array('value'=>1, 'locked'=>0)));
|
463 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_activities', new lang_string('generalactivities','backup'), new lang_string('configgeneralactivities','backup'), array('value'=>1, 'locked'=>0)));
|
| 455 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), array('value'=>1, 'locked'=>0)));
|
464 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), array('value'=>1, 'locked'=>0)));
|
| 456 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), array('value'=>1, 'locked'=>0)));
|
465 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), array('value'=>1, 'locked'=>0)));
|
| - |
|
466 |
$temp->add(new admin_setting_configcheckbox_with_lock(
|
| - |
|
467 |
'backup/backup_import_badges',
|
| - |
|
468 |
new lang_string('generalbadges', 'backup'),
|
| - |
|
469 |
new lang_string('configgeneralbadges', 'backup'),
|
| - |
|
470 |
['value' => 0, 'locked' => 0],
|
| - |
|
471 |
));
|
| 457 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_calendarevents', new lang_string('generalcalendarevents','backup'), new lang_string('configgeneralcalendarevents','backup'), array('value'=>1, 'locked'=>0)));
|
472 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_calendarevents', new lang_string('generalcalendarevents','backup'), new lang_string('configgeneralcalendarevents','backup'), array('value'=>1, 'locked'=>0)));
|
| 458 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_questionbank', new lang_string('generalquestionbank','backup'), new lang_string('configgeneralquestionbank','backup'), array('value'=>1, 'locked'=>0)));
|
- |
|
| 459 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_groups',
|
473 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_groups',
|
| 460 |
new lang_string('generalgroups', 'backup'), new lang_string('configgeneralgroups', 'backup'),
|
474 |
new lang_string('generalgroups', 'backup'), new lang_string('configgeneralgroups', 'backup'),
|
| 461 |
array('value' => 1, 'locked' => 0)));
|
475 |
array('value' => 1, 'locked' => 0)));
|
| 462 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), array('value'=>1, 'locked'=>0)));
|
476 |
$temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_import_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), array('value'=>1, 'locked'=>0)));
|
| 463 |
$temp->add(new admin_setting_configcheckbox_with_lock(
|
477 |
$temp->add(new admin_setting_configcheckbox_with_lock(
|
| - |
|
478 |
'backup/backup_import_customfield',
|
| - |
|
479 |
new lang_string('generalcustomfield', 'backup'),
|
| - |
|
480 |
new lang_string('configgeneralcustomfield', 'backup'),
|
| - |
|
481 |
['value' => 1, 'locked' => 0],
|
| - |
|
482 |
));
|
| - |
|
483 |
$temp->add(new admin_setting_configcheckbox_with_lock(
|
| 464 |
'backup/backup_import_contentbankcontent',
|
484 |
'backup/backup_import_contentbankcontent',
|
| 465 |
new lang_string('generalcontentbankcontent', 'backup'),
|
485 |
new lang_string('generalcontentbankcontent', 'backup'),
|
| 466 |
new lang_string('configgeneralcontentbankcontent', 'backup'),
|
486 |
new lang_string('configgeneralcontentbankcontent', 'backup'),
|
| 467 |
['value' => 1, 'locked' => 0])
|
487 |
['value' => 1, 'locked' => 0])
|
| 468 |
);
|
488 |
);
|
| Línea 583... |
Línea 603... |
| 583 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_badges', new lang_string('generalbadges','backup'), new lang_string('configgeneralbadges','backup'), 1));
|
603 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_badges', new lang_string('generalbadges','backup'), new lang_string('configgeneralbadges','backup'), 1));
|
| 584 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_calendarevents', new lang_string('generalcalendarevents','backup'), new lang_string('configgeneralcalendarevents','backup'), 1));
|
604 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_calendarevents', new lang_string('generalcalendarevents','backup'), new lang_string('configgeneralcalendarevents','backup'), 1));
|
| 585 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_userscompletion', new lang_string('generaluserscompletion','backup'), new lang_string('configgeneraluserscompletion','backup'), 1));
|
605 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_userscompletion', new lang_string('generaluserscompletion','backup'), new lang_string('configgeneraluserscompletion','backup'), 1));
|
| 586 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_logs', new lang_string('generallogs', 'backup'), new lang_string('configgenerallogs', 'backup'), 0));
|
606 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_logs', new lang_string('generallogs', 'backup'), new lang_string('configgenerallogs', 'backup'), 0));
|
| 587 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), 0));
|
607 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_histories', new lang_string('generalhistories','backup'), new lang_string('configgeneralhistories','backup'), 0));
|
| 588 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_questionbank', new lang_string('generalquestionbank','backup'), new lang_string('configgeneralquestionbank','backup'), 1));
|
- |
|
| 589 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_groups', new lang_string('generalgroups', 'backup'),
|
608 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_groups', new lang_string('generalgroups', 'backup'),
|
| 590 |
new lang_string('configgeneralgroups', 'backup'), 1));
|
609 |
new lang_string('configgeneralgroups', 'backup'), 1));
|
| 591 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), 1));
|
610 |
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_competencies', new lang_string('generalcompetencies','backup'), new lang_string('configgeneralcompetencies','backup'), 1));
|
| 592 |
$temp->add(new admin_setting_configcheckbox(
|
611 |
$temp->add(new admin_setting_configcheckbox(
|
| - |
|
612 |
'backup/backup_auto_customfield',
|
| - |
|
613 |
new lang_string('generalcustomfield', 'backup'),
|
| - |
|
614 |
new lang_string('configgeneralcustomfield', 'backup'),
|
| - |
|
615 |
1,
|
| - |
|
616 |
));
|
| - |
|
617 |
$temp->add(new admin_setting_configcheckbox(
|
| 593 |
'backup/backup_auto_contentbankcontent',
|
618 |
'backup/backup_auto_contentbankcontent',
|
| 594 |
new lang_string('generalcontentbankcontent', 'backup'),
|
619 |
new lang_string('generalcontentbankcontent', 'backup'),
|
| 595 |
new lang_string('configgeneralcontentbankcontent', 'backup'),
|
620 |
new lang_string('configgeneralcontentbankcontent', 'backup'),
|
| 596 |
1)
|
621 |
1)
|
| 597 |
);
|
622 |
);
|
| Línea 666... |
Línea 691... |
| 666 |
new lang_string('generalgroups', 'backup'), new lang_string('configrestoregroups', 'backup'),
|
691 |
new lang_string('generalgroups', 'backup'), new lang_string('configrestoregroups', 'backup'),
|
| 667 |
array('value' => 1, 'locked' => 0)));
|
692 |
array('value' => 1, 'locked' => 0)));
|
| 668 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_competencies',
|
693 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_competencies',
|
| 669 |
new lang_string('generalcompetencies', 'backup'),
|
694 |
new lang_string('generalcompetencies', 'backup'),
|
| 670 |
new lang_string('configrestorecompetencies', 'backup'), array('value' => 1, 'locked' => 0)));
|
695 |
new lang_string('configrestorecompetencies', 'backup'), array('value' => 1, 'locked' => 0)));
|
| - |
|
696 |
$temp->add(new admin_setting_configcheckbox_with_lock(
|
| - |
|
697 |
'restore/restore_general_customfield',
|
| - |
|
698 |
new lang_string('generalcustomfield', 'backup'),
|
| - |
|
699 |
new lang_string('configrestorecustomfield', 'backup'),
|
| - |
|
700 |
['value' => 1, 'locked' => 0],
|
| - |
|
701 |
));
|
| 671 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_contentbankcontent',
|
702 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_contentbankcontent',
|
| 672 |
new lang_string('generalcontentbankcontent', 'backup'),
|
703 |
new lang_string('generalcontentbankcontent', 'backup'),
|
| 673 |
new lang_string('configrestorecontentbankcontent', 'backup'), array('value' => 1, 'locked' => 0)));
|
704 |
new lang_string('configrestorecontentbankcontent', 'backup'), array('value' => 1, 'locked' => 0)));
|
| 674 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_xapistate',
|
705 |
$temp->add(new admin_setting_configcheckbox_with_lock('restore/restore_general_xapistate',
|
| 675 |
new lang_string('generalxapistate', 'backup'),
|
706 |
new lang_string('generalxapistate', 'backup'),
|