Skip to content

Commit

Permalink
MDL-8062 1.3 Remove name attribute from <form> and fix focus everywhe…
Browse files Browse the repository at this point in the history
…re - more changes ahead
  • Loading branch information
skodak committed Jan 4, 2007
1 parent 535792b commit b7dc225
Show file tree
Hide file tree
Showing 120 changed files with 266 additions and 271 deletions.
2 changes: 1 addition & 1 deletion admin/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
admin_externalpage_print_header($adminroot);
print_simple_box(get_string('configauthenticationplugins', 'admin'), 'center', '700');

echo "<form $CFG->frametarget name=\"authmenu\" method=\"post\" action=\"auth.php\">";
echo "<form $CFG->frametarget id=\"authmenu\" method=\"post\" action=\"auth.php\">";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\">";
print_table($table);

Expand Down
22 changes: 13 additions & 9 deletions admin/auth_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,8 @@
admin_externalpage_print_header($adminroot);

// choose an authentication method
echo "<form $CFG->frametarget name=\"authmenu\" method=\"post\" action=\"auth_config.php\">\n";
echo "<form $CFG->frametarget id=\"authmenu\" method=\"post\" action=\"auth_config.php\">\n";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\">\n";
echo "<div align=\"center\"><p><b>\n";
echo get_string('chooseauthmethod').': ';
choose_from_menu ($options, "auth", $auth, '', "document.location='auth_config.php?sesskey=$USER->sesskey&auth='+document.authmenu.auth.options[document.authmenu.auth.selectedIndex].value", '');
echo "</b></p></div>\n\n";

