I'll go ahead and post the code immediately ... not to go ahead of anything, of course.
//Register action in init
$this->register_action('plugin.manageprocmail_create', array($this, 'createFilter'));
//createFilter-function
function createFilter()
{
$rcmail = rcmail::get_instance();
$filterParams = array(
get_input_value('_filter_name', RCUBE_INPUT_POST),
get_input_value('_messages', RCUBE_INPUT_POST),
get_input_value('_object', RCUBE_INPUT_POST),
get_input_value('_condition', RCUBE_INPUT_POST),
get_input_value('_parameter', RCUBE_INPUT_POST),
get_input_value('_rule', RCUBE_INPUT_POST),
get_input_value('_location', RCUBE_INPUT_POST)
);
$result = $this->createNewFilter($filterParams);
$rcmail->output->command('plugin.manageprocmail_create', array('result' => $result));
}
//The HTML, returned from a php-function called printFilterForm().
//The Javascript/jQuery
rcmail.addEventListener('plugin.manageprocmail_new', printForm);
rcmail.register_command('plugin.manageprocmail_new', function() { rcmail.http_post('plugin.manageprocmail_new', '&_action=plugin.manageprocmail_new') }, true);
function printForm (response) {
$('#filter-box').html(response.a_form);
}
I really appreciate any help with this, cause' I'm quite at a loss right now. :confused: