/** * Includes and makes instance of the desired object * * @param string $sInternalKey: name of the object; something like rdt_text, dh_db, ... * @param string $sObjectType: type of the object; something like renderlets, datahandlers, ... * @return object Built object or FALSE if failed */ function _loadObject($sInternalKey, $sObjectType) { global $TYPO3_CONF_VARS; // needed to allow XCLASS on renderlets // http://bugs.typo3.org/view.php?id=9812 $aDeclaredObjects =& $GLOBALS["TYPO3_CONF_VARS"]["EXTCONF"]["ameos_formidable"]["declaredobjects"][$sObjectType]; if (array_key_exists($sInternalKey, $aDeclaredObjects)) { $aLoadedObjects =& $GLOBALS["TYPO3_CONF_VARS"]["EXTCONF"]["ameos_formidable"][$sObjectType]; if (!array_key_exists($sInternalKey, $aLoadedObjects)) { $aTemp = array("EXTKEY" => $aDeclaredObjects[$sInternalKey]["key"], "TYPE" => $sInternalKey, "BASE" => $aDeclaredObjects[$sInternalKey]["base"], "OBJECT" => $sObjectType); $aTemp["PATH"] = tx_ameosformidable::_getExtPath($aTemp); $aTemp["RELPATH"] = tx_ameosformidable::_getExtRelPath($aTemp); $aTemp["CLASS"] = "tx_" . str_replace("_", "", $aTemp["EXTKEY"]); $aTemp["CLASSPATH"] = $aTemp["PATH"] . "api/class." . $aTemp["CLASS"] . ".php"; if ($aTemp["BASE"] === TRUE && file_exists($aTemp["PATH"] . "ext_localconf.php")) { $aTemp["LOCALCONFPATH"] = $aTemp["PATH"] . "ext_localconf.php"; } $GLOBALS["TYPO3_CONF_VARS"]["EXTCONF"]["ameos_formidable"][$sObjectType][$aTemp["TYPE"]] = $aTemp; if (file_exists($aTemp["CLASSPATH"])) { require_once $aTemp["CLASSPATH"]; } if (file_exists($aTemp["LOCALCONFPATH"])) { require_once $aTemp["LOCALCONFPATH"]; } $aLoadedObjects[$sInternalKey] = $aTemp; } if (tx_ameosformidable::__getEnvExecMode() !== "EID") { if (isset($this)) { // allow static calls $this->__aRunningObjects[$sObjectType . "::" . $sInternalKey] = array("internalkey" => $sInternalKey, "objecttype" => $sObjectType); } // calls tx_myrdtclass::loaded(); // params are not passed by ref with call_user_func, so have to pass an array with & call_user_func(array($aLoadedObjects[$sInternalKey]["CLASS"], 'loaded'), array("form" => &$this)); } return $aLoadedObjects[$sInternalKey]; } return FALSE; }