Adjusted time.php to honor note on separate row option.
[timetracker.git] / WEB-INF / lib / form / Table.class.php
index e5aed81..7bcd78b 100644 (file)
@@ -47,17 +47,18 @@ class Table extends FormElement {
   var $mHeaderOptions = array();
   var $mProccessed    = false;
        
-  function __construct($name) {
+  function __construct($name, $cssClass = null) {
     $this->class = 'Table';
     $this->name = $name;
+    $this->cssClass = $cssClass;
   }
   
   function setKeyField($value) {
-       $this->mKeyField = $value;
+    $this->mKeyField = $value;
   }
   
   function setData($data) {
-       if (is_array($data) && isset($data[0]) && is_array($data[0]))
+    if (is_array($data) && isset($data[0]) && is_array($data[0]))
       $this->mData = &$data;
   }
   
@@ -122,6 +123,9 @@ class Table extends FormElement {
     if ($this->mInteractive) $html .= $this->_addJavaScript();
 
     $html .= "<table";
+    if ($this->cssClass) {
+      $html .= " class=\"".$this->cssClass."\"";
+    }
     if (count($this->mTableOptions) > 0) {
       foreach ($this->mTableOptions as $k=>$v) {
         $html .= " $k=\"$v\"";