[TYPO3-german] eiD Aufrufe
Stephan Schuler
Stephan.Schuler at netlogix.de
Thu Feb 7 18:19:13 CET 2013
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
_____________________________________________
More information about the TYPO3-german
mailing list