mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-8062 Remove name attribute from <form> and related javascript code cleanup (tested with FF, IE, Konq and Opera)
This commit is contained in:
parent
ee7f231d08
commit
d2ce367fb9
38 changed files with 135 additions and 125 deletions
|
@ -331,7 +331,7 @@
|
|||
html_header($course, $wdir, "form.name");
|
||||
echo "<p>$strrenamefileto:";
|
||||
echo "<table border=\"0\">\n<tr>\n<td>\n";
|
||||
echo "<form action=\"coursefiles.php\" method=\"post\" name=\"form\">\n";
|
||||
echo "<form action=\"coursefiles.php\" method=\"post\" id=\"form\">\n";
|
||||
echo " <input type=\"hidden\" name=\"id\" value=\"$id\" />\n";
|
||||
echo " <input type=\"hidden\" name=\"wdir\" value=\"$wdir\" />\n";
|
||||
echo " <input type=\"hidden\" name=\"action\" value=\"rename\" />\n";
|
||||
|
@ -809,7 +809,7 @@ function displaydir ($wdir) {
|
|||
"zip" => "$strcreateziparchive"
|
||||
);
|
||||
if (!empty($count)) {
|
||||
choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:document.dirform.submit()");
|
||||
choose_from_menu ($options, "action", "", "$strwithchosenfiles...", "javascript:getElementById('dirform').submit()");
|
||||
}
|
||||
if (!empty($USER->fileop) and ($USER->fileop == "move") and ($USER->filesource <> $wdir)) {
|
||||
echo "<form action=\"coursefiles.php\" method=\"get\">\n";
|
||||
|
|
|
@ -51,7 +51,7 @@ border-bottom: 1px solid black; letter-spacing: 2px;
|
|||
</head>
|
||||
<body>
|
||||
<div class="title"><?php print_string("createanchor","editor");?></div>
|
||||
<form name="fie">
|
||||
<form id="fie">
|
||||
<table border="0" cellpadding="2" cellspacing="0">
|
||||
<tr>
|
||||
<td><?php print_string("anchorname","editor");?>: <input id="f_anc" name="anc" type="text" size="30" /></td>
|
||||
|
|
|
@ -178,7 +178,7 @@ form { margin-bottom: 0px; margin-top: 0px; }
|
|||
<div class="space"></div>
|
||||
<div class="space"></div>
|
||||
<div class="space"></div>
|
||||
<form action="" method="get" name="first" id="first">
|
||||
<form action="" method="get" id="first">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="15%" align="right"><?php print_string("imageurl","editor");?>:</td>
|
||||
|
@ -281,13 +281,13 @@ form { margin-bottom: 0px; margin-top: 0px; }
|
|||
<?php if(has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id))) { ?>
|
||||
<table border="0" cellpadding="2" cellspacing="0">
|
||||
<tr><td><?php print_string("selection","editor");?>: </td>
|
||||
<td><form name="idelete" id="idelete">
|
||||
<td><form id="idelete">
|
||||
<input name="btnDelete" type="submit" id="btnDelete" value="<?php print_string("delete","editor");?>" onclick="return submit_form('delete');" /></form></td>
|
||||
<td><form name="imove" id="imove">
|
||||
<td><form id="imove">
|
||||
<input name="btnMove" type="submit" id="btnMove" value="<?php print_string("move","editor");?>" onclick="return submit_form('move');" /></td>
|
||||
<td><form name="izip" id="izip">
|
||||
<td><form id="izip">
|
||||
<input name="btnZip" type="submit" id="btnZip" value="<?php print_string("zip","editor");?>" onclick="return submit_form('zip');" /></form></td>
|
||||
<td><form name="irename" id="irename" method="post" action="../coursefiles.php" target="ibrowser">
|
||||
<td><form id="irename" method="post" action="../coursefiles.php" target="ibrowser">
|
||||
<input type="hidden" name="id" value="<?php print($course->id);?>" />
|
||||
<input type="hidden" name="wdir" value="" />
|
||||
<input type="hidden" name="file" value="" />
|
||||
|
@ -315,7 +315,7 @@ form { margin-bottom: 0px; margin-top: 0px; }
|
|||
<tr>
|
||||
<td height="22"><?php
|
||||
if(has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id))) { ?>
|
||||
<form name="cfolder" id="cfolder" action="../coursefiles.php" method="post" target="ibrowser">
|
||||
<form id="cfolder" action="../coursefiles.php" method="post" target="ibrowser">
|
||||
<input type="hidden" name="id" value="<?php print($course->id);?>" />
|
||||
<input type="hidden" name="wdir" value="" />
|
||||
<input type="hidden" name="action" value="mkdir" />
|
||||
|
@ -324,7 +324,7 @@ form { margin-bottom: 0px; margin-top: 0px; }
|
|||
<input name="btnCfolder" type="submit" id="btnCfolder" value="<?php print_string("createfolder","editor");?>" onclick="return checkvalue('foldername','cfolder');" />
|
||||
</form>
|
||||
<div class="space"></div>
|
||||
<form action="../coursefiles.php?id=<?php print($course->id);?>" method="post" enctype="multipart/form-data" name="uploader" target="ibrowser" id="uploader">
|
||||
<form action="../coursefiles.php?id=<?php print($course->id);?>" method="post" enctype="multipart/form-data" target="ibrowser" id="uploader">
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="<?php print($upload_max_filesize);?>" />
|
||||
<input type="hidden" name="id" VALUE="<?php print($course->id);?>" />
|
||||
<input type="hidden" name="wdir" value="" />
|
||||
|
|
|
@ -102,13 +102,13 @@ form { margin-bottom: 1px; margin-top: 1px; }
|
|||
<td>
|
||||
<table border="0" cellpadding="2" cellspacing="0">
|
||||
<tr><td><?php print_string("selection","editor");?>: </td>
|
||||
<td><form name="idelete" id="idelete">
|
||||
<td><form id="idelete">
|
||||
<input name="btnDelete" type="submit" id="btnDelete" value="<?php print_string("delete","editor");?>" onclick="return submit_form('delete');" /></form></td>
|
||||
<td><form name="imove" id="imove">
|
||||
<td><form id="imove">
|
||||
<input name="btnMove" type="submit" id="btnMove" value="<?php print_string("move","editor");?>" onclick="return submit_form('move');" /></form></td>
|
||||
<td><form name="izip" id="izip">
|
||||
<td><form id="izip">
|
||||
<input name="btnZip" type="submit" id="btnZip" value="<?php print_string("zip","editor");?>" onclick="return submit_form('zip');" /></form></td>
|
||||
<td><form name="irename" id="irename" method="post" action="../coursefiles.php" target="fbrowser">
|
||||
<td><form id="irename" method="post" action="../coursefiles.php" target="fbrowser">
|
||||
<input type="hidden" name="id" value="<?php print($course->id);?>" />
|
||||
<input type="hidden" name="wdir" value="" />
|
||||
<input type="hidden" name="file" value="" />
|
||||
|
@ -127,7 +127,7 @@ form { margin-bottom: 1px; margin-top: 1px; }
|
|||
<tr>
|
||||
<td height="22"><?php
|
||||
if(has_capability('moodle/course:managefiles', get_context_instance(CONTEXT_COURSE, $id))) { ?>
|
||||
<form name="cfolder" id="cfolder" action="../coursefiles.php" method="post" target="fbrowser">
|
||||
<form id="cfolder" action="../coursefiles.php" method="post" target="fbrowser">
|
||||
<input type="hidden" name="id" value="<?php print($course->id);?>" />
|
||||
<input type="hidden" name="wdir" value="" />
|
||||
<input type="hidden" name="action" value="mkdir" />
|
||||
|
@ -135,7 +135,7 @@ form { margin-bottom: 1px; margin-top: 1px; }
|
|||
<input name="name" type="text" id="foldername" size="35" />
|
||||
<input name="btnCfolder" type="submit" id="btnCfolder" value="<?php print_string("createfolder","editor");?>" onclick="return checkvalue('foldername','cfolder');" />
|
||||
</form>
|
||||
<form action="../coursefiles.php?id=<?php print($course->id);?>" method="post" enctype="multipart/form-data" name="uploader" target="fbrowser" id="uploader">
|
||||
<form action="../coursefiles.php?id=<?php print($course->id);?>" method="post" enctype="multipart/form-data" target="fbrowser" id="uploader">
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="<?php print($upload_max_filesize);?>" />
|
||||
<input type="hidden" name="id" VALUE="<?php print($course->id);?>" />
|
||||
<input type="hidden" name="wdir" value="" />
|
||||
|
|
|
@ -9,8 +9,10 @@ function popupchecker(msg) {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
function popUpProperties(inobj) {
|
||||
op = window.open();
|
||||
/// Legacy function
|
||||
var op = window.open();
|
||||
op.document.open('text/plain');
|
||||
for (objprop in inobj) {
|
||||
op.document.write(objprop + ' => ' + inobj[objprop] + '\n');
|
||||
|
@ -19,6 +21,7 @@ function popUpProperties(inobj) {
|
|||
}
|
||||
|
||||
function fillmessagebox(text) {
|
||||
/// Legacy function
|
||||
document.form.message.value = text;
|
||||
}
|
||||
|
||||
|
@ -26,27 +29,34 @@ function copyrichtext(textname) {
|
|||
/// Legacy stub for old editor - to be removed soon
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
function checkall() {
|
||||
void(d=document);
|
||||
void(el=d.getElementsByTagName('INPUT'));
|
||||
for(i=0;i<el.length;i++)
|
||||
void(el[i].checked=1)
|
||||
var el = document.getElementsByTagName('input');
|
||||
for(var i=0; i<el.length; i++) {
|
||||
if(el[i].type == 'checkbox') {
|
||||
el[i].checked = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checknone() {
|
||||
void(d=document);
|
||||
void(el=d.getElementsByTagName('INPUT'));
|
||||
for(i=0;i<el.length;i++)
|
||||
void(el[i].checked=0)
|
||||
var el = document.getElementsByTagName('input');
|
||||
for(var i=0; i<el.length; i++) {
|
||||
if(el[i].type == 'checkbox') {
|
||||
el[i].checked = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function lockoptions(form, master, subitems) {
|
||||
function lockoptions(formid, master, subitems) {
|
||||
// Subitems is an array of names of sub items.
|
||||
// Optionally, each item in subitems may have a
|
||||
// companion hidden item in the form with the
|
||||
// same name but prefixed by "h".
|
||||
if (eval("document."+form+"."+master+".checked")) {
|
||||
var form = document.forms[formid];
|
||||
|
||||
if (eval("form."+master+".checked")) {
|
||||
for (i=0; i<subitems.length; i++) {
|
||||
unlockoption(form, subitems[i]);
|
||||
}
|
||||
|
@ -59,16 +69,16 @@ function lockoptions(form, master, subitems) {
|
|||
}
|
||||
|
||||
function lockoption(form,item) {
|
||||
eval("document."+form+"."+item+".disabled=true");/* IE thing */
|
||||
if(document.forms[form].elements['h'+item]) {
|
||||
eval("document."+form+".h"+item+".value=1");
|
||||
eval("form."+item+".disabled=true");/* IE thing */
|
||||
if(form.elements['h'+item]) {
|
||||
eval("form.h"+item+".value=1");
|
||||
}
|
||||
}
|
||||
|
||||
function unlockoption(form,item) {
|
||||
eval("document."+form+"."+item+".disabled=false");/* IE thing */
|
||||
if(document.forms[form].elements['h'+item]) {
|
||||
eval("document."+form+".h"+item+".value=0");
|
||||
eval("form."+item+".disabled=false");/* IE thing */
|
||||
if(form.elements['h'+item]) {
|
||||
eval("form.h"+item+".value=0");
|
||||
}
|
||||
}
|
||||
function lockoptionsall(formid) {
|
||||
|
@ -139,7 +149,7 @@ function submitFormById(id) {
|
|||
if(!theform) {
|
||||
return false;
|
||||
}
|
||||
if(theform.tagName != 'FORM') {
|
||||
if(theform.tagName != 'form') {
|
||||
return false;
|
||||
}
|
||||
if(!theform.onsubmit || theform.onsubmit()) {
|
||||
|
@ -148,7 +158,7 @@ function submitFormById(id) {
|
|||
}
|
||||
|
||||
function select_all_in(elTagName, elClass, elId) {
|
||||
var inputs = document.getElementsByTagName('INPUT');
|
||||
var inputs = document.getElementsByTagName('input');
|
||||
inputs = filterByParent(inputs, function(el) {return findParentNode(el, elTagName, elClass, elId);});
|
||||
for(var i = 0; i < inputs.length; ++i) {
|
||||
if(inputs[i].type == 'checkbox' || inputs[i].type == 'radio') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue