]> git.mjollnir.org Git - moodle.git/commitdiff
modforum MDL-16706 Removed inline js script call in mod forum
authorsamhemelryk <samhemelryk>
Thu, 25 Jun 2009 02:57:46 +0000 (02:57 +0000)
committersamhemelryk <samhemelryk>
Thu, 25 Jun 2009 02:57:46 +0000 (02:57 +0000)
mod/forum/forum.js
mod/forum/search.php

index e1ac2172198cab2707daba49ff840ab97a7d2f7f..c18807fca2119b4870d390bc99381cddc20a32d5 100644 (file)
@@ -1,3 +1,6 @@
+var timefromitems = ['fromday','frommonth','fromyear','fromhour', 'fromminute'];
+var timetoitems = ['today','tomonth','toyear','tohour','tominute'];
+
 function forum_produce_subscribe_link(forumid, backtoindex, ltext, ltitle) {
     var elementid = "subscriptionlink";
     var subs_link = document.getElementById(elementid);
index 0d8e0df5d3944f24cf3df5a5572827178c9090c2..6005d7238f5ffc78e0ef87b5e0924688580eaff1 100644 (file)
  * @todo Document this function
  */
 function forum_print_big_search_form($course) {
-    global $CFG, $DB, $words, $subject, $phrase, $user, $userid, $fullwords, $notwords, $datefrom, $dateto;
+    global $CFG, $DB, $words, $subject, $phrase, $user, $userid, $fullwords, $notwords, $datefrom, $dateto, $PAGE;
 
     print_simple_box(get_string('searchforumintro', 'forum'), 'center', '', '', 'searchbox', 'intro');
 
     print_simple_box_start("center");
 
-    echo "<script type=\"text/javascript\">\n";
-    echo "var timefromitems = ['fromday','frommonth','fromyear','fromhour', 'fromminute'];\n";
-    echo "var timetoitems = ['today','tomonth','toyear','tohour','tominute'];\n";
-    echo "</script>\n";
+    echo $PAGE->requires->js('mod/forum/forum.js')->asap();
 
     echo '<form id="searchform" action="search.php" method="get">';
     echo '<table cellpadding="10" class="searchbox" id="form">';