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

Merge "Add notice & disable new secret urls when publicviews is off (bug #794385)"

parents fddbef12 7a164a56
<h3>Allow public pages</h3>
<p>If you wish to allow users to create pages that may be made accessible to the public, this option should be set to 'yes'. Public pages are still only editable by their owner.</p>
<p>If you disable this option, secret URL access will also be disabled.</p>
......@@ -107,6 +107,8 @@ $string['secreturlupdated'] = 'Secret URL updated';
$string['generatesecreturl'] = 'Generate a new secret URL for %s';
$string['secreturls'] = 'Secret URLs';
$string['publicaccessnotallowed'] = "Your institution or site administrator has disabled public pages and secret URLs. Any secret URLs you see listed here are currently inactive.";
// view user
$string['inviteusertojoingroup'] = 'Invite this user to join a group';
$string['addusertogroup'] = 'Add this user to a group';
{include file="header.tpl"}
{if !$allownew}
<div class="message info">{str tag=publicaccessnotallowed section=view}</div>
{if $editurls}
<table class="secreturls">
......@@ -248,7 +248,8 @@ function newurl_submit(Pieform $form, $values) {
redirect('/view/urls.php?id=' . $viewid);
$newform = pieform($newform);
$allownew = !$view->get('owner') || (get_config('allowpublicviews') && $USER->institution_allows_public_views());
$newform = $allownew ? pieform($newform) : null;
$js = <<<EOF
\$j(function() {
......@@ -268,5 +269,6 @@ $smarty = smarty(
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('editurls', $editurls);
$smarty->assign('allownew', $allownew);
$smarty->assign('newform', $newform);
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