]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
routes for training
authorEvan Prodromou <evan@status.net>
Wed, 7 Mar 2012 15:08:05 +0000 (09:08 -0600)
committerEvan Prodromou <evan@status.net>
Wed, 7 Mar 2012 15:08:05 +0000 (09:08 -0600)
ActivitySpamPlugin.php
trainhamform.php
trainspamform.php

index 6950d545544039f7245b5ac3c47d80a85e246cb6..cb9477d1ade96bc3f36c02c877f27eba8b07fa62 100644 (file)
@@ -194,6 +194,23 @@ class ActivitySpamPlugin extends Plugin
         return true;
     }
     
+    /**
+     * Map URLs to actions
+     *
+     * @param Net_URL_Mapper $m path-to-action mapper
+     *
+     * @return boolean hook value; true means continue processing, false means stop.
+     */
+
+    function onRouterInitialized($m)
+    {
+        $m->connect('main/train/spam',
+                    array('action' => 'train', 'category' => 'spam'));
+        $m->connect('main/train/ham',
+                    array('action' => 'train', 'category' => 'ham'));
+        return true;
+    }
+
     function onPluginVersion(&$versions)
     {
         $versions[] = array('name' => 'ActivitySpam',
index 71bd650a3ffea15fb23f663e54b0353d9fb3aef1..410b3206b8e94bfcb6affcda117d2f36f3ffa89f 100644 (file)
@@ -78,7 +78,6 @@ class TrainHamForm extends Form {
 
     function formData()
     {
-        $this->hidden('category', SpamFilter::HAM);
         $this->hidden('notice', $this->notice->id);
     }
 
@@ -125,7 +124,7 @@ class TrainHamForm extends Form {
 
     function action()
     {
-        return common_local_url('train');
+        return common_local_url('train', array('category' => 'ham'));
     }
 
     /**
index 07942f4546d93bc359a6eeae994c5ebe100f609d..ecf7b04190c5c501a1d3d7fc4427cf7d88e27f7b 100644 (file)
@@ -78,7 +78,6 @@ class TrainSpamForm extends Form {
 
     function formData()
     {
-        $this->hidden('category', SpamFilter::SPAM);
         $this->hidden('notice', $this->notice->id);
     }
 
@@ -125,7 +124,7 @@ class TrainSpamForm extends Form {
 
     function action()
     {
-        return common_local_url('train');
+        return common_local_url('train', array('category' => 'spam'));
     }
 
     /**