1 var timefromitems = ['fromday','frommonth','fromyear','fromhour', 'fromminute'];
2 var timetoitems = ['today','tomonth','toyear','tohour','tominute'];
4 function forum_produce_subscribe_link(forumid, backtoindex, ltext, ltitle) {
5 var elementid = "subscriptionlink";
6 var subs_link = document.getElementById(elementid);
8 subs_link.innerHTML = "<a title='"+ltitle+"' href='"+M.cfg.wwwroot+"/mod/forum/subscribe.php?id="+forumid+backtoindex+"&sesskey="+M.cfg.sesskey+"'>"+ltext+"<\/a>";
12 function forum_produce_tracking_link(forumid, ltext, ltitle) {
13 var elementid = "trackinglink";
14 var subs_link = document.getElementById(elementid);
16 subs_link.innerHTML = "<a title='"+ltitle+"' href='"+M.cfg.wwwroot+"/mod/forum/settracking.php?id="+forumid+"&sesskey="+M.cfg.sesskey+"'>"+ltext+"<\/a>";
20 function lockoptions_timetoitems() {
21 lockoptions('searchform','timefromrestrict', timefromitems);
24 function lockoptions_timefromitems() {
25 lockoptions('searchform','timetorestrict', timetoitems);
28 function lockoptions(formid, master, subitems) {
29 // Subitems is an array of names of sub items.
30 // Optionally, each item in subitems may have a
31 // companion hidden item in the form with the
32 // same name but prefixed by "h".
33 var form = document.forms[formid], i;
34 if (form[master].checked) {
35 for (i=0; i<subitems.length; i++) {
36 unlockoption(form, subitems[i]);
39 for (i=0; i<subitems.length; i++) {
40 lockoption(form, subitems[i]);
47 function lockoption(form,item) {
48 form[item].setAttribute('disabled', 'disabled');
49 if (form.elements['h'+item]) {
50 form.elements['h'+item].value=1;
54 function unlockoption(form,item) {
55 form[item].removeAttribute('disabled');
56 if (form.elements['h'+item]) {
57 form.elements['h'+item].value=0;