Exemplo n.º 1
0
$scriptStartTime = microtime(true);
define('R3_FAST_SESSION', true);
require_once dirname(__FILE__) . '/../../etc/config.php';
require_once R3_LIB_DIR . 'eco_app.php';
require_once R3_LIB_DIR . 'eco_utils.php';
require_once R3_LIB_DIR . 'storevar.php';
require_once R3_LIB_DIR . 'simpletable.php';
require_once R3_LIB_DIR . 'simplegrid.php';
require_once R3_LANG_DIR . 'lang.php';
register_shutdown_function('shutdown');
/* ---------------- Startup ------------------------------------------------- */
R3AppStart('admin', array('auth' => true, 'auth_manager' => false));
/* ---------------- Initialization ------------------------------------------ */
require_once R3_LIB_DIR . 'obj.base_lookup.php';
$objName = R3LookupController::getObjectType($_REQUEST);
$objAction = R3LookupController::getObjectAction($_REQUEST);
$objId = R3LookupController::getObjectId($_REQUEST);
$objNameUC = strToUpper($objName);
$objActionUC = strToUpper($objAction);
/* ---------------- jqGrid translation -------------------------------------- */
if (defined('USE_JQGRID')) {
    if (!isset($_REQUEST['order']) && isset($_REQUEST['sidx']) && isset($_REQUEST['sord'])) {
        $_REQUEST['order'] = "{$_REQUEST['sidx']}|{$_REQUEST['sord']}";
    }
}
/* ---------------- Factory ------------------------------------------------- */
$obj = R3LookupController::factory($_REQUEST);
$obj->setAuth($auth);
$obj->checkPerm();
/* ---------------- AJAX call ----------------------------------------------- */
Exemplo n.º 2
0
 /**
  * Return the object of the given type catched from request var
  *
  * @param array request   the $_REQUEST object. Extract the 'on' param to get the object type
  * @param array opt       option array. See class documentation for valid options
  * @return                a new object of $_REQUEST['on'] type
  * @access public
  */
 public static function factory(array $request = array(), array $opt = array())
 {
     $name = R3LookupController::getObjectType($request);
     $fileName = R3_LOOKUP_DIR . 'lkp.' . $name . '.php';
     if (!file_exists($fileName)) {
         throw new Exception('Invalid value for parameter "on": "' . $request['on'] . '"');
     }
     require_once $fileName;
     $className = R3LookupController::getObjectClassName($request);
     return new $className($request, $opt);
 }