Pman/Roo.php
[Pman.Base] / Pman / Roo.php
index 5cd630a..b9f0c33 100644 (file)
@@ -32,8 +32,8 @@ require_once 'Pman.php';
  * - beforeInsert($request,$roo) - before insert - jerr() will stop insert..
  *
  *  AFTER
- * - onUpdate($old, $request,$roo) - after update // return value ignored
- * - onInsert($request,$roo) - after insert
+ * - onUpdate($old, $request,$roo, $event) - after update // return value ignored
+ * - onInsert($request,$roo, $event) - after insert
  * - onDelete($req, $roo) - after delete
  * - onUpload($roo)
  * 
@@ -454,11 +454,18 @@ class Pman_Roo extends Pman
                 if ($cols == '*') {  /// did we get cols sent to us?
                     $cols = array_keys($x);
                 }
+                
+                if(!is_array($cols)) {
+                    $cols = explode(',', $cols);
+                }
                
                 if ($titles !== false) {
                     if ($titles== '*') {
                         $titles= array_keys($x);
                     }
+                    if(!is_array($titles)) {
+                        $titles = explode(',', $titles);
+                    }
                     foreach($cols as $i=>$col) {
                         $se_config['cols'][] = array(
                             'header'=> isset($titles[$i]) ? $titles[$i] : $col,
@@ -500,6 +507,14 @@ class Pman_Roo extends Pman
             if ($cols== '*') {
                 $cols= array_keys($x);
             }
+            
+            if(!is_array($titles)) {
+                $titles = explode(',', $titles);
+            }
+            if(!is_array($cols)) {
+                $cols = explode(',', $cols);
+            }
+            
             if ($titles !== false) {
                 foreach($cols as $i=>$col) {
                     $se_config['cols'][] = array(
@@ -515,7 +530,6 @@ class Pman_Roo extends Pman
                     
                 }
                 
-                
                 //fputcsv($fh, $titles);
                 $titles = false;
             }
@@ -1100,11 +1114,11 @@ class Pman_Roo extends Pman
         if ($res === false) {
             $this->jerr($x->_lastError->toString());
         }
-        
+        $ev = $this->addEvent("EDIT", $x);
+
         if (method_exists($x, 'onUpdate')) {
-            $x->onUpdate($old, $req, $this);
+            $x->onUpdate($old, $req, $this, $ev);
         }
-        $ev = $this->addEvent("EDIT", $x);
         if ($ev) { 
             $ev->audit($x, $old);
         }