]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-8062 chat, login page and messaging - removed name attribute from some <form...
authorskodak <skodak>
Wed, 3 Jan 2007 20:35:09 +0000 (20:35 +0000)
committerskodak <skodak>
Wed, 3 Jan 2007 20:35:09 +0000 (20:35 +0000)
lib/javascript.php
login/index.php
login/index_form.html
message/discussion.php
mod/chat/gui_basic/index.php

index 40a9547996cfe9b07d8463808f278b7347753739..bff9eea60629994e88c7e2490c00ae14e0ff33f0 100644 (file)
@@ -73,12 +73,14 @@ function inserttext(text) {
 }
 <?php if (!empty($focus)) {
     if(($pos = strpos($focus, '.')) !== false) {
+        //old style focus using form name - no allowed inXHTML Strict
         $topelement = substr($focus, 0, $pos);
+        echo "function setfocus() { if(document.$topelement) document.$focus.focus(); }\n";
+    } else {
+        //focus element with given id
+        echo "function setfocus() { if(el = document.getElementById('$focus')) el.focus(); }\n";
     }
-    else {
-        $topelement = $focus;
-    }
-    echo "function setfocus() { if(document.$topelement) document.$focus.focus(); }\n"; } ?>
+} ?>
 
 //]]>
 </script>
index 70ec4c9e8066ae7699e54fda7a5b5dde8d3c23d2..d4cd256401ecd67c707501027918809bb0760948 100644 (file)
     }
     
     if (!empty($frm->username)) {
-        $focus = "login.password";
+        $focus = "password";
     } else {
-        $focus = "login.username";
+        $focus = "username";
     }
     
     if (isset($CFG->auth_instructions)) {
index 8ba140e388f0a48894a362548d53623b84e5c0de..e7fefb0b7250d2096ca3e69c5213f16cf815607a 100644 (file)
@@ -22,7 +22,7 @@
         }
         ?><br /><?php formerr($errormsg) ?>
       </p>
-      <form action="index.php" method="post" name="login" id="login">
+      <form action="index.php" method="post" id="login">
         <table border="0" align="center">
         <tr>
           <td width="80%">
@@ -32,7 +32,7 @@
                   <label for="username"><?php print_string("username") ?></label>
                 </td>
                 <td class="c1">
-                  <input type="text" name="username" id="username" size="15" value="<?php p($frm->username) ?>" alt="<?php print_string("username") ?>" /> 
+                  <input type="text" name="username" id="username" size="15" value="<?php p($frm->username) ?>" /> 
                 </td>
               </tr>
               <tr class="password"> 
@@ -40,7 +40,7 @@
                   <label for="password"><?php print_string("password") ?></label>
                 </td>
                 <td class="c1">
-                  <input type="password" name="password" id="password" size="15" value="" alt="<?php print_string("password") ?>" />
+                  <input type="password" name="password" id="password" size="15" value="" />
                 </td>
               </tr>
             </table>
 <?php if ($CFG->guestloginbutton) {  ?>
       <hr width="80%" />
       <p><?php print_string("someallowguest") ?>:</p>
-        <form action="index.php" method="post" name="guestlogin">
+        <form action="index.php" method="post" id="guestlogin">
+         <div>
           <input type="hidden" name="username" value="guest" />
           <input type="hidden" name="password" value="guest" />
           <input type="hidden" name="testcookies" value="1" />
           <input type="submit" value="<?php print_string("loginguest") ?>" />
+         </div>
         </form>
 <?php } ?>
 
 ?>
       <hr width="80%" />
       <p><?php print_string("forgotten") ?></p> 
-        <form action="forgot_password.php" method="post" name="changepassword">
+        <form action="forgot_password.php" method="post" id="changepassword">
+         <div>
           <input type="hidden" name="sesskey" value="<?php echo $sesskey; ?>" />
           <input type="submit" value="<?php p($changebuttonname) ?>" />
+         </div>
         </form>
     </td>
 
@@ -83,8 +87,8 @@
                  print_string("loginsteps", "", "signup.php");
 ?>
                  <div align="center">
