From d2ce367fb9d978c4d1b6519f06f66706f7d3efab Mon Sep 17 00:00:00 2001 From: skodak Date: Sat, 6 Jan 2007 19:22:58 +0000 Subject: [PATCH] MDL-8062 Remove name attribute from
and related javascript code cleanup (tested with FF, IE, Konq and Opera) --- files/index.php | 2 +- install.php | 8 ++-- lib/editor/htmlarea/coursefiles.php | 4 +- lib/editor/htmlarea/popups/createanchor.php | 2 +- lib/editor/htmlarea/popups/insert_image.php | 14 +++--- lib/editor/htmlarea/popups/link.php | 12 ++--- lib/javascript-static.js | 48 +++++++++++-------- mod/assignment/lib.php | 14 +++--- mod/assignment/mod.html | 2 +- mod/exercise/assessments.php | 4 +- mod/exercise/locallib.php | 12 ++--- mod/exercise/submissions.php | 2 +- mod/exercise/view.php | 2 +- mod/forum/search.php | 10 ++-- mod/hotpot/mod.html | 4 +- mod/lams/mod.html | 4 +- mod/lesson/action/continue.html | 2 +- mod/lesson/view.php | 2 +- mod/quiz/config.html | 2 +- mod/resource/config.html | 2 +- mod/resource/type/common.html | 2 +- mod/resource/type/file/localfile.php | 4 +- mod/resource/type/file/localpath.php | 8 ++-- .../type/repository/hive/openhive.php | 4 +- mod/scorm/mod.html | 6 +-- mod/survey/view.php | 4 +- mod/workshop/assessments.php | 4 +- mod/workshop/locallib.php | 44 ++++++++--------- mod/workshop/submissions.php | 6 +-- question/editlib.php | 6 +-- question/import.php | 2 +- question/type/calculated/editquestion.html | 6 +-- question/type/calculated/questiontype.php | 2 +- .../type/datasetdependent/datasetitems.php | 2 +- .../datasetdependent/questiondatasets.html | 2 +- question/type/editquestionstart.html | 2 +- question/type/random/editquestion.html | 2 +- question/type/rqp/editquestion.html | 2 +- 38 files changed, 135 insertions(+), 125 deletions(-) diff --git a/files/index.php b/files/index.php index 89e7d354bb..102316609b 100644 --- a/files/index.php +++ b/files/index.php @@ -815,7 +815,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()"); } echo ""; echo "
"; diff --git a/install.php b/install.php index fbb5e65d34..9802989d1f 100644 --- a/install.php +++ b/install.php @@ -714,7 +714,7 @@ function form_table($nextstage = WELCOME, $formaction = "install.php") { if ($nextstage != DOWNLOADLANG) { $needtoopenform = false; ?> -
+ - + $strrenamefileto:"; echo "\n\n
\n"; - echo "\n"; + echo "\n"; echo " \n"; echo " \n"; echo " \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 "\n"; diff --git a/lib/editor/htmlarea/popups/createanchor.php b/lib/editor/htmlarea/popups/createanchor.php index 034be6c6f8..5220572029 100644 --- a/lib/editor/htmlarea/popups/createanchor.php +++ b/lib/editor/htmlarea/popups/createanchor.php @@ -51,7 +51,7 @@ border-bottom: 1px solid black; letter-spacing: 2px;
- + diff --git a/lib/editor/htmlarea/popups/insert_image.php b/lib/editor/htmlarea/popups/insert_image.php index 8adeae2824..89d478734c 100644 --- a/lib/editor/htmlarea/popups/insert_image.php +++ b/lib/editor/htmlarea/popups/insert_image.php @@ -178,7 +178,7 @@ form { margin-bottom: 0px; margin-top: 0px; }
- +
:
@@ -281,13 +281,13 @@ form { margin-bottom: 0px; margin-top: 0px; }
:
- - - -
: + " onclick="return submit_form('delete');" />
+
" onclick="return submit_form('move');" /> + " onclick="return submit_form('zip');" />
+
@@ -315,7 +315,7 @@ form { margin-bottom: 0px; margin-top: 0px; }
- + @@ -324,7 +324,7 @@ form { margin-bottom: 0px; margin-top: 0px; } " onclick="return checkvalue('foldername','cfolder');" />
-
+ diff --git a/lib/editor/htmlarea/popups/link.php b/lib/editor/htmlarea/popups/link.php index 8e9279e9f8..38e245b668 100644 --- a/lib/editor/htmlarea/popups/link.php +++ b/lib/editor/htmlarea/popups/link.php @@ -102,13 +102,13 @@ form { margin-bottom: 1px; margin-top: 1px; }
- - - -
: + " onclick="return submit_form('delete');" />
+
" onclick="return submit_form('move');" />
+
" onclick="return submit_form('zip');" />
+
@@ -127,7 +127,7 @@ form { margin-bottom: 1px; margin-top: 1px; }
- + @@ -135,7 +135,7 @@ form { margin-bottom: 1px; margin-top: 1px; } " onclick="return checkvalue('foldername','cfolder');" /> -
+ diff --git a/lib/javascript-static.js b/lib/javascript-static.js index c7e4444dc1..f015ea8386 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -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
\n"; echo "
student)."\" - onclick=\"document.assessmentform.submit();\" />\n"; + onclick=\"getElementById('assessmentform').submit();\" />\n"; echo "student)."\" - onclick=\"document.assessmentform.resubmit.value='1';document.assessmentform.submit();\" />\n"; + onclick=\"getElementById('assessmentform').resubmit.value='1';getElementById('assessmentform').submit();\" />\n"; echo "\n"; } diff --git a/mod/exercise/submissions.php b/mod/exercise/submissions.php index de637461c2..88e63ad4e5 100644 --- a/mod/exercise/submissions.php +++ b/mod/exercise/submissions.php @@ -69,7 +69,7 @@ $submission = get_record("exercise_submissions", "id", $sid); print_heading(get_string("amendtitle", "exercise")); ?> -
+ diff --git a/mod/exercise/view.php b/mod/exercise/view.php index 12dc33e96b..6ae1121b85 100644 --- a/mod/exercise/view.php +++ b/mod/exercise/view.php @@ -251,7 +251,7 @@ if (!$correctpass) { print_simple_box_start("center"); - echo "\n"; + echo "\n"; echo "id\" />\n"; echo ""; if (isset($_POST['userpassword'])) { diff --git a/mod/forum/search.php b/mod/forum/search.php index c18275ec17..29015ce568 100644 --- a/mod/forum/search.php +++ b/mod/forum/search.php @@ -275,7 +275,7 @@ function forum_print_big_search_form($course) { echo "var timetoitems = ['today','tomonth','toyear','tohour','tominute'];\n"; echo "\n"; - echo ''; + echo ''; echo ''; echo '
'; @@ -304,7 +304,7 @@ function forum_print_big_search_form($course) { echo ''; echo ''; echo ''; echo ''; echo '