Hallo zusammen,
ich habe zwei Fragen welche mich schon seit einem Monat quälen:
-
Gibt es allgemeine Probleme mit der SR_FEUSER_REGISTER (3.1.2) unter Typo3 6.2 ?
-
Ist es möglich die Extension SR_FEUSER_REGISTER (3.1.2) um ein TEXTAREA zu erweitern und im FE den htmlArea RTE einzusetzten?
Ich versuche seit geraumer Zeit die Extension SR_FEUSER_REGISTER (3.1.2) mit einer eigenen Extension zu erweitern (Wie in der Dokumentation beschrieben und schon 100-mal erfolgreich umgesetzt). Die neue Extension in Kickstarter erstellt. In der Datei ext_tables.php den Hook gesetzt:
t3lib_div::loadTCA('fe_users');
t3lib_extMgm::addTCAcolumns('fe_users',$tempColumns,1);
t3lib_extMgm::addToAllTCAtypes('fe_users','tx_oebs_description;;;richtext[]:rte_transform[mode=ts_css|imgpath=uploads/tx_oebs/rte/];1-1-1,tx_oebs_cv');
Die Erweiterung funktioniert (Felder sind im BE sichtbar)...
Nun das erste Problem:
Das Feld wird in der Registrierung zwar angezeigt, wird aber nicht an die DB übermittelt:
<!-- ###SUB_INCLUDED_FIELD_tx_oebs_description### -->
<dt>
<label for="tx-srfeuserregister-pi1-tx_oebs_description">###LABEL_TX_OEBS_DESCRIPTION###</label>
<span class="tx-srfeuserregister-pi1-required">###REQUIRED_TX_OEBS_DESCRIPTION###</span>
</dt>
<dd>
<!-- ###SUB_ERROR_FIELD_tx_oebs_description### -->
<p class="tx-srfeuserregister-pi1-error">###EVAL_ERROR_FIELD_tx_oebs_description###</p>
<!-- ###SUB_ERROR_FIELD_tx_oebs_description### -->
<!-- ###SUB_REQUIRED_FIELD_tx_oebs_description### -->
<p class="tx-srfeuserregister-pi1-error">###MISSING_TX_OEBS_DESCRIPTION###</p>
<!-- ###SUB_REQUIRED_FIELD_tx_oebs_description### -->
###TCA_INPUT_tx_oebs_description###
</dd>
<!-- ###SUB_INCLUDED_FIELD_tx_oebs_description### -->
Im TS ist natürlich auch alles eingetragen:
plugin.tx_srfeuserregister_pi1.formFields = ..., tx_oebs_cv,tx_oebs_description
plugin.tx_srfeuserregister_pi1.create.evalValues.tx_oebs_description=text
plugin.tx_srfeuserregister_pi1.parseValues.tx_oebs_description=trim
Ich verstehe einfach nicht wo der Fehler liegt....
Ich habe inzwischen versucht ein einfaches INPUT Feld zu erstellen, da ich zuerst dachte, dass es möglicherweise an dem TEXTAREA liegt, aber auch dieses wird nicht an die DB übertragen....
Zweite Frage:
Ich möchte die Registrierung (TEXTAREA) mit dem RTE ausstatten. Mit der folgenden Anleitung habe ich es zumindest geschafft in einer FE_PlugIn Extension den RTE anzuzeigen bzw. mit Daten aus der FE Tabelle zu füttern.
http://www.sk-typo3.de/RTE-im-Frontend-benutzen.285.0.html
Leider scheitere ich die Daten wieder in die DB zurück zu spielen bzw. die in die SR_FEUSER_REGISTER (3.1.2) einzubauen.
//require_once(PATH_tslib . 'class.tslib_pibase.php');
require_once(t3lib_extMgm::extPath('rtehtmlarea').'pi2/class.tx_rtehtmlarea_pi2.php'); //RTE
/**
* Plugin 'OEBS Profile' for the 'oebs' extension.
*
* @author Pfusterschmied Jürgen <juergen.pfusterschmied@sbg.ac.at>
* @package TYPO3
* @subpackage tx_oebs
*/
class tx_oebs_pi1 extends tslib_pibase {
public $prefixId = 'tx_oebs_pi1'; // Same as class name
public $scriptRelPath = 'pi1/class.tx_oebs_pi1.php'; // Path to this script relative to the extension dir.
public $extKey = 'oebs'; // The extension key.
public $pi_checkCHash = TRUE;
/* RTE vars */
var $RTEObj;
var $docLarge = 0;
var $RTEcounter = 0;
var $formName;
// Initial JavaScript to be printed before the form
// (should be in head, but cannot due to IE6 timing bug)
var $additionalJS_initial = '';
// Additional JavaScript to be printed before the form
// (works in Mozilla/Firefox when included in head, but not in IE6)
var $additionalJS_pre = array();
// Additional JavaScript to be printed after the form
var $additionalJS_post = array();
// Additional JavaScript to be executed on submit
var $additionalJS_submit = array();
var $PA = array(
'itemFormElName' => '',
'itemFormElValue' => '',
);
var $specConf = array(
'rte_transform' => array(
'parameters' => array('mode' => 'ts_css')
)
);
var $thisConfig = array();
var $RTEtypeVal = 'text';
var $thePidValue;
/**
* The main method of the Plugin.
*
* @param string $content The Plugin content
* @param array $conf The Plugin configuration
* @return string The content that is displayed on the website
*/
public function main($content, array $conf) {
$this->conf = $conf;
$this->pi_setPiVarDefaults();
$this->pi_loadLL();
//$this->prefixId = 'tx_oebs';
$tableFEUser .=$_GLOBALS['TSFE']->fe_user->user['uid'];
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*','fe_users', 'uid='.$GLOBALS['TSFE']->fe_user->user['uid']);
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
//$tableFEUser .= $row['username'].'<br/>'.$this->pi_RTEcssText($row['tx_oebs_description']);
//RTE Config
if(!$this->RTEObj) $this->RTEObj = t3lib_div::makeInstance('tx_rtehtmlarea_pi2');
if($this->RTEObj->isAvailable()) {
$this->RTEcounter++;
$this->table = 'fe_users';
$this->field = 'tx_oebs_description';
$this->formName = 'tx_oebs_form';
$this->PA['itemFormElName'] = 'fe_users[tx_oebs_description]';
$this->PA['itemFormElValue'] = $row['tx_oebs_description'];
$this->thisConfig['showButtons'] = ' bold, italic,underline,left,orderedlist,unorderedlist, formatblock';
$this->thisConfig['hideButtons '] = 'chMode, about, findreplace, textindicator, blockstyle,
blockstylelabel, insertcharacter, table, toggleborders, tableproperties,
rowproperties, rowinsertabove, rowinsertunder, rowdelete, rowsplit,
columninsertbefore, columninsertafter, columndelete, columninsert,
cellproperties, cellinsertbefore, cellinsertafter, celldelete, cellsplit,
cellmerge';
$this->thisConfig['buttons.']['formatblock.']['removeItems']= 'address, article, aside, div, footer, header, nav, p, h4, h5, h6, pre, blockquote, section';
$this->thePidValue = $GLOBALS['TSFE']->id;
$RTEItem = $this->RTEObj->drawRTE(
$this,
'fe_users',
'tx_oebs_description',
$row=array(),
$this->PA,
$this->specConf,
$this->thisConfig,
$this->RTEtypeVal,
'',
$this->thePidValue
);
$sims['###ADDITIONALJS_PRE###'] = $this->additionalJS_initial.'
<script type="text/javascript">'. implode(chr(10), $this->additionalJS_pre).'
</script>';
$sims['###ADDITIONALJS_POST###'] = '
<script type="text/javascript">'. implode(chr(10), $this->additionalJS_post).'
</script>';
$sims['###ADDITIONALJS_SUBMIT###'] = implode(';', $this->additionalJS_submit);
}
}
$content='
<h3>Beschreibung bearbeiten</h3>'.$sims['###ADDITIONALJS_PRE###'].'
<form name="rtetestform" action="'.$this->pi_getPageLink($GLOBALS['TSFE']->id).'" method="POST" onsubmit="'.$sims['###ADDITIONALJS_SUBMIT###'].'">
<input type="hidden" name="no_cache" value="1">
'.$tableFEUser.'
'.$RTEItem.'
<input type="submit" name="tx_oebs_submit_button" value="Änderungen Speichern">
</form>'.$sims['###ADDITIONALJS_POST###'] .'
';
// Safe RTE Data
// if(isset($_POST['tx_oebs_submit_button']))
// {
if($this->RTEObj->isAvailable()) {
//$pageTSConfig = $GLOBALS['TSFE']->getPagesTSconfig();
//$RTEsetup = $pageTSConfig['RTE.'];
$this->thisConfig = $RTEsetup['default.'];
$this->thisConfig = $this->thisConfig['FE.'];
$dataArray['tx_oebs_description'] = $this->RTEObj->transformContent(
'db',
$dataArray['tx_oebs_description'],
'fe_users',
'tx_oebs_description',
$dataArray,
$this->specConf,
$this->thisConfig,
'',
$this->thePidValue
);
}
//$update = $GLOBALS['TYPO3_DB']->exec_UPDATEquery('fe_users', 'uid = '.$GLOBALS['TSFE']->fe_user->user['uid'],$dataArray['tx_oebs_description']);
echo('<pre>');
print_r($dataArray);
echo('<br/><br/><br/>');
//print_r($_POST);
echo('</pre>');
// }
return $this->pi_wrapInBaseClass($content);
}
}
if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/oebs/pi1/class.tx_oebs_pi1.php'])) {
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/oebs/pi1/class.tx_oebs_pi1.php']);
}
Hat dies schon jemand gemacht bzw. gibt es dafür eine schöne alternative Lösung? Ich bin nach langer Suche noch nicht fündig geworden....