[TYPO3-german] eiD Aufrufe

Christian Platt christian.platt at pharmaline.de
Fri Feb 8 05:37:07 CET 2013


Hallo Stephan,

danke für den Link,

es wird noch etwas dauen, bis ich ausprobiren kann, ob es so klappt.

es ist schon mal ein anderer Ansatz als ich nutze, ich gehe da momentan eher den klassischen weg

$TSFE = t3lib_div::makeInstance('tslib_fe',  $TYPO3_CONF_VARS, 154);
	$GLOBALS['TSFE']->id = t3lib_div::_GP('pid');	//set pid

	$TSFE->connectToDB();
	$TSFE->initFEuser();
	$TSFE->checkAlternativeIdMethods();
	$TSFE->clear_preview();
	$TSFE->determineId();	
	$TSFE->initTemplate();	
	$TSFE->getConfigArray();
	$conf = $TSFE->tmpl->setup['plugin.']['tx_extension_pi1.'];


Liebe Grüße
Christian


Am 07.02.2013 um 18:19 schrieb Stephan Schuler:

> Hallo Christian.
> 
> Du kannst dir den folgenden Hook mal anschauen:
> $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['initFEuser'][]
> 
> Der wird innerhalb von der wird innerhalb von tslib_fe::initFEuser aufgerufen.
> Wenn du deine eID-Klasse zunächst auf den Hook registrierst und anschließend tslib_eidtools::initFeUser() aufrufst, ruft dich das tslib_fe quasi zurück. Dadurch wird es zwar noch immer nicht global, aber du hast dann das Objekt schon mal in der Hand.
> 
> Es ist jetzt auch kein Zweizeiler, aber wenn man meine Kommentare nicht beachtet sind es auch nicht viel mehr als fünf.
> 
> http://pastebin.com/tqeZZKVw
> 
> Gruß,
> 
> 
> 
> Stephan Schuler
> Web-Entwickler
> 
> Telefon: +49 (911) 539909 - 0
> E-Mail: Stephan.Schuler at netlogix.de
> Website: media.netlogix.de
> 
> 
> --
> netlogix GmbH & Co. KG
> IT-Services | IT-Training | Media
> Andernacher Straße 53 | 90411 Nürnberg
> Telefon: +49 (911) 539909 - 0 | Fax: +49 (911) 539909 - 99
> E-Mail: info at netlogix.de | Internet: http://www.netlogix.de
> 
> netlogix GmbH & Co. KG ist eingetragen am Amtsgericht Nürnberg (HRA 13338)
> Persönlich haftende Gesellschafterin: netlogix Verwaltungs GmbH (HRB 20634)
> Umsatzsteuer-Identifikationsnummer: DE 233472254
> Geschäftsführer: Stefan Buchta, Matthias Schmidt
> 
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: typo3-german-bounces at lists.typo3.org [mailto:typo3-german-bounces at lists.typo3.org] Im Auftrag von Christian Platt
> Gesendet: Donnerstag, 31. Januar 2013 22:29
> An: German TYPO3 Userlist
> Betreff: Re: [TYPO3-german] eiD Aufrufe
> 
> Danke, Flo.
> 
> Die ausführliche Variante setze ich aktuelle auch ein, es wär nur schöner, die durch einen Zweiteiler zu ersetzen.
> 
> Trotzdem Dank für Deine Mühen.
> 
> Christian
> 
> Am 31.01.2013 um 17:00 schrieb FIorian Zimmermann:
> 
>> Am 28.01.2013 18:34, schrieb Christian Platt:
>>> Hallo Liste,
>>> 
>>> 
>>> ich möchte aus einer Extension per EID auf Contentobjekte zugreifen.
>>> (4.5. LTS)
>>> 
>>> Dazu habe ich das eID wie folgt aufgebaut:
>>> Quelle:
>>> http://www.typo3-tutorials.org/tutorials/entwicklung/typo3-und-ajax-w
>>> ie-geht-das.html
>>> 
>>> 
>>> class unsereKlasse {
>>> 
>>>    public function main() {
>>>        $feUserObject = tslib_eidtools::initFeUser();
>>>        $TSFEObject = tslib_eidtools::getTSFE();
>>>        return json_encode(array('myResult' => 'World'));
>>>    }
>>> 
>>> }
>>> 
>>> $output = t3lib_div::makeInstance('unsereKlasse');
>>> echo $output->main();
>>> 
>>> 
>>> Allerdings bekomme ich bei dem Aufruf einen
>>> 
>>> "Fatal error: Call to private method tslib_eidtools::getTSFE() from context '"
>>> 
>>> 
>>> Eigentlich sollten die doch public sein, oder?
>>> http://doc-typo3.ameos.com/4.1.0/classtslib__eidtools.html
>>> 
>>> 
>>> Liebe Grüße
>>> Christian
>>> 
>> Hmm..
>> ich habe mich das auch mal gefragt und dann einfach ein Workaraound mir geschaffen.
>> Hier mal mein Code
>> include_once('./typo3/sysext/cms/tslib/class.tslib_fe.php');
>> include_once('./typo3/sysext/cms/tslib/class.tslib_content.php');
>> include_once('./t3lib/class.t3lib_tstemplate.php');
>> include_once('./t3lib/class.t3lib_page.php');
>> include_once('./typo3conf/localconf.php');
>> 
>> 
>> if (!defined ('PATH_typo3conf'))     die ('Could not access this script directly!');
>> 
>> //Ich übergebe eben bei dem eID aufruf die page Id $pid =
>> intval(t3lib_div::_GP('pid')); $feUserObj =
>> tslib_eidtools::initFeUser(); tslib_eidtools::connectDB();
>> 
>> $TSFE = t3lib_div::makeInstance('tslib_fe',$TYPO3_CONF_VARS,
>> intval($pid), 0, true); $TSFE->fe_user = $feUserObj; $TSFE->sys_ptw.tyage =
>> t3lib_div::makeInstance('t3lib_pageSelect');
>> $TSFE->tmpl = t3lib_div::makeInstance('t3lib_tstemplate');
>> $TSFE->tmpl->init();
>> $TSFE->rootLine = $TSFE->sys_page->getRootLine(intval($pid));
>> $TSFE->getConfigArray();
>> $GLOBALS['TSFE'] = $TSFE;
>> 
>> Bis dann
>> FIorian
>> _______________________________________________
>> TYPO3-german mailing list
>> TYPO3-german at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german
> 
> _______________________________________________
> TYPO3-german mailing list
> TYPO3-german at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german
> E->tmpl->init();
>> $TSFE->rootLine = $TSFE->sys_page->getRootLine(intval($pid));
>> $TSFE->getConfigArray();
>> $GLOBALS['TSFE'] = $TSFE;
>> 
>> Bis dann
>> FIorian
>> _______________________________________________
>> TYPO3-german mailing list
>> TYPO3-german at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german
> 
> _____________________________________________
> _______________________________________________
> TYPO3-german mailing list
> TYPO3-german at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german



More information about the TYPO3-german mailing list