mirror of
https://github.com/moodle/moodle.git
synced 2025-04-08 01:43:32 +02:00
MDL-62286 tool_policy: Add Policies link to the site footer
This commit is contained in:
parent
446d8483a3
commit
54659fd14d
@ -107,6 +107,10 @@ class page_viewalldoc implements renderable, templatable {
|
||||
|
||||
$data->policies = array_values($this->policies);
|
||||
|
||||
array_walk($data->policies, function($item, $key) {
|
||||
$item->policytypestr = get_string('policydoctype'.$item->type, 'tool_policy');
|
||||
});
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
@ -93,6 +93,25 @@ function tool_policy_before_standard_html_head() {
|
||||
return $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback to add footer elements.
|
||||
*
|
||||
* @return str valid html footer content
|
||||
*/
|
||||
function tool_policy_standard_footer_html() {
|
||||
global $CFG;
|
||||
|
||||
$output = '';
|
||||
if (!empty($CFG->sitepolicyhandler)
|
||||
&& $CFG->sitepolicyhandler == 'tool_policy') {
|
||||
$url = (new moodle_url('/admin/tool/policy/viewall.php'))->out();
|
||||
$output .= html_writer::link($url, get_string('userpolicysettings', 'tool_policy'));
|
||||
$output = html_writer::div($output, 'policiesfooter');
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hooks redirection to policy acceptance pages before sign up.
|
||||
*/
|
||||
|
@ -32,31 +32,52 @@
|
||||
{
|
||||
"policies": [
|
||||
{
|
||||
"id": "2",
|
||||
"name": "Terms & conditions",
|
||||
"summary": "Policy <u>summary</u>",
|
||||
"content": "Policy <em>content</em>"
|
||||
"content": "Policy <em>content</em>",
|
||||
"policytypestr": "Site policy"
|
||||
},
|
||||
{
|
||||
"id": "5",
|
||||
"name": "Privacy",
|
||||
"summary": "We keep your information private",
|
||||
"content": "Very private"
|
||||
"content": "Very private",
|
||||
"policytypestr": "Privacy policy"
|
||||
}
|
||||
]
|
||||
}
|
||||
}}
|
||||
|
||||
<a id="top"></a>
|
||||
<div id="policies_index" class="m-b-3">
|
||||
<ul>
|
||||
{{#policies }}
|
||||
<li><a href="#policy-{{id}}">{{{name}}} ({{{policytypestr}}})</a></li>
|
||||
{{/policies }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{#policies }}
|
||||
<hr>
|
||||
<div class="policy_version m-b-3">
|
||||
<div class="clearfix m-t-2">
|
||||
<h1>{{{name}}}</h1>
|
||||
<h1><a id="policy-{{id}}">{{{name}}}</a></h1>
|
||||
</div>
|
||||
<div class="policy_document_summary clearfix m-b-1">
|
||||
<h2>{{# str }} policydocsummary, tool_policy {{/ str }}</h2>
|
||||
{{{summary}}}
|
||||
</div>
|
||||
<div class="policy_document_content m-t-2">
|
||||
<h2>{{# str }} policydoccontent, tool_policy {{/ str }}</h2>
|
||||
{{{content}}}
|
||||
</div>
|
||||
<hr>
|
||||
<div class="pull-right">
|
||||
<a href="#top">
|
||||
{{# str }} backtotop, tool_policy {{/ str }}
|
||||
<i class="icon text-primary fa fa-caret-up" title="{{# str }} backtotop, tool_policy {{/ str }}" ></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{/policies }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user