Commit 121c0f10 authored by Maria Sorica's avatar Maria Sorica Committed by Robert Lyon

Bug 1734182: Display the site privacy on institution privacy page

behatnotneeded

Change-Id: I50c0bb5767f866ce0a8b5a961cbd0dd177962323
parent 99561341
......@@ -49,10 +49,19 @@ $institutionselector = pieform(array(
$data = '<div class="no-results">' . get_string('noinstitutionprivacy', 'admin') . '</div>'; //privacy data to show
$wwwroot = get_config('wwwroot');
// Site privacy to display in an expandable panel
$siteprivacycontent = get_record_sql("
SELECT s.content, s.ctime
FROM {site_content_version} s
WHERE s.institution = ?
ORDER BY s.id DESC
LIMIT 1", array('mahara'));
$js = <<< EOF
jQuery(function($) {
function reloadUsers() {
window.location.href = '{$wwwroot}admin/users/institutionprivacy.php?institution='+$('#usertypeselect_institution').val();
window.location.href = '{$wwwroot}admin/users/institutionprivacy.php?institution=' + $('#usertypeselect_institution').val();
}
$('#usertypeselect_institution').on('change', reloadUsers);
......@@ -64,5 +73,7 @@ setpageicon($smarty, 'icon-umbrella');
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('data', $data);
$smarty->assign('siteprivacycontent', $siteprivacycontent);
$smarty->assign('lastupdated', get_string('lastupdatedon', 'blocktype.externalfeed', format_date(strtotime($siteprivacycontent->ctime))));
$smarty->assign('institutionselector', $institutionselector);
$smarty->display('admin/users/institutionprivacy.tpl');
......@@ -1331,3 +1331,4 @@ $string['viewversion'] = 'View version %s';
$string['editversion'] = 'Edit version %s';
$string['lastversion'] = 'Privacy statements must have unique version names of up to 15 characters. The latest version for this privacy statement is "%s".';
$string['versionalreadyexist'] = 'A privacy statement with the version name "%s" already exists.';
$string['siteprivacystatement'] = 'Site privacy statement';
{include file="header.tpl"}
<div class="lead">{str tag="institutionprivacypagedescription" section="admin"}</div>
<div class="panel panel-default">
<div class="last form-group collapsible-group">
<fieldset class="pieform-fieldset last collapsible">
<legend>
<h4>
<a href="#dropdown" data-toggle="collapse" aria-expanded="false" aria-controls="dropdown" class="collapsed">
{str tag="siteprivacystatement" section="admin"}
<span class="icon icon-chevron-down collapse-indicator right pull-right"> </span>
</a>
</h4>
</legend>
<div class="fieldset-body collapse " id="dropdown">
<span class="text-midtone pull-right">{$lastupdated}</span>
<br>
{$siteprivacycontent->content|safe}
</div>
</fieldset>
</div>
</div>
<div class="panel panel-default">
<div id="institutionprivacylistcontainer">
{$data|safe}
......
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