Voici un bout de code initiant le développement d’un eID avec TYPO3 :
<?php
require_once(PATH_tslib.’class.tslib_pibase.php’);
class tx_myext_eID extends tslib_pibase{
private function init(){
require_once(PATH_tslib.’class.tslib_content.php’);
require_once(PATH_t3lib.’class.t3lib_page.php’);
require_once(t3lib_extMgm::extPath(‘realurl’).’class.tx_realurl.php’);
tslib_eidtools::connectDB();
$this->realurl = t3lib_div::makeInstance(‘tx_realurl’);
$GLOBALS[‘TSFE’]->sys_page = t3lib_div::makeInstance(‘t3lib_pageSelect’);
$GLOBALS[‘TSFE’]->tmpl = t3lib_div::makeInstance(‘t3lib_TStemplate’);
$GLOBALS[‘TSFE’]->config[‘config’][‘tx_realurl_enable’] = 1;
$this->cObj = t3lib_div::makeInstance(‘tslib_cObj’);
}
private function main(){
$this->init();
// .. add you functionality here
// .. for links use $this->geturl($pid, $params): $params are $key => $value pairs
}
private function geturl($pid, $params){
$res = $GLOBALS[‘TYPO3_DB’]->exec_SELECTquery(‘*’, ‘pages’, ‘uid = ‘.(int)$pid);
$pagerow = $GLOBALS[‘TYPO3_DB’]->sql_fetch_assoc($res);
$conf[‘LD’] = $GLOBALS[‘TSFE’]->tmpl->linkData( $pagerow, », 0,’index.php’, »,t3lib_div::implodeArrayForUrl( »,$params);
$this->realurl->encodeSpURL($conf, $this);
$url = $conf[‘LD’][‘totalURL’];
return $url;
}
}
$eID = t3lib_div::makeIntance(‘tx_myext_eID’);
$content = $eID->main();
echo $content;
?>