NOT RENDERED: OFFICE:FORMS
- Services are libraries that provide a given service through a clearly defined API. A service may exist both in the frontend and the backend. Please refer to the "TYPO3 Services" manual (doc_core_services) for more information about this type of extension.
| |
|---|
| ext_emconf.php | |
| ext_localconf.php | Addition to localconf.php which is included if found. Should contain additional configuration of $TYPO3_CONF_VARS and may include additional PHP class files.
All ext_localconf.php files of included extensions are included right after the typo3conf/localconf.php file has been included and database constants defined. Therefore you cannot setup database name, username, password though, because database constants are defined already at this point. |
| ext_tables.php | |
| ext_tables.sql | SQL definition of database tables.
This file should contain a table-structure dump of the tables used by the extension. It is used for evaluation of the database structure and is therefore important to check and update the database when an extension is enabled. If you add additional fields (or depend on certain fields) to existing tables you can also put them here. In that case insert a CREATE TABLE structure for that table, but remove all lines except the ones defining the fields you need. The ext_tables.sql file may not necessarily be "dumpable" directly to MySQL (because of the semi-complete table definitions allowed defining only required fields, see above). But the EM or Install Tool can handle this. The only very important thing is that the syntax of the content is exactly like MySQL made it so that the parsing and analysis of the file is done correctly by the EM. |
| ext_tables_static+adt.sql | |
| ext_typoscript_constants.txt | |
| ext_typoscript_setup.txt | Deprecated (use static template files instead, see extMgm API description)
Such a file will be included in the setup section of all TypoScript templates. |
| ext_typoscript_editorcfg.txt | Deprecated (use static template files instead, see extMgm API description) |
| ext_conf_template.txt | |
| ext_icon.gif | |
| (*/) locallang*.xml | |
| class.ext_update.php | |
| ext_autoload.php | |
| ext_api_php.dat | |
| pi*/ | |
| mod*/ | |
| sv*/ | |
| res/ | |
| | |
|---|
| | |
| Global | typo3/ext/ | |
| System | typo3/sysext/ | |
| | | | |
|---|
| | | | |
| | Examples: | | Examples: |
| | | | |
| (Same as database tables and fields. Prepend class file names "class." though.) |
| | |
|---|
| | |
| | |
| | - be
- module
- fe
- plugin
- misc
- services
- templates
- example
- doc
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | If any subfolders to an extension contains backend modules, those folder names should be listed here. It allows the EM to know about the existence of the module, which is important because the EM has to update the conf.php file of the module in order to set the correct TYPO3_MOD_PATH constant.
Note: this is not needed anymore if you use the dispatch mechanism for BE modules (see "Inside TYPO3", chapter "Backend modules using typo3/mod.php"). |
| | - alpha
- beta
- stable
- experimental
- test
- obsolete
|
| | |
| | |
| | |
| | |
| |
|
| | |
| | |
| | |
| | |
| |
Deprecated |
| | Deprecated |
| private | boolean | If set, this version of the extension is not included in the public list!
(Not supported anymore) |
| download_password | string | If set, this password must additionally be specified if people want to access (import or see details for) this the extension.
(Not supported anymore) |
| | |
Warning about re-editing
| | |
|---|
| Database Abstraction Base API | |
| Character Set handling API | |
| General Purpose Functions | |
| Backend Specific Functions
This class is NOT available in the frontend! | |
| Extension API functions
See extension programming tutorials for more details. | |
| Icons / Part of skinning API
This class is NOT available in the frontend! | |
| Backend Template Class
Contains functions for producing the layout of backend modules, setting up HTML headers, wrapping JavaScript sections correctly for XHTML etc. | |
| |
|---|
| Getting values from GET or POST vars
// Setting GPvars:
$this->file = t3lib_div::_GP('file');
$this->size = t3lib_div::_GP('size');
$params = t3lib_div::_GET(); |
| Creating objects
// Making an instance of class "t3lib_TSparser":
$parseObj = t3lib_div::makeInstance('t3lib_TSparser');
// Make an object with an argument passed to the constructor (TYPO3 4.3+): |
| Environment-safe server and environment variables.
if (t3lib_div::getIndpEnv('HTTP_ACCEPT_LANGUAGE') == $test)...
if (t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $pcs[1]))...
$prefix = t3lib_div::getIndpEnv('TYPO3_REQUEST_URL');
$redirectTo = t3lib_div::getIndpEnv('TYPO3_SITE_URL').$redirectTo; |
| Loading full table description into $TCA
t3lib_div::loadTCA($this->table);
foreach ($TCA[$this->table]['columns'] as $fN) {
$fieldListArr[] = $fN;
} |
| Get SQL WHERE-clause filtering "deleted" records
(Notice: In the frontend this is build into the "enableFields()" function.)
Example:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'pid,uid,title,TSconfig,is_siteroot,storage_pid',
'pages',
'uid='.intval($uid).' '.
t3lib_BEfunc::deleteClause('pages').' '.
$clause |
| Returns true if an extension is loaded (installed)
// If the extension "sys_note" is loaded, then...
if (t3lib_extMgm::isLoaded('sys_note')) ...
// If the "cms" extension is NOT loaded, return false
if (!t3lib_extMgm::isLoaded('cms')) return;
// Check if the "indexed_search" extension is loaded. If not, exit PHP!
t3lib_extMgm::isLoaded('indexed_search', TRUE);
// Assign value "popup" if extension "tsconfig_help" is loaded |
| Get file path to an extension directory
// Include a PHP file from the extension "extrep_wizard".
// t3lib_extMgm::extPath() returns the absolute path to the
// extension directory.
require_once(
t3lib_extMgm::extPath('extrep_wizard') .
'pi/class.tx_extrepwizard.php'
);
// Get relative path (relative to PATH_typo3) to an icon (backend)
$icon = t3lib_extMgm::extRelPath('tt_rating') . 'rating.gif';
// Get relative path (relative to PATH_site) to an icon (frontend)
return '<img src="'.
t3lib_extMgm::siteRelPath('indexed_search') . 'pi/res/locked.gif' |
| Evaluate files and directories for security reasons
// Getting absolute path of a temporary file:
$cacheFile = t3lib_div::getFileAbsFileName('typo3temp/tempfile.tmp');
// Include file if it exists:
$file = t3lib_div::getFileAbsFileName($fileRef);
if (@is_file($file)) {
include($file);
}
// If the path is true and validates as a valid path string:
if ($path && t3lib_div::validPathStr($path)) ...
// Returns relative filename for icon:
if (t3lib_div::isAbsPath($Ifilename)) {
$Ifilename = '../' . substr($Ifilename, strlen(PATH_site));
}
if (@file_exists($path) && t3lib_div::isAllowedAbsPath($path)) {
$fI = pathinfo($path);
.... |
| Creates directory
$root.=$dirParts . '/';
if (!is_dir($extDirPath . $root)) {
t3lib_div::mkdir($extDirPath . $root);
if (!@is_dir($extDirPath.$root)) {
return 'Error: The directory "' .
$extDirPath.$root.
'" could not be created...';
}
} |
| Functions for handling uploads and temporary files
// Read uploaded file:
$uploadedTempFile = t3lib_div::upload_to_tempfile(
$GLOBALS['HTTP_POST_FILES']['upload_ext_file']['tmp_name']
);
$fileContent = t3lib_div::getUrl($uploadedTempFile);
// Create file 1 and write string
$file1 = t3lib_div::tempnam('diff1_');
t3lib_div::writeFile($file1, $str1);
// Create file 2 and write string
$file2 = t3lib_div::tempnam('diff2_');
t3lib_div::writeFile($file2, $str2);
// Perform diff.
$cmd = $GLOBALS['TYPO3_CONF_VARS']['BE']['diff_path'].
' '.$this->diffOptions . ' ' . $file1 . ' ' . $file2;
exec($cmd, $res);
unlink($file1); |
| Truncating a string for visual display, observing the character set (backend only)
// Limits Record title to 30 chars
t3lib_div::fixed_lgd_cs($thisRecTitle, 30);
// Limits string to title-length configured for backend user:
$title = t3lib_div::fixed_lgd_cs(
$row['title'],
$this->BE_USER->uc['titleLen']
); |
| Preparing a string for output between <textarea> tags.
Use this function to prepare content for <textarea> tags. Then you will avoid extra / stripped whitespace when the form is submitted multiple times.
// Create item:
$item = '
<textarea>' .
t3lib_div::formatForTextarea($value) . |
| Preparing a URL for a HTTP location-header
header('Location: ' . t3lib_div::locationHeaderUrl($this->retUrl));
exit; |
| Create "Function menu" in backend modules
t3lib_BEfunc::getFuncMenu(
$this->id,
'SET[mode]',
$this->MOD_SETTINGS['mode'],
$this->MOD_MENU['mode']
)
$this->MOD_MENU = array(
'mode' => array(
0 => $LANG->getLL('user_overview'),
'perms' => $LANG->getLL('permissions')
)
); // Clean up settings: $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData( $this->MOD_MENU, t3lib_div::_GP('SET'),
$this->MCONF['name']
);
t3lib_BEfunc::getFuncCheck(
0,
'SET[own_member_only]',
$this->MOD_SETTINGS['own_member_only']
); |
| Create onclick-JavaScript code that links to edit form for a record
$params = '&edit[pages][' . $row['uid'] . ']=edit';
$link = '<a href="#" onclick="' .
htmlspecialchars(t3lib_BEfunc::editOnClick($params, '', -1)). |
| Create onclick-JavaScript code that opens a page in the frontend
// "View page" link is added:
$link = '<a href="#" onclick="' .
htmlspecialchars(t3lib_BEfunc::viewOnClick(
$pageId,
$GLOBALS['BACK_PATH'],
t3lib_BEfunc::BEgetRootLine($pageId) |
| Creates a link to "tce_db.php" (with a command like copy, move,delete for records)
Creates a URL to the TYPO3 Core Engine interface provided from the core script, "tce_db.php". The $params array is filled with date or cmd values. For detailed list of options see section about TCE elsewhere in this document.
Example:
// Delete
$params = '&cmd[tt_content][' . $row['uid'] . '][delete]=1';
$out .= '<a href="' .
htmlspecialchars($GLOBALS['SOBE']->doc->issueCommand($params)).
'" onclick="' .
htmlspecialchars("return confirm('Want to delete?');"). |
| Create icon or short description for Context Sensitive Help (CSH)
Examples:
// Setting "table name" to module name with prefix
$tableIdent = '_MOD_' . $this->MCONF['name'];
// Creating CSH icon and short description:
$HTMLcode .=
t3lib_BEfunc::helpTextIcon($tableIdent, 'quickEdit', $BACK_PATH).
t3lib_BEfunc::helpText($tableIdent, 'quickEdit', $BACK_PATH).
'<br />';
if ($BE_USER->uc['edit_showFieldHelp']) {
$LANG->loadSingleTableDescription($tableIdent);
} |
| Getting correct icon for database table record
// Getting default icon for the "tt_content" table:
t3lib_iconWorks::getIconImage('tt_content', array(), $this->backPath, '');
// Getting an icon where record content may define the look:
$icon = t3lib_iconWorks::getIconImage(
$this->table,
$row,
$this->backPath,
'align="top" class="c-recIcon"'
);
// Getting the icon filename only:
$ficon = t3lib_iconWorks::getIcon($table, $row); |
| Processing icons for skin API
$skin_enabled_icon = '<img' .
t3lib_iconWorks::skinImg(
$this->doc->backPath,
'gfx/recordlock_warning3.gif',
'width="17" height="12"'
) . |
| Database Access API
Inserting a record:
Just fill an array with "fieldname => value" pairs and pass it to exec_INSERTquery() along with the table name in which it should be inserted:
$insertFields = array(
'md5hash' => $md5,
'tstamp' => time(),
'type' => 2,
'params' => $inUrl
);
$GLOBALS['TYPO3_DB']->exec_INSERTquery(
'cache_md5params',
$insertFields
);
Updating a record:
$fields_values = array(
'title' => $data['sys_todos'][$key]['title'],
'deadline' => $data['sys_todos'][$key]['deadline'],
'description' => $data['sys_todos'][$key]['description'],
'tstamp' => time()
);
$GLOBALS['TYPO3_DB']->exec_UPDATEquery(
'sys_todos',
'uid=' . intval($key),
$fields_values
);
Deleting a record:
$GLOBALS['TYPO3_DB']->exec_DELETEquery(
'sys_todos',
'uid=' . intval($key)
);
Selecting a record:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'*',
$theTable,
$theField . '="' .
$GLOBALS['TYPO3_DB']->quoteStr($theValue, $theTable) . '"' .
$this->deleteClause($theTable) . ' ' .
$whereClause,
$groupBy,
$orderBy,
$limit
);
$rows = array();
while(($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
$rows[] = $row;
}
$GLOBALS['TYPO3_DB']->sql_free_result($res); |
| Return true if current backend user is "admin" |
| Return WHERE clause for filtering pages which permission mismatch for current user |
| |
|---|
| |
| |
| |
| |
| |
| |
| t3lib_div::modifyHTMLColor('#cca823', +10, +10, +10) |
| |
| |
| array_unique(t3lib_div::trimExplode(',', $rawExtList, 1));
// Make integer list
implode(t3lib_div::intExplode(',', $row['subgroup']), ','); |
| |
| if ($this->xmlStorage) {
$cfgArr = t3lib_div::xml2array($row[$this->P['field']]);
} |
| |
| |
| if (@is_dir($path)) {
$directories = t3lib_div::get_dirs($path);
if (is_array($directories)) {
foreach($directories as $dirName) {
...
}
}
}
$sFiles = t3lib_div::getFilesInDir(PATH_typo3conf ,'', 1, 1);
// Get all files with absolute paths prefixed:
$fileList_abs =
t3lib_div::getAllFilesAndFoldersInPath(array(), $absPath, 'php,inc');
// Traverse files and remove abs path from each (becomes relative)
$fileList_rel = |
| |
| |
| |
| function procItems($items,$iArray,$config,$table,$row,$field) {
global $TCA;
$params=array();
$params['items'] = &$items;
$params['config'] = $config;
$params['TSconfig'] = $iArray;
$params['table'] = $table;
$params['row'] = $row;
$params['field'] = $field;
t3lib_div::callUserFunction(
$config['itemsProcFunc'],
$params,
$this
);
return $items;
}
$_procObj = &t3lib_div::getUserObj($_classRef);
$_procObj->pObj = &$this; |
| |
| |
| // Getting array with title field from a page:
t3lib_BEfunc::getRecord('pages', intval($row['shortcut']), 'title');
// Getting a full record with permission WHERE clause
$pageinfo = t3lib_BEfunc::getRecord(
'pages',
$id,
'*',
($perms_clause ? ' AND ' . $perms_clause : '')
);
// Checking if the id-parameter is an alias.
if (!t3lib_div::testInt($id)) {
list($idPartR) =
t3lib_BEfunc::getRecordsByField('pages', 'alias', $id);
$id = intval($idPartR['uid']);
} |
| $label = t3lib_BEfunc::getRecordPath(
intval($row['shortcut']),
$perms_clause,
20 |
| $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); |
| $agePrefixes = ' min| hrs| days| yrs'; |
| $out = t3lib_BEfunc::titleAttribForPages($row, '', 0); |
| t3lib_BEfunc::getThumbNail(
$this->doc->backPath . 'thumbs.php',
$filepath,
'hspace="5" vspace="5" border="1"'
); |
| // Parsing the user TS (or getting from cache)
$userTS = implode($TSdataArray,chr(10) . '[GLOBAL]' . chr(10));
$hash = md5('pageTS:' . $userTS);
$cachedContent = t3lib_BEfunc::getHash($hash, 0);
$TSconfig = array();
if (isset($cachedContent)) {
$TSconfig = unserialize($cachedContent);
} else {
$parseObj = t3lib_div::makeInstance('t3lib_TSparser');
$parseObj->parse($userTS);
$TSconfig = $parseObj->setup;
t3lib_BEfunc::storeHash($hash,serialize($TSconfig), 'IDENT');
} |
| $outputValue = nl2br(
htmlspecialchars(
trim(
t3lib_div::fixed_lgd_cs(
t3lib_BEfunc::getProcessedValue(
$table,
$fieldName,
$row[$fieldName]
),
250
)
)
)
); |
| $fI = pathinfo($filePath);
$fileIcon = t3lib_BEfunc::getFileIcon(strtolower($fI['extension']));
$fileIcon = '<img' .
t3lib_iconWorks::skinImg(
$this->backPath,
'gfx/fileicons/' . $fileIcon,
'width="18" height="16"' |
| $modTSconfig = $GLOBALS['BE_USER']->getTSConfig(
'mod.web_list',
t3lib_BEfunc::getPagesTSconfig($id)
); |
| // tt_address modified
t3lib_div::loadTCA('tt_address');
t3lib_extMgm::addTCAcolumns('tt_address', array(
'module_sys_dmail_category' =>
array('config' => array('type' => 'passthrough')),
'module_sys_dmail_html' =>
array('config' => array('type' => 'passthrough'))
)); |
| t3lib_extMgm::addToAllTCAtypes(
'fe_users',
'tx_myext_newfield;;;;1-1-1, tx_myext_another_field'
); |
| |
| t3lib_extMgm::addModule(
'user',
'setup',
'after:task',
t3lib_extMgm::extPath($_EXTKEY) . 'mod/'
);
t3lib_extMgm::addModule(
'tools',
'txcoreunittestM1',
'',
t3lib_extMgm::extPath($_EXTKEY) . 'mod1/'
); |
| t3lib_extMgm::insertModuleFunction(
'web_func',
'tx_cmsplaintextimport_webfunc',
t3lib_extMgm::extPath($_EXTKEY) .
'class.tx_cmsplaintextimport_webfunc.php',
'LLL:EXT:cms_plaintext_import/locallang.php:menu_1'
); |
| t3lib_extMgm::addPlugin(
array(
'LLL:EXT:newloginbox/locallang_db.php:tt_content.list_type1',
$_EXTKEY . '_pi1'
),
'list_type'
); |
| |
| |
|---|
| Example: |
| Example:
// This is the same as:
$row = t3lib_BEfunc::getRecord($table, $uid); |
| |
| |
| |
| |
| Example:
); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
|---|
| | |
| | |
| | See table below for command keywords and values |
| | The value for the command
See table below for command keywords and values |
$cmd['tt_content'][54]['delete'] = 1; // Deletes tt_content record with uid=54
$cmd['pages'][1203]['copy'] = -303; //Copies page id=1203 to the position after page 303
| | |
|---|
| | |
| | |
| | Name of the database field you want to set a value for. Must be configure in $TCA[ tablename ]['columns'] |
| | Value for "fieldname".
(Always make sure $this->stripslashes_values is false before using TCEmain.) |
$data['pages']['NEW9823be87'] = array(
'title' => 'The page title',
'subtitle' => 'Other title stuff',
'pid' => '45'
);
$data['pages']['NEW9823be87'] = array(
'title' => 'The page title',
'subtitle' => 'Other title stuff',
'pid' => '-45'
);
$data['pages']['NEW9823be87'] = array(
'title' => 'Page 1',
'pid' => '-45'
);
$data['pages']['NEWbe68s587'] = array(
'title' => 'Page 2',
'pid' => '-NEW9823be87'
);
$data['pages'][9834] = array(
'title' => 'New title for this page',
'no_cache' => '1'
);
$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'][] = 'myext_cacheProc->proc';
| | |
|---|
| | |
| | |
| | |
| | |
| | It is highly recommended to set this value to zero every time the class is used! |
require_once (PATH_t3lib . 'class.t3lib_tcemain.php');
1: $tce = t3lib_div::makeInstance('t3lib_TCEmain');
2: $tce->stripslashes_values = 0;
3: $tce->start($data, array());
4: $tce->process_datamap();
1: $tce = t3lib_div::makeInstance('t3lib_TCEmain');
2: $tce->stripslashes_values=0;
3: $tce->start(array(), $cmd);
4: $tce->process_cmdmap();
1: $tce = t3lib_div::makeInstance('t3lib_TCEmain');
2: $tce->start(array(), array());
3: $tce->clear_cacheCmd('all');
$data = array(
'pages' => array(
'NEW_1' => array(
'pid' => 456,
'title' => 'Title for page 1',
),
'NEW_2' => array(
'pid' => 456,
'title' => 'Title for page 2',
),
)
);
1: $tce = t3lib_div::makeInstance('t3lib_TCEmain');
2: $tce->stripslashes_values = 0;
3: $tce->reverseOrder = 1;
4: $tce->start($data, array());
5: $tce->process_datamap();
6: t3lib_BEfunc::getSetUpdateSignal('updatePageTree');
7: $tce->clear_cacheCmd('pages');
1: $tce = t3lib_div::makeInstance('t3lib_TCEmain');
2: $tce->stripslashes_values = 0;
3: $tce->start($data, $cmd, $alternative_BE_USER);
4: $tce->process_datamap();
| | |
|---|
| | See table below for command keywords, keys and values |
| | |
| | Depending on the command type. The keys will carry the information needed to perform the action. Typically a "target" key is used to point to the target directory or file while a "data" key carries the data.
See table below for command keywords, keys and values |
| | The value for the command
See table below for command keywords, keys and values |
1: // Initializing:
2: $this->fileProcessor = t3lib_div::makeInstance('t3lib_extFileFunctions');
3: $this->fileProcessor->init($FILEMOUNTS, $TYPO3_CONF_VARS['BE']['fileExtensions']);
4: $this->fileProcessor->init_actionPerms($BE_USER->user['fileoper_perms']);
5:
6: $this->fileProcessor->start($this->file);
7: $this->fileProcessor->processData();
$TYPO3_CONF_VARS['BE']['fileExtensions'] = array (
'webspace' => array('allow' => '', 'deny' => 'php'),
'ftpspace' => array('allow' => '*', 'deny' => '')
);
require_once(t3lib_extMgm::extPath('myext') . 'class.myext_cacheProc.php');
$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'][] = 'myext_cacheProc->proc';
1: // Call post processing function for clear-cache:
2: if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'])) {
3: $_params = array('cacheCmd' => $cacheCmd);
4: foreach($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearCachePostProc'] as $_funcRef) {
5: t3lib_div::callUserFunction($_funcRef, $_params, $this);
6: }
7: }
1: function getRootLineFields(&$fieldArr) {
2: $rl = $this->rootLevel;
3:
4: $fieldArr['rl0'] = intval($rl[0]['uid']);
5: $fieldArr['rl1'] = intval($rl[1]['uid']);
6: $fieldArr['rl2'] = intval($rl[2]['uid']);
7:
8: if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'])) {
9: foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['indexed_search']['addRootLineFields'] as $fieldName => $rootLineLevel) {
10: $fieldArr[$fieldName] = intval($rl[$rootLineLevel]['uid']);
11: }
12: }
1: // Hook for preprocessing of the content for formmails:
2: if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['sendFormmail-PreProcClass'])) {
3: foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['sendFormmail-PreProcClass'] as $_classRef) {
4: $_procObj = &t3lib_div::getUserObj($_classRef);
5: $EMAIL_VARS = $_procObj->sendFormmail_preProcessVariables($EMAIL_VARS, $this);
6: }
1: if ($_classRef = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['transformation'][$cmd]) {
2: $_procObj = &t3lib_div::getUserObj($_classRef);
3: $_procObj->pObj = &$this;
4: $_procObj->transformationKey = $cmd;
5: $value = $_procObj->transform_db($value, $this);
1: // Hook for post-processing of page content cached/non-cached:
2: if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'])) {
3: $_params = array('pObj' => &$this);
4: foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['contentPostProc-all'] as $_funcRef) {
5: t3lib_div::callUserFunction($_funcRef, $_params, $this);
6: }
1: // Setting internal array of classes for extending the clickmenu:
2: $this->extClassArray = $GLOBALS['TBE_MODULES_EXT']['xMOD_alt_clickmenu']['extendCMclasses'];
3:
4: // Traversing that array and setting files for inclusion:
5: if (is_array($this->extClassArray)) {
6: foreach($this->extClassArray as $extClassConf) {
7: if ($extClassConf['path']) $this->include_once[]=$extClassConf['path'];
8: }
9: }
1: // Setting class files to include:
2: if (is_array($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'])) {
3: $this->include_once = array_merge($this->include_once,$TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']);
1: // PLUG-INS:
2: if (is_array($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'])) {
3: reset($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']);
4: while(list($class,$path)=each($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'])) {
5: $modObj = t3lib_div::makeInstance($class);
6: $wizardItems = $modObj->proc($wizardItems);
7: }
// Hook for preprocessing of the content for formmails:
if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['sendFormmail-PreProcClass'])) {
foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['sendFormmail-PreProcClass'] as $_classRef) {
$_procObj = &t3lib_div::getUserObj($_classRef);
$EMAIL_VARS = $_procObj->sendFormmail_preProcessVariables($EMAIL_VARS, $this);
}
}
// Call post processing function for constructor:
if (is_array($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-PostProc'])) {
$_params = array('pObj' => &$this);
foreach($this->TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_fe.php']['tslib_fe-PostProc'] as $_funcRef) {
t3lib_div::callUserFunction($_funcRef,$_params, $this);
}
}
| | | |
|---|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| TYPO3_MOD_PATH | | | |
| TYPO3_enterInstallScript | | Example: | |
| TYPO3_PROCEED_IF_NO_USER | | | |
| TYPO3_cliMode | | | |
| TYPO3_version | | | |
| | | |
|---|
| | | |
| | | |
| | | |
| | | |
| | | |
| | Deprecated - used constant "TYPO3_version" instead! | |
| | Set to true to indicate that an AJAX call is being processed | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| $TBE_MODULES_EXT | | | |
| $TCA_DESCR | | | |
$compareFlags = t3lib_div::GPvar('compareFlags');
| | | |
|---|
| | |
|
| | | See "type" above
When not available, use value "0" |
| | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
debug(t3lib_div::_GET(),'GET variables:');
1: require_once(PATH_t3lib . 'class.t3lib_pagetree.php');
2:
3: // Initialize starting point of page tree:
4: $treeStartingPoint = 1135;
5: $treeStartingRecord = t3lib_BEfunc::getRecord('pages', $treeStartingPoint);
6: $depth = 2;
7:
8: // Initialize tree object:
9: $tree = t3lib_div::makeInstance('t3lib_pageTree');
10: $tree->init('AND ' . $GLOBALS['BE_USER']->getPagePermsClause(1));
11:
12: // Creating top icon; the current page
13: $HTML = t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'], 'align="top"');
14: $tree->tree[] = array(
15: 'row' => $treeStartingRecord,
16: 'HTML'=>$HTML
17: );
18:
19: // Create the tree from starting point:
20: $tree->getTree($treeStartingPoint, $depth, '');
21: #debug($tree->tree);
22:
23: // Put together the tree HTML:
24: $output = '
25: <tr bgcolor="#999999">
26: <td><b>Icon / Title:</b></td>
27: <td><b>Page UID:</b></td>
28: </tr>';
29: foreach($tree->tree as $data) {
30: $output.='
31: <tr bgcolor="#cccccc">
32: <td nowrap="nowrap">' . $data['HTML'] . htmlspecialchars($data['row']['title']) . '</td>
33: <td>' . htmlspecialchars($data['row']['uid']) . '</td>
34: </tr>';
35: }
36:
37: $output = '<table border="0" cellspacing="1" cellpadding="0">' . $output . '</table>';
1: require_once(PATH_t3lib . 'class.t3lib_clipboard.php');
2:
3: // Clipboard is initialized:
4: $clipObj = t3lib_div::makeInstance('t3lib_clipboard'); // Start clipboard
5: $clipObj->initializeClipboard(); // Initialize - reads the clipboard content from the user session
6: debug($clipObj->clipData);
debug($clipObj->elFromTable('_FILE'), 'Files available:');
debug($clipObj->elFromTable('pages'), 'Page records:');
$clipObj->setCurrentPad('normal');
echo 'Changed to "normal" pad...';
debug($clipObj->elFromTable('_FILE'), 'Files available:');
debug($clipObj->elFromTable('pages'), 'Page records:');
// Clipboard actions are handled:
$CB = t3lib_div::_GET('CB'); // CB is the clipboard command array
if ($this->cmd=='setCB') {
// CBH is all the fields selected for the clipboard, CBC is the checkbox fields which were checked. By merging we get a full array of checked/unchecked elements
// This is set to the 'el' array of the CB after being parsed so only the table in question is registered.
$CB['el'] = $dblist->clipObj->cleanUpCBC(array_merge(t3lib_div::_POST('CBH'), t3lib_div::_POST('CBC')), $this->cmd_table);
}
if (!$this->MOD_SETTINGS['clipBoard']) {
$CB['setP'] = 'normal'; // If the clipboard is NOT shown, set the pad to 'normal'.
}
$dblist->clipObj->setCmd($CB); // Execute commands.
$dblist->clipObj->cleanCurrent(); // Clean up pad
<?php
if (!defined ('TYPO3_MODE')) die ('Access denied.');
if (TYPO3_MODE=='BE') {
$GLOBALS['TBE_MODULES_EXT']['xMOD_alt_clickmenu']['extendCMclasses'][] = array(
'name' => 'tx_extrapagecmoptions',
'path' => t3lib_extMgm::extPath($_EXTKEY) . 'class.tx_extrapagecmoptions.php'
);
}
?>
/**
* Class, adding extra context menu options
*
* @author Kasper Skaarhoj <kasper@typo3.com>
* @package TYPO3
* @subpackage tx_extrapagecmoptions
*/
class tx_extrapagecmoptions {
/**
* Adding various standard options to the context menu.
* This includes both first and second level.
*
* @param object The calling object. Value by reference.
* @param array Array with the currently collected menu items to show.
* @param string Table name of clicked item.
* @param integer UID of clicked item.
* @return array Modified $menuItems array
*/
function main(&$backRef, $menuItems, $table, $uid) {
global $BE_USER,$TCA,$LANG;
$localItems = array(); // Accumulation of local items.
...
$menuItems = array_merge($menuItems, $localItems);
return $menuItems;
}
}
}
1: // Setting up the context sensitive menu:
2: $CMparts = $this->doc->getContextMenuCode();
3: $this->doc->bodyTagAdditions = $CMparts[1];
4: $this->doc->JScode .= $CMparts[0];
5: $this->doc->postCode.= $CMparts[2];
// Get icon with CSM:
$icon = t3lib_iconworks::getIconImage('tx_templavoila_datastructure', $row, $GLOBALS['BACK_PATH'], 'align="top"');
$content .= $this->doc->wrapClickMenuOnIcon($icon, 'tx_templavoila_datastructure', $row['uid'], 1);
$GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon,$path);
1: require_once(PATH_t3lib . 'class.t3lib_parsehtml.php');
2:
3: $testHTML = '
4: <DIV>
5: <IMG src="welcome.gif">
6: <p>Line 1</p>
7: <p>Line <B class="test">2</B></p>
8: <p>Line <b><i>3</i></p>
9: <img src="test.gif" />
10: <BR><br/>
11: <TABLE>
12: <tr>
13: <td>Another line here</td>
14: </tr>
15: </TABLE>
16: </div>
17: <B>Text outside div tag</B>
18: <table>
19: <tr>
20: <td>Another line here</td>
21: </tr>
22: </table>
23: ';
24:
25: // Splitting HTML into blocks defined by <div> and <table> tags
26: $parseObj = t3lib_div::makeInstance('t3lib_parsehtml');
27: $result = $parseObj->splitIntoBlock('div,table', $testHTML);
28: debug($result, 'Splitting by <div> and <table> tags');
30: // Splitting HTML into blocks defined by <img> and <br> tags
31: $result = $parseObj->splitTags('img,br', $testHTML);
32: debug($result,'Extracting <img> and <br> tags');
foreach($result as $intKey => $HTMLvalue) {
// Find all ODD keys:
if ($intKey%2) {
$result[$intKey] = '--'.$result[$intKey].'--';
}
}
$newContent = implode('',$result);
34: // Cleaning HTML:
35: $tagCfg = array_flip(explode(',', 'b,img,div,br,p'));
36: $tagCfg['b'] = array(
37: 'nesting' => 1,
38: 'remap' => 'strong',
39: 'allowedAttribs' => 0
40: );
41: $tagCfg['p'] = array(
42: 'fixAttrib' => array(
43: 'class' => array(
44: 'set' => 'bodytext'
45: )
46: )
47: );
48: $result = $parseObj->HTMLcleaner($testHTML, $tagCfg, FALSE, FALSE, array('xhtml' => 1));
49: debug(array($result), 'Cleaning to XHTML, removing non-allowed tags and attributes');
1: class user_processing {
2: function process($str) {
3: $this->parseObj = t3lib_div::makeInstance('t3lib_parsehtml_proc');
4:
5: $outStr = $this->parseObj->splitIntoBlockRecursiveProc(
6: 'div|table|blockquote|caption|tr|td|th|h1|h2|h3|h4|h5|h6|ol|ul',
7: $str,
8: $this,
9: 'callBackContent',
10: 'callBackTags'
11: );
12:
13: return $outStr;
14: }
15:
16: function callBackContent($str, $level) {
17: if (trim($str)) {
18:
19: // Fixing <P>
20: $pSections = $this->parseObj->splitTags('p', $str);
21: foreach($pSections as $k => $v) {
22: $pSections[$k] = trim(ereg_replace('[[:space:]]+', ' ', $pSections[$k]));
23: if (!($k%2)) {
24:
25: if ($k && !strstr(strtolower($pSections[$k]), '</p>')) {
26: $pSections[$k] = trim($pSections[$k]) . '</p>';
27: }
28:
29: $pSections[$k].=chr(10);
30: }
31: }
32: $str = implode('',$pSections);
33: }
34:
35: if (trim($str)) {
36: $str = $this->parseObj->indentLines(trim($str),$level) . chr(10);
37: } else {
38: $str = trim($str);
39: }
40:
41: return $str;
42: }
43:
44: function callBackTags($tags,$level) {
45:
46: if (substr($tags['tag_name'],0,1) == 'h') {
47: $tags['tag_end'] .= chr(10);
48: $tags['content'] = trim($tags['content']);
49: // Removing the <hx> tags if they content nothing when tags are stripped:
50: if (!strlen(trim(strip_tags($tags['content'])))) {
51: $tags['tag_start'] = $tags['tag_end'] = '';
52: $tags['add_level'] = 0;
53: $tags['content'] = '';
54: return $tags;
55: }
56: } elseif ($tags['tag_name'] == 'div' || $tags['tag_name'] == 'blockquote') {
57: $tags['tag_start'] = $tags['tag_end'] = '';
58: $tags['add_level'] = 0;
59: } else {
60: $tags['tag_start'] = $this->parseObj->indentLines(trim($tags['tag_start']),$level) . chr(10);
61: $tags['tag_end'] = $this->parseObj->indentLines(trim($tags['tag_end']),$level) . chr(10);
62: }
63: return $tags;
64: }
65: }
1: $editUid = 1135;
2: $editTable = 'pages';
3:
4: // Edit whole record:
5: $params = '&edit[' . $editTable . '][' . $editUid . ']=edit';
6: $output.= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'])) . '">' .
7: '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/edit2.gif', 'width="11" height="12"') . ' title="Edit me" border="0" alt="" />'.
8: 'Edit record ' . $editUid . ' from the "' . $editTable . '" table' .
9: '</a><br/><br/>';
10:
11: // Edit only "title" and "hidden" fields from record:
12: $params = '&edit[' . $editTable . '][' . $editUid.']=edit&columnsOnly=title,hidden';
13: $output .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'])) . '">'.
14: 'Edit "title" and "hidden" fields from record ' . $editUid . ' from the "' . $editTable . '" table' .
15: '</a><br/><br/>';
16:
17: // Create new "Content Element" record in PID 1135
18: $params = '&edit[tt_content][' . $editUid . ']=new&defVals[tt_content][header]=New%20Element';
19: $output .= '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params,$GLOBALS['BACK_PATH'])) . '">' .
20: 'Create new Content Element inside page ' . $editUid.
$TYPO3_CONF_VARS['EXTCONF']['cms']['db_layout']['addTables']['tt_news'][0] = array(
'fList' => 'title,short;author',
'icon' => TRUE
);
if (TYPO3_MODE=='BE') {
$TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']['tx_ttguest_wizicon'] =
t3lib_extMgm::extPath($_EXTKEY) . 'class.tx_ttguest_wizicon.php';
}
/**
* Class, containing function for adding an element to the content element wizard.
*
* @author Kasper Skaarhoj <kasper@typo3.com>
* @package TYPO3
* @subpackage tx_ttguest
*/
class tx_ttguest_wizicon {
/**
* Processing the wizard-item array from db_new_content_el.php
*
* @param array Wizard item array
* @return array Wizard item array, processed (adding a plugin for tt_guest extension)
*/
function proc($wizardItems) {
global $LANG;
// Include the locallang information.
$LL = $this->includeLocalLang();
// Adding the item:
$wizardItems['plugins_ttguest'] = array(
'icon' => t3lib_extMgm::extRelPath('tt_guest') . 'guestbook.gif',
'title' => $LANG->getLLL('plugins_title', $LL),
'description' => $LANG->getLLL('plugins_description', $LL),
'params' => '&defVals[tt_content][CType]=list&defVals[tt_content][list_type]=3&defVals[tt_content][select_key]=' . rawurlencode('GUESTBOOK, POSTFORM')
);
return $wizardItems;
}
/**
* Include locallang file for the tt_guest book extension (containing the description and title for the element)
*
* @return array LOCAL_LANG array
*/
function includeLocalLang() {
include(t3lib_extMgm::extPath('tt_guest') . 'locallang.xml');
return $LOCAL_LANG;
}
}
$TYPO3_CONF_VARS['BE']['customPermOptions'] = array(
'tx_coreunittest_cat1' => array(
'header' => '[Core Unittest] Category 1',
'items' => array(
'key1' => array('Key 1 header'),
'key2' => array('Key 2 header'),
'key3' => array('Key 3 header'),
)
)
);
...
'tx_coreunittest_cat2' => array(
'header' => 'LLL:EXT:coreunittest/locallang_test.php:test_header',
'items' => array(
'keyA' => array('Key a header', 'icon_ok.gif', 'This is a description....'),
'keyB' => array('LLL:EXT:coreunittest/locallang_test.php:test_item', '../typo3/gfx/icon_ok2.gif', 'LLL:EXT:coreunittest/locallang_test.php:test_description'),
'key3' => array('Key 3 header', 'EXT:coreunittest/ext_icon.gif'),
)
)
...
$BE_USER->check('custom_options', $catKey . ':' . $itemKey);
1: // Defining a new column for the mininews extension (goes into the tt_content table)
2: $tempColumns = array(
3: "tx_mininews_frontpage_list" => array(
4: "exclude" => 1,
5: "label" => "LLL:EXT:mininews/locallang_db.php:tt_content.tx_mininews_frontpage_list",
6: "config" => array(
7: "type" => "select",
8: "items" => array(
9: array("LLL:EXT:mininews/locallang_db.php:tt_content.tx_mininews_frontpage_list.I.0", "0"),
10: array("LLL:EXT:mininews/locallang_db.php:tt_content.tx_mininews_frontpage_list.I.1", "1"),
11: ),
12: )
13: ),
14: );
15:
16: // Make sure to load all of "tt_content":
17: t3lib_div::loadTCA("tt_content");
18:
19: // ... then add the column for mininews which was defined above:
20: t3lib_extMgm::addTCAcolumns("tt_content", $tempColumns, 1);
21:
22: // ... and finally add the new column definition to the list of fields shown for the mininews plugin:
23: // (This also removes the presence of the normally shown fields, "layout" and "select_key")
24: $TCA["tt_content"]["types"]["list"]["subtypes_excludelist"][$_EXTKEY."_pi1"]="layout,select_key";
25: $TCA["tt_content"]["types"]["list"]["subtypes_addlist"][$_EXTKEY."_pi1"]="tx_mininews_frontpage_list;;;;1-1-1";
26:
27: // Now, define a new table for the extension. Name: "tx_mininews_news"
28: // Only the "ctrl" section is defined since the rest of the config is in the "tca.php" file, loaded dynamically when needed.
29: $TCA["tx_mininews_news"] = array(
30: "ctrl" => array(
31: "title" => "LLL:EXT:mininews/locallang_db.php:tx_mininews_news",
32: "label" => "title",
33: "tstamp" => "tstamp",
34: "crdate" => "crdate",
35: "cruser_id" => "cruser_id",
36: "default_sortby" => "ORDER BY datetime DESC",
37: "delete" => "deleted",
38: "enablecolumns" => array(
39: "disabled" => "hidden",
40: "starttime" => "starttime",
41: "endtime" => "endtime",
42: "fe_group" => "fe_group",
43: ),
44: "dynamicConfigFile" => t3lib_extMgm::extPath($_EXTKEY)."tca.php",
45: "iconfile" => t3lib_extMgm::extRelPath($_EXTKEY)."icon_tx_mininews_news.gif",
46: ),
47: "feInterface" => array(
48: "fe_admin_fieldList" => "hidden, starttime, endtime, fe_group, datetime, title, teaser, full_text, front_page",
49: )
50: );
51:
52: // Then, make sure records from this table is allowed on regular pages:
53: t3lib_extMgm::allowTableOnStandardPages("tx_mininews_news");
54: // ... and allowed to be added in the "Insert Record" content element type:
55: t3lib_extMgm::addToInsertRecords("tx_mininews_news");
| |
|---|
| The table
|
| The backend interface handling |
| Frontend Editing |
| The individual fields |
| The form layout for editing |
| The palette fields order |
| | | |
|---|
| | Example:
$TCA['static_template'] = array(
'ctrl' => array(
'label' => 'title',
'tstamp' => 'tstamp', | |
| | Required! | Display |
| | Example: | |
| | | |
| |
| |
| | Example:
'types' => array(
'1' => array('showitem' => 'title, description'),
'2' => array('showitem' => 'title, description, title_link')
) | |
| | | |
| | | |
| |
Example: How to assign an icon from an extension
In the ext_tables.php files of your extension you normally define the "ctrl" section of the tables you have added to the system. Here you can add a local icon from the extension like this:
| |
| | Example: | |
| | Example of configuration (from the "tt_content" table):
| |
| | Example: | |
| | | |
| | | |
| | | |
| | A few examples: | |
| | Example: | |
| | | |
| | Example:
$TCA['fe_users'] = array(
'ctrl' => array(
'label' => 'username', | |
| | | |
| | | |
| |
| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | Example: | |
| | | |
| | | |
| | Example: | |
| | Example: | |
| | Example: | |
| | Example: | |
| | Example (also including the features "rootLevel", "readOnly" and "adminOnly" above):
$TCA['static_template'] = array(
'ctrl' => array(
'label' => 'title',
'tstamp' => 'tstamp',
'title' => 'LLL:EXT:cms/locallang_tca.php:static_template',
'readOnly' => 1, // Prevents the table from being altered
'adminOnly' => 1, // Only admin, if any
'rootLevel' => 1, | |
| | | |
| | | |
| | | |
| | Localization access control. | |
| | Fieldname, which contains the uid of the record which this record is a translation of. If this value is found being set together with "languageField" then TCEforms will show the default translation value under the fields in the main form. This is very neat if translators are to see what they are translating of course...
Must be configured in "columns", at least as a passthrough type. | |
| | Optional table name for the table where record uids in "transOrigPointerField" comes from. This is needed in very rare applications where the original language is found in another table of the database. In such cases the field names must match between the tables.
An example of this is the pages table and "pages_language_overlay".
WARNING: This is unsupported almost everywhere except for the "pages" table for which it was originally invented. | |
| | | |
| | WARNING: This is still highly unsupported for all other tables than the "pages" table. If this is to work well for any table you wish to configure, some more work needs to get done! | |
| |
| |
| | Special "t3ver_swapmode" field for pages | |
| | | |
| | Tracking Originals | |
| | Migration: | |
| |
Example: | |
| |
Example:
<?php
if (!defined ("TYPO3_MODE")) die ("Access denied.");
$TCA["tx_mininews_news"] = array(
"ctrl" => $TCA["tx_mininews_news"]["ctrl"],
"interface" => array(
"showRecordFieldList" => "hidden,starttime,front_page"
),
"feInterface" => $TCA["tx_mininews_news"]["feInterface"],
"columns" => array(
"hidden" => array(
"exclude" => 1,
"label" => $LANG_GENERAL_LABELS["hidden"],
"config" => array(
"type" => "check",
"default" => "0"
)
),
... etc | |
| | | |
1: $TCA['pages'] = array(
2: 'ctrl' => array(
3: 'label' => 'title',
4: 'tstamp' => 'tstamp',
5: 'sortby' => 'sorting',
6: 'title' => 'LLL:EXT:lang/locallang_tca.php:pages',
7: 'type' => 'doktype',
8: 'delete' => 'deleted',
9: 'crdate' => 'crdate',
10: 'hideAtCopy' => 1,
11: 'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
12: 'cruser_id' => 'cruser_id',
13: 'useColumnsForDefaultValues' => 'doktype'
14: ),
1: // ******************************************************************
2: // This is the standard TypoScript content table, tt_content
3: // ******************************************************************
4: $TCA['tt_content'] = array(
5: 'ctrl' => array(
6: 'label' => 'header',
7: 'label_alt' => 'subheader,bodytext',
8: 'sortby' => 'sorting',
9: 'tstamp' => 'tstamp',
10: 'title' => 'LLL:EXT:cms/locallang_tca.php:tt_content',
11: 'delete' => 'deleted',
12: 'type' => 'CType',
13: 'prependAtCopy' => 'LLL:EXT:lang/locallang_general.php:LGL.prependAtCopy',
14: 'copyAfterDuplFields' => 'colPos,sys_language_uid',
15: 'useColumnsForDefaultValues' => 'colPos,sys_language_uid',
16: 'enablecolumns' => array(
17: 'disabled' => 'hidden',
18: 'starttime' => 'starttime',
19: 'endtime' => 'endtime',
20: 'fe_group' => 'fe_group',
21: ),
22: 'typeicon_column' => 'CType',
23: 'typeicons' => array(
24: 'header' => 'tt_content_header.gif',
25: 'textpic' => 'tt_content_textpic.gif',
26: 'image' => 'tt_content_image.gif',
27: 'bullets' => 'tt_content_bullets.gif',
28: 'table' => 'tt_content_table.gif',
29: 'splash' => 'tt_content_news.gif',
30: 'uploads' => 'tt_content_uploads.gif',
31: 'multimedia' => 'tt_content_mm.gif',
32: 'menu' => 'tt_content_menu.gif',
33: 'list' => 'tt_content_list.gif',
34: 'mailform' => 'tt_content_form.gif',
35: 'search' => 'tt_content_search.gif',
36: 'login' => 'tt_content_login.gif',
37: 'shortcut' => 'tt_content_shortcut.gif',
38: 'script' => 'tt_content_script.gif',
39: 'div' => 'tt_content_div.gif',
40: 'html' => 'tt_content_html.gif'
41: ),
42: 'mainpalette' => '1',
43: 'thumbnail' => 'image',
44: 'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY).'tbl_tt_content.php'
45: )
46: );
'interface' => array(
'showRecordFieldList' => 'doktype,title',
'maxDBListItems' => 30,
'maxSingleDBListItems' => 50
| | | |
|---|
| | Required! | Display |
| | | |
| |
| |
| |
| |
| | | |
| |
| |
| |
- HIDE_FOR_NON_ADMINS: This will hide the field for all non-admin users while admins can see it. Useful for FlexForm container fields which are not supposed to be edited directly via the FlexForm but rather through some other interface (TemplaVoilà's Page module for instance).
- VERSION:
Example: | |
| | Example value: | |
| | | |
|---|
| | [Must be set to "input"] | Display / Proc. |
| | | |
| | | |
| | | |
| |
- trim : The value in the field will have whitespaces around it trimmed away.
- date : The field will evaluate the input as a date, automatically converting the input to a UNIX-time in seconds. The display will be like "12-8-2003" while the database value stored will be "1060639200".
- time : The field will evaluate the input as a timestamp in seconds for the current day (with a precision of minutes). The display will be like "23:45" while the database will be "85500".
- year : Evaluates the input to a year between 1970 and 2038. If you need any year, then use "int" evaluation instead.
- int : Evaluates the input to an integer.
- upper : Converts to uppercase (only A-Z plus a selected set of Western European special chars).
- lower : Converts the string to lowercase (only A-Z plus a selected set of Western European special chars).
- alpha : Allows only a-zA-Z characters.
- alphanum : Same as "alpha" but allows also "0-9"
- alphanum_x : Same as "alphanum" but allows also "_" and "-" chars.
- nospace : Removes all occurrences of space characters (chr(32))
- md5 : Will convert the inputted value to the md5-hash of it (The JavaScript MD5() function is found in typo3/md5.js)
- is_in : Will filter out any character in the input string which is not found in the string entered in the key "is_in" (see below).
- password : Will show "*******" in the field after entering the value and moving to another field. Thus passwords can be protected from display in the field. Notice that the value during entering it is visible!
- double2 : Converts the input to a floating point with 2 decimal positions, using the "." (period) as the decimal delimited (accepts also "," for the same).
- unique : Requires the field to be unique for the whole table. (Evaluated on the server only). NOTICE: When selecting on unique-fields, make sure to select using "AND pid>=0" since the field CAN contain duplicate values in other versions of records (always having PID = -1). This also means that if you are using versioning on a table where the unique-feature is used you cannot set the field to be truely unique in the database either!
- uniqueInPid : Requires the field to be unique for the current PID (among other records on the same page). (Evaluated on the server only)
- tx_* : User defined form evaluations. See below.
All the above evaluations (unless noted) are done by JavaScript with the functions found in the script t3lib/jsfunc.evalfield.js
"(TCE)" means the evaluation is done in the TCE on the server. The class used for this is t3lib_TCEmain.
Example:
| |
| |
User defined form evaluations:
The function evaluateFieldValue() has 3 arguments:
- $value :The field value to be evaluated.
- $is_in : The is_in value of the field configuration from TCA.
- &$set : Boolean defining if the value is written to the database or not. Must be passed by reference and changed if needed.
Example:
class tx_exampleextraevaluations_extraeval1 {
return $value . ' [added by PHP]';
<?php | |
| | | |
| | Example:
Example listing: | |
| | Keys:
Example:
'eval' => 'int',
'range' => array(
'upper' => mktime(0,0,0,12,31,2020),
'lower' => mktime(0,0,0,date('m')-1,date('d'),date('Y'))
) | |
| | | |
| | | |
|---|
| | [Must be set to "text"] | Display / Proc. |
| | | |
| | | |
| | Example: | |
| | | |
| | | |
| | | |
|---|
| | [Must be set to "check"] | Display / Proc. |
| | Example: | |
| | | |
| | | |
| | | |
| | | |
| | | |
|---|
| | [Must be set to "radio"] | Display / Proc. |
| | Required. | Display |
| | | |
| | | |
| | | |
|---|
| | [Must be set to "select"] | Display / Proc. |
| |
- The special value "--div--" is used to insert a non-selectable value that appears as a divider label in the selector box (only for maxitems <=1)
Example:
'type' => 'select',
'items' => array(
array('LLL:EXT:cms/locallang_ttc.php:k1', 0, 'selicons/k1.gif'),
array('LLL:EXT:cms/locallang_ttc.php:k2', 1, 'selicons/k2.gif'),
array('LLL:EXT:cms/locallang_ttc.php:k3', 2, 'selicons/k3.gif'),
) | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | Example:
Markers:
| |
| | | |
| | | |
| | | |
| | Example:
'config' => array (
'type' => 'select',
'items' => array (
array('', 0),
),
'fileFolder' => 'EXT:cms/tslib/media/flags/',
'fileFolder_extList' => 'png,jpg,jpeg,gif',
'fileFolder_recursions' => 0,
'selicon_cols' => 8,
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
) | |
| | | |
| | | |
| | If "foreign_table" is enabled: | |
| | | |
| | | |
| | | |
| |
MM relations and flexforms
MM relations has been tested to work with flexforms if not in a repeated element in a section. See example below. | |
| | Notice: Bidrectional references only gets registered once on the native side in sys_refindex | |
| | | |
| | | |
| | | |
| | | |
| |
| |
| | | |
| | | |
| | | |
| | | |
| |
| |
| | | |
| | | |
| | | |
| | | |
| | | |
| |
maxitems > 1 | |
| |
| |
| | | |
| | | |
2: 'label' => 'Include static:',
3: 'config' => array(
4: 'type' => 'select',
5: 'foreign_table' => 'static_template',
6: 'foreign_table_where' => 'ORDER BY static_template.title DESC',
7: 'size' => 10,
8: 'maxitems' => 20,
9: 'default' => ''
10: )
11: ),
1: 'static_lang_isocode' => Array (
2: 'exclude' => 1,
3: 'label' => 'LLL:EXT:cms/locallang_tca.php:sys_language.isocode',
4: 'displayCond' => 'EXT:static_info_tables:LOADED:true',
5: 'config' => Array (
6: 'type' => 'select',
7: 'items' => Array (
8: Array('',0),
9: ),
10: 'foreign_table' => 'static_languages',
11: 'foreign_table_where' => 'AND static_languages.pid=0 ORDER BY static_languages.lg_name_en',
12: 'size' => 1,
13: 'minitems' => 0,
14: 'maxitems' => 1,
15: )
16: ),
1: 'imageorient' => array(
2: 'label' => 'LLL:EXT:cms/locallang_ttc.php:imageorient',
3: 'config' => array(
4: 'type' => 'select',
5: 'items' => array(
6: array('LLL:EXT:cms/locallang_ttc.php:imageorient.I.0', 0, 'selicons/above_center.gif'),
7: array('LLL:EXT:cms/locallang_ttc.php:imageorient.I.1', 1, 'selicons/above_right.gif'),
8: array('LLL:EXT:cms/locallang_ttc.php:imageorient.I.2', 2, 'selicons/above_left.gif'),
9: array('LLL:EXT:cms/locallang_ttc.php:imageorient.I.3', 8, 'selicons/below_center.gif'),
10: array('LLL:EXT:cms/locallang_ttc.php:imageorient.I.4', 9, 'selicons/below_right.gif'),
11: array('LLL:EXT:cms/locallang_ttc.php:imageorient.I.5', 10, 'selicons/below_left.gif'),
12: array('LLL:EXT:cms/locallang_ttc.php:imageorient.I.6', 17, 'selicons/intext_right.gif'),
13: array('LLL:EXT:cms/locallang_ttc.php:imageorient.I.7', 18, 'selicons/intext_left.gif'),
14: array('LLL:EXT:cms/locallang_ttc.php:imageorient.I.8', '--div--'),
15: array('LLL:EXT:cms/locallang_ttc.php:imageorient.I.9', 25, 'selicons/intext_right_nowrap.gif'),
16: array('LLL:EXT:cms/locallang_ttc.php:imageorient.I.10', 26, 'selicons/intext_left_nowrap.gif')
17: ),
18: 'selicon_cols' => 6,
19: 'default' => '8'
20: )
21: ),
1: 'file_mountpoints' => array(
2: 'label' => 'File Mounts:',
3: 'config' => array(
4: 'type' => 'select',
5: 'foreign_table' => 'sys_filemounts',
6: 'foreign_table_where' => ' AND sys_filemounts.pid=0 ORDER BY sys_filemounts.title',
7: 'size' => '3',
8: 'maxitems' => '10',
9: 'autoSizeMax' => 10,
10: 'show_thumbs' => '1',
11: 'wizards' => array(
12: '_PADDING' => 1,
13: '_VERTICAL' => 1,
14: 'edit' => array(
15: 'type' => 'popup',
16: 'title' => 'Edit filemount',
17: 'script' => 'wizard_edit.php',
18: 'icon' => 'edit2.gif',
19: 'popup_onlyOpenIfSelected' => 1,
20: 'JSopenParams' => 'height=350,width=580,status=0,menubar=0,scrollbars=1',
21: ),
22: 'add' => array(
23: 'type' => 'script',
24: 'title' => 'Create new filemount',
25: 'icon' => 'add.gif',
26: 'params' => array(
27: 'table'=>'sys_filemounts',
28: 'pid' => '0',
29: 'setValue' => 'prepend'
30: ),
31: 'script' => 'wizard_add.php',
32: ),
33: 'list' => array(
34: 'type' => 'script',
35: 'title' => 'List filemounts',
36: 'icon' => 'list.gif',
37: 'params' => array(
38: 'table'=>'sys_filemounts',
39: 'pid' => '0',
40: ),
41: 'script' => 'wizard_list.php',
42: )
43: )
44: )
45: ),
| | | |
|---|
| | [Must be set to "group"] | Display / Proc. |
| | Required!
| |
| | For the "file" internal type (Optional):
For the "db" internal type (Required!): | |
| | [internal_type = file ONLY]
| |
| |
see ['columns'][fieldname]['config'] / TYPE: "select" => MM for additional features. | |
| | see ['columns'][fieldname]['config'] / TYPE: "select" => MM_opposite_field | |
| | see ['columns'][fieldname]['config'] / TYPE: "select" => MM_match_fields | |
| | see ['columns'][fieldname]['config'] / TYPE: "select" => MM_insert_fields | |
| | see ['columns'][fieldname]['config'] / TYPE: "select" => MM_table_where | |
| | see ['columns'][fieldname]['config'] / TYPE: "select" => MM_hasUidField | |
| | [internal_type = file ONLY] | |
| | [internal_type = file ONLY]
Warning: do NOT add a trailing slash (/) to the uploadfolder otherwise the full path stored in the references will contain a double slash (e.g. "uploads/pictures//stuff.png"). | |
| | [internal_type = db ONLY] | |
| | [internal_type = db ONLY] | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | 
| |
| | | |
2: 'label' => 'LLL:EXT:cms/locallang_ttc.php:records',
3: 'config' => array(
4: 'type' => 'group',
5: 'internal_type' => 'db',
6: 'allowed' => 'tt_content',
7: 'size' => '5',
8: 'maxitems' => '200',
9: 'minitems' => '0',
10: 'show_thumbs' => '1'
11: )
12: ),
1: 'storage_pid' => array(
2: 'exclude' => 1,
3: 'label' => 'LLL:EXT:lang/locallang_tca.php:storage_pid',
4: 'config' => array(
5: 'type' => 'group',
6: 'internal_type' => 'db',
7: 'allowed' => 'pages',
8: 'size' => '1',
9: 'maxitems' => '1',
10: 'minitems' => '0',
11: 'show_thumbs' => '1'
12: )
13: ),
1: 'image' => array(
2: 'label' => 'LLL:EXT:lang/locallang_general.php:LGL.images',
3: 'config' => array(
4: 'type' => 'group',
5: 'internal_type' => 'file',
6: 'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
7: 'max_size' => '1000',
8: 'uploadfolder' => 'uploads/pics',
9: 'show_thumbs' => '1',
10: 'size' => '3',
11: 'maxitems' => '200',
12: 'minitems' => '0',
13: 'autoSizeMax' => 40,
14: )
15: ),
| | |
|---|
| | [Must be set to "passthrough"] |
// tt_address modified
t3lib_div::loadTCA('tt_address');
t3lib_extMgm::addTCAcolumns('tt_address', array(
'module_sys_dmail_category' => array('config' => array('type' => 'passthrough')),
'module_sys_dmail_html' => array('config' => array('type' => 'passthrough'))
));
| | |
|---|
| | [Must be set to "user"] |
| | Function or method reference.
If you want to call a function, just enter the function name. The function name must be prefixed "user_" or "tx_".
If you want to call a method in a class, enter "[classname]->[methodname]". The class name must be prefixed "user_" or "tx_".
Two arguments will be passed to the function/method: The first argument is an array (passed by reference) which contains the current information about the current field being rendered. The second argument is a reference to the parent object (an instance of the t3lib_TCEforms class).
Notice: You must include the class manually on beforehand! |
| | |
| | |
|---|
| | [Must be set to "flex"] |
| | |
| |
Example with XML directly entered:
'config' => array(
'type' => 'flex',
'ds_pointerField' => 'list_type',
'ds' => array(
'default' => '
<T3DataStructure>
<ROOT>
<type>array</type>
<el>
<xmlTitle>
<TCEforms>
<label>The Title:</label>
<config>
<type>input</type>
<size>48</size>
</config>
</TCEforms>
</xmlTitle>
</el>
</ROOT>
</T3DataStructure>
',
)
)
Example with XML in external file:
'config' => array(
'type' => 'flex',
'ds_pointerField' => 'list_type',
'ds' => array(
'default' => 'FILE:EXT:mininews/flexform_ds.xml',
)
)
Example using two ds_pointerFields (as used for tt_content.pi_flexform since TYPO3 4.2.0):
'config' => array(
'type' => 'flex',
'ds_pointerField' => 'list_type,CType',
'ds' => array(
'default' => 'FILE:...',
)
) |
| | 'tx_templavoila_flex' => array(
'exclude' => 1,
'label' => '...',
'displayCond' => 'FIELD:tx_templavoila_ds:REQ:true',
'config' => array(
'type' => 'flex',
'ds_pointerField' => 'tx_templavoila_ds',
'ds_tableField' => 'tx_templavoila_datastructure:dataprot',
)
), |
| | |
| | |
"Array" Elements:
| | |
|---|
| | |
| | A direct reflection of a ['columns']['fieldname']['config'] PHP array configuring a field in TCA. As XML this is expressed by array2xml()'s output. See example below. |
| | <sheetTitle>
<sheetDescription>
<sheetShortDescr> |
"Value" Elements:
| | |
|---|
| | |
| | |
| | |
| <sheetDescription> | | |
| <sheetShortDescr> | | |
"Array" Elements:
| | |
|---|
| | |
| | |
| | <sheet> |
| | <sDEF>
<s_[sheet keys]> |
| <sDEF>
<[sheet keys]> | | <lDEF>
<l[ISO language code]> |
| <lDEF>
<[language keys]> | | <[fieldname]> |
| <[fieldname]> | | <vDEF>
<v[ISO language code]> |
| <currentLangId> | | <n[0-x]> |
"Value" Elements:
| | |
|---|
| <vDEF>
<v[ISO language code]> | | |
| <currentSheetId> | | |
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:examples/locallang_db.xml: examples.pi_flexform.sheetGeneral</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<pageSelector>
<TCEforms>
<label>LLL:EXT:examples/locallang_db.xml: examples.pi_flexform.pageSelector</label>
<config>
<type>select</type>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:examples/locallang_db.xml:examples.pi_flexform.choosePage</numIndex>
<numIndex index="1">0</numIndex>
</numIndex>
</items>
<foreign_table>pages</foreign_table>
<foreign_table_where>ORDER BY title</foreign_table_where>
<minitems>0</minitems>
<maxitems>1</maxitems>
</config>
</TCEforms>
</pageSelector>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
<s_Message>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT: examples/locallang_db.xml:examples.pi_flexform.s_Message</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<header>
<TCEforms>
<label>LLL:EXT: examples/locallang_db.xml:examples.pi_flexform.header</label>
<config>
<type>input</type>
<size>30</size>
</config>
</TCEforms>
</header>
<message>
<TCEforms>
<label>LLL:EXT: examples/locallang_db.xml:examples.pi_flexform.message</label>
<config>
<type>text</type>
<cols>40</cols>
<rows>5</rows>
</config>
</TCEforms>
</message>
</el>
</ROOT>
</s_Message>
<language index="lDE">
<language index="lEN">
<language index="lDE">
<language index="lEN">
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3FlexForms>
<data>
<sheet index="sDEF">
<language index="lDEF">
<field index="pageSelector">
<value index="vDEF"></value>
<value index="vDE"></value>
<value index="vEN"></value>
<value index="vDE.vDEFbase"></value>
<value index="vEN.vDEFbase"></value>
</field>
</language>
</sheet>
<sheet index="s_Message">
<language index="lDEF">
<field index="header">
<value index="vDEF">My header</value>
<value index="vDE">Hallo!</value>
<value index="vEN"></value>
<value index="vDE.vDEFbase">My header</value>
<value index="vEN.vDEFbase">My header</value>
</field>
<field index="message">
<value index="vDEF">And my message.
On several lines.</value>
<value index="vDE">Das is auf Deutsch!</value>
<value index="vEN"></value>
<value index="vDE.vDEFbase">And my message.
On several lines.</value>
<value index="vEN.vDEFbase">And my message.
On several lines.</value>
</field>
</language>
</sheet>
</data>
</T3FlexForms>
| | | |
|---|
| | [Must be set to "inline"] | Display / Proc. |
| | | Display / Proc. |
| | Has information about the appearance of child-records, namely:
- collapseAll (boolean)
Show all child-records collapsed (if false, all are expanded)
- expandSingle (boolean)
Show only one child-record expanded each time. If a collapsed record is clicked, the currently open one collapses and the clicked one expands.
- newRecordLinkAddTitle (boolean)
Adds the title of the foreign_table to the "New record" link. false: "Create new" true: "Create new <title of foreign_table>", e.g. "Create new address"
- newRecordLinkPosition (string)
Values: 'top', 'bottom', 'both', 'none' ? default: 'top' Defines where to show the "New record" link in relation to the child records.
- useCombination (boolean)
This is only useful on bidirectional relations using an intermediate table with attributes. In a "combination" it is possible to edit the attributes AND the related child record itself. If using a foreign_selector in such a case, the foreign_unique property must be set to the same field as the foreign_selector.
- useSortable (boolean)
Active Drag&Drop Sorting by the script.aculo.us Sortable object.
- showPossibleLocalizationRecords (boolean)
Show unlocalized records which are in the original language, but not yet localized.
- showRemovedLocalizationRecords (boolean)
Show records which were once localized but do not exist in the original language anymore.
- showAllLocalizationLink (boolean)
Defines whether to show the "localize all records" link to fetch untranslated records from the original language.
- showSynchronizationLink (boolean)
Defines whether to show a "synchronize" link to update to a 1:1 translation with the original language.
- enabledControls (array)
Associative array with the keys 'info', 'new', 'dragdrop', 'sort', 'hide', 'delete', 'localize'. If the accordant values are set to a boolean value (true or false), the control is shown or hidden in the header of each record.
| Display |
| | Has information about the behavior of child-records, namely:
- localizationMode ('keep', 'select')
Defines in general whether children are really localizable (set to 'select') or just taken from the default language (set to 'keep'). If this property is not set, but the affected parent and child tables were localizable, the mode 'select' is used by default.
- Mode 'keep': This is not a real localization, since the children are taken from the parent of the original language. But the children can be moved, deleted, modified etc. on the localized parent which - of course - also affects the original language.
- Mode 'select': This mode provides the possibility to have a selective localization and to compare localized data to the pendants of the original language. Furthermore this mode is extended by a 'localize all' feature, which works similar to the localization of content on pages, and a 'synchronize' feature which offers the possibility to synchronize a localization with its original language.
- localizeChildrenAtParentLocalization (boolean)
Defines whether children should be localized when the localization of the parent gets created.
- disableMovingChildrenWithParent (boolean)
Disables that child records get moved along with their parent records.
| Display / Proc. |
| | The foreign_field is the field of the child record pointing to the parent record. This defines where to store the uid of the parent record. | Display / Proc. |
| | If set, it overrides the label set in $TCA[<foreign_table>]['ctrl']['label'] for the inline-view. | Display / Proc. |
| | A selector is used to show all possible child records that could be used to create a relation with the parent record. It will be rendered as a multi-select-box. On clicking on an item inside the selector a new relation is created. The foreign_selector points to a field of the foreign_table that is responsible for providing a selector-box ? this field on the foreign_table usually has the type "select" and also has a "foreign_table" defined. | Display / Proc. |
| | Define a field on the child record (or on the intermediate table) that stores the manual sorting information. It is possible to have a different sorting, depending from which side of the relation we look at parent or child. | Display / Proc. |
| | Otherwise this is used as the "ORDER BY" statement to sort the records in the table when listed. | Display |
| | The foreign_table_field is the field of the child record pointing to the parent record. This defines where to store the tablename of the parent record. On setting this configuration key together with foreign_field, the child record knows what its parent record is ? so the child record could also be used on other parent tables. This issue is also known as "weak entity". Do not confuse with foreign_table or foreign_field. It has its own behavior. | Display / Proc. |
| | | Display / Proc. |
| |
| |
| | | |
| | | |
| | | |
| | | |
| | | Display / Proc. |
| | If set, it overrides the label set in $TCA[<foreign_table>]['ctrl']['label'] for the inline-view and only if looking to a symmetric relation from the "other" side. | Display / Proc. |
| | | Display / Proc. |
$TCA['company'] = array(
| | |
|---|
| | Required.
Example:
--div--;Your Label,field1,field2,
--div--;Your Label2;newline,field3,field4
')
) |
| | Example (from sysext/cms/tbl_tt_content.php):
|
| | Syntax: |
| | Syntax: |
| | Example: |
| | |
'types' => array(
'1' => array('showitem' => 'CType'),
'header' => array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, subheader;;8'),
'text' => array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, bodytext;;9;richtext[paste|bold|italic|underline|formatblock|class|left|center|right|orderedlist|unorderedlist|outdent|indent|link|image]:rte_transform[flag=rte_enabled|mode=ts];3-3-3, rte_enabled, text_properties'),
'textpic' => array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, bodytext;;9;richtext[paste|bold|italic|underline|formatblock|class|left|center|right|orderedlist|unorderedlist|outdent|indent|link|image]:rte_transform[flag=rte_enabled|mode=ts];3-3-3, rte_enabled, text_properties, --div--, image;;;;4-4-4, imageorient;;2, imagewidth;;13,
--palette--;LLL:EXT:cms/locallang_ttc.php:ALT.imgLinks;7,
--palette--;LLL:EXT:cms/locallang_ttc.php:ALT.imgOptions;11,
imagecaption;;5'),
'rte' => array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, bodytext;;;nowrap:richtext[*]:rte_transform[mode=ts_images-ts_reglinks];3-3-3'),
'image' => array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, image;;;;4-4-4, imageorient;;2, imagewidth;;13,
--palette--;LLL:EXT:cms/locallang_ttc.php:ALT.imgLinks;7,
--palette--;LLL:EXT:cms/locallang_ttc.php:ALT.imgOptions;11,
imagecaption;;5'),
'bullets' => array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, layout;;;;3-3-3, bodytext;;9;nowrap, text_properties'),
'table' => array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, layout;;10;button;3-3-3, cols, bodytext;;9;nowrap:wizards[table], text_properties'),
'splash' => array('showitem' => 'CType;;4;button;1-1-1, header;LLL:EXT:lang/locallang_general.php:LGL.name;;;2-2-2, splash_layout, bodytext;;;;3-3-3, image;;6'),
'uploads' => array('showitem' => 'CType;;4;button;1-1-1, header;;3;;2-2-2, media;;;;5-5-5,
select_key;LLL:EXT:cms/locallang_ttc.php:select_key.ALT.uploads,
layout;;10;button, filelink_size,
'defaultExtras' => 'nowrap'
| | | |
|---|
| | | |
| | | |
| See table below for a list of the key values possible. | | |
| | | |
| | | |
| | | |
| See table below for value of f1-f5 | | |
| | | |
'_PADDING' => 4,
'_VERTICAL' => 1,
'suggest' => array(
'type' => 'suggest',
),
'edit' => array(
'type' => 'popup',
'title' => 'Edit template',
'script' => 'wizard_edit.php',
'popup_onlyOpenIfSelected' => 1,
'icon' => 'edit2.gif',
'JSopenParams' => 'height=350,width=580,status=0,menubar=0,scrollbars=1',
),
'add' => array(
'type' => 'script',
'title' => 'LLL:EXT:cms/locallang_tca.xml:sys_template.basedOn_add',
'icon' => 'add.gif',
'params' => array(
'table'=>'sys_template',
'pid' => '###CURRENT_PID###',
'setValue' => 'prepend'
),
'script' => 'wizard_add.php',
)
| | |
|---|
| | This setting is required! |
| | |
| | |
| | |
| | |
| | |
| | |
|---|
| Type: script
Creates a link to an external script which can do "context sensitive" processing of the field. This is how the Form and Table wizards are used. |
| | |
| | |
| | |
| | |
| Type: popup (+colorbox)
Creates a link to an external script opened in a pop-up window. |
| | |
| | |
| | |
| |
Example: |
| Type: userFunc
Calls a user function/method to produce the wizard or whatever they are up to. |
| | |
| | |
| Type: colorbox
Renders a square box (table) with the background color set to the value of the field. The id-attribute is set to a md5-hash so you might change the color dynamically from pop-up- wizard.
The icon is not used, but the title is given as alt-text inside the color-square. |
| | |
| | |
| | Example: |
| Type: select
This renders a selector box. When a value is selected in the box, the value is transferred to the field and the field (default) element is thereafter selected (this is a blank value and the label is the wizard title).
"select" wizards make no use of the icon.
The "select" wizard's select-properties can be manipulated with the same number of TSconfig options which are available for "real" select-types in TCEFORM.[table].[field]. The position of these properties is "TCEFORM.[table].[field].wizards.[wizard-key]". |
| | |
| | Example:
|
| Type: suggest
This renders an input field next to a select field of type "group" (internal_type=db) or of type "select" (using foreign_table). After the user has typed at least 2 (minimumCharacters) characters in this field, a search will start and show a list of records matching the search word. The "suggest" wizard's properties can be configured directly in TCA or in page TSConfig (TCEFORM.suggest.default, TCEFORM.suggest.[queryTable], see TSconfig manual).
The configuration options are applied to each table queried by the suggest wizard. There's a general "default" configuration that applies to all tables. On top of that, there can be specific configurations for each table (use the table's name as a key). See wizard example below. |
| | Example:
|
| | Example:
|
| | |
| | |
| | Example:
|
| | Example: |
| | |
| | |
| | |
| | |
|---|
| | Table to add record in. |
| | pid of the new record.
You can use the "markers" (constants) as values instead if you wish:
(see TCA/select for description) |
| | "set" = the field will be forced to have the new value on return
"append"/"prepend" = the field will have the value appended/prepended.
You must set one of these values. |
'type' => 'script',
'title' => 'LLL:EXT:lang/locallang_tca.xml:be_users.usergroup_add_title',
'icon' => 'add.gif',
'params' => array(
'table' => 'be_groups',
'pid' => '0',
'setValue' => 'prepend'
),
'script' => 'wizard_add.php',
),
'type' => 'popup',
'title' => 'LLL:EXT:lang/locallang_tca.xml:be_users.usergroup_edit_title',
'script' => 'wizard_edit.php',
'popup_onlyOpenIfSelected' => 1,
'icon' => 'edit2.gif',
'JSopenParams' => 'height=350,width=580,status=0,menubar=0,scrollbars=1',
),
| | |
|---|
| | Table to manage records for |
| | id of the records you wish to list.
You can use the "markers" (constants) as values instead if you wish:
(see TCA/select for description) |
'type' => 'script',
'title' => 'LLL:EXT:lang/locallang_tca.xml:be_users.usergroup_list_title',
'icon' => 'list.gif',
'params' => array(
'table' => 'be_groups',
'pid' => '0',
),
'script' => 'wizard_list.php',
)
'type' => 'colorbox',
'title' => 'LLL:EXT:examples/locallang_db.xml:tx_examples_haiku.colorPick',
'script' => 'wizard_colorpicker.php',
'dim' => '20x20',
'tableStyle' => 'border: solid 1px black; margin-left: 20px;',
'JSopenParams' => 'height=600,width=380,status=0,menubar=0,scrollbars=1',
'exampleImg' => 'EXT:examples/res/images/japanese_garden.jpg',
)
| | |
|---|
| | If set, the output from the wizard is XML instead of the strangely formatted TypoScript form-configuration code. |
| | |
|---|
| | If set, the output from the wizard is XML instead of the TypoScript form-configuration code. |
| | Setting the number of blank rows that will be added in the bottom of the table when the plus-icon is pressed. The default is 5, the range is 1-50. |
'type' => 'popup',
'title' => 'Link',
'icon' => 'link_popup.gif',
'script' => 'browse_links.php?mode=wizard',
'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1'
)
// Setting ICON_TYPES
$ICON_TYPES = Array(
'shop' => Array('icon' => 'modules_shop.gif'),
'board' => Array('icon' => 'modules_board.gif'),
'news' => Array('icon' => 'modules_news.gif'),
'dmail' => Array('icon' => 'modules_dmail.gif'),
'fe_users' => Array('icon' => 'modules_fe_users.gif'),
'approve' => Array('icon' => 'modules_approvals.gif')
);
$LANG_GENERAL_LABELS = array(
'endtime' => 'LLL:EXT:lang/locallang_general.php:LGL.endtime',
'hidden' => 'LLL:EXT:lang/locallang_general.php:LGL.hidden',
'starttime' => 'LLL:EXT:lang/locallang_general.php:LGL.starttime',
'fe_group' => 'LLL:EXT:lang/locallang_general.php:LGL.fe_group',
'hide_at_login' => 'LLL:EXT:lang/locallang_general.php:LGL.hide_at_login',
'any_login' => 'LLL:EXT:lang/locallang_general.php:LGL.any_login',
'usergroups' => 'LLL:EXT:lang/locallang_general.php:LGL.usergroups',
);
| | |
|---|
| Default | Default index. Always used on main-palettes in the bottom of the forms. |
| Meta fields | Typically used for "Hidden", "Type" and other primary "meta" fields |
| Headers | For fields related to header information |
| Main content | For main content |
| Extras | For extra content, like images, files etc. |
| Advanced | For special content |
| | |
|---|
| |
Example:
Example: |
| | This value is the content of the "style" attribute of a form element (defined by "elementKey").
If the value is prefixed "CLASS:" then it will set the class attribute instead to the value after the prefix.
"elementKey" is the value of a ['columns']['fieldname']['config'] / TYPE (e.g. "text", "group", "check", "flex" etc.) or the string "all" (for defining a default value)
Example:
Example: |
| | This value defines the border style of the group of fields.
Technically the group of fields are wrapped into a table.
"key" is an index defining various values:
- "0" : "style" attribute of the table wrapping the section
- "1" : Distance in pixels after the wrapping table
- "2" : "background" attribute of table wrapping the section: Reference to background image is relative to typo3/ folder (prefixed with ->backPath)
- "3" : "class" attribute of table wrapping the section.
Example:
Example:
With an associated stylesheet you can get the same result (image not included):
|
$TBE_STYLES['colorschemes'] = Array (
'0' => '#F7F7F3,#E3E3DF,#EDEDE9',
'1' => '#94A19A,#7C8D84,#7C8D84',
'2' => '#E4D69E,#E7DBA8,#E9DEAF',
'3' => '#C2BFC0,#C7C5C5,#C7C5C5',
'4' => '#B2B5C3,#C4C6D1,#D5D7DE',
'5' => '#C3B2B5,#D1C4C6,#DED5D7'
);
$TBE_STYLES['styleschemes'] = Array (
'0' => array('all'=>'background-color: #F7F7F3;border:#7C8D84 solid 1px;', 'check'=>''),
'1' => array('all'=>'background-color: #94A19A;border:#7C8D84 solid 1px;', 'check'=>''),
'2' => array('all'=>'background-color: #E4D69E;border:#7C8D84 solid 1px;', 'check'=>''),
'3' => array('all'=>'background-color: #C2BFC0;border:#7C8D84 solid 1px;', 'check'=>''),
'4' => array('all'=>'background-color: #B2B5C3;border:#7C8D84 solid 1px;', 'check'=>''),
'5' => array('all'=>'background-color: #C3B2B5;border:#7C8D84 solid 1px;', 'check'=>''),
);
$TBE_STYLES['borderschemes'] = Array (
'0' => array('border:solid 1px black;',5),
'1' => array('border:solid 1px black;',5),
'2' => array('border:solid 1px black;',5),
'3' => array('border:solid 1px black;',5),
'4' => array('border:solid 1px black;',5),
'5' => array('border:solid 1px black;',5)
);
if (!defined ('TYPO3_MODE')) die ('Access denied.');
$TYPO3_CONF_VARS['BE']['RTE_reg']['rte'] = array('objRef' => 'EXT:rte/class.tx_rte_base.php:&tx_rte_base');
4: require_once(PATH_t3lib.'class.t3lib_rteapi.php');
5: /**
6: * RTE base class (Traditional RTE for MSIE 5+ on windows only!)
7: *
8: * @author Kasper Skaarhoj <kasper@typo3.com>
9: * @package TYPO3
10: * @subpackage tx_rte
11: */
12: class tx_rte_base extends t3lib_rteapi {
13:
14: // External:
15: var $RTEdivStyle; // Alternative style for RTE <div> tag.
16:
17: // Internal, static:
18: var $ID = 'rte'; // Identifies the RTE ...
19: var $debugMode = FALSE; // Debug mode
20:
21:
22: /**
23: * Returns true if the RTE is available. Here you check if the browser requirements are met.
24: * If there are reasons why the RTE cannot be displayed you simply enter them as text in ->errorLog
25: *
26: * @return boolean TRUE if this RTE object offers an RTE
27: */
28: function isAvailable() {
29: global $CLIENT;
30:
31: if (TYPO3_DLOG) t3lib_div::devLog('Checking for availability...','rte');
32:
33: $this->errorLog = array();
34: if (!$this->debugMode) { // If debug-mode, let any browser through
35: if ($CLIENT['BROWSER']!='msie') $this->errorLog[] = '"rte": Browser is not MSIE';
36: if ($CLIENT['SYSTEM']!='win') $this->errorLog[] = '"rte": Client system is not Windows';
37: if ($CLIENT['VERSION']<5) $this->errorLog[] = '"rte": Browser version below 5';
38: }
39: if (!count($this->errorLog)) return TRUE;
40: }
41:
42: /**
43: * Draws the RTE as an iframe for MSIE 5+
44: *
...
55: * @return string HTML code for RTE!
56: */
57: function drawRTE(&$pObj,$table,$field,$row,$PA,$specConf,$thisConfig,$RTEtypeVal,$RTErelPath,$thePidValue) {
58:
59: // Draw form element:
60: if ($this->debugMode) { // Draws regular text area (debug mode)
61: $item = parent::drawRTE($pObj,$table,$field,$row,$PA,$specConf,$thisConfig,$RTEtypeVal,$RTErelPath,$thePidValue);
62: } else { // Draw real RTE (MSIE 5+ only)
63:
64: // Adding needed code in top:
65: $pObj->additionalJS_pre['rte_loader_function'] = $this->loaderFunc($pObj->formName);
66: $pObj->additionalJS_submit[] = "
67: if(TBE_RTE_WINDOWS['".$PA['itemFormElName']."']) { document.".$pObj->formName."['".$PA['itemFormElName']."'].value = TBE_RTE_WINDOWS['".$PA['itemFormElName']."'].getHTML(); } else { OK=0; }";
68:
...
82:
83: // Transform value:
84: $value = $this->transformContent('rte',$PA['itemFormElValue'],$table,$field,$row,$specConf,$thisConfig,$RTErelPath,$thePidValue);
85:
86: // Register RTE windows:
87: $pObj->RTEwindows[] = $PA['itemFormElName'];
88: $item = '
89: '.$this->triggerField($PA['itemFormElName']).'
90: <input type="hidden" name="'.htmlspecialchars($PA['itemFormElName']).'" value="'.htmlspecialchars($value).'" />
91: <div id="cdiv'.count($pObj->RTEwindows).'" style="'.htmlspecialchars($RTEdivStyle).'">
92: <iframe
93: src="'.htmlspecialchars($rteURL).'"
94: id="'.$PA['itemFormElName'].'_RTE"
95: style="visibility:visible; position:absolute; left:0px; top:0px; height:100%; width:100%;"></iframe>
96: </div>';
97: }
98:
99: // Return form item:
100: return $item;
101: }
| |
|---|
| ts_transform | |
| css_transform | |
| ts_preserve | |
| ts_images | |
| ts_links | |
| ts_reglinks | |
| |
| ts | |
| ts_css | |
8: proc.preserveTables = 1
9:
10: proc.entryHTMLparser_db = 1
11: proc.entryHTMLparser_db {
12: keepNonMatchedTags = 1
13: xhtml_cleaning = 1
14: }
| | |
|---|
| | |
| | (Applies for "ts_transform" only)
Example that disables "typolist": |
| | (Applies for "ts_transform" only)
Example that disables "typohead": |
| | Example: |
| | (Applies for "ts_transform" and "css_transform" only (function divideIntoLines))
|
| | (Applies for "ts_transform" and "css_transform" only (function divideIntoLines)) |
| | (Applies for "ts_transform" and "css_transform" only (function divideIntoLines))
|
| | (Applies for "ts_transform" only) |
| | (Applies for "ts_transform" and "css_transform" only (function getKeepTags)) |
| | (Applies for "ts_transform" and "css_transform" only (function getKeepTags)) |
| | (Applies for "ts_transform" and "css_transform" only (function getKeepTags))
|
| | (Applies for "ts_transform" and "css_transform" only (function getKeepTags))
|
| | (Applies for "ts_transform" and "css_transform" only (function HTMLcleaner_db)) |
| | (Applies for "ts_transform" and "css_transform" only (function HTMLcleaner_db)) |
| | (Applies for "ts_transform" and "css_transform" only (function setDivTags)) |
| | (Applies for "ts_transform" and "css_transform" only (function setDivTags)) |
| | (Applies for "ts_transform" and "css_transform" only (function setDivTags)) |
| | (Applies for "ts_transform" and "css_transform" only (function getKeepTags)) |
| | (Applies for "ts_transform" and "css_transform" only (function getKeepTags)) |
| | (Applies for "ts_transform" and "css_transform" only (function divideIntoLines)) |
| | (Applies for "ts_transform" and "css_transform" only (function divideIntoLines)) |
| | (Applies for "ts_transform" and "css_transform" only (function divideIntoLines)) |
| | (Applies for "ts_transform" only and "css_transform" (function TS_transform_rte)) |
| | (Applies for "ts_transform" and "css_transform" only)
|
| | (Applies for "ts_transform") |
| | (Applies for "ts_images") |
| | (Applies for "ts_images")
If set, all "plain" local images (those that are not magic images) will be cleaned up in some way.
If the value is just set, then the style attribute will be removed after detecting any special width/height CSS attributes (which is what the RTE will set if you scale the image manually) and the border attribute is set to zero.
You can also configure with special keywords. So setting "plainImageMode" to any of the value below will perform special processing:
"lockDimensions" : This will read the real dimensions of the image file and force these values into the <img> tag. Thus this option will prevent any user applied scaling in the image!
"lockRatio" : This will allow users to scale the image but will automatically correct the height dimension so the aspect ratio from the original image file is preserved.
"lockRatioWhenSmaller" : Like "lockRatio", but will not allow any scaling larger than the original size of the image. |
| | (Applies for all kinds of processing) |
| | (Applies for all kinds of processing) |
| | Custom option-space for userdefined transformations.
See example from section about custom transformations. |
[page:->PROC]
$TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_parsehtml_proc.php']['transformation']['tx_myext']
= 'EXT:myext/custom_transformation.php:user_transformation';
0: /**
1: * Custom RTE transformation
2: */
3: class user_transformation {
4:
5: // object; Reference to the parent object, t3lib_parsehtml_proc
6: var $pObj;
7:
8: // Transformation key of self.
9: var $transformationKey = 'tx_myext';
10:
11: // Will contain transformation configuration if found:
12: var $conf;
13:
14:
15: /**
16: * Setting specific configuration for this transformation
17: *
18: * @return void
19: */
20: function initConfig() {
21: $this->conf = $this->pObj->procOptions['usertrans.'][$this->transformationKey.'.'];
22: }
23:
24: /**
25: * Reserved method name, called when content is transformed for DB storage
26: * If "proc.usertrans.tx_myext.addHrulerInRTE = 1" then a horizontal ruler in the
27: * end of the content will be removed (if found)
28: *
29: * @param string RTE HTML to clean for database storage
30: * @return string Processed input string.
31: */
32: function transform_db($value) {
33: $this->initConfig();
34:
35: if ($this->conf['addHrulerInRTE']) {
36: $value = eregi_replace('<hr[[:space:]]*[\/]>[[:space:]]*$','',$value);
37: }
38:
39: return $value;
40: }
41:
42: /**
43: * Reserved method name, called when content is transformed for RTE display
44: * If "proc.usertrans.tx_myext.addHrulerInRTE = 1" then a horizontal ruler
45: * will be added in the end of the content.
46: *
47: * @param string Database content to transform to RTE ready HTML
48: * @return string Processed input string.
49: */
50: function transform_rte($value) {
51: $this->initConfig();
52:
53: if ($this->conf['addHrulerInRTE']) {
54: $value.='<hr/>';
55: }
56:
57: return $value;
58: }
59: }
1: 'TEST01' => Array (
2: 'label' => 'TEST01: Text field',
3: 'config' => Array (
4: 'type' => 'text',
5: ),
6: 'defaultExtras' => 'richtext[*]:rte_transform[mode=tx_myext-css_transform]'
7: ),
| | |
|---|
| | Related to TCEforms. See other section about visual style of TCEforms. |
| | Related to TCEforms. See other section about visual style of TCEforms. |
| | Related to TCEforms. See other section about visual style of TCEforms. |
| |
Example:
|
| | Deprecated - use the $TBE_STYLES['skinImg'] feature instead! |
| | Deprecated - use the $TBE_STYLES['skinImg'] feature instead! |
| | Deprecated - use the $TBE_STYLES['skinImg'] feature instead! |
| | |
| | |
| | |
| | |
| | |
| |
Example: |
| | |
| |
Example code listing: |
| | |
| | |
$iconImg = '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/edit2.gif','width="11" height="12"').' title="My Icon" alt="" />';
$iconImg = '<img src="gfx/edit2.gif" width="11" height="12" title="My Icon" alt="" />';
$iconImg = '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],t3lib_extMgm::extRelPath('templavoila').'mod1/greenled.gif','').' title="Rule applies" border="0" alt="" align="absmiddle" />';
Values in red are set by TYPO3.
| | | | | | |
|---|
| | | | | | |
| |
| | 0 (no errors are turned into exceptions) | | | | 0 (Off) |
| | | | | | 1 (On) |
| | | | | | 1 (On) |
| | 0 (Off) |
Example:
Example:
<T3DataStructure>
</T3DataStructure>
<T3DataStructure>
</T3DataStructure>
<T3DataStructure>
</T3DataStructure>
<T3DataStructure>
</T3DataStructure>
<T3DataStructure>
</T3DataStructure>
<T3DataStructure>
</T3DataStructure>
<T3DataStructure>
</T3DataStructure>
| | |
|---|
| | |
| | |
| | |
| | |
| | |
|
| Alternatively, when used under <data> it can be a string pointing to an external "include file"! |
| | |
| | |
|---|
| | |
| See <data> element of <T3locallang> above. | |
| See <data> element of <T3locallang> above. | |
| See <data> element of <T3locallang> above. | |