PluginProbe
CSS & JavaScript Toolbox / 8.0.3
CSS & JavaScript Toolbox v8.0.3
trunk 0.3 0.8 10 10.1 11 11.2 11.3 11.4 11.5 11.6 11.7 11.8 11.9 11.9.1 12 12.0 12.0.1 12.0.3 12.0.4 12.0.5 12.0.6 12.0.7 6.0 6.0.11 All 60 releases
← All changes | access.points/ajax.accesspoint.php +12 -3 6.08.0.3 View file →
@@ -27,9 +27,9 @@
27 27 *
28 28 */
29 29 protected function doListen() {
30 30 // Define CJT AJAX access point!
31 - add_action("wp_ajax_{$this->pageId}_api", array(&$this, 'route'));
31 + add_action("wp_ajax_{$this->pageId}_api", array(&$this, 'route'), 10, 0);
32 32 }
33 33
34 34 /**
35 35 * put your comment there...
@@ -34,9 +34,9 @@
34 34 /**
35 35 * put your comment there...
36 36 *
37 37 */
38 - public function route() {
38 + public function route($loadView = null, $request = null) {
39 39 // Initializing!
40 40 $controller = false;
41 41 // Controllers allowed to be Loaded if not installed
42 42 $notInstalledAllowedControllers = array('installer', 'setup');
@@ -43,10 +43,19 @@
43 43 // Veil access point unless CJT installed or the controller is installer (to allow instalaltion throught AJAX)!
44 44 if (CJTPlugin::getInstance()->isInstalled() || in_array($this->controllerName, $notInstalledAllowedControllers)) {
45 45 // Connected!
46 46 $this->connected();
47 + // IF Module-Prefix passed THEN Point to correct Controller path
48 + if (isset($_REQUEST['cjtajaxmodule'])) {
49 + # try to get module associated to passed module
50 + $accessPointClassLoader = CJT_Framework_Autoload_Loader::autoLoad($_REQUEST['cjtajaxmodule']);
51 + if ($accessPointClassLoader) {
52 + $this->overrideControllersPath = $accessPointClassLoader->getPath() . DIRECTORY_SEPARATOR . 'controllers';
53 + $this->overrideControllersPrefix = $accessPointClassLoader->getPrefix();
54 + }
55 + }
47 56 // Instantiate controller.
48 - $controller = parent::route();
57 + $controller = parent::route($loadView, $request);
49 58 // Dispatch the call as its originally requested from ajax action!
50 59 $action = "wp_ajax_{$this->pageId}_{$_REQUEST['CJTAjaxAction']}";
51 60 // Fire Ajax action.
52 61 do_action($action);