-                   <form action="signup.php" method="get" name="signup">
-                   <input type="submit" value="<?php print_string("startsignup") ?>" />
+                   <form action="signup.php" method="get" id="signup">
+                   <div><input type="submit" value="<?php print_string("startsignup") ?>" /></div>
                    </form>
                  </div>
 <?php            break;
                  if (!empty($CFG->auth_user_create) and function_exists('auth_user_create') ){
 ?>
                  <div align="center">
-                    <form action="signup.php" method="get" name="signup">
+                    <form action="signup.php" method="get" id="signup">
                     <input type="submit" value="<?php print_string("startsignup") ?>" />
                     </form>
                  </div>
index 3c7bc06257ced6dd9820fb550ac36ebb54ecd21d..d64a36f170264837305a65e3a0404128fe6ebc59 100644 (file)
     $userfullname = fullname($user);
     $mefullname   = fullname($USER);
 
-    print_header(get_string('discussion', 'message').': '.fullname($user));
+    print_header(get_string('discussion', 'message').': '.fullname($user), '', '', 'edit-message');
     echo '<div class="message-discussion-noframes">';
     echo '<div id="userinfo">';
     echo print_user_picture($user->id, SITEID, $user->picture, 48, true, true, 'userwindow');
     echo '</div>'; // class="userinfo"
 
     echo '<div id="send">';
-    echo '<form name="editing" method="post" action="discussion.php">';
-    echo '<input type="hidden" name="id" value="'.$user->id.'" />';
-    echo '<input type="hidden" name="start" value="'.$start.'" />';
-    echo '<input type="hidden" name="noframesjs" value="'.$noframesjs.'" />';
-    echo '<input type="hidden" name="last" value="'.time().'" />';
-    echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
+    echo '<form id="editing" method="post" action="discussion.php">';
 
     $usehtmleditor = (can_use_html_editor() && get_user_preferences('message_usehtmleditor', 0));
     echo '<h1><label for="edit-message">'.get_string('sendmessage', 'message').'</label></h1>';
         echo '<input type="hidden" name="format" value="'.FORMAT_MOODLE.'" />';
     }
     echo '</div><div>';
+    echo '<input type="hidden" name="id" value="'.$user->id.'" />';
+    echo '<input type="hidden" name="start" value="'.$start.'" />';
+    echo '<input type="hidden" name="noframesjs" value="'.$noframesjs.'" />';
+    echo '<input type="hidden" name="last" value="'.time().'" />';
+    echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
     echo '<input type="submit" value="'.get_string('sendmessage', 'message').'" />&nbsp;';
     echo '<input type="submit" name="refresh" value="'.get_string('refresh').'" />';
     echo '<input type="checkbox" name="newonly" id="newonly" '.($newonly?'checked="checked" ':'').'/><label for="newonly">'.get_string('newonlymsg', 'message').'</label>';
             }
 
             $printmessage = format_text($message->message, $message->format, $options, 0);
-            $printmessage = str_replace("\r", ' ', $printmessage);
-            $printmessage = str_replace("\n", ' ', $printmessage);
             $printmessage = '<div class="message other"><span class="author">'.$fullname.'</span> '.
                 '<span class="time">['.$time.']</span>: '.
                 '<span class="content">'.$printmessage.'</span></div>';
             $time = userdate($message->timecreated, get_string('strftimedaytime'));
 
             $printmessage = format_text($message->message, $message->format, $options, 0);
-            $printmessage = str_replace("\r", ' ', $printmessage);
-            $printmessage = str_replace("\n", ' ', $printmessage);
             $printmessage = '<div class="message other"><span class="author">'.$mefullname.'</span> '.
                 '<span class="time">['.$time.']</span>: '.
                 '<span class="content">'.$printmessage.'</span></div>';
             $time = userdate($message->timecreated, get_string('strftimedaytime'));
 
             $printmessage = format_text($message->message, $message->format, $options, 0);
-            $printmessage = str_replace("\r", ' ', $printmessage);
-            $printmessage = str_replace("\n", ' ', $printmessage);
             $printmessage = '<div class="message other"><span class="author">'.$userfullname.'</span> '.
                 '<span class="time">['.$time.']</span>: '.
                 '<span class="content">'.$printmessage.'</span></div>';
index e72aaacfbcabb8c3876797283c579a664a41bf84..89210c8e60f1d9ab636cc5a39c063a43ad3c3b96 100644 (file)
@@ -95,7 +95,7 @@
     }
 
 
-    print_header("$strchat: $course->shortname: ".format_string($chat->name,true)."$groupname");
+    print_header("$strchat: $course->shortname: ".format_string($chat->name,true)."$groupname", '', '', 'message');
 
     echo '<div id="mod-chat-gui_basic">';
     echo '<h1>'.get_string('participants').'</h1>';
     }
     echo '</ul></div>';
     echo '<div id="send">';
-    echo '<form name="editing" method="post" action="index.php">';
-    echo '<input type="hidden" name="id" value="'.$id.'" />';
-    echo '<input type="hidden" name="groupid" value="'.$groupid.'" />';
-    echo '<input type="hidden" name="last" value="'.time().'" />';
-    echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
+    echo '<form id="editing" method="post" action="index.php">';
 
     $usehtmleditor = can_use_html_editor();
     echo '<h1><label for="message">'.get_string('sendmessage', 'message').'</label></h1>';
     echo '<div>';
     echo '<input type="text" id="message" name="message" value="'.s($refreshedmessage, true).'" size="60" />';
     echo '</div><div>';
+    echo '<input type="hidden" name="id" value="'.$id.'" />';
+    echo '<input type="hidden" name="groupid" value="'.$groupid.'" />';
+    echo '<input type="hidden" name="last" value="'.time().'" />';
+    echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
     echo '<input type="submit" value="'.get_string('submit').'" />&nbsp;';
     echo '<input type="submit" name="refresh" value="'.get_string('refresh').'" />';
     echo '<input type="checkbox" name="newonly" id="newonly" '.($newonly?'checked="checked" ':'').'/><label for="newonly">'.get_string('newonlymsg', 'message').'</label>';