/**
  * put your comment there...
  * 
  */
 public function route($loadView = null, $request = null)
 {
     // Initializing!
     $controller = false;
     // Controllers allowed to be Loaded if not installed
     $notInstalledAllowedControllers = array('installer', 'setup');
     // Veil access point unless CJT installed or the controller is installer (to allow instalaltion throught AJAX)!
     if (CJTPlugin::getInstance()->isInstalled() || in_array($this->controllerName, $notInstalledAllowedControllers)) {
         // Connected!
         $this->connected();
         // IF Module-Prefix passed THEN Point to correct Controller path
         if (isset($_REQUEST['cjtajaxmodule'])) {
             # try to get module associated to passed module
             $accessPointClassLoader = CJT_Framework_Autoload_Loader::autoLoad($_REQUEST['cjtajaxmodule']);
             if ($accessPointClassLoader) {
                 $this->overrideControllersPath = $accessPointClassLoader->getPath() . DIRECTORY_SEPARATOR . 'controllers';
                 $this->overrideControllersPrefix = $accessPointClassLoader->getPrefix();
             }
         }
         // Instantiate controller.
         $controller = parent::route($loadView, $request);
         // Dispatch the call as its originally requested from ajax action!
         $action = "wp_ajax_{$this->pageId}_{$_REQUEST['CJTAjaxAction']}";
         // Fire Ajax action.
         do_action($action);
     }
     return $controller;
 }
 /**
  * put your comment there...
  * 
  */
 public function __construct($defaultController = 'blocks')
 {
     // Initialize Hookable.
     parent::__construct();
     // Overrides controllers path using current Access Point model class path
     $accessPointClassLoader =& CJT_Framework_Autoload_Loader::findClassLoader(get_class($this));
     if ($accessPointClassLoader) {
         $this->overrideControllersPath = $accessPointClassLoader->getPath() . DIRECTORY_SEPARATOR . 'controllers';
         $this->overrideControllersPrefix = $accessPointClassLoader->getPrefix();
     }
     // Initialize!
     $this->controllerName = $this->ongetdefaultcontrollername(isset($_REQUEST['controller']) ? $_REQUEST['controller'] : $defaultController);
 }
Example #3
0
 /**
  * put your comment there...
  * 
  * @param mixed $class
  * @param mixed $file
  */
 public function getClassFile($class, $file)
 {
     // Get absolute path to the class.
     $loader = CJT_Framework_Autoload_Loader::autoLoad('CJT');
     return $loader->getClassFile($class, $file);
 }
<?php

/**
* 
*/
// NOTE: NOT ALL CLASSED IS AUTOLOADED YET! ONLY FEW CLASSES
// IS AUTOLOADED. ONLY CLASSES WITH NAME MAPPED TO TE PHYSICAL PATH
// IS AUTOLOADED!!
require_once CJTOOLBOX_FRAMEWORK . '/autoload/loader.php';
$CJTAutoLoad = CJT_Framework_Autoload_Loader::autoLoad('CJT', CJTOOLBOX_PATH);
// Old class maps.
// Only commonly-used classed will be mapped here.
$map = $CJTAutoLoad->map();
// xTable class
$map->offsetSet('CJTxTable', 'framework/db/mysql/xtable.inc.php');
$map->offsetSet('CJTTable', 'framework/db/mysql/table.inc.php');
$map->offsetSet('CJTBlockPinsTable', 'tables/block-pins.php');
$map->offsetSet('CJTBlocksTable', 'tables/blocks.php');
$map->offsetSet('CJTBlockFilesTable', 'tables/block-files.php');
$map->offsetSet('CJTBlockModel', 'models/block.php');
$map->offsetSet('CJTBlocksModel', 'models/blocks.php');
$map->offsetSet('CJTAccessPoint', 'framework/access-points/access-point.class.php');
$map->offsetSet('CJTPageAccessPoint', 'framework/access-points/page.class.php');
# Composer Autoloads (All the above autoloads is deprecated and will be revmoed later)
require 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';