mirror of
https://github.com/moodle/moodle.git
synced 2025-04-17 06:25:33 +02:00
This patch includes a big set of changes that are all designed to work together to provide a better way to navigate in the new theme, and a different way of working with blocks. Blocks have been moved to a "drawer" that can be opened and closed (this is remembered in a user pref). A new "flat navigation" element is also available in a drawer - which should let you do 90% of things without needing to open the "blocks" drawer. The flat navigation is build from specific parts of the nav tree - the top nodes like "calendar, dashboard" are hand picked. There is a mycourses node listing your enrolled courses. There is a node for the current course, built from the top nodes in the current course node in the nav tree. Administrators have a link to the Site admin settings here too. These nav elements are used by the templates for the new theme, which also has a resigned layout for login and signup. There have also been some additional fixes / improvements to the scss for the new theme which goes along with these layout changes. This set of changes is a collaboration between Martin, Damyon and Alberto (thanks!).
63 lines
1.8 KiB
PHP
63 lines
1.8 KiB
PHP
<?php
|
|
|
|
// searches for admin settings
|
|
|
|
require_once('../config.php');
|
|
require_once($CFG->libdir.'/adminlib.php');
|
|
|
|
$query = trim(optional_param('query', '', PARAM_NOTAGS)); // Search string
|
|
|
|
$PAGE->set_context(context_system::instance());
|
|
|
|
admin_externalpage_setup('search', '', array('query' => $query)); // now hidden page
|
|
|
|
$adminroot = admin_get_root(); // need all settings here
|
|
$adminroot->search = $query; // So we can reference it in search boxes later in this invocation
|
|
$statusmsg = '';
|
|
$errormsg = '';
|
|
$focus = '';
|
|
|
|
// now we'll deal with the case that the admin has submitted the form with changed settings
|
|
if ($data = data_submitted() and confirm_sesskey()) {
|
|
if (admin_write_settings($data)) {
|
|
redirect($PAGE->url, get_string('changessaved'), null, \core\output\notification::NOTIFY_SUCCESS);
|
|
}
|
|
|
|
if (!empty($adminroot->errors)) {
|
|
$errormsg = get_string('errorwithsettings', 'admin');
|
|
$firsterror = reset($adminroot->errors);
|
|
$focus = $firsterror->id;
|
|
} else {
|
|
redirect($PAGE->url);
|
|
}
|
|
}
|
|
|
|
// and finally, if we get here, then there are matching settings and we have to print a form
|
|
// to modify them
|
|
echo $OUTPUT->header($focus);
|
|
|
|
echo $OUTPUT->heading(get_string('administrationsite'));
|
|
|
|
if ($errormsg !== '') {
|
|
echo $OUTPUT->notification($errormsg);
|
|
|
|
} else if ($statusmsg !== '') {
|
|
echo $OUTPUT->notification($statusmsg, 'notifysuccess');
|
|
}
|
|
|
|
require_once("admin_settings_search_form.php");
|
|
$form = new admin_settings_search_form();
|
|
$form->display();
|
|
echo '<hr>';
|
|
|
|
if ($query) {
|
|
echo admin_search_settings_html($query);
|
|
} else {
|
|
$node = $PAGE->settingsnav->find('root', navigation_node::TYPE_SITE_ADMIN);
|
|
if ($node) {
|
|
echo $OUTPUT->render_from_template('core/settings_link_page', ['node' => $node]);
|
|
}
|
|
}
|
|
|
|
echo $OUTPUT->footer();
|