routes for training
This commit is contained in:
parent
0b87e76945
commit
55a18f1d17
|
@ -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',
|
||||
|
|
|
@ -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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user