3 // This file defines everything related to frontpage
5 if (get_site()) { //do not use during installation
6 $frontpagecontext = get_context_instance(CONTEXT_COURSE
, SITEID
);
7 $frontpagecontextid = $frontpagecontext->id
;
9 $frontpagecontext = NULL;
10 $frontpagecontextid = 0;
13 // "frontpage" settingpage
14 $temp = new admin_settingpage('frontpagesettings', get_string('frontpagesettings','admin'), 'moodle/course:update', false, $frontpagecontext);
15 $temp->add(new admin_setting_sitesettext('fullname', get_string('fullsitename'), '', ''));
16 $temp->add(new admin_setting_sitesettext('shortname', get_string('shortsitename'), '', ''));
17 $temp->add(new admin_setting_special_frontpagedesc());
18 $temp->add(new admin_setting_courselist_frontpage(false)); // non-loggedin version of the setting (that's what the parameter is for :) )
19 $temp->add(new admin_setting_courselist_frontpage(true)); // loggedin version of the setting
20 $temp->add(new admin_setting_sitesetcheckbox('numsections', get_string('sitesection'), get_string('sitesectionhelp','admin'), 1));
21 $temp->add(new admin_setting_sitesetselect('newsitems', get_string('newsitemsnumber'), '', 3,
33 $temp->add(new admin_setting_configtext('coursesperpage', get_string('coursesperpage', 'admin'), get_string('configcoursesperpage', 'admin'), 20, PARAM_INT
));
34 $temp->add(new admin_setting_configcheckbox('allowvisiblecoursesinhiddencategories', get_string('allowvisiblecoursesinhiddencategories', 'admin'), get_string('configvisiblecourses', 'admin'), 0));
35 $ADMIN->add('frontpage', $temp);
37 $ADMIN->add('frontpage', new admin_externalpage('frontpageroles', get_string('frontpageroles', 'admin'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=" . $frontpagecontextid, 'moodle/role:assign', false, $frontpagecontext));
39 $ADMIN->add('frontpage', new admin_externalpage('frontpagebackup', get_string('frontpagebackup', 'admin'), $CFG->wwwroot
.'/backup/backup.php?id='.SITEID
, 'moodle/site:backup', false, $frontpagecontext));
41 $ADMIN->add('frontpage', new admin_externalpage('frontpagerestore', get_string('frontpagerestore', 'admin'), $CFG->wwwroot
.'/files/index.php?id='.SITEID
.'&wdir=/backupdata', 'moodle/site:restore', false, $frontpagecontext));
43 $ADMIN->add('frontpage', new admin_externalpage('sitefiles', get_string('sitefiles'), $CFG->wwwroot
. '/files/index.php?id=' . SITEID
, 'moodle/course:managefiles', false, $frontpagecontext));