Skip to content

Commit

Permalink
mod-forum MDL-16706 Removed inline JS and replaced with new PAGE methods
Browse files Browse the repository at this point in the history
  • Loading branch information
samhemelryk committed Jun 26, 2009
1 parent a39fe28 commit 002575a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 9 additions & 1 deletion mod/forum/forum.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,12 @@ function forum_produce_tracking_link(forumid, ltext, ltitle) {
if(subs_link){
subs_link.innerHTML = "<a title="+ltitle+" href='"+moodle_cfg.wwwroot+"/mod/forum/settracking.php?id="+forumid+"'>"+ltext+"<\/a>";
}
}
}

function lockoptions_timetoitems() {
lockoptions('searchform','timefromrestrict', timefromitems);
}

function lockoptions_timefromitems() {
lockoptions('searchform','timetorestrict', timetoitems);
}
6 changes: 2 additions & 4 deletions mod/forum/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,8 @@ function forum_print_big_search_form($course) {
echo '</table>';
echo '</form>';

echo "<script type=\"text/javascript\">";
echo "lockoptions('searchform','timefromrestrict', timefromitems);";
echo "lockoptions('searchform','timetorestrict', timetoitems);";
echo "</script>\n";
echo $PAGE->requires->js_function_call('lockoptions_timetoitems')->asap();
echo $PAGE->requires->js_function_call('lockoptions_timefromitems')->asap();

print_simple_box_end();
}
Expand Down

0 comments on commit 002575a

Please sign in to comment.