-
Notifications
You must be signed in to change notification settings - Fork 1
/
ajax.php
29 lines (22 loc) · 711 Bytes
/
ajax.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require_once(INCLUDE_DIR . 'class.plugin.php');
require_once(INCLUDE_DIR . 'class.signal.php');
require_once(INCLUDE_DIR . 'class.app.php');
require_once('config.php');
class AjaxPlugin extends Plugin {
var $config_class = 'AjaxConfig';
public function bootstrap() {
$config = $this->getConfig();
if ($config->get('ajax_submission_enable')) {
Signal::connect('ajax.client', ['AjaxPlugin', 'registerDispatch']);
}
}
public static function registerDispatch($dispatcher, $data) {
$form_url = url('^/ajax-form/', patterns(
'AjaxFormController.php:AjaxFormController',
url_get('^open', 'get_open'),
url_post('^submit', 'post_submit')
));
$dispatcher->append($form_url);
}
}