Commit c30be1ee authored by Richard Mansfield's avatar Richard Mansfield Committed by Gerrit Code Review
Browse files

Merge "Site Options:indicate overriden allowpublicprofiles"

parents 40eed097 614ab223
......@@ -467,7 +467,7 @@ $siteoptionform = array(
'description' => get_string('allowpublicprofilesdescription', 'admin'),
'defaultvalue' => get_config('allowpublicprofiles'),
'help' => true,
'disabled' => in_array('allowpublicprofiles', $OVERRIDDEN),
'disabled' => in_array('allowpublicprofiles', $OVERRIDDEN) || get_config('allowpublicviews'),
),
'generatesitemap' => array(
'type' => 'checkbox',
......@@ -587,6 +587,10 @@ function siteoptions_submit(Pieform $form, $values) {
if ($values['allowpublicviews'] == false) {
$values['generatesitemap'] = false;
}
else {
// Ensure allowpublicprofiles is set as well
$values['allowpublicprofiles'] = 1;
}
$oldlanguage = get_config('lang');
$oldtheme = get_config('theme');
......
......@@ -42,13 +42,27 @@ function connectElements() {
connect('siteoptions_' + element, 'onchange', reloadRequired);
}
});
connect('siteoptions_allowpublicviews', 'onclick', update_allowpublicprofiles);
}
// Javascript success handler for the form. Re-wires up the elements
function checkReload(form, data) {
update_allowpublicprofiles();
isReloadRequired = false;
connectElements();
formSuccess(form, data);
}
function update_allowpublicprofiles() {
if ($('siteoptions_allowpublicviews').checked) {
$('siteoptions_allowpublicprofiles').checked = true;
$('siteoptions_allowpublicprofiles').setAttribute('disabled', 'disabled');
}
else {
$('siteoptions_allowpublicprofiles').removeAttribute('disabled');
}
}
addLoadEvent(connectElements);
......@@ -221,11 +221,11 @@ $string['adminsonly'] = 'Administrators only';
$string['adminsandstaffonly'] = 'Administrators and Staff only';
$string['advanced'] = 'Advanced';
$string['allowpublicviews'] = 'Allow public pages';
$string['allowpublicviewsdescription'] = 'If set to yes, users will be able to create portfolio pages that are accessable to the public rather than only to logged in users';
$string['allowpublicviewsdescription'] = 'If set to yes, users will be able to create portfolio pages that are accessible to the public rather than only to logged in users';
$string['allowinstitutionpublicviews'] = 'Allow institution public pages';
$string['allowinstitutionpublicviewsdescription'] = 'If set to yes, users belonging to this institution will be able to create portfolio pages that are accessable to the public rather than only to logged in users';
$string['allowinstitutionpublicviewsdescription'] = 'If set to yes, users belonging to this institution will be able to create portfolio pages that are accessible to the public rather than only to logged in users';
$string['allowpublicprofiles'] = 'Allow public profiles';
$string['allowpublicprofilesdescription'] = 'If set to yes, users will be able to set their profile pages to be accessable to the public rather than only to logged in users';
$string['allowpublicprofilesdescription'] = 'If set to yes, users will be able to set their profile pages to be accessible to the public rather than only to logged in users';
$string['anonymouscomments'] = 'Anonymous Comments';
$string['anonymouscommentsdescription'] = 'If checked, logged-out users can leave comments on public pages or pages they can access by secret URL.';
$string['antispam'] = 'Anti-spam';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment