[TYPO3-dev] [eID] $conf-Variable

Stefan Geith typo3dev2006 at geithware.de
Fri Dec 15 11:12:38 CET 2006


Björn Kraus schrieb:
> Hi!
> 
> Has there been any proper solution how to retrieve the $conf-Array on 
> eID-calls?
> 
> Franz Holzinger's solution doesn't work (for me) since the retrieved 
> data is - as far as I can understand it - only some TS stuff of the page 
> (e.g. RTE settings) which is quite different from the required TS setup 
> for the PI. AND: it's still TS, not a nice PHP array ...

I did it like this:

<snip>
// // // OK here we go after index.php&eID init ...
// // //

define ('CRLF', "\r\n");
define ('DQT', '"');
define ('QT', "'");

// *********************
// Libraries included
// *********************
$TT->push('Include Frontend libraries','');
	require_once(PATH_tslib.'class.tslib_fe.php');
	require_once(PATH_t3lib.'class.t3lib_page.php');
	require_once(PATH_t3lib.'class.t3lib_userauth.php');
	require_once(PATH_tslib.'class.tslib_feuserauth.php');
	require_once(PATH_t3lib.'class.t3lib_tstemplate.php');
	require_once(PATH_t3lib.'class.t3lib_cs.php');
$TT->pull();

// ***********************************
// Create $TSFE object (TSFE = TypoScript Front End)
// Connecting to database
// ***********************************
$temp_TSFEclassName=t3lib_div::makeInstanceClassName('tslib_fe');
$TSFE = new $temp_TSFEclassName(
		$TYPO3_CONF_VARS,
		t3lib_div::_GP('id'),
		t3lib_div::_GP('type'),
		t3lib_div::_GP('no_cache'),
		t3lib_div::_GP('cHash'),
		t3lib_div::_GP('jumpurl'),
		t3lib_div::_GP('MP'),
		t3lib_div::_GP('RDCT')
	);
$TSFE->connectToMySQL();
if ($TSFE->RDCT)	{$TSFE->sendRedirect();}


// *******************
// output compression
// *******************
if ($TYPO3_CONF_VARS['FE']['compressionLevel'])	{
	ob_start();
	require_once(PATH_t3lib.'class.gzip_encode.php');
}

// *********
// FE_USER
// *********
$TT->push('Front End user initialized','');
	$TSFE->initFEuser();
$TT->pull();






// *****************************************
// Proces the ID, type and other parameters
// After this point we have an array, $page in TSFE, which is the
page-record of the current page, $id
// *****************************************
$TT->push('Process ID','');
	// not needed and doesnot work with realurl //
$TSFE->checkAlternativeIdMethods();
	$TSFE->clear_preview();
	$TSFE->determineId();

		// Now, if there is a backend user logged in and he has NO access to
this page, then re-evaluate the id shown!
	if ($TSFE->beUserLogin && !$BE_USER->extPageReadAccess($TSFE->page))	{

			// Remove user
		unset($BE_USER);
		$TSFE->beUserLogin = 0;

			// Re-evaluate the page-id.
		$TSFE->checkAlternativeIdMethods();
		$TSFE->clear_preview();
		$TSFE->determineId();
	}
	$TSFE->makeCacheHash();
$TT->pull();


// *******************************************
// Get compressed $TCA-Array();
// After this, we should now have a valid $TCA, though minimized
// *******************************************
$TSFE->getCompressedTCarray();


// ********************************
// Starts the template
// *******************************
$TT->push('Start Template','');
	$TSFE->initTemplate();
	$TSFE->tmpl->getFileName_backPath = PATH_site;
$TT->pull();


// ******************************************************
// Get config if not already gotten
// After this, we should have a valid config-array ready
// ******************************************************
$TSFE->getConfigArray();

$conf = $TSFE->tmpl->setup['plugin.']['tx_myplugin.'];
...
</snip>

Maybe this helps ...

-

Stefan

> It would be nice to have some know how of the core developers here ;)
> 
> Regards
> Björn Kraus
> 
> 
> benny at weltenkonstrukteur.de wrote:
>> Hi list,
>>
>> this is my first post and I am rather new in t3-development. I just coded my first ext-
>> ension using some AJAX too. Using the new eID-feature explained by Kaspar in the
>> podcasts works like a charme.
>>
>> But one question I have. What should be called to access the $conf variable in my 
>> eID-php ajax programm ? I am speaking of the $conf-variable which is normally
>> passed to the main-function of a fe-plugin classed (extended from tslib_pibase).
>>
>> I wanted to access some of the variables which are set via typoscript.
>>
>> Any help appreciated.
>>
>> Thanks in advance,
>> greets benny!
>>
>>
>>
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev








More information about the TYPO3-dev mailing list