| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | -* | |
| 3 | +* | |
| 4 | 4 | */ |
| 5 | 5 | |
| 6 | 6 | // Disallow direct access. |
| 7 | 7 | defined('ABSPATH') or die("Access denied"); |
| @@ -6,15 +6,15 @@ | ||
| 6 | 6 | // Disallow direct access. |
| 7 | 7 | defined('ABSPATH') or die("Access denied"); |
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | -* | |
| 10 | +* | |
| 11 | 11 | */ |
| 12 | 12 | class CJTAjaxAccessPoint extends CJTAccessPoint { |
| 13 | - | |
| 13 | + | |
| 14 | 14 | /** |
| 15 | 15 | * put your comment there... |
| 16 | - * | |
| 16 | + * | |
| 17 | 17 | */ |
| 18 | 18 | public function __construct() { |
| 19 | 19 | // Initialize Access Point base! |
| 20 | 20 | parent::__construct(); |
| @@ -23,18 +23,18 @@ | ||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * put your comment there... |
| 27 | - * | |
| 27 | + * | |
| 28 | 28 | */ |
| 29 | 29 | protected function doListen() { |
| 30 | 30 | // Define CJT AJAX access point! |
| 31 | 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... |
| 36 | - * | |
| 36 | + * | |
| 37 | 37 | */ |
| 38 | 38 | public function route($loadView = null, $request = null) { |
| 39 | 39 | // Initializing! |
| 40 | 40 | $controller = false; |
| @@ -39,27 +39,20 @@ | ||
| 39 | 39 | // Initializing! |
| 40 | 40 | $controller = false; |
| 41 | 41 | // Controllers allowed to be Loaded if not installed |
| 42 | 42 | $notInstalledAllowedControllers = array('installer', 'setup'); |
| 43 | - // Veil access point unless CJT installed or the controller is installer (to allow instalaltion through AJAX)! | |
| 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 | |
| 47 | + // IF Module-Prefix passed THEN Point to correct Controller path | |
| 48 | 48 | if (isset($_REQUEST['cjtajaxmodule'])) { |
| 49 | 49 | # try to get module associated to passed module |
| 50 | 50 | $accessPointClassLoader = CJT_Framework_Autoload_Loader::autoLoad($_REQUEST['cjtajaxmodule']); |
| 51 | - | |
| 52 | - // CODE MODIFIED BY RBJ -- START | |
| 53 | - if ($accessPointClassLoader) { | |
| 54 | - if ($_REQUEST['cjtajaxmodule'] == 'ECMEHD') { | |
| 55 | - $this->overrideControllersPath = dirname(__DIR__) . '-plus/CJTEnv/controllers'; | |
| 56 | - } else { | |
| 57 | - $this->overrideControllersPath = $accessPointClassLoader->getPath() . DIRECTORY_SEPARATOR . 'controllers'; | |
| 58 | - } | |
| 59 | - $this->overrideControllersPrefix = $accessPointClassLoader->getPrefix(); | |
| 60 | - } | |
| 61 | - // CODE MODIFIED BY RBJ -- END | |
| 51 | + if ($accessPointClassLoader) { | |
| 52 | + $this->overrideControllersPath = $accessPointClassLoader->getPath() . DIRECTORY_SEPARATOR . 'controllers'; | |
| 53 | + $this->overrideControllersPrefix = $accessPointClassLoader->getPrefix(); | |
| 54 | + } | |
| 62 | 55 | } |
| 63 | 56 | // Instantiate controller. |
| 64 | 57 | $controller = parent::route($loadView, $request); |
| 65 | 58 | // Dispatch the call as its originally requested from ajax action! |
| @@ -64,13 +57,13 @@ | ||
| 64 | 57 | $controller = parent::route($loadView, $request); |
| 65 | 58 | // Dispatch the call as its originally requested from ajax action! |
| 66 | 59 | $action = "wp_ajax_{$this->pageId}_{$_REQUEST['CJTAjaxAction']}"; |
| 67 | 60 | // Fire Ajax action. |
| 68 | - do_action($action); | |
| 61 | + do_action($action); | |
| 69 | 62 | } |
| 70 | 63 | return $controller; |
| 71 | 64 | } |
| 72 | - | |
| 65 | + | |
| 73 | 66 | } // End class. |
| 74 | 67 | |
| 75 | 68 | // Hookable! |
| 76 | 69 | CJTAjaxAccessPoint::define('CJTAjaxAccessPoint', array('hookType' => CJTWordpressEvents::HOOK_FILTER)); |