mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-9190 Site policy xhtml compliance and other minor fixes
This commit is contained in:
parent
380a4235ff
commit
4d5dd30513
2 changed files with 29 additions and 11 deletions
|
@ -2549,6 +2549,20 @@ body#user-index .rolesform {
|
||||||
text-align:center;
|
text-align:center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#user-policy .noticebox {
|
||||||
|
text-align:center;
|
||||||
|
margin-left:auto;
|
||||||
|
margin-right:auto;
|
||||||
|
margin-bottom:10px;
|
||||||
|
width:80%;
|
||||||
|
height:250px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#user-policy #policyframe {
|
||||||
|
width:100%;
|
||||||
|
height:100%;
|
||||||
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
*** Modules: Assignment
|
*** Modules: Assignment
|
||||||
***/
|
***/
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
<?php // $Id$
|
<?php // $Id$
|
||||||
|
|
||||||
require_once("../config.php");
|
require_once('../config.php');
|
||||||
|
require_once($CFG->libdir.'/filelib.php');
|
||||||
|
|
||||||
$agree = optional_param('agree', 0, PARAM_INT);
|
$agree = optional_param('agree', 0, PARAM_BOOL);
|
||||||
|
|
||||||
define('MESSAGE_WINDOW', true); // This prevents the message window coming up
|
define('MESSAGE_WINDOW', true); // This prevents the message window coming up
|
||||||
|
|
||||||
|
if (!isloggedin()) {
|
||||||
if (empty($USER->id)) {
|
|
||||||
require_login();
|
require_login();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($agree == 1 and confirm_sesskey()) { // User has agreed
|
if ($agree and confirm_sesskey()) { // User has agreed
|
||||||
if ($USER->username != 'guest') { // Don't remember guests
|
if (!isguestuser()) { // Don't remember guests
|
||||||
if (!set_field('user', 'policyagreed', 1, 'id', $USER->id)) {
|
if (!set_field('user', 'policyagreed', 1, 'id', $USER->id)) {
|
||||||
error('Could not save your agreement');
|
error('Could not save your agreement');
|
||||||
}
|
}
|
||||||
|
@ -37,14 +37,18 @@
|
||||||
|
|
||||||
print_heading($strpolicyagreement);
|
print_heading($strpolicyagreement);
|
||||||
|
|
||||||
echo '<center>';
|
$mimetype = mimeinfo('type', $CFG->sitepolicy);
|
||||||
echo '<iframe width="90%" height="70%" src="'.$CFG->sitepolicy.'">';
|
echo '<div class="noticebox">';
|
||||||
|
echo '<object id="policyframe" data="'.$CFG->sitepolicy.'" type="'.$mimetype.'">';
|
||||||
echo link_to_popup_window ($CFG->sitepolicy, 'agreement', $strpolicyagreementclick,
|
echo link_to_popup_window ($CFG->sitepolicy, 'agreement', $strpolicyagreementclick,
|
||||||
500, 500, 'Popup window', 'none', true);
|
500, 500, 'Popup window', 'none', true);
|
||||||
echo '</iframe>';
|
echo '</object></div>';
|
||||||
echo '</center>';
|
|
||||||
|
|
||||||
notice_yesno($strpolicyagree, "policy.php?agree=1&sesskey=$USER->sesskey", $CFG->wwwroot);
|
$linkyes = 'policy.php';
|
||||||
|
$optionsyes = array('agree'=>1, 'sesskey'=>sesskey());
|
||||||
|
$linkno = $CFG->wwwroot.'/login/logout.php';
|
||||||
|
$optionsno = array('sesskey'=>sesskey());
|
||||||
|
notice_yesno($strpolicyagree, $linkyes, $linkno, $optionsyes, $optionsno);
|
||||||
|
|
||||||
print_footer();
|
print_footer();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue