File: csv_table.inc

package info (click to toggle)
phplib 1%3A7.3dev-3.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 1,752 kB
  • ctags: 247
  • sloc: php: 6,659; perl: 323; pascal: 157; makefile: 102; sh: 7
file content (47 lines) | stat: -rw-r--r-- 994 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
 /*
  * PHP Base Library
  *
  * Copyright (c) 1998,1999 NetUSE GmbH
  *                    Boris Erdmann, Kristian Koehntopp
  *
  * $Id: csv_table.inc,v 1.5 1999/10/27 13:17:33 kk Exp $
  *
  */

class CSV_Table extends Table {
  var $classname = "CSV_Table";

  ## CSV Tables are very simple. We don't need
  ## row or column openers/closers
  
  function table_open($class = "") {
    return;
  }
  
  function table_close() {
    return;
  }
  
  function table_row_open($row, $data, $class = "") {
    return;
  }
  
  function table_row_close($row) {
    printf("\n");
  }

  ## Cell creator functions
  ## Need to translate " in $val fields into ""...
  function table_cell($row, $cell, $key, $val, $class) {
    printf("\"%s\",", ereg_replace("\"", "\"\"", $val));
  }
  
  function table_heading_cell($col, $val, $class) {
    printf("\"%s\",", ereg_replace("\"", "\"\"", $val));
  }
  
  function table_checkbox_cell($row, $row_key, $data, $class) {
    printf("\"\",");
  }
}