New config setting for /my redirect and breadcrumb replacement rather than always doing it

This commit is contained in:
mjollnir_ 2005-08-29 02:34:17 +00:00
parent 9245f1d462
commit 62e4c0959b
4 changed files with 6 additions and 4 deletions

View File

@ -85,7 +85,8 @@ class configvarrss extends configvar {
choose_from_menu ($noyesoptions, 'enablerssfeeds', $config->enablerssfeeds, '', '', '', true),
'<font color="red"> You need to add XML support to your PHP installation.</font>' );
$misc['mymoodleredirect'] = new configvar (get_string('configmymoodleredirect','admin'),
choose_from_menu($noyesoptions,'mymoodleredirect',$config->mymoodleredirect,'','','',true));
////////////////////////////////////////////////////////////////////

View File

@ -64,6 +64,7 @@ $string['configlongtimenosee'] = 'If students haven\'t logged in for a very long
$string['configmaxbytes'] = 'This specifies a maximum size that uploaded files can be throughout the whole site. This setting is limited by the PHP setting upload_max_filesize and the Apache setting LimitRequestBody. In turn, maxbytes limits the range of sizes that can be chosen at course level or module level.';
$string['configmaxeditingtime'] = 'This specifies the amount of time people have to re-edit forum postings, glossary comments etc. Usually 30 minutes is a good value.';
$string['configmessaging'] = 'Should the messaging system between site users be enabled?';
$string['configmymoodleredirect'] = 'This setting forces redirects to /my on login for non-admins and replaces the top level site breadcrumb with /my';
$string['confignoreplyaddress'] = 'Emails are sometimes sent out on behalf of a user (eg forum posts). The email address you specify here will be used as the \"From\" address in those cases when the recipients should not be able to reply directly to the user (eg when a user chooses to keep their address private).';
$string['confignotifyloginfailures'] = 'If login failures have been recorded, email notifications can be sent out. Who should see these notifications?';
$string['confignotifyloginthreshold'] = 'If notifications about failed logins are active, how many failed login attempts by one user or one IP address is it worth notifying about?';

View File

@ -2253,7 +2253,7 @@ function print_navigation ($navigation) {
$site->shortname = get_string('home');
}
$navigation = str_replace('->', '&raquo;', $navigation);
echo '<a target="'. $CFG->framename .'" href="'. $CFG->wwwroot.((!isadmin() && !empty($USER->id)) ? '/my' : '') .'/">'. $site->shortname .'</a> &raquo; '. $navigation;
echo '<a target="'. $CFG->framename .'" href="'. $CFG->wwwroot.((!isadmin() && !empty($USER->id) && !empty($CFG->mymoodleredirect)) ? '/my' : '') .'/">'. $site->shortname .'</a> &raquo; '. $navigation;
}
}

View File

@ -149,8 +149,8 @@
} else {
$urltogo = $CFG->wwwroot.'/my'; /// Go to the standard home page
if (isadmin()) {
$urltogo = $CFG->wwwroot; /// not needed by admins.
if (isadmin() || empty($CFG->mymoodleredirect)) {
$urltogo = $CFG->wwwroot; /// not needed by admins or when it's turned off
}
unset($SESSION->wantsurl); /// Just in case
}