/[mldonkey]/mldonkey/src/utils/cdk/printf2.ml
ViewVC logotype

Diff of /mldonkey/src/utils/cdk/printf2.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by spiralvoice, Tue Sep 6 11:25:00 2005 UTC revision 1.12 by spiralvoice, Thu Sep 8 12:30:29 2005 UTC
# Line 264  let log_to_buffer buf = Line 264  let log_to_buffer buf =
264    
265  let set_logging b =  let set_logging b =
266    lprintf_to_stdout := b    lprintf_to_stdout := b
267    
268    (* html_mods *)
269    
270    let html_mods_commands buf n c l =
271        (* Name Class List *)
272        Printf.bprintf buf "\\<div class=\\\"%s\\\"\\>\\<table id=\\\"%s\\\"
273        name=\\\"%s\\\" class=\\\"%s\\\" cellspacing=0 cellpadding=0
274        width=\\\"100pc\\\"\\>\\<tbody\\>\\<tr\\>"
275        c n n c;
276        List.iter (fun (w,x,y,z)  ->
277         (* Class Title Onclick Value *)
278         Printf.bprintf buf "\\<td class=\\\"%s\\\"
279         title=\\\"%s\\\" onMouseOver=\\\"mOvr(this,'mOvr1');\\\" onMouseOut=\\\"mOut(this);\\\"
280         onClick=\\\"%s\\\" \\>%s\\</td\\>"
281         w x y z;
282        ) l;
283        Printf.bprintf buf "\\</tr\\>\\</tbody\\>\\</table\\>\\</div\\>"
284    
285    (*
286      html_mods_commands buf "commandsTable" "commands" [
287        ( "bu bbig", "Extend search to more servers and view results", "mSub('output','vr');", "Extend search" ) ;
288    *)
289    
290    
291    let html_mods_table_header buf n c l =
292        (* Name Class List *)
293        Printf.bprintf buf "\\<div class=\\\"%s\\\"\\>\\<table id=\\\"%s\\\" name=\\\"%s\\\" class=\\\"%s\\\" cellspacing=0 cellpadding=0\\>"
294        c n n c;
295        if List.length l > 0 then begin
296            Printf.bprintf buf "\\<tr\\>";
297            List.iter (fun (w,x,y,z)  ->
298             (* Sort Class Title Value *)
299             Printf.bprintf buf "\\<td onClick=\\\"_tabSort(this,%s);\\\" class=\\\"%s\\\" title=\\\"%s\\\"\\>%s\\</td\\>"
300             w x y z;
301            ) l;
302            Printf.bprintf buf "\\</tr\\>"
303          end
304    (* Add colspan functionality to html_mods_table_header *)
305    
306    let html_mods_table_header_colspan buf n c l =
307        (* Name Class List *)
308        Printf.bprintf buf "\\<div class=\\\"%s\\\"\\>\\<table id=\\\"%s\\\" name=\\\"%s\\\" class=\\\"%s\\\" cellspacing=0 cellpadding=0\\>\\<tr\\>"
309        c n n c;
310        List.iter (fun (v,w,x,y,z)  ->
311         (* Sort Class Title Value *)
312         Printf.bprintf buf "\\<td colspan=%s onClick=\\\"_tabSort(this,%s);\\\" class=\\\"%s\\\" title=\\\"%s\\\"\\>%s\\</td\\>"
313         v w x y z;
314        ) l;
315        Printf.bprintf buf "\\</tr\\>"
316    
317    let html_mods_table_no_header buf n c l =
318        (* 1 row * n cols *)
319        (* Name Class List *)
320        Printf.bprintf buf "\\<div class=\\\"%s\\\"\\>\\<table id=\\\"%s\\\" name=\\\"%s\\\" class=\\\"%s\\\" cellspacing=0 cellpadding=0\\>\\<tr\\>"
321        c n n c;
322        List.iter (fun (t,c,d)  ->
323        (* Title Class Value *)
324         Printf.bprintf buf "\\<td class=\\\"%s\\\" %s\\>%s\\</td\\>"
325         c (if t <> "" then "title=\\\"" ^ t ^ "\\\"" else "") d;
326        ) l;
327        Printf.bprintf buf "\\</tr\\>\\</table\\>\\</div\\>"
328    
329    let html_mods_table_one_row buf n c l =
330        (* 1 row * n cols *)
331        (* Name Class List *)
332        Printf.bprintf buf "\\<div class=\\\"%s\\\"\\>\\<table id=\\\"%s\\\" name=\\\"%s\\\" class=\\\"%s\\\" cellspacing=0 cellpadding=0\\>\\<tr\\>"
333        c n n c;
334        List.iter (fun (t,c,d)  ->
335        (* Title Class Value *)
336         Printf.bprintf buf "\\<td class=\\\"%s\\\" %s\\>%s\\</td\\>"
337         c (if t <> "" then "title=\\\"" ^ t ^ "\\\"" else "") d;
338        ) l;
339        Printf.bprintf buf "\\</tr\\>\\</table\\>\\</div\\>"
340    
341    let html_mods_table_one_col buf n c l =
342        (* n rows * 1 col *)
343        (* Name Class List *)
344        Printf.bprintf buf "\\<div class=\\\"%s\\\"\\>\\<table id=\\\"%s\\\" name=\\\"%s\\\" class=\\\"%s\\\" cellspacing=0 cellpadding=0\\>\\<tr\\>"
345        c n n c;
346        List.iter (fun (t,c,d)  ->
347        (* Title Class Value *)
348         Printf.bprintf buf "\\<tr\\>\\<td class=\\\"%s\\\" %s\\>%s\\</td\\>\\</tr\\>"
349         c (if t <> "" then "title=\\\"" ^ t ^ "\\\"" else "") d;
350        ) l;
351        Printf.bprintf buf "\\</tr\\>\\</table\\>\\</div\\>"
352    
353    let html_mods_td buf l =
354        (* List *)
355        List.iter (fun (t,c,d)  ->
356        (* Title Class Value *)
357         Printf.bprintf buf "\\<td class=\\\"%s\\\" %s\\>%s\\</td\\>"
358         c (if t <> "" then "title=\\\"" ^ t ^ "\\\"" else "") d;
359        ) l
360    
361    let html_mods_counter = ref true
362    
363    let html_mods_cntr () =
364        html_mods_counter := not !html_mods_counter;
365        if !html_mods_counter then 1 else 2
366    
367    let html_mods_cntr_init () =
368      html_mods_counter := true

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26