// auth plugin description
print_simple_box_start('center', '80%');
Expand Down Expand Up @@ -118,10 +114,18 @@ function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts,
foreach ($user_fields as $field) {

// Define some vars we'll work with
optional_variable($pluginconfig->{"field_map_$field"}, '');
optional_variable($pluginconfig->{"field_updatelocal_$field"}, '');
optional_variable($pluginconfig->{"field_updateremote_$field"}, '');
optional_variable($pluginconfig->{"field_lock_$field"}, '');
if (isset($pluginconfig->{"field_map_$field"})) {
$pluginconfig->{"field_map_$field"} = '';
}
if (isset($pluginconfig->{"field_updatelocal_$field"})) {
$pluginconfig->{"field_updatelocal_$field"} = '';
}
if (isset($pluginconfig->{"field_updateremote_$field"})) {
$pluginconfig->{"field_updateremote_$field"} = '';
}
if (isset($pluginconfig->{"field_lock_$field"})) {
$pluginconfig->{"field_lock_$field"} = '';
}

// define the fieldname we display to the user
$fieldname = $field;
Expand Down
2 changes: 1 addition & 1 deletion admin/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

print_simple_box(get_string('configenrolmentplugins', 'admin'), 'center', '700');

echo "<form $CFG->frametarget name=\"enrolmenu\" method=\"post\" action=\"enrol.php\">";
echo "<form $CFG->frametarget id=\"enrolmenu\" method=\"post\" action=\"enrol.php\">";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\" />";

$table = new stdClass();
Expand Down
11 changes: 1 addition & 10 deletions admin/enrol_config.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,8 @@

admin_externalpage_print_header($adminroot);

echo "<form $CFG->frametarget name=\"enrolmenu\" method=\"post\" action=\"enrol_config.php\">";
echo "<form $CFG->frametarget id=\"enrolmenu\" method=\"post\" action=\"enrol_config.php\">";
echo "<input type=\"hidden\" name=\"sesskey\" value=\"".$USER->sesskey."\">";
echo "<div align=\"center\"><p><b>";


/// Choose an enrolment method
echo get_string('chooseenrolmethod').': ';
choose_from_menu ($options, "enrol", $enrol, "",
"document.location='enrol_config.php?enrol='+document.enrolmenu.enrol.options[document.enrolmenu.enrol.selectedIndex].value", "");

echo "</b></p></div>";

/// Print current enrolment type description
print_simple_box_start("center", "80%");
Expand Down
2 changes: 1 addition & 1 deletion admin/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@
@include("$langdir/$currentfile");

if ($editable) {
echo "<form name=\"$currentfile\" action=\"lang.php\" method=\"post\">";
echo "<form id=\"$currentfile\" action=\"lang.php\" method=\"post\">";
}
echo "<table summary=\"\" width=\"100%\" cellpadding=\"2\" cellspacing=\"3\" border=\"0\" class=\"generalbox\">";
$linescounter = 0;
Expand Down
2 changes: 1 addition & 1 deletion admin/langdoc.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
echo "<td align=\"center\">\n";

if ($editable) {
echo "<form name=\"$currentfile\" action=\"langdoc.php\" method=\"post\">";
echo "<form id=\"$currentfile\" action=\"langdoc.php\" method=\"post\">";
echo '<input type="hidden" name="sesskey" value="'.$USER->sesskey.'" />';
echo '<input type="hidden" name="currentfile" value="'.$currentfile.'" />';

Expand Down
6 changes: 3 additions & 3 deletions admin/langimport.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
print_simple_box_start('center','60%');
echo '<table summary="" width="100%">';
echo '<tr><td align="center" valign="top">';
echo '<form name="uninstallform" action="langimport.php?mode=4" method="post">';
echo '<form id="uninstallform" action="langimport.php?mode=4" method="post">';
echo '<input name="sesskey" type="hidden" value="'.sesskey().'" />';
unset($CFG->langlist); // ignore admin's langlist
$installedlangs = get_list_of_languages();
Expand All @@ -261,7 +261,7 @@
echo '</select>';
echo '<br /><input type="submit" value="'.get_string('uninstall','admin').'" />';
echo '</form>';
echo '<form name="updateform" action="langimport.php?mode=5" method="post">';
echo '<form id="updateform" action="langimport.php?mode=5" method="post">';
echo '<br /><input type="submit" value="'.get_string('updatelangs','admin').'" />';
echo '</form>';

Expand All @@ -275,7 +275,7 @@

/// if this language pack is not already installed, then we allow installation

echo '<form name="installform" method="post" action="langimport.php?mode=2">';
echo '<form id="installform" method="post" action="langimport.php?mode=2">';
echo '<input name="sesskey" type="hidden" value="'.sesskey().'" />';
echo '<label for="pack">'.get_string('availablelangs','admin')."</label><br />\n";
if ($remote) {
Expand Down
2 changes: 1 addition & 1 deletion admin/mnet/access_control.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@

?>
<div class="mnetaddtoaclform">
<form name="mnetaddtoacl" method="post">
<form id="mnetaddtoacl" method="post">
<input type="hidden" name="sesskey" value="<?php echo $sesskey; ?>">
<?php

Expand Down
2 changes: 1 addition & 1 deletion admin/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

print_simple_box_start("center", "");

echo "<form name=\"form\" action=\"http://moodle.org/register/\" method=\"post\">\n";
echo "<form id=\"form\" action=\"http://moodle.org/register/\" method=\"post\">\n";
echo "<table cellpadding=\"9\" border=\"0\">\n";
echo "<tr valign=\"top\">\n";
echo "<td align=\"center\" colspan=\"2\">".get_string("location")."</td>\n";
Expand Down
26 changes: 13 additions & 13 deletions admin/roles/assign.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<form name="assignform" id="assignform" method="post" action="">
<form id="assignform" method="post" action="">
<input type="hidden" name="previoussearch" value="<?php p($previoussearch) ?>" />
<input type="hidden" name="userid" value="<?php p($userid) ?>" />
<input type="hidden" name="courseid" value="<?php p($courseid) ?>" />
Expand All @@ -11,9 +11,9 @@
<label for="removeselect"><?php print_string('existingusers', 'role', count($contextusers)); ?></label>
<br />
<select name="removeselect[]" size="20" id="removeselect" multiple="multiple"
onfocus="document.assignform.add.disabled=true;
document.assignform.remove.disabled=false;
document.assignform.addselect.selectedIndex=-1;">
onfocus="getElementById('assignform').add.disabled=true;
getElementById('assignform').remove.disabled=false;
getElementById('assignform').addselect.selectedIndex=-1;">
<?php
foreach ($contextusers as $contextuser) {
$fullname = fullname($contextuser, true);
Expand Down Expand Up @@ -44,9 +44,9 @@
<label for="addselect"><?php print_string('potentialusers', 'role', $usercount); ?></label>
<br />
<select name="addselect[]" size="20" id="addselect" multiple="multiple"
onfocus="document.assignform.add.disabled=false;
document.assignform.remove.disabled=true;
document.assignform.removeselect.selectedIndex=-1;">
onfocus="getElementById('assignform').add.disabled=false;
getElementById('assignform').remove.disabled=true;
getElementById('assignform').removeselect.selectedIndex=-1;">
<?php

if (!empty($searchtext)) {
Expand Down Expand Up @@ -81,14 +81,14 @@
<br />
<label for="searchtext" class="accesshide"><?php p($strsearch) ?></label>
<input type="text" name="searchtext" id="searchtext" size="30" value="<?php p($searchtext, true) ?>"
onfocus ="document.assignform.add.disabled=true;
document.assignform.remove.disabled=true;
document.assignform.removeselect.selectedIndex=-1;
document.assignform.addselect.selectedIndex=-1;"
onfocus ="getElementById('assignform').add.disabled=true;
getElementById('assignform').remove.disabled=true;
getElementById('assignform').removeselect.selectedIndex=-1;
getElementById('assignform').addselect.selectedIndex=-1;"
onkeydown = "var keyCode = event.which ? event.which : event.keyCode;
if (keyCode == 13) {
document.assignform.previoussearch.value=1;
document.assignform.submit();
getElementById('assignform').previoussearch.value=1;
getElementById('assignform').submit();
} " />
<input name="search" id="search" type="submit" value="<?php p($strsearch) ?>" />
<?php
Expand Down
2 changes: 1 addition & 1 deletion admin/roles/manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div align="right">
<a href="manage.php?roleid=<?php p($roleid); ?>&amp;action=duplicate"><?php print_string('duplicaterole'); ?></a>
</div>
<form name="rolesform" action="manage.php" method="post">
<form id="rolesform" action="manage.php" method="post">
<input type="hidden" name="roleid" value="<?php p($roleid) ?>" />
<input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
<input type="hidden" name="action" value="<?php if ($action != 'view') { echo p($action); } ?>" />
Expand Down
4 changes: 2 additions & 2 deletions admin/roles/manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,11 @@
echo '<div align="center" class="selector">';
if ($action == 'view') {
echo get_string('selectrole', 'role').': ';
echo '<form style="display:inline;" name="switchrole" action="manage.php" method="get">';
echo '<form style="display:inline;" id="switchrole" action="manage.php" method="get">';
echo '<input type="hidden" name="action" value="view" />';
choose_from_menu ($roleoptions, 'roleid', $roleid, get_string('listallroles', 'role').'...', $script='switchrole.submit()');
echo '</form>';
echo '<form style="display:inline;" name="editrole" action="manage.php" method="get">';
echo '<form style="display:inline;" id="editrole" action="manage.php" method="get">';
echo '<input type="hidden" name="roleid" value="'.$roleid.'" />';
echo '<input type="hidden" name="action" value="edit" />';
echo '<input type="submit" value="'.get_string('edit').'" />';
Expand Down
2 changes: 1 addition & 1 deletion admin/roles/override.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
$strprohibit = get_string('prohibit','role');
?>

<form name="overrideform" action="override.php" method="post">
<form id="overrideform" action="override.php" method="post">
<input type="hidden" name="contextid" value="<?php p($contextid) ?>" />
<input type="hidden" name="roleid" value="<?php p($roleid) ?>" />
<input type="hidden" name="sesskey" value="<?php p(sesskey()) ?>" />
Expand Down
2 changes: 1 addition & 1 deletion admin/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

$resultshtml = search_settings_html(admin_get_root(), $query);

echo '<form action="search.php" method="post" name="adminsettings" id="adminsettings">';
echo '<form action="search.php" method="post" id="adminsettings">';
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
echo '<input type="hidden" name="query" value="' . s($query) . '" />';
echo '<fieldset>';
Expand Down
2 changes: 1 addition & 1 deletion admin/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

// ---------------------------------------------------------------------------------------------------------------

echo '<form action="settings.php" method="post" name="adminsettings" id="adminsettings">';
echo '<form action="settings.php" method="post" id="adminsettings">';
echo '<input type="hidden" name="section" value="' . $PAGE->section . '" />';
echo '<input type="hidden" name="sesskey" value="' . $USER->sesskey . '" />';
echo '<input type="hidden" name="return" value="' . $return . '" />';
Expand Down
2 changes: 1 addition & 1 deletion admin/upgradesettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

print_simple_box(get_string('upgradesettingsintro','admin'),'','100%','',5,'generalbox','');

echo '<form action="upgradesettings.php" method="post" name="adminsettings" id="adminsettings">';
echo '<form action="upgradesettings.php" method="post" id="adminsettings">';
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';
echo '<fieldset>';
echo '<div class="clearer"><!-- --></div>';
Expand Down
2 changes: 1 addition & 1 deletion admin/xmldb/actions/edit_field/edit_field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function invoke() {
$origstructure =& $dbdir->xml_file->getStructure();

/// Add the main form
$o = '<form name="form" id="form" action="index.php" method="post">';
$o = '<form id="form" action="index.php" method="post">';
$o.= ' <input type="hidden" name ="dir" value="' . str_replace($CFG->dirroot, '', $dirpath) . '" />';
$o.= ' <input type="hidden" name ="table" value="' . $tableparam .'" />';
$o.= ' <input type="hidden" name ="field" value="' . $fieldparam .'" />';
Expand Down
2 changes: 1 addition & 1 deletion admin/xmldb/actions/edit_index/edit_index.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function invoke() {
$origstructure =& $dbdir->xml_file->getStructure();

/// Add the main form
$o = '<form name="form" id="form" action="index.php" method="post">';
$o = '<form id="form" action="index.php" method="post">';
$o.= ' <input type="hidden" name ="dir" value="' . str_replace($CFG->dirroot, '', $dirpath) . '" />';
$o.= ' <input type="hidden" name ="table" value="' . $tableparam .'" />';
$o.= ' <input type="hidden" name ="index" value="' . $indexparam .'" />';
Expand Down
2 changes: 1 addition & 1 deletion admin/xmldb/actions/edit_key/edit_key.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function invoke() {
$origstructure =& $dbdir->xml_file->getStructure();

/// Add the main form
$o = '<form name="form" id="form" action="index.php" method="post">';
$o = '<form id="form" action="index.php" method="post">';
$o.= ' <input type="hidden" name ="dir" value="' . str_replace($CFG->dirroot, '', $dirpath) . '" />';
$o.= ' <input type="hidden" name ="table" value="' . $tableparam .'" />';
$o.= ' <input type="hidden" name ="key" value="' . $keyparam .'" />';
Expand Down
2 changes: 1 addition & 1 deletion admin/xmldb/actions/edit_sentence/edit_sentence.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function invoke() {
$values = $statement->getValuesFromInsertSentence($sentence);

/// Add the main form
$o = '<form name="form" id="form" action="index.php" method="post">';
$o = '<form id="form" action="index.php" method="post">';
$o.= ' <input type="hidden" name ="dir" value="' . str_replace($CFG->dirroot, '', $dirpath) . '" />';
$o.= ' <input type="hidden" name ="statement" value="' . $statementparam .'" />';
$o.= ' <input type="hidden" name ="sentence" value="' . $sentenceparam .'" />';
Expand Down
14 changes: 7 additions & 7 deletions auth/cas/index_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
(<?php print_string("cookiesenabled");?>)
<?php helpbutton("cookies", get_string("cookiesenabled"))?><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" style="font-size: small">
<tr>
<td width="100%">
<input type="hidden" name="username" value="cas" />
<input type="hidden" name="password" value="cas" />
<input type="hidden" name="username" id="username" value="cas" />
<input type="hidden" name="password" id="password" value="cas" />
<input type="submit" value="<?php print_string("auth_cas_logincas", "auth") ?>" />
</td>
</tr>
Expand All @@ -29,7 +29,7 @@
<?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">
<input type="hidden" name="username" value="guest" />
<input type="hidden" name="password" value="guest" />
<input type="submit" value="<?php print_string("loginguest") ?>" />
Expand All @@ -42,7 +42,7 @@
?>
<hr width="80%" />
<p><?php print_string("forgotten") ?></p>
<form action="<?php p($changepassword) ?>" method="get" name="changepassword">
<form action="<?php p($changepassword) ?>" method="get" id="changepassword">
<input type="submit" value="<?php p($changebuttonname) ?>" />
</form>
<?php } ?>
Expand All @@ -56,7 +56,7 @@
print_string("loginsteps", "", "signup.php");
?>
<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>
Expand All @@ -71,7 +71,7 @@
?>

<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>
Expand Down
2 changes: 1 addition & 1 deletion backup/backup_check.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}
?>

<form name="form" method="post" action="backup.php">
<form id="form" method="post" action="backup.php">
<table cellpadding="5">
<?php

Expand Down
2 changes: 1 addition & 1 deletion backup/backup_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
-->
</script>

<form name="form1" id="form1" method="post" action="backup.php">
<form id="form1" method="post" action="backup.php">
<table cellpadding="5">
<?php
//Now, check modules and info and show posibilities
Expand Down
2 changes: 1 addition & 1 deletion backup/restore_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
-->
</script>

<form name="form1" id="form1" method="post" action="restore.php">
<form id="form1" method="post" action="restore.php">
<table cellpadding="5">
<?php

Expand Down
2 changes: 1 addition & 1 deletion blocks/loancalc/block_loancalc.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function comp(v) { // general entry point for all cases
<title></title>
<h1></h1>
<form method="post" id="vbankform" name="vbankform">
<form method="post" id="vbankform">
<table>
<tr>
<td colspan="2">'.get_string('amountofloan','block_loancalc').'</td>
Expand Down
2 changes: 1 addition & 1 deletion blocks/login/block_login.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function get_content () {

if (empty($USER->loggedin) or isguest()) { // Show the block

$this->content->text .= "\n".'<form class="loginform" name="login" method="post" action="'.$wwwroot.'/login/index.php">';
$this->content->text .= "\n".'<form class="loginform" id="login" method="post" action="'.$wwwroot.'/login/index.php">';

$this->content->text .= '<div class="c1"><label for="login_username">'.get_string('username').'</label>: ';
$this->content->text .= '<input type="text" name="username" id="login_username" value="'.$username.'" /></div>';
Expand Down
2 changes: 1 addition & 1 deletion blocks/search/block_search.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function get_content() {

//basic search form
$this->content->text =
'<form name="query" method="get" action="'. $CFG->wwwroot .'/search/query.php"><div>'
'<form id="searchquery" method="get" action="'. $CFG->wwwroot .'/search/query.php"><div>'
. '<label for="block_search_q">'. $label .'</label>'
. '<input id="block_search_q" type="text" name="query_string" length="50" />'
. '<input type="submit" value="'.$button.'" />'
Expand Down
2 changes: 1 addition & 1 deletion blog/preferences.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<form method="post" action="preferences.php" name="entry" id="entry">
<form method="post" action="preferences.php" id="entry">
<table cellpadding="9" cellspacing="0">
<tr>
<td><?php print_string('pagesize', 'blog');?>:</td>
Expand Down
Loading

0 comments on commit b7dc225

Please sign in to comment.