DataObjects/Core_watch.php
authorAlan Knowles <alan@roojs.com>
Wed, 5 Mar 2014 08:09:48 +0000 (16:09 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 5 Mar 2014 08:09:48 +0000 (16:09 +0800)
DataObjects/Core_watch.php

index f09a241..54011c0 100644 (file)
@@ -48,12 +48,40 @@ class Pman_Core_DataObjects_Core_watch extends DB_DataObject
     ###END_AUTOCODE
     /** make sure there is a watch for this user.. */
     
+    
+    function applyFilters($q,$au, $roo)
+    {
+        if (!empty($q['_list_actions'])) {
+            $this->listActions($roo,$q);
+        }
+        
+        
+    }
+    function listActions($roo, $q) {
+        
+        $d = DB_DataObject::Factory($q['on_table']);
+        $ret = array();
+        foreach(get_class_methods($d) as $m) {
+            if (!preg_match('/^notify/', $m)) {
+                continue;
+            }
+            $ret[] = array(
+                'display_name' => preg_replace('/^notify/', '' , $m),
+                'name' => $q['on_table'] .':'. $m
+            )
+        }
+        $roo->jdata($ret);
+    }
+    
     /**
      *
      * Create a watch...
      *
      */
     
+    
+    
+    
     function ensureNotify(  $ontable, $onid, $person_id, $whereAdd)
     {
         //DB_DAtaObject::debugLevel(1);