Project

General

Profile

Bug #22410 » 14050_cleaning_t3lib_tceforms.patch

Administrator Admin, 2010-11-24 17:13

View differences:

t3lib/class.t3lib_tceforms.php (revision )
<?php
/***************************************************************
* Copyright notice
*
* (c) 1999-2010 Kasper Sk?rh?j (kasperYYYY@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
* Copyright notice
*
* (c) 1999-2010 Kasper Sk?rh?j (kasperYYYY@typo3.com)
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
* A copy is found in the textfile GPL.txt and important notices to the license
* from the author is found in LICENSE.txt distributed with these scripts.
*
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* Contains TYPO3 Core Form generator - AKA "TCEforms"
*
......
*
*
* 196: class t3lib_TCEforms
* 302: function t3lib_TCEforms()
* 302: function t3lib_TCEforms()
* 338: function initDefaultBEmode()
* 338: function initDefaultBEmode()
*
* SECTION: Rendering the forms, fields etc
* SECTION: Rendering the forms, fields etc
* 385: function getSoloField($table,$row,$theFieldToReturn)
* 385: function getSoloField($table,$row,$theFieldToReturn)
* 424: function getMainFields($table,$row,$depth=0)
* 424: function getMainFields($table,$row,$depth=0)
* 618: function getListedFields($table,$row,$list)
* 618: function getListedFields($table,$row,$list)
* 660: function getPaletteFields($table,$row,$palette,$header='',$itemList='',$collapsedHeader='')
* 660: function getPaletteFields($table,$row,$palette,$header='',$itemList='',$collapsedHeader='')
* 737: function getSingleField($table,$field,$row,$altName='',$palette=0,$extra='',$pal=0)
* 737: function getSingleField($table,$field,$row,$altName='',$palette=0,$extra='',$pal=0)
* 900: function getSingleField_SW($table,$field,$row,&$PA)
* 900: function getSingleField_SW($table,$field,$row,&$PA)
*
* SECTION: Rendering of each TCEform field type
* SECTION: Rendering of each TCEform field type
* 976: function getSingleField_typeInput($table,$field,$row,&$PA)
* 976: function getSingleField_typeInput($table,$field,$row,&$PA)
* 1057: function getSingleField_typeText($table,$field,$row,&$PA)
* 1057: function getSingleField_typeText($table,$field,$row,&$PA)
* 1178: function getSingleField_typeCheck($table,$field,$row,&$PA)
* 1178: function getSingleField_typeCheck($table,$field,$row,&$PA)
* 1244: function getSingleField_typeRadio($table,$field,$row,&$PA)
* 1244: function getSingleField_typeRadio($table,$field,$row,&$PA)
* 1279: function getSingleField_typeSelect($table,$field,$row,&$PA)
* 1279: function getSingleField_typeSelect($table,$field,$row,&$PA)
* 1359: function getSingleField_typeSelect_single($table,$field,$row,&$PA,$config,$selItems,$nMV_label)
* 1359: function getSingleField_typeSelect_single($table,$field,$row,&$PA,$config,$selItems,$nMV_label)
* 1490: function getSingleField_typeSelect_checkbox($table,$field,$row,&$PA,$config,$selItems,$nMV_label)
* 1490: function getSingleField_typeSelect_checkbox($table,$field,$row,&$PA,$config,$selItems,$nMV_label)
* 1609: function getSingleField_typeSelect_singlebox($table,$field,$row,&$PA,$config,$selItems,$nMV_label)
* 1609: function getSingleField_typeSelect_singlebox($table,$field,$row,&$PA,$config,$selItems,$nMV_label)
* 1719: function getSingleField_typeSelect_multiple($table,$field,$row,&$PA,$config,$selItems,$nMV_label)
* 1719: function getSingleField_typeSelect_multiple($table,$field,$row,&$PA,$config,$selItems,$nMV_label)
* 1823: function getSingleField_typeGroup($table,$field,$row,&$PA)
* 1823: function getSingleField_typeGroup($table,$field,$row,&$PA)
* 1992: function getSingleField_typeNone($table,$field,$row,&$PA)
* 1992: function getSingleField_typeNone($table,$field,$row,&$PA)
* 2008: function getSingleField_typeNone_render($config,$itemValue)
* 2008: function getSingleField_typeNone_render($config,$itemValue)
* 2070: function getSingleField_typeFlex($table,$field,$row,&$PA)
* 2070: function getSingleField_typeFlex($table,$field,$row,&$PA)
* 2205: function getSingleField_typeFlex_langMenu($languages,$elName,$selectedLanguage,$multi=1)
* 2205: function getSingleField_typeFlex_langMenu($languages,$elName,$selectedLanguage,$multi=1)
* 2224: function getSingleField_typeFlex_sheetMenu($sArr,$elName,$sheetKey)
* 2224: function getSingleField_typeFlex_sheetMenu($sArr,$elName,$sheetKey)
* 2259: function getSingleField_typeFlex_draw($dataStruct,$editData,$cmdData,$table,$field,$row,&$PA,$formPrefix='',$level=0,$tRows=array())
* 2259: function getSingleField_typeFlex_draw($dataStruct,$editData,$cmdData,$table,$field,$row,&$PA,$formPrefix='',$level=0,$tRows=array())
* 2452: function getSingleField_typeUnknown($table,$field,$row,&$PA)
* 2452: function getSingleField_typeUnknown($table,$field,$row,&$PA)
* 2467: function getSingleField_typeUser($table,$field,$row,&$PA)
* 2467: function getSingleField_typeUser($table,$field,$row,&$PA)
*
* SECTION: Field content processing
* SECTION: Field content processing
* 2496: function formatValue ($config, $itemValue)
* 2496: function formatValue ($config, $itemValue)
*
* SECTION: "Configuration" fetching/processing functions
* SECTION: "Configuration" fetching/processing functions
* 2588: function getRTypeNum($table,$row)
* 2588: function getRTypeNum($table,$row)
* 2614: function rearrange($fields)
* 2614: function rearrange($fields)
* 2640: function getExcludeElements($table,$row,$typeNum)
* 2640: function getExcludeElements($table,$row,$typeNum)
* 2688: function getFieldsToAdd($table,$row,$typeNum)
* 2688: function getFieldsToAdd($table,$row,$typeNum)
* 2713: function mergeFieldsWithAddedFields($fields,$fieldsToAdd)
* 2713: function mergeFieldsWithAddedFields($fields,$fieldsToAdd)
* 2745: function setTSconfig($table,$row,$field='')
* 2745: function setTSconfig($table,$row,$field='')
* 2767: function getSpecConfForField($table,$row,$field)
* 2767: function getSpecConfForField($table,$row,$field)
* 2788: function getSpecConfFromString($extraString, $defaultExtras)
* 2788: function getSpecConfFromString($extraString, $defaultExtras)
* 3007: function loadPaletteElements($table, $row, $palette, $itemList='')
* 3007: function loadPaletteElements($table, $row, $palette, $itemList='')
*
* SECTION: Display of localized content etc.
* SECTION: Display of localized content etc.
* 2816: function registerDefaultLanguageData($table,$rec)
* 2816: function registerDefaultLanguageData($table,$rec)
* 2848: function getLanguageOverlayRawValue($table, $row, $field, $fieldConf)
* 2848: function getLanguageOverlayRawValue($table, $row, $field, $fieldConf)
* 2876: function renderDefaultLanguageContent($table,$field,$row,$item)
* 2876: function renderDefaultLanguageContent($table,$field,$row,$item)
* 2899: function renderDefaultLanguageDiff($table,$field,$row,$item)
* 2899: function renderDefaultLanguageDiff($table,$field,$row,$item)
*
* SECTION: Form element helper functions
* SECTION: Form element helper functions
* 2955: function dbFileIcons($fName,$mode,$allowed,$itemArray,$selector='',$params=array(),$onFocus='')
* 2955: function dbFileIcons($fName,$mode,$allowed,$itemArray,$selector='',$params=array(),$onFocus='')
* 3108: function getClipboardElements($allowed,$mode)
* 3108: function getClipboardElements($allowed,$mode)
* 3157: function getClickMenu($str,$table,$uid='')
* 3157: function getClickMenu($str,$table,$uid='')
* 3178: function renderWizards($itemKinds,$wizConf,$table,$row,$field,&$PA,$itemName,$specConf,$RTE=0)
* 3178: function renderWizards($itemKinds,$wizConf,$table,$row,$field,&$PA,$itemName,$specConf,$RTE=0)
* 3382: function getIcon($icon)
* 3382: function getIcon($icon)
* 3409: function optionTagStyle($iconString)
* 3409: function optionTagStyle($iconString)
* 3425: function extractValuesOnlyFromValueLabelList($itemFormElValue)
* 3425: function extractValuesOnlyFromValueLabelList($itemFormElValue)
* 3447: function wrapOpenPalette($header,$table,$row,$palette,$retFunc=0)
* 3447: function wrapOpenPalette($header,$table,$row,$palette,$retFunc=0)
* 3471: function checkBoxParams($itemName,$thisValue,$c,$iCount,$addFunc='')
* 3471: function checkBoxParams($itemName,$thisValue,$c,$iCount,$addFunc='')
* 3485: function elName($itemName)
* 3485: function elName($itemName)
* 3496: function noTitle($str,$wrapParts=array())
* 3496: function noTitle($str,$wrapParts=array())
* 3505: function blur()
* 3505: function blur()
* 3514: function thisReturnUrl()
* 3514: function thisReturnUrl()
* 3527: function getSingleHiddenField($table,$field,$row)
* 3527: function getSingleHiddenField($table,$field,$row)
* 3549: function formWidth($size=48,$textarea=0)
* 3549: function formWidth($size=48,$textarea=0)
* 3576: function formWidthText($size=48,$wrap='')
* 3576: function formWidthText($size=48,$wrap='')
* 3592: function formElStyle($type)
* 3592: function formElStyle($type)
* 3603: function formElClass($type)
* 3603: function formElClass($type)
* 3614: function formElStyleClassValue($type, $class=FALSE)
* 3614: function formElStyleClassValue($type, $class=FALSE)
* 3638: function insertDefStyle($type)
* 3638: function insertDefStyle($type)
* 3657: function getDynTabMenu($parts, $idString)
* 3657: function getDynTabMenu($parts, $idString)
*
* SECTION: Item-array manipulation functions (check/select/radio)
* SECTION: Item-array manipulation functions (check/select/radio)
* 3696: function initItemArray($fieldValue)
* 3696: function initItemArray($fieldValue)
* 3714: function addItems($items,$iArray)
* 3714: function addItems($items,$iArray)
* 3736: function procItems($items,$iArray,$config,$table,$row,$field)
* 3736: function procItems($items,$iArray,$config,$table,$row,$field)
* 3760: function addSelectOptionsToItemArray($items,$fieldValue,$TSconfig,$field)
* 3760: function addSelectOptionsToItemArray($items,$fieldValue,$TSconfig,$field)
* 3980: function addSelectOptionsToItemArray_makeModuleData($value)
* 3980: function addSelectOptionsToItemArray_makeModuleData($value)
* 4002: function foreignTable($items,$fieldValue,$TSconfig,$field,$pFFlag=0)
* 4002: function foreignTable($items,$fieldValue,$TSconfig,$field,$pFFlag=0)
*
* SECTION: Template functions
* SECTION: Template functions
* 4083: function setNewBEDesign()
* 4083: function setNewBEDesign()
* 4138: function intoTemplate($inArr,$altTemplate='')
* 4138: function intoTemplate($inArr,$altTemplate='')
* 4162: function addUserTemplateMarkers($marker,$table,$field,$row,&$PA)
* 4162: function addUserTemplateMarkers($marker,$table,$field,$row,&$PA)
* 4173: function wrapLabels($str)
* 4173: function wrapLabels($str)
* 4186: function wrapTotal($c,$rec,$table)
* 4186: function wrapTotal($c,$rec,$table)
* 4199: function replaceTableWrap($arr,$rec,$table)
* 4199: function replaceTableWrap($arr,$rec,$table)
* 4236: function wrapBorder(&$out_array,&$out_pointer)
* 4236: function wrapBorder(&$out_array,&$out_pointer)
* 4258: function rplColorScheme($inTemplate)
* 4258: function rplColorScheme($inTemplate)
* 4278: function getDivider()
* 4278: function getDivider()
* 4288: function printPalette($palArr)
* 4288: function printPalette($palArr)
* 4339: function helpTextIcon($table,$field,$force=0)
* 4339: function helpTextIcon($table,$field,$force=0)
* 4359: function helpText($table,$field)
* 4359: function helpText($table,$field)
* 4380: function setColorScheme($scheme)
* 4380: function setColorScheme($scheme)
* 4404: function resetSchemes()
* 4404: function resetSchemes()
* 4415: function storeSchemes()
* 4415: function storeSchemes()
* 4427: function restoreSchemes()
* 4427: function restoreSchemes()
*
* SECTION: JavaScript related functions
* SECTION: JavaScript related functions
* 4457: function JStop()
* 4457: function JStop()
* 4508: function JSbottom($formname='forms[0]')
* 4508: function JSbottom($formname='forms[0]')
* 4835: function dbFileCon($formObj='document.forms[0]')
* 4835: function dbFileCon($formObj='document.forms[0]')
* 5053: function printNeededJSFunctions()
* 5053: function printNeededJSFunctions()
* 5080: function printNeededJSFunctions_top()
* 5080: function printNeededJSFunctions_top()
*
* SECTION: Various helper functions
* SECTION: Various helper functions
* 5128: function getDefaultRecord($table,$pid=0)
* 5128: function getDefaultRecord($table,$pid=0)
* 5167: function getRecordPath($table,$rec)
* 5167: function getRecordPath($table,$rec)
* 5181: function readPerms()
* 5181: function readPerms()
* 5195: function sL($str)
* 5195: function sL($str)
* 5208: function getLL($str)
* 5208: function getLL($str)
* 5229: function isPalettesCollapsed($table,$palette)
* 5229: function isPalettesCollapsed($table,$palette)
* 5245: function isDisplayCondition($displayCond,$row,$ffValueKey='')
* 5245: function isDisplayCondition($displayCond,$row,$ffValueKey='')
* 5349: function getTSCpid($table,$uid,$pid)
* 5349: function getTSCpid($table,$uid,$pid)
* 5363: function doLoadTableDescr($table)
* 5363: function doLoadTableDescr($table)
* 5375: function getAvailableLanguages($onlyIsoCoded=1,$setDefault=1)
* 5375: function getAvailableLanguages($onlyIsoCoded=1,$setDefault=1)
*
*
* 5417: class t3lib_TCEforms_FE extends t3lib_TCEforms
* 5425: function wrapLabels($str)
* 5425: function wrapLabels($str)
* 5435: function printPalette($palArr)
* 5435: function printPalette($palArr)
* 5460: function setFancyDesign()
* 5460: function setFancyDesign()
*
* TOTAL FUNCTIONS: 100
* (This index is automatically created/updated by the extension "extdeveval")
......
*/
/**
* 'TCEforms' - Class for creating the backend editing forms.
*
......
* @package TYPO3
* @subpackage t3lib
*/
class t3lib_TCEforms {
class t3lib_TCEforms {
// variables not commented yet.... (do so...)
var $palFieldArr = array();
......
var $transformedRow = array();
var $extJSCODE = '';
var $printNeededJS = array();
var $hiddenFieldAccum=array();
var $hiddenFieldAccum = array();
var $TBE_EDITOR_fieldChanged_func='';
var $TBE_EDITOR_fieldChanged_func = '';
var $loadMD5_JS=1;
var $loadMD5_JS = 1;
var $prevBorderStyle='[nothing here...]'; // Something unique...
var $prevBorderStyle = '[nothing here...]'; // Something unique...
var $allowUpload=0; // If set direct upload fields will be shown
var $allowUpload = 0; // If set direct upload fields will be shown
var $titleLen=15; // @deprecated since TYPO3 4.1: $BE_USER->uc['titleLen'] but what is default??
var $titleLen = 15; // @deprecated since TYPO3 4.1: $BE_USER->uc['titleLen'] but what is default??
var $defaultLanguageData = array(); // Array where records in the default language is stored. (processed by transferdata)
var $defaultLanguageData = array(); // Array where records in the default language is stored. (processed by transferdata)
var $defaultLanguageData_diff = array(); // Array where records in the default language is stored (raw without any processing. used for making diff)
var $defaultLanguageData_diff = array(); // Array where records in the default language is stored (raw without any processing. used for making diff)
var $additionalPreviewLanguageData = array();
// EXTERNAL, static
var $backPath=''; // Set this to the 'backPath' pointing back to the typo3 admin directory from the script where this form is displayed.
var $backPath = ''; // Set this to the 'backPath' pointing back to the typo3 admin directory from the script where this form is displayed.
var $returnUrl=''; // Alternative return URL path (default is t3lib_div::linkThisScript())
var $returnUrl = ''; // Alternative return URL path (default is t3lib_div::linkThisScript())
var $doSaveFieldName=''; // Can be set to point to a field name in the form which will be set to '1' when the form is submitted with a *save* button. This way the recipient script can determine that the form was submitted for save and not "close" for example.
var $doSaveFieldName = ''; // Can be set to point to a field name in the form which will be set to '1' when the form is submitted with a *save* button. This way the recipient script can determine that the form was submitted for save and not "close" for example.
var $palettesCollapsed=0; // Can be set true/false to whether palettes (secondary options) are in the topframe or in form. True means they are NOT IN-form. So a collapsed palette is one, which is shown in the top frame, not in the page.
var $palettesCollapsed = 0; // Can be set true/false to whether palettes (secondary options) are in the topframe or in form. True means they are NOT IN-form. So a collapsed palette is one, which is shown in the top frame, not in the page.
var $disableRTE=0; // If set, the RTE is disabled (from form display, eg. by checkbox in the bottom of the page!)
var $disableRTE = 0; // If set, the RTE is disabled (from form display, eg. by checkbox in the bottom of the page!)
var $globalShowHelp=1; // If false, then all CSH will be disabled, regardless of settings in $this->edit_showFieldHelp
var $globalShowHelp = 1; // If false, then all CSH will be disabled, regardless of settings in $this->edit_showFieldHelp
var $localizationMode=''; // If true, the forms are rendering only localization relevant fields of the records.
var $localizationMode = ''; // If true, the forms are rendering only localization relevant fields of the records.
var $fieldOrder=''; // Overrule the field order set in TCA[types][showitem], eg for tt_content this value, 'bodytext,image', would make first the 'bodytext' field, then the 'image' field (if set for display)... and then the rest in the old order.
var $fieldOrder = ''; // Overrule the field order set in TCA[types][showitem], eg for tt_content this value, 'bodytext,image', would make first the 'bodytext' field, then the 'image' field (if set for display)... and then the rest in the old order.
var $doPrintPalette=1; // If set to false, palettes will NEVER be rendered.
var $doPrintPalette = 1; // If set to false, palettes will NEVER be rendered.
/**
* Set to initialized clipboard object; Then the element browser will offer a link to paste in records from clipboard.
*
* @var t3lib_clipboard
*/
var $clipObj=FALSE;
var $clipObj = FALSE;
var $enableClickMenu=FALSE; // Enable click menu on reference icons.
var $enableClickMenu = FALSE; // Enable click menu on reference icons.
var $enableTabMenu = FALSE; // Enable Tab Menus.
var $enableTabMenu = FALSE; // Enable Tab Menus.
var $renderReadonly = FALSE; // When enabled all fields are rendered non-editable.
var $renderReadonly = FALSE; // When enabled all fields are rendered non-editable.
var $form_rowsToStylewidth = 9.58; // Form field width compensation: Factor from NN4 form field widths to style-aware browsers (like NN6+ and MSIE, with the $CLIENT[FORMSTYLE] value set)
var $form_rowsToStylewidth = 9.58; // Form field width compensation: Factor from NN4 form field widths to style-aware browsers (like NN6+ and MSIE, with the $CLIENT[FORMSTYLE] value set)
var $form_largeComp = 1.33; // Form field width compensation: Compensation for large documents, doc-tab (editing)
var $form_largeComp = 1.33; // Form field width compensation: Compensation for large documents, doc-tab (editing)
var $charsPerRow=40; // The number of chars expected per row when the height of a text area field is automatically calculated based on the number of characters found in the field content.
var $charsPerRow = 40; // The number of chars expected per row when the height of a text area field is automatically calculated based on the number of characters found in the field content.
var $maxTextareaWidth=48; // The maximum abstract value for textareas
var $maxTextareaWidth = 48; // The maximum abstract value for textareas
var $maxInputWidth=48; // The maximum abstract value for input fields
var $maxInputWidth = 48; // The maximum abstract value for input fields
var $defaultMultipleSelectorStyle='width:250px;'; // Default style for the selector boxes used for multiple items in "select" and "group" types.
var $defaultMultipleSelectorStyle = 'width:250px;'; // Default style for the selector boxes used for multiple items in "select" and "group" types.
// INTERNAL, static
var $prependFormFieldNames = 'data'; // The string to prepend formfield names with.
var $prependFormFieldNames = 'data'; // The string to prepend formfield names with.
var $prependCmdFieldNames = 'cmd'; // The string to prepend commands for tcemain::process_cmdmap with.
var $prependCmdFieldNames = 'cmd'; // The string to prepend commands for tcemain::process_cmdmap with.
var $prependFormFieldNames_file = 'data_files'; // The string to prepend FILE form field names with.
var $prependFormFieldNames_file = 'data_files'; // The string to prepend FILE form field names with.
var $formName = 'editform'; // The name attribute of the form.
var $formName = 'editform'; // The name attribute of the form.
var $allowOverrideMatrix = array(); // Whitelist that allows TCA field configuration to be overridden by TSconfig, @see overrideFieldConf()
var $allowOverrideMatrix = array(); // Whitelist that allows TCA field configuration to be overridden by TSconfig, @see overrideFieldConf()
// INTERNAL, dynamic
var $perms_clause=''; // Set by readPerms() (caching)
var $perms_clause = ''; // Set by readPerms() (caching)
var $perms_clause_set=0; // Set by readPerms() (caching-flag)
var $perms_clause_set = 0; // Set by readPerms() (caching-flag)
var $edit_showFieldHelp=''; // Used to indicate the mode of CSH (Context Sensitive Help), whether it should be icons-only ('icon'), full description ('text') or not at all (blank).
var $edit_showFieldHelp = ''; // Used to indicate the mode of CSH (Context Sensitive Help), whether it should be icons-only ('icon'), full description ('text') or not at all (blank).
var $docLarge=0; // If set, the forms will be rendered a little wider, more precisely with a factor of $this->form_largeComp.
var $docLarge = 0; // If set, the forms will be rendered a little wider, more precisely with a factor of $this->form_largeComp.
var $clientInfo=array(); // Loaded with info about the browser when class is instantiated.
var $clientInfo = array(); // Loaded with info about the browser when class is instantiated.
var $RTEenabled=0; // True, if RTE is possible for the current user (based on result from BE_USER->isRTE())
var $RTEenabled = 0; // True, if RTE is possible for the current user (based on result from BE_USER->isRTE())
var $RTEenabled_notReasons=''; // If $this->RTEenabled was false, you can find the reasons listed in this array which is filled with reasons why the RTE could not be loaded)
var $RTEenabled_notReasons = ''; // If $this->RTEenabled was false, you can find the reasons listed in this array which is filled with reasons why the RTE could not be loaded)
var $RTEcounter = 0; // Counter that is incremented before an RTE is created. Can be used for unique ids etc.
var $RTEcounter = 0; // Counter that is incremented before an RTE is created. Can be used for unique ids etc.
var $colorScheme; // Contains current color scheme
var $colorScheme; // Contains current color scheme
var $classScheme; // Contains current class scheme
var $classScheme; // Contains current class scheme
var $defColorScheme; // Contains the default color scheme
var $defColorScheme; // Contains the default color scheme
var $defClassScheme; // Contains the default class scheme
var $defClassScheme; // Contains the default class scheme
var $fieldStyle; // Contains field style values
var $fieldStyle; // Contains field style values
var $borderStyle; // Contains border style values.
var $borderStyle; // Contains border style values.
var $commentMessages=array(); // An accumulation of messages from the class.
var $commentMessages = array(); // An accumulation of messages from the class.
// INTERNAL, templates
var $totalWrap='<hr />|<hr />'; // Total wrapping for the table rows.
var $totalWrap = '<hr />|<hr />'; // Total wrapping for the table rows.
var $fieldTemplate='<strong>###FIELD_NAME###</strong><br />###FIELD_ITEM###<hr />'; // Field template
var $fieldTemplate = '<strong>###FIELD_NAME###</strong><br />###FIELD_ITEM###<hr />'; // Field template
var $sectionWrap=''; // Wrapping template code for a section
var $sectionWrap = ''; // Wrapping template code for a section
var $palFieldTemplateHeader=''; // Template for palette headers
var $palFieldTemplateHeader = ''; // Template for palette headers
var $palFieldTemplate=''; // Template for palettes
var $palFieldTemplate = ''; // Template for palettes
// INTERNAL, working memory
var $excludeElements=''; // Set to the fields NOT to display, if any.
var $excludeElements = ''; // Set to the fields NOT to display, if any.
var $palettesRendered=array(); // During rendering of forms this will keep track of which palettes has already been rendered (so they are not rendered twice by mistake)
var $palettesRendered = array(); // During rendering of forms this will keep track of which palettes has already been rendered (so they are not rendered twice by mistake)
var $hiddenFieldListArr = array(); // This array of fields will be set as hidden-fields instead of rendered normally! For instance palette fields edited in the top frame are set as hidden fields since the main form has to submit the values. The top frame actually just sets the value in the main form!
var $hiddenFieldListArr = array(); // This array of fields will be set as hidden-fields instead of rendered normally! For instance palette fields edited in the top frame are set as hidden fields since the main form has to submit the values. The top frame actually just sets the value in the main form!
var $requiredFields=array(); // Used to register input-field names, which are required. (Done during rendering of the fields). This information is then used later when the JavaScript is made.
var $requiredFields = array(); // Used to register input-field names, which are required. (Done during rendering of the fields). This information is then used later when the JavaScript is made.
var $requiredAdditional=array(); // Used to register input-field names, which are required an have additional requirements (e.g. like a date/time must be positive integer). The information of this array is merged with $this->requiredFields later.
var $requiredAdditional = array(); // Used to register input-field names, which are required an have additional requirements (e.g. like a date/time must be positive integer). The information of this array is merged with $this->requiredFields later.
var $requiredElements=array(); // Used to register the min and max number of elements for selectorboxes where that apply (in the "group" type for instance)
var $requiredElements = array(); // Used to register the min and max number of elements for selectorboxes where that apply (in the "group" type for instance)
var $requiredNested=array(); // Used to determine where $requiredFields or $requiredElements are nested (in Tabs or IRRE)
var $requiredNested = array(); // Used to determine where $requiredFields or $requiredElements are nested (in Tabs or IRRE)
var $renderDepth=0; // Keeps track of the rendering depth of nested records.
var $renderDepth = 0; // Keeps track of the rendering depth of nested records.
var $savedSchemes=array(); // Color scheme buffer.
var $savedSchemes = array(); // Color scheme buffer.
var $dynNestedStack = array(); // holds the path an element is nested in (e.g. required for RTEhtmlarea)
var $dynNestedStack = array(); // holds the path an element is nested in (e.g. required for RTEhtmlarea)
// Internal, registers for user defined functions etc.
var $additionalCode_pre = array(); // Additional HTML code, printed before the form.
var $additionalCode_pre = array(); // Additional HTML code, printed before the form.
var $additionalJS_pre = array(); // Additional JavaScript, printed before the form
var $additionalJS_pre = array(); // Additional JavaScript, printed before the form
var $additionalJS_post = array(); // Additional JavaScript printed after the form
var $additionalJS_post = array(); // Additional JavaScript printed after the form
var $additionalJS_submit = array(); // Additional JavaScript executed on submit; If you set "OK" variable it will raise an error about RTEs not being loaded and offer to block further submission.
var $additionalJS_submit = array(); // Additional JavaScript executed on submit; If you set "OK" variable it will raise an error about RTEs not being loaded and offer to block further submission.
var $additionalJS_delete = array(); // Additional JavaScript executed when section element is deleted. This is neceessary, for example, to correctly clean up HTMLArea RTE (bug #8232)
var $additionalJS_delete = array(); // Additional JavaScript executed when section element is deleted. This is neceessary, for example, to correctly clean up HTMLArea RTE (bug #8232)
/**
* Instance of t3lib_tceforms_inline
......
* @var t3lib_TCEforms_inline
*/
var $inline;
var $hookObjectsMainFields = array(); // Array containing hook class instances called once for a form
var $hookObjectsMainFields = array(); // Array containing hook class instances called once for a form
var $hookObjectsSingleField = array(); // Array containing hook class instances called for each field
var $hookObjectsSingleField = array(); // Array containing hook class instances called for each field
var $extraFormHeaders = array(); // Rows gettings inserted into the alt_doc headers (when called from alt_doc.php)
var $extraFormHeaders = array(); // Rows gettings inserted into the alt_doc headers (when called from alt_doc.php)
public $templateFile = ''; // Form templates, relative to typo3 directory
public $templateFile = ''; // Form templates, relative to typo3 directory
/**
* Constructor function, setting internal variables, loading the styles used.
*
* @return void
*/
function t3lib_TCEforms() {
function t3lib_TCEforms() {
global $CLIENT, $TYPO3_CONF_VARS;
$this->clientInfo = t3lib_div::clientInfo();
$this->RTEenabled = $GLOBALS['BE_USER']->isRTE();
if (!$this->RTEenabled) {
if (!$this->RTEenabled) {
$this->RTEenabled_notReasons = implode(LF,$GLOBALS['BE_USER']->RTE_errors);
$this->RTEenabled_notReasons = implode(LF, $GLOBALS['BE_USER']->RTE_errors);
$this->commentMessages[] = 'RTE NOT ENABLED IN SYSTEM due to:'.LF.$this->RTEenabled_notReasons;
$this->commentMessages[] = 'RTE NOT ENABLED IN SYSTEM due to:' . LF . $this->RTEenabled_notReasons;
}
// Default color+class scheme
$this->defColorScheme = array(
$GLOBALS['SOBE']->doc->bgColor, // Background for the field AND palette
$GLOBALS['SOBE']->doc->bgColor, // Background for the field AND palette
t3lib_div::modifyHTMLColorAll($GLOBALS['SOBE']->doc->bgColor,-20), // Background for the field header
t3lib_div::modifyHTMLColorAll($GLOBALS['SOBE']->doc->bgColor, -20), // Background for the field header
t3lib_div::modifyHTMLColorAll($GLOBALS['SOBE']->doc->bgColor,-10), // Background for the palette field header
t3lib_div::modifyHTMLColorAll($GLOBALS['SOBE']->doc->bgColor, -10), // Background for the palette field header
'black', // Field header font color
'black', // Field header font color
'#666666' // Palette field header font color
'#666666' // Palette field header font color
);
$this->defColorScheme = array();
......
);
// Create instance of t3lib_TCEforms_inline only if this a non-IRRE-AJAX call:
if (!isset($GLOBALS['ajaxID']) || strpos($GLOBALS['ajaxID'], 't3lib_TCEforms_inline::')!==0) {
if (!isset($GLOBALS['ajaxID']) || strpos($GLOBALS['ajaxID'], 't3lib_TCEforms_inline::') !== 0) {
$this->inline = t3lib_div::makeInstance('t3lib_TCEforms_inline');
}
// Create instance of t3lib_TCEforms_suggest only if this a non-Suggest-AJAX call:
if (!isset($GLOBALS['ajaxID']) || strpos($GLOBALS['ajaxID'], 't3lib_TCEforms_suggest::')!==0) {
if (!isset($GLOBALS['ajaxID']) || strpos($GLOBALS['ajaxID'], 't3lib_TCEforms_suggest::') !== 0) {
$this->suggest = t3lib_div::makeInstance('t3lib_TCEforms_suggest');
}
// Prepare user defined objects (if any) for hooks which extend this function:
$this->hookObjectsMainFields = array();
if (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getMainFieldsClass'])) {
if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getMainFieldsClass'])) {
foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getMainFieldsClass'] as $classRef) {
foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getMainFieldsClass'] as $classRef) {
$this->hookObjectsMainFields[] = t3lib_div::getUserObj($classRef);
}
}
$this->hookObjectsSingleField = array();
if (is_array ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass'])) {
if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass'])) {
foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass'] as $classRef) {
foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass'] as $classRef) {
$this->hookObjectsSingleField[] = t3lib_div::getUserObj($classRef);
}
}
......
*
* @return void
*/
function initDefaultBEmode() {
function initDefaultBEmode() {
global $BE_USER;
$this->prependFormFieldNames = 'data';
$this->formName = 'editform';
......
$this->edit_showFieldHelp = $BE_USER->uc['edit_showFieldHelp'];
$this->edit_docModuleUpload = $BE_USER->uc['edit_docModuleUpload'];
$this->titleLen = $BE_USER->uc['titleLen']; // @deprecated since TYPO3 4.1
$this->titleLen = $BE_USER->uc['titleLen']; // @deprecated since TYPO3 4.1
$this->inline->init($this);
$this->suggest->init($this);
}
/*******************************************************
*
* Rendering the forms, fields etc
......
* @return string HTML output
* @see getMainFields()
*/
function getSoloField($table,$row,$theFieldToReturn) {
function getSoloField($table, $row, $theFieldToReturn) {
global $TCA;
if ($TCA[$table]) {
if ($TCA[$table]) {
t3lib_div::loadTCA($table);
$typeNum = $this->getRTypeNum($table,$row);
$typeNum = $this->getRTypeNum($table, $row);
if ($TCA[$table]['types'][$typeNum]) {
if ($TCA[$table]['types'][$typeNum]) {
$itemList = $TCA[$table]['types'][$typeNum]['showitem'];
if ($itemList) {
if ($itemList) {
$fields = t3lib_div::trimExplode(',',$itemList,1);
$fields = t3lib_div::trimExplode(',', $itemList, 1);
$excludeElements = $this->excludeElements = $this->getExcludeElements($table,$row,$typeNum);
$excludeElements = $this->excludeElements = $this->getExcludeElements($table, $row, $typeNum);
foreach($fields as $fieldInfo) {
foreach ($fields as $fieldInfo) {
$parts = explode(';',$fieldInfo);
$parts = explode(';', $fieldInfo);
$theField = trim($parts[0]);
if (!in_array($theField,$excludeElements) && !strcmp($theField,$theFieldToReturn)) {
if (!in_array($theField, $excludeElements) && !strcmp($theField, $theFieldToReturn)) {
if ($TCA[$table]['columns'][$theField]) {
if ($TCA[$table]['columns'][$theField]) {
$sField = $this->getSingleField($table,$theField,$row,$parts[1],1,$parts[3],$parts[2]);
$sField = $this->getSingleField($table, $theField, $row, $parts[1], 1, $parts[3], $parts[2]);
return $sField['ITEM'];
}
}
......
* @return string HTML output
* @see getSoloField()
*/
function getMainFields($table,$row,$depth=0) {
function getMainFields($table, $row, $depth = 0) {
global $TCA, $TYPO3_CONF_VARS;
$this->renderDepth=$depth;
$this->renderDepth = $depth;
// Init vars:
$out_array = array(array());
$out_array_meta = array(array(
'title' => $this->getLL('l_generalTab')
));
'title' => $this->getLL('l_generalTab')
));
$out_pointer=0;
$out_pointer = 0;
$out_sheet=0;
$out_sheet = 0;
$this->palettesRendered=array();
$this->palettesRendered = array();
$this->palettesRendered[$this->renderDepth][$table]=array();
$this->palettesRendered[$this->renderDepth][$table] = array();
// Hook: getMainFields_preProcess (requested by Thomas Hempel for use with the "dynaflex" extension)
foreach ($this->hookObjectsMainFields as $hookObj) {
foreach ($this->hookObjectsMainFields as $hookObj) {
if (method_exists($hookObj,'getMainFields_preProcess')) {
if (method_exists($hookObj, 'getMainFields_preProcess')) {
$hookObj->getMainFields_preProcess($table,$row,$this);
$hookObj->getMainFields_preProcess($table, $row, $this);
}
}
if ($TCA[$table]) {
if ($TCA[$table]) {
// Load the full TCA for the table.
t3lib_div::loadTCA($table);
......
$dividers2tabs =& $TCA[$table]['ctrl']['dividers2tabs'];
// Load the description content for the table.
if ($this->edit_showFieldHelp || $this->doLoadTableDescr($table)) {
if ($this->edit_showFieldHelp || $this->doLoadTableDescr($table)) {
$GLOBALS['LANG']->loadSingleTableDescription($table);
}
// Get the current "type" value for the record.
$typeNum = $this->getRTypeNum($table,$row);
$typeNum = $this->getRTypeNum($table, $row);
// Find the list of fields to display:
if ($TCA[$table]['types'][$typeNum]) {
if ($TCA[$table]['types'][$typeNum]) {
$itemList = $TCA[$table]['types'][$typeNum]['showitem'];
if ($itemList) { // If such a list existed...
if ($itemList) { // If such a list existed...
// Explode the field list and possibly rearrange the order of the fields, if configured for
$fields = t3lib_div::trimExplode(',',$itemList,1);
$fields = t3lib_div::trimExplode(',', $itemList, 1);
if ($this->fieldOrder) {
if ($this->fieldOrder) {
$fields = $this->rearrange($fields);
}
// Get excluded fields, added fiels and put it together:
$excludeElements = $this->excludeElements = $this->getExcludeElements($table,$row,$typeNum);
$excludeElements = $this->excludeElements = $this->getExcludeElements($table, $row, $typeNum);
$fields = $this->mergeFieldsWithAddedFields($fields,$this->getFieldsToAdd($table,$row,$typeNum));
$fields = $this->mergeFieldsWithAddedFields($fields, $this->getFieldsToAdd($table, $row, $typeNum));
// If TCEforms will render a tab menu in the next step, push the name to the tab stack:
$tabIdentString = '';
$tabIdentStringMD5 = '';
if (strstr($itemList, '--div--') !== false && $this->enableTabMenu && $dividers2tabs) {
$tabIdentString = 'TCEforms:'.$table.':'.$row['uid'];
$tabIdentString = 'TCEforms:' . $table . ':' . $row['uid'];
$tabIdentStringMD5 = $GLOBALS['TBE_TEMPLATE']->getDynTabMenuId($tabIdentString);
// Remember that were currently working on the general tab:
if (isset($fields[0]) && strpos($fields[0], '--div--') !== 0) {
$this->pushToDynNestedStack('tab', $tabIdentStringMD5.'-1');
$this->pushToDynNestedStack('tab', $tabIdentStringMD5 . '-1');
}
}
// Traverse the fields to render:
$cc=0;
$cc = 0;
foreach($fields as $fieldInfo) {
foreach ($fields as $fieldInfo) {
// Exploding subparts of the field configuration:
$parts = explode(';',$fieldInfo);
$parts = explode(';', $fieldInfo);
// Getting the style information out:
$color_style_parts = t3lib_div::trimExplode('-',$parts[4]);
$color_style_parts = t3lib_div::trimExplode('-', $parts[4]);
if (strcmp($color_style_parts[0],'')) {
if (strcmp($color_style_parts[0], '')) {
$this->setColorScheme($GLOBALS['TBE_STYLES']['colorschemes'][intval($color_style_parts[0])]);
}
if (strcmp($color_style_parts[1],'')) {
if (strcmp($color_style_parts[1], '')) {
$this->fieldStyle = $GLOBALS['TBE_STYLES']['styleschemes'][intval($color_style_parts[1])];
if (!isset($this->fieldStyle)) $this->fieldStyle = $GLOBALS['TBE_STYLES']['styleschemes'][0];
if (!isset($this->fieldStyle)) {
$this->fieldStyle = $GLOBALS['TBE_STYLES']['styleschemes'][0];
}
}
}
if (strcmp($color_style_parts[2],'')) {
if (strcmp($color_style_parts[2], '')) {
$this->wrapBorder($out_array[$out_sheet],$out_pointer);
$this->wrapBorder($out_array[$out_sheet], $out_pointer);
$this->borderStyle = $GLOBALS['TBE_STYLES']['borderschemes'][intval($color_style_parts[2])];
if (!isset($this->borderStyle)) $this->borderStyle = $GLOBALS['TBE_STYLES']['borderschemes'][0];
if (!isset($this->borderStyle)) {
$this->borderStyle = $GLOBALS['TBE_STYLES']['borderschemes'][0];
}
}
}
// Render the field:
$theField = $parts[0];
if (!in_array($theField,$excludeElements)) {
if (!in_array($theField, $excludeElements)) {
if ($TCA[$table]['columns'][$theField]) {
if ($TCA[$table]['columns'][$theField]) {
$sFieldPal='';
$sFieldPal = '';
if ($parts[2] && !isset($this->palettesRendered[$this->renderDepth][$table][$parts[2]])) {
if ($parts[2] && !isset($this->palettesRendered[$this->renderDepth][$table][$parts[2]])) {
$sFieldPal=$this->getPaletteFields($table,$row,$parts[2]);
$sFieldPal = $this->getPaletteFields($table, $row, $parts[2]);
$this->palettesRendered[$this->renderDepth][$table][$parts[2]] = 1;
}
$sField = $this->getSingleField($table,$theField,$row,$parts[1],0,$parts[3],$parts[2]);
$sField = $this->getSingleField($table, $theField, $row, $parts[1], 0, $parts[3], $parts[2]);
if ($sField) { $sField.= $sFieldPal; }
if ($sField) {
$sField .= $sFieldPal;
}
$out_array[$out_sheet][$out_pointer].= $sField;
$out_array[$out_sheet][$out_pointer] .= $sField;
} elseif ($theField=='--div--') {
} elseif ($theField == '--div--') {
if ($cc>0) {
if ($cc > 0) {
$out_array[$out_sheet][$out_pointer].=$this->getDivider();
$out_array[$out_sheet][$out_pointer] .= $this->getDivider();
if ($this->enableTabMenu && $dividers2tabs) {
$this->wrapBorder($out_array[$out_sheet],$out_pointer);
$this->wrapBorder($out_array[$out_sheet], $out_pointer);
// Remove last tab entry from the dynNestedStack:
$out_sheet++;
// Remove the previous sheet from stack (if any):
$this->popFromDynNestedStack('tab', $tabIdentStringMD5.'-'.($out_sheet));
$this->popFromDynNestedStack('tab', $tabIdentStringMD5 . '-' . ($out_sheet));
// Remember on which sheet we're currently working:
$this->pushToDynNestedStack('tab', $tabIdentStringMD5.'-'.($out_sheet+1));
$this->pushToDynNestedStack('tab', $tabIdentStringMD5 . '-' . ($out_sheet + 1));
$out_array[$out_sheet] = array();
$out_array_meta[$out_sheet]['title'] = $this->sL($parts[1]);
// Register newline for Tab
$out_array_meta[$out_sheet]['newline'] = ($parts[2] == "newline");
// Register newline for Tab
$out_array_meta[$out_sheet]['newline'] = ($parts[2] == "newline");
}
} else { // Setting alternative title for "General" tab if "--div--" is the very first element.
} else { // Setting alternative title for "General" tab if "--div--" is the very first element.
$out_array_meta[$out_sheet]['title'] = $this->sL($parts[1]);
// Only add the first tab to the dynNestedStack if there are more tabs:
if ($tabIdentString && strpos($itemList, '--div--', strlen($fieldInfo))) {
$this->pushToDynNestedStack('tab', $tabIdentStringMD5.'-1');
$this->pushToDynNestedStack('tab', $tabIdentStringMD5 . '-1');
}
}
} elseif($theField=='--palette--') {
} elseif ($theField == '--palette--') {
if ($parts[2] && !isset($this->palettesRendered[$this->renderDepth][$table][$parts[2]])) {
if ($parts[2] && !isset($this->palettesRendered[$this->renderDepth][$table][$parts[2]])) {
// render a 'header' if not collapsed
if ($TCA[$table]['palettes'][$parts[2]]['canNotCollapse'] AND $parts[1]) {
$out_array[$out_sheet][$out_pointer].=$this->getPaletteFields($table,$row,$parts[2],$this->sL($parts[1]));
$out_array[$out_sheet][$out_pointer] .= $this->getPaletteFields($table, $row, $parts[2], $this->sL($parts[1]));
} else {
$out_array[$out_sheet][$out_pointer].=$this->getPaletteFields($table,$row,$parts[2],'','',$this->sL($parts[1]));
$out_array[$out_sheet][$out_pointer] .= $this->getPaletteFields($table, $row, $parts[2], '', '', $this->sL($parts[1]));
}
$this->palettesRendered[$this->renderDepth][$table][$parts[2]] = 1;
}
......
}
// Hook: getMainFields_postProcess (requested by Thomas Hempel for use with the "dynaflex" extension)
foreach ($this->hookObjectsMainFields as $hookObj) {
foreach ($this->hookObjectsMainFields as $hookObj) {
if (method_exists($hookObj,'getMainFields_postProcess')) {
if (method_exists($hookObj, 'getMainFields_postProcess')) {
$hookObj->getMainFields_postProcess($table,$row,$this);
$hookObj->getMainFields_postProcess($table, $row, $this);
}
}
// Wrapping a border around it all:
$this->wrapBorder($out_array[$out_sheet],$out_pointer);
$this->wrapBorder($out_array[$out_sheet], $out_pointer);
// Resetting styles:
$this->resetSchemes();
// Rendering Main palettes, if any
$mParr = t3lib_div::trimExplode(',',$TCA[$table]['ctrl']['mainpalette']);
$mParr = t3lib_div::trimExplode(',', $TCA[$table]['ctrl']['mainpalette']);
$i = 0;
if (count($mParr)) {
if (count($mParr)) {
foreach ($mParr as $mP) {
foreach ($mParr as $mP) {
if (!isset($this->palettesRendered[$this->renderDepth][$table][$mP])) {
if (!isset($this->palettesRendered[$this->renderDepth][$table][$mP])) {
$temp_palettesCollapsed=$this->palettesCollapsed;
$temp_palettesCollapsed = $this->palettesCollapsed;
$this->palettesCollapsed=0;
$this->palettesCollapsed = 0;
$label = ($i==0?$this->getLL('l_generalOptions'):$this->getLL('l_generalOptions_more'));
$label = ($i == 0 ? $this->getLL('l_generalOptions') : $this->getLL('l_generalOptions_more'));
$out_array[$out_sheet][$out_pointer].=$this->getPaletteFields($table,$row,$mP,$label);
$out_array[$out_sheet][$out_pointer] .= $this->getPaletteFields($table, $row, $mP, $label);
$this->palettesCollapsed=$temp_palettesCollapsed;
$this->palettesCollapsed = $temp_palettesCollapsed;
$this->palettesRendered[$this->renderDepth][$table][$mP] = 1;
}
$this->wrapBorder($out_array[$out_sheet],$out_pointer);
$this->wrapBorder($out_array[$out_sheet], $out_pointer);
$i++;
if ($this->renderDepth) {
if ($this->renderDepth) {
$this->renderDepth--;
}
}
}
// Return the imploded $out_array:
if ($out_sheet>0) { // There were --div-- dividers around...
if ($out_sheet > 0) { // There were --div-- dividers around...
// Create parts array for the tab menu:
$parts = array();
foreach ($out_array as $idx => $sheetContent) {
foreach ($out_array as $idx => $sheetContent) {
$content = implode('', $sheetContent);
if ($content) {
// Wrap content (row) with table-tag, otherwise tab/sheet will be disabled (see getdynTabMenu() )
// Wrap content (row) with table-tag, otherwise tab/sheet will be disabled (see getdynTabMenu() )
$content = '<table border="0" cellspacing="0" cellpadding="0" width="100%">'.$content.'</table>';
$content = '<table border="0" cellspacing="0" cellpadding="0" width="100%">' . $content . '</table>';
}
$parts[$idx] = array(
'label' => $out_array_meta[$idx]['title'],
'content' => $content,
'newline' => $out_array_meta[$idx]['newline'], // Newline for this tab/sheet
'newline' => $out_array_meta[$idx]['newline'], // Newline for this tab/sheet
);
}
if (count($parts) > 1) {
// Unset the current level of tab menus:
$this->popFromDynNestedStack('tab', $tabIdentStringMD5.'-'.($out_sheet+1));
$this->popFromDynNestedStack('tab', $tabIdentStringMD5 . '-' . ($out_sheet + 1));
$dividersToTabsBehaviour = (isset($TCA[$table]['ctrl']['dividers2tabs']) ? $TCA[$table]['ctrl']['dividers2tabs'] : 1);
$output = $this->getDynTabMenu($parts, $tabIdentString, $dividersToTabsBehaviour);
......
$output = '
<tr>
<td colspan="2">
'.$output.'
' . $output . '
</td>
</tr>';
} else {
// Only one, so just implode:
$output = implode('',$out_array[$out_sheet]);
$output = implode('', $out_array[$out_sheet]);
}
return $output;
......
* @param string Commalist of fields from the table. These will be shown in the specified order in a form.
* @return string TCEform elements in a string.
*/
function getListedFields($table,$row,$list) {
function getListedFields($table, $row, $list) {
global $TCA;
t3lib_div::loadTCA($table);
if ($this->edit_showFieldHelp || $this->doLoadTableDescr($table)) {
if ($this->edit_showFieldHelp || $this->doLoadTableDescr($table)) {
$GLOBALS['LANG']->loadSingleTableDescription($table);
}
$out = '';
$types_fieldConfig = t3lib_BEfunc::getTCAtypes($table,$row,1);
$types_fieldConfig = t3lib_BEfunc::getTCAtypes($table, $row, 1);
$editFieldList=array_unique(t3lib_div::trimExplode(',',$list,1));
$editFieldList = array_unique(t3lib_div::trimExplode(',', $list, 1));
foreach($editFieldList as $theFieldC) {
foreach ($editFieldList as $theFieldC) {
list($theField,$palFields) = preg_split('/\[|\]/', $theFieldC);
list($theField, $palFields) = preg_split('/\[|\]/', $theFieldC);
$theField = trim($theField);
$palFields = trim($palFields);
if ($TCA[$table]['columns'][$theField]) {
if ($TCA[$table]['columns'][$theField]) {
$parts = t3lib_div::trimExplode(';',$types_fieldConfig[$theField]['origString']);
$parts = t3lib_div::trimExplode(';', $types_fieldConfig[$theField]['origString']);
$sField = $this->getSingleField($table,$theField,$row,$parts[1],0,$parts[3],0); // Don't sent palette pointer - there are no options anyways for a field-list.
$sField = $this->getSingleField($table, $theField, $row, $parts[1], 0, $parts[3], 0); // Don't sent palette pointer - there are no options anyways for a field-list.
$out.= $sField;
$out .= $sField;
} elseif($theField=='--div--') {
} elseif ($theField == '--div--') {
$out.= $this->getDivider();
$out .= $this->getDivider();
}
if ($palFields) {
if ($palFields) {
$out.= $this->getPaletteFields($table,$row,'','',implode(',',t3lib_div::trimExplode('|',$palFields,1)));
$out .= $this->getPaletteFields($table, $row, '', '', implode(',', t3lib_div::trimExplode('|', $palFields, 1)));
}
}
......
* @param string Optional Link text for activating a palette (when palettes does not have another form element to belong to).
* @return string HTML code.
*/
function getPaletteFields($table,$row,$palette,$header='',$itemList='',$collapsedHeader=NULL) {
function getPaletteFields($table, $row, $palette, $header = '', $itemList = '', $collapsedHeader = NULL) {
if (!$this->doPrintPalette) {
if (!$this->doPrintPalette) {
return '';
}
......
if ($header) {
$out .= $this->intoTemplate(
array('HEADER' => htmlspecialchars($header)),
$this->palFieldTemplateHeader
);
array('HEADER' => htmlspecialchars($header)),
$this->palFieldTemplateHeader
);
}
$collapsed = $this->isPalettesCollapsed($table, $palette);
......
$thePalIcon = '<span style="margin-left: 20px;">' . $thePalIcon . $collapsedHeader . '</span>';
}
$paletteHtml = $this->wrapPaletteField($this->printPalette($parts), $table, $row ,$palette, $collapsed);
$paletteHtml = $this->wrapPaletteField($this->printPalette($parts), $table, $row, $palette, $collapsed);
$out .= $this->intoTemplate(
array('PALETTE' => $thePalIcon . $paletteHtml),
$this->palFieldTemplate
);
array('PALETTE' => $thePalIcon . $paletteHtml),
$this->palFieldTemplate
);
}
}
return $out;
......
* @param integer The palette pointer.
* @return mixed String (normal) or array (palettes)
*/
function getSingleField($table,$field,$row,$altName='',$palette=0,$extra='',$pal=0) {
function getSingleField($table, $field, $row, $altName = '', $palette = 0, $extra = '', $pal = 0) {
global $TCA,$BE_USER;
global $TCA, $BE_USER;
// Hook: getSingleField_preProcess
foreach ($this->hookObjectsSingleField as $hookObj) {
foreach ($this->hookObjectsSingleField as $hookObj) {
if (method_exists($hookObj,'getSingleField_preProcess')) {
if (method_exists($hookObj, 'getSingleField_preProcess')) {
$hookObj->getSingleField_preProcess($table, $field, $row, $altName, $palette, $extra, $pal, $this);
}
}
......
// Get the TCA configuration for the current field:
$PA['fieldConf'] = $TCA[$table]['columns'][$field];
$PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ? $PA['fieldConf']['config']['form_type'] : $PA['fieldConf']['config']['type']; // Using "form_type" locally in this script
$PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ? $PA['fieldConf']['config']['form_type'] : $PA['fieldConf']['config']['type']; // Using "form_type" locally in this script
$skipThisField = $this->inline->skipField($table, $field, $row, $PA['fieldConf']['config']);
// Now, check if this field is configured and editable (according to excludefields + other configuration)
if ( is_array($PA['fieldConf']) &&
if (is_array($PA['fieldConf']) &&
!$skipThisField &&
!$skipThisField &&
(!$PA['fieldConf']['exclude'] || $BE_USER->check('non_exclude_fields',$table.':'.$field)) &&
(!$PA['fieldConf']['exclude'] || $BE_USER->check('non_exclude_fields', $table . ':' . $field)) &&
$PA['fieldConf']['config']['form_type']!='passthrough' &&
$PA['fieldConf']['config']['form_type'] != 'passthrough' &&
($this->RTEenabled || !$PA['fieldConf']['config']['showIfRTE']) &&
($this->RTEenabled || !$PA['fieldConf']['config']['showIfRTE']) &&
(!$PA['fieldConf']['displayCond'] || $this->isDisplayCondition($PA['fieldConf']['displayCond'],$row)) &&
(!$PA['fieldConf']['displayCond'] || $this->isDisplayCondition($PA['fieldConf']['displayCond'], $row)) &&
(!$TCA[$table]['ctrl']['languageField'] || $PA['fieldConf']['l10n_display'] || strcmp($PA['fieldConf']['l10n_mode'],'exclude') || $row[$TCA[$table]['ctrl']['languageField']]<=0) &&
(!$TCA[$table]['ctrl']['languageField'] || $PA['fieldConf']['l10n_display'] || strcmp($PA['fieldConf']['l10n_mode'], 'exclude') || $row[$TCA[$table]['ctrl']['languageField']] <= 0) &&
(!$TCA[$table]['ctrl']['languageField'] || !$this->localizationMode || $this->localizationMode===$PA['fieldConf']['l10n_cat'])
(!$TCA[$table]['ctrl']['languageField'] || !$this->localizationMode || $this->localizationMode === $PA['fieldConf']['l10n_cat'])
) {
) {
// Fetching the TSconfig for the current table/field. This includes the $row which means that
$PA['fieldTSConfig'] = $this->setTSconfig($table,$row,$field);
$PA['fieldTSConfig'] = $this->setTSconfig($table, $row, $field);
// If the field is NOT disabled from TSconfig (which it could have been) then render it
if (!$PA['fieldTSConfig']['disabled']) {
if (!$PA['fieldTSConfig']['disabled']) {
// Override fieldConf by fieldTSconfig:
$PA['fieldConf']['config'] = $this->overrideFieldConf($PA['fieldConf']['config'], $PA['fieldTSConfig']);
// Init variables:
$PA['itemFormElName']=$this->prependFormFieldNames.'['.$table.']['.$row['uid'].']['.$field.']'; // Form field name
$PA['itemFormElName'] = $this->prependFormFieldNames . '[' . $table . '][' . $row['uid'] . '][' . $field . ']'; // Form field name
$PA['itemFormElName_file']=$this->prependFormFieldNames_file.'['.$table.']['.$row['uid'].']['.$field.']'; // Form field name, in case of file uploads
$PA['itemFormElName_file'] = $this->prependFormFieldNames_file . '[' . $table . '][' . $row['uid'] . '][' . $field . ']'; // Form field name, in case of file uploads
$PA['itemFormElValue']=$row[$field]; // The value to show in the form field.
$PA['itemFormElValue'] = $row[$field]; // The value to show in the form field.
$PA['itemFormElID']=$this->prependFormFieldNames.'_'.$table.'_'.$row['uid'].'_'.$field;
$PA['itemFormElID'] = $this->prependFormFieldNames . '_' . $table . '_' . $row['uid'] . '_' . $field;
// set field to read-only if configured for translated records to show default language content as readonly
if ($PA['fieldConf']['l10n_display'] && t3lib_div::inList($PA['fieldConf']['l10n_display'], 'defaultAsReadonly') && $row[$TCA[$table]['ctrl']['languageField']] > 0) {
$PA['fieldConf']['config']['readOnly'] = true;
$PA['fieldConf']['config']['readOnly'] = true;
$PA['itemFormElValue'] = $this->defaultLanguageData[$table.':'.$row['uid']][$field];
$PA['itemFormElValue'] = $this->defaultLanguageData[$table . ':' . $row['uid']][$field];
}
// Create a JavaScript code line which will ask the user to save/update the form due to changing the element. This is used for eg. "type" fields and others configured with "requestUpdate"
if (
($TCA[$table]['ctrl']['type'] && !strcmp($field,$TCA[$table]['ctrl']['type'])) ||
($TCA[$table]['ctrl']['type'] && !strcmp($field, $TCA[$table]['ctrl']['type'])) ||
($TCA[$table]['ctrl']['requestUpdate'] && t3lib_div::inList($TCA[$table]['ctrl']['requestUpdate'],$field))) {
($TCA[$table]['ctrl']['requestUpdate'] && t3lib_div::inList($TCA[$table]['ctrl']['requestUpdate'], $field))) {
if($GLOBALS['BE_USER']->jsConfirmation(1)) {
if ($GLOBALS['BE_USER']->jsConfirmation(1)) {
$alertMsgOnChange = 'if (confirm(TBE_EDITOR.labels.onChangeAlert) && TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';
} else {
$alertMsgOnChange = 'if (TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';
......
}
// Render as a hidden field?
if (in_array($field,$this->hiddenFieldListArr)) {
if (in_array($field, $this->hiddenFieldListArr)) {
$this->hiddenFieldAccum[]='<input type="hidden" name="'.$PA['itemFormElName'].'" value="'.htmlspecialchars($PA['itemFormElValue']).'" />';
$this->hiddenFieldAccum[] = '<input type="hidden" name="' . $PA['itemFormElName'] . '" value="' . htmlspecialchars($PA['itemFormElValue']) . '" />';
} else { // Render as a normal field:
} else { // Render as a normal field:
// If the field is NOT a palette field, then we might create an icon which links to a palette for the field, if one exists.
if (!$PA['palette']) {
if (!$PA['palette']) {
$paletteFields = $this->loadPaletteElements($table, $row, $PA['pal']);
if ($PA['pal'] && $this->isPalettesCollapsed($table,$PA['pal']) && count($paletteFields)) {
if ($PA['pal'] && $this->isPalettesCollapsed($table, $PA['pal']) && count($paletteFields)) {
list($thePalIcon,$palJSfunc) = $this->wrapOpenPalette(t3lib_iconWorks::getSpriteIcon('actions-system-options-view', array('title' => htmlspecialchars($this->getLL('l_moreOptions')))),$table,$row,$PA['pal'],1);
list($thePalIcon, $palJSfunc) = $this->wrapOpenPalette(t3lib_iconWorks::getSpriteIcon('actions-system-options-view', array('title' => htmlspecialchars($this->getLL('l_moreOptions')))), $table, $row, $PA['pal'], 1);
} else {
$thePalIcon = '';
$palJSfunc = '';
}
}
// onFocus attribute to add to the field:
$PA['onFocus'] = ($palJSfunc && !$BE_USER->uc['dontShowPalettesOnFocusInAB']) ? ' onfocus="'.htmlspecialchars($palJSfunc).'"' : '';
$PA['onFocus'] = ($palJSfunc && !$BE_USER->uc['dontShowPalettesOnFocusInAB']) ? ' onfocus="' . htmlspecialchars($palJSfunc) . '"' : '';
// Find item
$item='';
$item = '';
$PA['label'] = ($PA['altName'] ? $PA['altName'] : $PA['fieldConf']['label']);
$PA['label'] = ($PA['fieldTSConfig']['label'] ? $PA['fieldTSConfig']['label'] : $PA['label']);
$PA['label'] = ($PA['fieldTSConfig']['label.'][$GLOBALS['LANG']->lang] ? $PA['fieldTSConfig']['label.'][$GLOBALS['LANG']->lang] : $PA['label']);
$PA['label'] = $this->sL($PA['label']);
// JavaScript code for event handlers:
$PA['fieldChangeFunc']=array();
$PA['fieldChangeFunc'] = array();
$PA['fieldChangeFunc']['TBE_EDITOR_fieldChanged'] = "TBE_EDITOR.fieldChanged('".$table."','".$row['uid']."','".$field."','".$PA['itemFormElName']."');";
$PA['fieldChangeFunc']['TBE_EDITOR_fieldChanged'] = "TBE_EDITOR.fieldChanged('" . $table . "','" . $row['uid'] . "','" . $field . "','" . $PA['itemFormElName'] . "');";
$PA['fieldChangeFunc']['alert']=$alertMsgOnChange;
$PA['fieldChangeFunc']['alert'] = $alertMsgOnChange;
// if this is the child of an inline type and it is the field creating the label
if ($this->inline->isInlineChildAndLabelField($table, $field)) {
$inlineObjectId = implode(
t3lib_TCEforms_inline::Structure_Separator,
array(
$this->inline->inlineNames['object'],
$table,
$row['uid']
$this->inline->inlineNames['object'],
$table,
$row['uid']
)
);
$PA['fieldChangeFunc']['inline'] = "inline.handleChangedField('" . $PA['itemFormElName'] . "','" . $inlineObjectId . "');";
}
// Based on the type of the item, call a render function:
$item = $this->getSingleField_SW($table,$field,$row,$PA);
$item = $this->getSingleField_SW($table, $field, $row, $PA);
// Add language + diff
if ($PA['fieldConf']['l10n_display'] && (t3lib_div::inList($PA['fieldConf']['l10n_display'], 'hideDiff') || t3lib_div::inList($PA['fieldConf']['l10n_display'], 'defaultAsReadonly'))) {
......
}
if ($renderLanguageDiff) {
$item = $this->renderDefaultLanguageContent($table,$field,$row,$item);
$item = $this->renderDefaultLanguageContent($table, $field, $row, $item);
$item = $this->renderDefaultLanguageDiff($table,$field,$row,$item);
$item = $this->renderDefaultLanguageDiff($table, $field, $row, $item);
}
// If the record has been saved and the "linkTitleToSelf" is set, we make the field name into a link, which will load ONLY this field in alt_doc.php
$label = t3lib_div::deHSCentities(htmlspecialchars($PA['label']));
if (t3lib_div::testInt($row['uid']) && $PA['fieldTSConfig']['linkTitleToSelf'] && !t3lib_div::_GP('columnsOnly')) {
if (t3lib_div::testInt($row['uid']) && $PA['fieldTSConfig']['linkTitleToSelf'] && !t3lib_div::_GP('columnsOnly')) {
$lTTS_url = $this->backPath.'alt_doc.php?edit['.$table.']['.$row['uid'].']=edit&columnsOnly='.$field.'&returnUrl='.rawurlencode($this->thisReturnUrl());
$lTTS_url = $this->backPath . 'alt_doc.php?edit[' . $table . '][' . $row['uid'] . ']=edit&columnsOnly=' . $field . '&returnUrl=' . rawurlencode($this->thisReturnUrl());
$label = '<a href="' . htmlspecialchars($lTTS_url) . '">' . $label . '</a>';
}
......
$PA['label'] = $label = t3lib_BEfunc::wrapInHelp($table, $field, $label);
// Create output value:
if ($PA['fieldConf']['config']['form_type']=='user' && $PA['fieldConf']['config']['noTableWrapping']) {
if ($PA['fieldConf']['config']['form_type'] == 'user' && $PA['fieldConf']['config']['noTableWrapping']) {
$out = $item;
} elseif ($PA['palette']) {
} elseif ($PA['palette']) {
// Array:
$out=array(
$out = array(
'NAME' => $label,
'ID'=>$row['uid'],
'ID' => $row['uid'],
'FIELD'=>$field,
'FIELD' => $field,
'TABLE'=>$table,
'TABLE' => $table,
'ITEM'=>$item
'ITEM' => $item
);
$out = $this->addUserTemplateMarkers($out,$table,$field,$row,$PA);
$out = $this->addUserTemplateMarkers($out, $table, $field, $row, $PA);
} else {
// String:
$out=array(
$out = array(
'NAME'=>$label,
'NAME' => $label,
'ITEM'=>$item,
'ITEM' => $item,
'TABLE'=>$table,
'TABLE' => $table,
'ID'=>$row['uid'],
'ID' => $row['uid'],
'PAL_LINK_ICON'=>$thePalIcon,
'PAL_LINK_ICON' => $thePalIcon,
'FIELD'=>$field
'FIELD' => $field
);
$out = $this->addUserTemplateMarkers($out,$table,$field,$row,$PA);
$out = $this->addUserTemplateMarkers($out, $table, $field, $row, $PA);
// String:
$out=$this->intoTemplate($out);
$out = $this->intoTemplate($out);
}
}
} else $this->commentMessages[]=$this->prependFormFieldNames.'['.$table.']['.$row['uid'].']['.$field.']: Disabled by TSconfig';
} else {
$this->commentMessages[] = $this->prependFormFieldNames . '[' . $table . '][' . $row['uid'] . '][' . $field . ']: Disabled by TSconfig';
}
}
}
// Hook: getSingleField_postProcess
foreach ($this->hookObjectsSingleField as $hookObj) {
foreach ($this->hookObjectsSingleField as $hookObj) {
if (method_exists($hookObj,'getSingleField_postProcess')) {
if (method_exists($hookObj, 'getSingleField_postProcess')) {
$hookObj->getSingleField_postProcess($table, $field, $row, $out, $PA, $this);
}
}
......
* @access private
* @see getSingleField(), getSingleField_typeFlex_draw()
*/
function getSingleField_SW($table,$field,$row,&$PA) {
function getSingleField_SW($table, $field, $row, &$PA) {
$PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ? $PA['fieldConf']['config']['form_type'] : $PA['fieldConf']['config']['type']; // Using "form_type" locally in this script
$PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ? $PA['fieldConf']['config']['form_type'] : $PA['fieldConf']['config']['type']; // Using "form_type" locally in this script
// Hook: getSingleField_beforeRender
// Hook: getSingleField_beforeRender
foreach ($this->hookObjectsSingleField as $hookObject) {
if (method_exists($hookObject, 'getSingleField_beforeRender')) {
$hookObject->getSingleField_beforeRender($table, $field, $row, $PA);
}
}
switch($PA['fieldConf']['config']['form_type']) {
switch ($PA['fieldConf']['config']['form_type']) {
case 'input':
$item = $this->getSingleField_typeInput($table,$field,$row,$PA);
$item = $this->getSingleField_typeInput($table, $field, $row, $PA);
break;
case 'text':
$item = $this->getSingleField_typeText($table,$field,$row,$PA);
$item = $this->getSingleField_typeText($table, $field, $row, $PA);
break;
case 'check':
$item = $this->getSingleField_typeCheck($table,$field,$row,$PA);
$item = $this->getSingleField_typeCheck($table, $field, $row, $PA);
break;
case 'radio':
$item = $this->getSingleField_typeRadio($table,$field,$row,$PA);
$item = $this->getSingleField_typeRadio($table, $field, $row, $PA);
break;
case 'select':
$item = $this->getSingleField_typeSelect($table,$field,$row,$PA);
$item = $this->getSingleField_typeSelect($table, $field, $row, $PA);
break;
case 'group':
$item = $this->getSingleField_typeGroup($table,$field,$row,$PA);
$item = $this->getSingleField_typeGroup($table, $field, $row, $PA);
break;
case 'inline':
$item = $this->inline->getSingleField_typeInline($table,$field,$row,$PA);
$item = $this->inline->getSingleField_typeInline($table, $field, $row, $PA);
break;
case 'none':
$item = $this->getSingleField_typeNone($table,$field,$row,$PA);
$item = $this->getSingleField_typeNone($table, $field, $row, $PA);
break;
case 'user':
$item = $this->getSingleField_typeUser($table,$field,$row,$PA);
$item = $this->getSingleField_typeUser($table, $field, $row, $PA);
break;
case 'flex':
$item = $this->getSingleField_typeFlex($table,$field,$row,$PA);
$item = $this->getSingleField_typeFlex($table, $field, $row, $PA);
break;
default:
$item = $this->getSingleField_typeUnknown($table,$field,$row,$PA);
$item = $this->getSingleField_typeUnknown($table, $field, $row, $PA);
break;
}
......
}
/**********************************************************
*
* Rendering of each TCEform field type
......
* @param array An array with additional configuration options.
* @return string The HTML code for the TCEform field
*/
function getSingleField_typeInput($table,$field,$row,&$PA) {
function getSingleField_typeInput($table, $field, $row, &$PA) {
$config = $PA['fieldConf']['config'];
$specConf = $this->getSpecConfFromString($PA['extra'], $PA['fieldConf']['defaultExtras']);
$size = t3lib_div::intInRange($config['size']?$config['size']:30,5,$this->maxInputWidth);
$size = t3lib_div::intInRange($config['size'] ? $config['size'] : 30, 5, $this->maxInputWidth);
$evalList = t3lib_div::trimExplode(',',$config['eval'],1);
$evalList = t3lib_div::trimExplode(',', $config['eval'], 1);
$classAndStyleAttributes = $this->formWidthAsArray($size);
$fieldAppendix = '';
$cssClasses = array($classAndStyleAttributes['class']);
$cssClasses = array($classAndStyleAttributes['class']);
$cssStyle = $classAndStyleAttributes['style'];
$cssStyle = $classAndStyleAttributes['style'];
if(in_array('date', $evalList) || in_array('datetime', $evalList)) {
if (in_array('date', $evalList) || in_array('datetime', $evalList)) {
if(in_array('datetime', $evalList)) {
if (in_array('datetime', $evalList)) {
$class = 'datetime';
} else {
$class = 'date';
......
$fieldAppendix = t3lib_iconWorks::getSpriteIcon(
'actions-edit-pick-date',
array(
'style' => 'cursor:pointer;',
'id' => 'picker-' . $inputId
'style' => 'cursor:pointer;',
'id' => 'picker-' . $inputId
)
);
} elseif (in_array('timesec', $evalList)) {
......
$cssClasses[] = 'tceforms-textfield tceforms-colorfield';
}
if($this->renderReadonly || $config['readOnly']) {
if ($this->renderReadonly || $config['readOnly']) {
$itemFormElValue = $PA['itemFormElValue'];
if (in_array('date',$evalList)) {
if (in_array('date', $evalList)) {
$config['format'] = 'date';
} elseif (in_array('datetime',$evalList)) {
} elseif (in_array('datetime', $evalList)) {
$config['format'] = 'datetime';
} elseif (in_array('time',$evalList)) {
} elseif (in_array('time', $evalList)) {
$config['format'] = 'time';
}
if (in_array('password',$evalList)) {
if (in_array('password', $evalList)) {
$itemFormElValue = $itemFormElValue ? '*********' : '';
}
return $this->getSingleField_typeNone_render($config, $itemFormElValue);
......
foreach ($evalList as $func) {
switch ($func) {
case 'required':
$this->registerRequiredProperty('field', $table.'_'.$row['uid'].'_'.$field, $PA['itemFormElName']);
$this->registerRequiredProperty('field', $table . '_' . $row['uid'] . '_' . $field, $PA['itemFormElName']);
// Mark this field for date/time disposal:
if (array_intersect($evalList, array('date', 'datetime', 'time'))) {
$this->requiredAdditional[$PA['itemFormElName']]['isPositiveNumber'] = true;
$this->requiredAdditional[$PA['itemFormElName']]['isPositiveNumber'] = true;
}
break;
break;
default:
if (substr($func, 0, 3) == 'tx_') {
if (substr($func, 0, 3) == 'tx_') {
// Pair hook to the one in t3lib_TCEmain::checkValue_input_Eval()
// Pair hook to the one in t3lib_TCEmain::checkValue_input_Eval()
$evalObj = t3lib_div::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$func].':&'.$func);
$evalObj = t3lib_div::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$func] . ':&' . $func);
if (is_object($evalObj) && method_exists($evalObj, 'deevaluateFieldValue')) {
if (is_object($evalObj) && method_exists($evalObj, 'deevaluateFieldValue')) {
$_params = array(
'value' => $PA['itemFormElValue']
);
$PA['itemFormElValue'] = $evalObj->deevaluateFieldValue($_params);
}
}
break;
break;
}
}
$paramsList = "'" . $PA['itemFormElName'] . "','" . implode(',', $evalList) . "','" . trim($config['is_in']) . "'," . (isset($config['checkbox']) ? 1 : 0) . ",'" . $config['checkbox'] . "'";
if ((in_array('date', $evalList) || in_array('datetime', $evalList))) {
$item .= '<span class="t3-tceforms-input-wrapper-datetime" onmouseOver="if (document.getElementById(\'' .
$inputId . '\').value) {this.className=\'t3-tceforms-input-wrapper-datetime-hover\';} else {this.className=\'t3-tceforms-input-wrapper-datetime\';};" onmouseOut="this.className=\'t3-tceforms-input-wrapper-datetime\';">';
$inputId . '\').value) {this.className=\'t3-tceforms-input-wrapper-datetime-hover\';} else {this.className=\'t3-tceforms-input-wrapper-datetime\';};" onmouseOut="this.className=\'t3-tceforms-input-wrapper-datetime\';">';
// Add server timezone offset to UTC to our stored date
if ($PA['itemFormElValue'] > 0) {
......
}
} else {
$item .= '<span class="t3-tceforms-input-wrapper" onmouseOver="if (document.getElementById(\'' . $inputId .
'\').value) {this.className=\'t3-tceforms-input-wrapper-hover\';} else {this.className=\'t3-tceforms-input-wrapper\';};" onmouseOut="this.className=\'t3-tceforms-input-wrapper\';">';
'\').value) {this.className=\'t3-tceforms-input-wrapper-hover\';} else {this.className=\'t3-tceforms-input-wrapper\';};" onmouseOut="this.className=\'t3-tceforms-input-wrapper\';">';
}
$PA['fieldChangeFunc'] = array_merge(
......
$iOnChange = implode('', $PA['fieldChangeFunc']);
$item .= '<input type="text" id="' . $inputId .
'" class="' . implode(' ', $cssClasses) . '" name="' . $PA['itemFormElName'] .
'_hr" value="" style="' . $cssStyle . '" maxlength="' . $mLgd . '" onchange="' .
htmlspecialchars($iOnChange) . '"' . $PA['onFocus'] . ' />'; // This is the EDITABLE form field.
'" class="' . implode(' ', $cssClasses) . '" name="' . $PA['itemFormElName'] .
'_hr" value="" style="' . $cssStyle . '" maxlength="' . $mLgd . '" onchange="' .
htmlspecialchars($iOnChange) . '"' . $PA['onFocus'] . ' />'; // This is the EDITABLE form field.
$item .= '<input type="hidden" name="' . $PA['itemFormElName'] . '" value="' .
htmlspecialchars($PA['itemFormElValue']) . '" />'; // This is the ACTUAL form field - values from the EDITABLE field must be transferred to this field which is the one that is written to the database.
htmlspecialchars($PA['itemFormElValue']) . '" />'; // This is the ACTUAL form field - values from the EDITABLE field must be transferred to this field which is the one that is written to the database.
$item .= $fieldAppendix . '</span><div style="clear:both;"></div>';
$this->extJSCODE .= 'typo3form.fieldSet(' . $paramsList . ');';
// going through all custom evaluations configured for this field
foreach ($evalList as $evalData) {
if (substr($evalData, 0, 3) == 'tx_') {
if (substr($evalData, 0, 3) == 'tx_') {
$evalObj = t3lib_div::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$evalData].':&'.$evalData);
$evalObj = t3lib_div::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$evalData] . ':&' . $evalData);
if(is_object($evalObj) && method_exists($evalObj, 'returnFieldJS')) {
if (is_object($evalObj) && method_exists($evalObj, 'returnFieldJS')) {
$this->extJSCODE .= "\n\nfunction ".$evalData."(value) {\n".$evalObj->returnFieldJS()."\n}\n";
$this->extJSCODE .= "\n\nfunction " . $evalData . "(value) {\n" . $evalObj->returnFieldJS() . "\n}\n";
}
}
}
// Creating an alternative item without the JavaScript handlers.
... This diff was truncated because it exceeds the maximum size that can be displayed.
(60-60/93)