From: Evan Prodromou Date: Wed, 7 Mar 2012 15:08:05 +0000 (-0600) Subject: routes for training X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=55a18f1d17b7a4879e2fe8b11d2b3daf5e73e99f;p=quix0rs-gnu-social.git routes for training --- diff --git a/ActivitySpamPlugin.php b/ActivitySpamPlugin.php index 6950d54554..cb9477d1ad 100644 --- a/ActivitySpamPlugin.php +++ b/ActivitySpamPlugin.php @@ -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', diff --git a/trainhamform.php b/trainhamform.php index 71bd650a3f..410b3206b8 100644 --- a/trainhamform.php +++ b/trainhamform.php @@ -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')); } /** diff --git a/trainspamform.php b/trainspamform.php index 07942f4546..ecf7b04190 100644 --- a/trainspamform.php +++ b/trainspamform.php @@ -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')); } /**