]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-9190 Site policy xhtml compliance and other minor fixes; merged from MOODLE_18_STABLE
authorskodak <skodak>
Tue, 3 Apr 2007 09:51:53 +0000 (09:51 +0000)
committerskodak <skodak>
Tue, 3 Apr 2007 09:51:53 +0000 (09:51 +0000)
theme/standard/styles_layout.css
user/policy.php

index d2b8570dbf04e59224017563ef32efded833484f..7922a11f6e8f7610a0565861b70ec5f7f3c7c12f 100644 (file)
@@ -2549,6 +2549,20 @@ body#user-index .rolesform {
   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
  ***/
index 0519883c6629decd7aabb0c20b7d4b4c0a45cff2..bc4c83f062bbd49f1442d0ce449ee95402aa4efa 100644 (file)
@@ -1,18 +1,18 @@
 <?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
 
-
-    if (empty($USER->id)) {
+    if (!isloggedin()) {
         require_login();
     }
 
-    if ($agree == 1 and confirm_sesskey()) {        // User has agreed
-        if ($USER->username != 'guest') {           // Don't remember guests
+    if ($agree and confirm_sesskey()) {    // User has agreed
+        if (!isguestuser()) {              // Don't remember guests
             if (!set_field('user', 'policyagreed', 1, 'id', $USER->id)) {
                 error('Could not save your agreement');
             }
 
     print_heading($strpolicyagreement);
 
-    echo '<center>';
-    echo '<iframe width="90%" height="70%" src="'.$CFG->sitepolicy.'">';
+    $mimetype = mimeinfo('type', $CFG->sitepolicy);
+    echo '<div class="noticebox">';
+    echo '<object id="policyframe" data="'.$CFG->sitepolicy.'" type="'.$mimetype.'">';
     echo link_to_popup_window ($CFG->sitepolicy, 'agreement', $strpolicyagreementclick,
                                500, 500, 'Popup window', 'none', true);
-    echo '</iframe>';
-    echo '</center>';
+    echo '</object></div>';
 
-    notice_yesno($strpolicyagree, "policy.php?agree=1&amp;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();