[TYPO3] How to use the class t3lib_TCEforms to paint a file selector in a BE module?
Antonio Alvarez
aalvarez at igalia.com
Tue Jul 29 08:08:54 CEST 2008
Hello,
I'm triying to make a file selector in a BE module using the class
t3lib_TCEforms, but i got some problems because I never use it before.
First, I have created a table with the following fields:
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL,
crdate int(11) DEFAULT '0' NOT NULL,
cruser_id int(11) DEFAULT '0' NOT NULL,
deleted tinyint(4) DEFAULT '0' NOT NULL,
hidden tinyint(4) DEFAULT '0' NOT NULL,
files varchar(2000) DEFAULT '' NOT NULL,
Then, the code is:
$this->tce_form = t3lib_div::makeInstance('t3lib_TCEforms');
$this->tce_form->backPath = BACK_PATH;
$this->tce_form->initDefaultBEmode();
$this->tce_form->dbFileCon('document.forms[1]');
$tmp = t3lib_BEfunc::getRecordsByField($this->table, 'uid', 1);
$row = $tmp[0];
$content .= $this->tce_form->getSingleField_type($this->table,
'files', $row) . $this->tce_form->printNeededJSFunctions();
The selector of files is showed right, and the popup window to select
files appears, but the files selected there doesn't modify the selector.
Also, the buttons to delete and move doesn't work. If I insert manually
values separated by commas in the field 'files', when the selector is
loaded they appear.
I don't know what I'm doing wrong...
Thanks.
--
Antonio Álvarez Feijoo
Computer Science Engineer
mailto:aalvarez at igalia.com
Tel: +34 986 10 76 10
Fax: +34 981 91 39 49
Igalia - http://www.igalia.com
More information about the TYPO3-english
mailing list