*
* @author Kasper Skårhøj <kasperYYYY@typo3.com>
*/
-/**
- * [CLASS/FUNCTION INDEX of SCRIPT]
- *
- *
- *
- * 196: class t3lib_TCEforms
- * 302: function t3lib_TCEforms()
- * 338: function initDefaultBEmode()
- *
- * SECTION: Rendering the forms, fields etc
- * 385: function getSoloField($table,$row,$theFieldToReturn)
- * 424: function getMainFields($table,$row,$depth=0)
- * 618: function getListedFields($table,$row,$list)
- * 660: function getPaletteFields($table,$row,$palette,$header='',$itemList='',$collapsedHeader='')
- * 737: function getSingleField($table,$field,$row,$altName='',$palette=0,$extra='',$pal=0)
- * 900: function getSingleField_SW($table,$field,$row,&$PA)
- *
- * SECTION: Rendering of each TCEform field type
- * 976: function getSingleField_typeInput($table,$field,$row,&$PA)
- * 1057: function getSingleField_typeText($table,$field,$row,&$PA)
- * 1178: function getSingleField_typeCheck($table,$field,$row,&$PA)
- * 1244: function getSingleField_typeRadio($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)
- * 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)
- * 1719: function getSingleField_typeSelect_multiple($table,$field,$row,&$PA,$config,$selItems,$nMV_label)
- * 1823: function getSingleField_typeGroup($table,$field,$row,&$PA)
- * 1992: function getSingleField_typeNone($table,$field,$row,&$PA)
- * 2008: function getSingleField_typeNone_render($config,$itemValue)
- * 2070: function getSingleField_typeFlex($table,$field,$row,&$PA)
- * 2205: function getSingleField_typeFlex_langMenu($languages,$elName,$selectedLanguage,$multi=1)
- * 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())
- * 2452: function getSingleField_typeUnknown($table,$field,$row,&$PA)
- * 2467: function getSingleField_typeUser($table,$field,$row,&$PA)
- *
- * SECTION: Field content processing
- * 2496: function formatValue ($config, $itemValue)
- *
- * SECTION: "Configuration" fetching/processing functions
- * 2588: function getRTypeNum($table,$row)
- * 2614: function rearrange($fields)
- * 2640: function getExcludeElements($table,$row,$typeNum)
- * 2688: function getFieldsToAdd($table,$row,$typeNum)
- * 2713: function mergeFieldsWithAddedFields($fields,$fieldsToAdd)
- * 2745: function setTSconfig($table,$row,$field='')
- * 2767: function getSpecConfForField($table,$row,$field)
- * 2788: function getSpecConfFromString($extraString, $defaultExtras)
- * 3007: function loadPaletteElements($table, $row, $palette, $itemList='')
- *
- * SECTION: Display of localized content etc.
- * 2816: function registerDefaultLanguageData($table,$rec)
- * 2848: function getLanguageOverlayRawValue($table, $row, $field, $fieldConf)
- * 2876: function renderDefaultLanguageContent($table,$field,$row,$item)
- * 2899: function renderDefaultLanguageDiff($table,$field,$row,$item)
- *
- * SECTION: Form element helper functions
- * 2955: function dbFileIcons($fName,$mode,$allowed,$itemArray,$selector='',$params=array(),$onFocus='')
- * 3108: function getClipboardElements($allowed,$mode)
- * 3157: function getClickMenu($str,$table,$uid='')
- * 3178: function renderWizards($itemKinds,$wizConf,$table,$row,$field,&$PA,$itemName,$specConf,$RTE=0)
- * 3382: function getIcon($icon)
- * 3409: function optionTagStyle($iconString)
- * 3425: function extractValuesOnlyFromValueLabelList($itemFormElValue)
- * 3447: function wrapOpenPalette($header,$table,$row,$palette,$retFunc=0)
- * 3471: function checkBoxParams($itemName,$thisValue,$c,$iCount,$addFunc='')
- * 3485: function elName($itemName)
- * 3496: function noTitle($str,$wrapParts=array())
- * 3505: function blur()
- * 3514: function thisReturnUrl()
- * 3527: function getSingleHiddenField($table,$field,$row)
- * 3549: function formWidth($size=48,$textarea=0)
- * 3576: function formWidthText($size=48,$wrap='')
- * 3592: function formElStyle($type)
- * 3603: function formElClass($type)
- * 3614: function formElStyleClassValue($type, $class=FALSE)
- * 3638: function insertDefStyle($type)
- * 3657: function getDynTabMenu($parts, $idString)
- *
- * SECTION: Item-array manipulation functions (check/select/radio)
- * 3696: function initItemArray($fieldValue)
- * 3714: function addItems($items,$iArray)
- * 3736: function procItems($items,$iArray,$config,$table,$row,$field)
- * 3760: function addSelectOptionsToItemArray($items,$fieldValue,$TSconfig,$field)
- * 3980: function addSelectOptionsToItemArray_makeModuleData($value)
- * 4002: function foreignTable($items,$fieldValue,$TSconfig,$field,$pFFlag=0)
- *
- * SECTION: Template functions
- * 4083: function setNewBEDesign()
- * 4138: function intoTemplate($inArr,$altTemplate='')
- * 4162: function addUserTemplateMarkers($marker,$table,$field,$row,&$PA)
- * 4173: function wrapLabels($str)
- * 4186: function wrapTotal($c,$rec,$table)
- * 4199: function replaceTableWrap($arr,$rec,$table)
- * 4236: function wrapBorder(&$out_array,&$out_pointer)
- * 4258: function rplColorScheme($inTemplate)
- * 4278: function getDivider()
- * 4288: function printPalette($palArr)
- * 4339: function helpTextIcon($table,$field,$force=0)
- * 4359: function helpText($table,$field)
- * 4380: function setColorScheme($scheme)
- * 4404: function resetSchemes()
- * 4415: function storeSchemes()
- * 4427: function restoreSchemes()
- *
- * SECTION: JavaScript related functions
- * 4457: function JStop()
- * 4508: function JSbottom($formname='forms[0]')
- * 4835: function dbFileCon($formObj='document.forms[0]')
- * 5053: function printNeededJSFunctions()
- * 5080: function printNeededJSFunctions_top()
- *
- * SECTION: Various helper functions
- * 5128: function getDefaultRecord($table,$pid=0)
- * 5167: function getRecordPath($table,$rec)
- * 5181: function readPerms()
- * 5195: function sL($str)
- * 5208: function getLL($str)
- * 5229: function isPalettesCollapsed($table,$palette)
- * 5245: function isDisplayCondition($displayCond,$row,$ffValueKey='')
- * 5349: function getTSCpid($table,$uid,$pid)
- * 5363: function doLoadTableDescr($table)
- * 5375: function getAvailableLanguages($onlyIsoCoded=1,$setDefault=1)
- *
- *
- * 5417: class t3lib_TCEforms_FE extends t3lib_TCEforms
- * 5425: function wrapLabels($str)
- * 5435: function printPalette($palArr)
- * 5460: function setFancyDesign()
- *
- * TOTAL FUNCTIONS: 100
- * (This index is automatically created/updated by the extension "extdeveval")
- *
- */
/**
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 $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 $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 $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 $enableTabMenu = FALSE; // Enable Tab Menus.
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 $GLOBALS['CLIENT']['FORMSTYLE'] value set)
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 $maxTextareaWidth = 48; // The maximum abstract value for textareas
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 $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 $colorScheme; // Contains current color scheme
*
* @return void
*/
- function t3lib_TCEforms() {
- global $CLIENT, $TYPO3_CONF_VARS;
-
+ function __construct() {
$this->clientInfo = t3lib_div::clientInfo();
$this->RTEenabled = $GLOBALS['BE_USER']->isRTE();
// 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'])) {
- foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getMainFieldsClass'] as $classRef) {
+ if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getMainFieldsClass'])) {
+ foreach ($GLOBALS['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'])) {
- foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass'] as $classRef) {
+ if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass'])) {
+ foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass'] as $classRef) {
$this->hookObjectsSingleField[] = t3lib_div::getUserObj($classRef);
}
}
// 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) {
+ if (strstr($itemList, '--div--') !== FALSE && $this->enableTabMenu && $dividers2tabs) {
$tabIdentString = 'TCEforms:' . $table . ':' . $row['uid'];
$tabIdentStringMD5 = $GLOBALS['TBE_TEMPLATE']->getDynTabMenuId($tabIdentString);
// Remember that were currently working on the general tab:
// Add language + diff
if ($PA['fieldConf']['l10n_display'] && (t3lib_div::inList($PA['fieldConf']['l10n_display'], 'hideDiff') || t3lib_div::inList($PA['fieldConf']['l10n_display'], 'defaultAsReadonly'))) {
- $renderLanguageDiff = false;
+ $renderLanguageDiff = FALSE;
} else {
$renderLanguageDiff = TRUE;
}
$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_utility_Math::forceIntegerInRange($config['size'] ? $config['size'] : 30, 5, $this->maxInputWidth);
$evalList = t3lib_div::trimExplode(',', $config['eval'], 1);
$classAndStyleAttributes = $this->formWidthAsArray($size);
}
break;
default:
- if (substr($func, 0, 3) == 'tx_') {
+ if (t3lib_div::hasValidClassPrefix($func)) {
// 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);
if (is_object($evalObj) && method_exists($evalObj, 'deevaluateFieldValue')) {
// going through all custom evaluations configured for this field
foreach ($evalList as $evalData) {
- if (substr($evalData, 0, 3) == 'tx_') {
+ if (t3lib_div::hasValidClassPrefix($evalData)) {
$evalObj = t3lib_div::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$evalData] . ':&' . $evalData);
if (is_object($evalObj) && method_exists($evalObj, 'returnFieldJS')) {
$this->extJSCODE .= "\n\nfunction " . $evalData . "(value) {\n" . $evalObj->returnFieldJS() . "\n}\n";
}
// Setting columns number:
- $cols = t3lib_div::intInRange($config['cols'] ? $config['cols'] : 30, 5, $this->maxTextareaWidth);
+ $cols = t3lib_utility_Math::forceIntegerInRange($config['cols'] ? $config['cols'] : 30, 5, $this->maxTextareaWidth);
// Setting number of rows:
- $origRows = $rows = t3lib_div::intInRange($config['rows'] ? $config['rows'] : 5, 1, 20);
+ $origRows = $rows = t3lib_utility_Math::forceIntegerInRange($config['rows'] ? $config['rows'] : 5, 1, 20);
if (strlen($PA['itemFormElValue']) > $this->charsPerRow * 2) {
$cols = $this->maxTextareaWidth;
- $rows = t3lib_div::intInRange(round(strlen($PA['itemFormElValue']) / $this->charsPerRow), count(explode(LF, $PA['itemFormElValue'])), 20);
+ $rows = t3lib_utility_Math::forceIntegerInRange(round(strlen($PA['itemFormElValue']) / $this->charsPerRow), count(explode(LF, $PA['itemFormElValue'])), 20);
if ($rows < $origRows) {
$rows = $origRows;
}
$this->registerRequiredProperty('field', $table . '_' . $row['uid'] . '_' . $field, $PA['itemFormElName']);
break;
default:
- if (substr($func, 0, 3) == 'tx_') {
+ if (t3lib_div::hasValidClassPrefix($func)) {
// Pair hook to the one in t3lib_TCEmain::checkValue_input_Eval() and t3lib_TCEmain::checkValue_text_Eval()
$evalObj = t3lib_div::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$func] . ':&' . $func);
if (is_object($evalObj) && method_exists($evalObj, 'deevaluateFieldValue')) {
if ($optGroupOpen) { // Closing optgroup if open
$opt[] = '</optgroup>';
- $optGroupOpen = false;
+ $optGroupOpen = FALSE;
}
// No-matching-value:
$selector_itemListStyle = isset($config['itemListStyle']) ? ' style="' . htmlspecialchars($config['itemListStyle']) . '"' : ' style="' . $this->defaultMultipleSelectorStyle . '"';
$size = intval($config['size']);
$cssPrefix = ($size === 1) ? 'tceforms-select' : 'tceforms-multiselect';
- $size = $config['autoSizeMax'] ? t3lib_div::intInRange(count($selItems) + 1, t3lib_div::intInRange($size, 1), $config['autoSizeMax']) : $size;
+ $size = $config['autoSizeMax'] ? t3lib_utility_Math::forceIntegerInRange(count($selItems) + 1, t3lib_utility_Math::forceIntegerInRange($size, 1), $config['autoSizeMax']) : $size;
$selectBox = '<select id="' . uniqid($cssPrefix) . '" name="' . $PA['itemFormElName'] . '[]"' .
$this->insertDefStyle('select', $cssPrefix) .
($size ? ' size="' . $size . '"' : '') .
}
// Set max and min items:
- $maxitems = t3lib_div::intInRange($config['maxitems'], 0);
+ $maxitems = t3lib_utility_Math::forceIntegerInRange($config['maxitems'], 0);
if (!$maxitems) {
$maxitems = 100000;
}
- $minitems = t3lib_div::intInRange($config['minitems'], 0);
+ $minitems = t3lib_utility_Math::forceIntegerInRange($config['minitems'], 0);
// Register the required number of elements:
$this->registerRequiredProperty('range', $PA['itemFormElName'], array($minitems, $maxitems, 'imgName' => $table . '_' . $row['uid'] . '_' . $field));
// Put together the selector box:
$selector_itemListStyle = isset($config['itemListStyle']) ? ' style="' . htmlspecialchars($config['itemListStyle']) . '"' : ' style="' . $this->defaultMultipleSelectorStyle . '"';
$size = intval($config['size']);
- $size = $config['autoSizeMax'] ? t3lib_div::intInRange(count($itemArray) + 1, t3lib_div::intInRange($size, 1), $config['autoSizeMax']) : $size;
+ $size = $config['autoSizeMax'] ? t3lib_utility_Math::forceIntegerInRange(count($itemArray) + 1, t3lib_utility_Math::forceIntegerInRange($size, 1), $config['autoSizeMax']) : $size;
if ($config['exclusiveKeys']) {
$sOnChange = 'setFormValueFromBrowseWin(\'' . $PA['itemFormElName'] . '\',this.options[this.selectedIndex].value,this.options[this.selectedIndex].text,\'' . $config['exclusiveKeys'] . '\'); ';
} else {
// Pass to "dbFileIcons" function:
$params = array(
'size' => $size,
- 'autoSizeMax' => t3lib_div::intInRange($config['autoSizeMax'], 0),
+ 'autoSizeMax' => t3lib_utility_Math::forceIntegerInRange($config['autoSizeMax'], 0),
'style' => isset($config['selectedListStyle']) ? ' style="' . htmlspecialchars($config['selectedListStyle']) . '"' : ' style="' . $this->defaultMultipleSelectorStyle . '"',
'dontShowMoveIcons' => ($maxitems <= 1),
'maxitems' => $maxitems,
$internal_type = $config['internal_type'];
$show_thumbs = $config['show_thumbs'];
$size = intval($config['size']);
- $maxitems = t3lib_div::intInRange($config['maxitems'], 0);
+ $maxitems = t3lib_utility_Math::forceIntegerInRange($config['maxitems'], 0);
if (!$maxitems) {
$maxitems = 100000;
}
- $minitems = t3lib_div::intInRange($config['minitems'], 0);
+ $minitems = t3lib_utility_Math::forceIntegerInRange($config['minitems'], 0);
$allowed = trim($config['allowed']);
$disallowed = trim($config['disallowed']);
$params = array(
'size' => $size,
'dontShowMoveIcons' => ($maxitems <= 1),
- 'autoSizeMax' => t3lib_div::intInRange($config['autoSizeMax'], 0),
+ 'autoSizeMax' => t3lib_utility_Math::forceIntegerInRange($config['autoSizeMax'], 0),
'maxitems' => $maxitems,
'style' => isset($config['selectedListStyle']) ? ' style="' . htmlspecialchars($config['selectedListStyle']) . '"' : ' style="' . $this->defaultMultipleSelectorStyle . '"',
'info' => $info,
$params = array(
'size' => $size,
'dontShowMoveIcons' => ($maxitems <= 1),
- 'autoSizeMax' => t3lib_div::intInRange($config['autoSizeMax'], 0),
+ 'autoSizeMax' => t3lib_utility_Math::forceIntegerInRange($config['autoSizeMax'], 0),
'maxitems' => $maxitems,
'style' => isset($config['selectedListStyle']) ?
' style="' . htmlspecialchars($config['selectedListStyle']) . '"'
// Creating string showing allowed types:
$tempFT = t3lib_div::trimExplode(',', $allowed, TRUE);
if (!strcmp(trim($tempFT[0]), '*')) {
- $onlySingleTableAllowed = false;
+ $onlySingleTableAllowed = FALSE;
$info .= '<span class="nobr">' .
htmlspecialchars($this->getLL('l_allTables')) .
'</span><br />';
$params = array(
'size' => $size,
'dontShowMoveIcons' => ($maxitems <= 1),
- 'autoSizeMax' => t3lib_div::intInRange($config['autoSizeMax'], 0),
+ 'autoSizeMax' => t3lib_utility_Math::forceIntegerInRange($config['autoSizeMax'], 0),
'maxitems' => $maxitems,
'style' => isset($config['selectedListStyle']) ? ' style="' . htmlspecialchars($config['selectedListStyle']) . '"' : ' style="' . $this->defaultMultipleSelectorStyle . '"',
'info' => $info,
$itemValue = nl2br(htmlspecialchars($itemValue));
}
// like textarea
- $cols = t3lib_div::intInRange($config['cols'] ? $config['cols'] : 30, 5, $this->maxTextareaWidth);
+ $cols = t3lib_utility_Math::forceIntegerInRange($config['cols'] ? $config['cols'] : 30, 5, $this->maxTextareaWidth);
if (!$config['fixedRows']) {
- $origRows = $rows = t3lib_div::intInRange($rows, 1, 20);
+ $origRows = $rows = t3lib_utility_Math::forceIntegerInRange($rows, 1, 20);
if (strlen($itemValue) > $this->charsPerRow * 2) {
$cols = $this->maxTextareaWidth;
- $rows = t3lib_div::intInRange(round(strlen($itemValue) / $this->charsPerRow), count(explode(LF, $itemValue)), 20);
+ $rows = t3lib_utility_Math::forceIntegerInRange(round(strlen($itemValue) / $this->charsPerRow), count(explode(LF, $itemValue)), 20);
if ($rows < $origRows) {
$rows = $origRows;
}
$itemValue = sprintf('%' . $format, $itemValue);
break;
case 'float':
- $precision = t3lib_div::intInRange($config['format.']['precision'], 1, 10, 2);
+ $precision = t3lib_utility_Math::forceIntegerInRange($config['format.']['precision'], 1, 10, 2);
$itemValue = sprintf('%.' . $precision . 'f', $itemValue);
break;
case 'number':
// If a bitmask-value field has been configured, then find possible fields to exclude based on that:
if ($GLOBALS['TCA'][$table]['types'][$typeNum]['bitmask_value_field']) {
$sTfield = $GLOBALS['TCA'][$table]['types'][$typeNum]['bitmask_value_field'];
- $sTValue = t3lib_div::intInRange($row[$sTfield], 0);
+ $sTValue = t3lib_utility_Math::forceIntegerInRange($row[$sTfield], 0);
if (is_array($GLOBALS['TCA'][$table]['types'][$typeNum]['bitmask_excludelist_bits'])) {
foreach ($GLOBALS['TCA'][$table]['types'][$typeNum]['bitmask_excludelist_bits'] as $bitKey => $eList) {
$bit = substr($bitKey, 1);
if (t3lib_div::testInt($bit)) {
- $bit = t3lib_div::intInRange($bit, 0, 30);
+ $bit = t3lib_utility_Math::forceIntegerInRange($bit, 0, 30);
if (
(substr($bitKey, 0, 1) == '-' && !($sTValue & pow(2, $bit))) ||
(substr($bitKey, 0, 1) == '+' && ($sTValue & pow(2, $bit)))
}
// Create selector box of the options
- $sSize = $params['autoSizeMax'] ? t3lib_div::intInRange($itemArrayC + 1, t3lib_div::intInRange($params['size'], 1), $params['autoSizeMax']) : $params['size'];
+ $sSize = $params['autoSizeMax'] ? t3lib_utility_Math::forceIntegerInRange($itemArrayC + 1, t3lib_utility_Math::forceIntegerInRange($params['size'], 1), $params['autoSizeMax']) : $params['size'];
if (!$selector) {
$selector = '<select id="' . uniqid('tceforms-multiselect-') . '" ' . ($params['noList'] ? 'style="display: none"' : 'size="' . $sSize . '"' . $this->insertDefStyle('group', 'tceforms-multiselect')) . ' multiple="multiple" name="' . $fName . '_list" ' . $onFocus . $params['style'] . $disabled . '>' . implode('', $opt) . '</select>';
}
// Color wizard colorbox:
if ((string) $wConf['type'] == 'colorbox') {
$dim = t3lib_div::intExplode('x', $wConf['dim']);
- $dX = t3lib_div::intInRange($dim[0], 1, 200, 20);
- $dY = t3lib_div::intInRange($dim[1], 1, 200, 20);
+ $dX = t3lib_utility_Math::forceIntegerInRange($dim[0], 1, 200, 20);
+ $dY = t3lib_utility_Math::forceIntegerInRange($dim[1], 1, 200, 20);
$color = $PA['itemFormElValue'] ? ' bgcolor="' . htmlspecialchars($PA['itemFormElValue']) . '"' : '';
$outArr[] = '<table border="0" cellpadding="0" cellspacing="0" id="' . $md5ID . '"' . $color . ' style="' . htmlspecialchars($wConf['tableStyle']) . '">
<tr>
$padLeft = 22; // In order to get the same padding for all option tags even if icon sizes differ a little, set it to 22 if it was between 18 and 24 pixels
}
- $padTop = t3lib_div::intInRange(($selIconInfo[1] - 12) / 2, 0);
- $styleAttr = 'background: #fff url(' . $selIconFile . ') 0% 50% no-repeat; height: ' . t3lib_div::intInRange(($selIconInfo[1] + 2) - $padTop, 0) . 'px; padding-top: ' . $padTop . 'px; padding-left: ' . $padLeft . 'px;';
+ $padTop = t3lib_utility_Math::forceIntegerInRange(($selIconInfo[1] - 12) / 2, 0);
+ $styleAttr = 'background: #fff url(' . $selIconFile . ') 0% 50% no-repeat; height: ' . t3lib_utility_Math::forceIntegerInRange(($selIconInfo[1] + 2) - $padTop, 0) . 'px; padding-top: ' . $padTop . 'px; padding-left: ' . $padLeft . 'px;';
return $styleAttr;
}
}
// set it to 22, if it was between 18 and 24 pixels.
$padLeft = 22;
}
- $padTop = t3lib_div::intInRange(($selIconInfo[1] - 12) / 2, 0);
+ $padTop = t3lib_utility_Math::forceIntegerInRange(($selIconInfo[1] - 12) / 2, 0);
return 'background: #ffffff url(' . $selIconFile . ') 0 0 no-repeat; padding-top: ' . $padTop . 'px; padding-left: ' . $padLeft . 'px;';
}
// Configurations:
$extList = $fieldValue['config']['fileFolder_extList'];
- $recursivityLevels = isset($fieldValue['config']['fileFolder_recursions']) ? t3lib_div::intInRange($fieldValue['config']['fileFolder_recursions'], 0, 99) : 99;
+ $recursivityLevels = isset($fieldValue['config']['fileFolder_recursions']) ? t3lib_utility_Math::forceIntegerInRange($fieldValue['config']['fileFolder_recursions'], 0, 99) : 99;
// Get files:
$fileFolder = rtrim($fileFolder, '/') . '/';
* @return void
*/
function setNewBEDesign() {
- $template = t3lib_div::getURL(PATH_typo3 . $this->templateFile);
+ $template = t3lib_div::getUrl(PATH_typo3 . $this->templateFile);
// Wrapping all table rows for a particular record being edited:
$this->totalWrap = t3lib_parsehtml::getSubpart($template, '###TOTALWRAP###');
*/
public static function getHiddenTokenField($formName = 'securityToken', $tokenName = 'formToken') {
$formprotection = t3lib_formprotection_Factory::get();
- return '<input type="hidden" name="' .$tokenName . '" value="' . $formprotection->generateToken($formName) . '-' . $formName . '" />';
+ return '<input type="hidden" name="' .$tokenName . '" value="' . $formprotection->generateToken($formName) . '" />';
}
/**
$fDat['details'] || $fDat['syntax'] || $fDat['image_descr'] || $fDat['image'] || $fDat['seeAlso']
) .
'</td><td valign="top"><span class="typo3-TCEforms-helpText">' .
- $GLOBALS['LANG']->hscAndCharConv(strip_tags($fDat['description']), 1) .
+ htmlspecialchars(strip_tags($fDat['description'])) .
'</span></td></tr></table>';
}
}
if ($alttitle) {
$hoverText = '<span class="header">' . $alttitle . '</span><br />' . $hoverText;
}
- $hoverText = '<span class="typo3-csh-inline">' . $GLOBALS['LANG']->hscAndCharConv($hoverText, FALSE) . '</span>';
+ $hoverText = '<span class="typo3-csh-inline">' . $hoverText . '</span>';
}
// CSH exists
$cshFile
) .
'</td><td valign="top"><span class="typo3-TCEforms-helpText-flexform">' .
- $GLOBALS['LANG']->hscAndCharConv(strip_tags($value), 1) .
+ htmlspecialchars(strip_tags($value)) .
'</span></td></tr></table>';
}
}
*
* @param string $formname: The identification of the form on the page.
* @param boolean $update: Just extend/update existing settings, e.g. for AJAX call
- * @return string A section with JavaScript - if $update is false, embedded in <script></script>
+ * @return string A section with JavaScript - if $update is FALSE, embedded in <script></script>
*/
function JSbottom($formname = 'forms[0]', $update = FALSE) {
$jsFile = array();
* Get the dynNestedStack as associative array.
* The result is e.g. ['tab','DTM-ABCD-1'], ['inline','data[13][table][uid][field]'], ['tab','DTM-DEFG-2'], ...
*
- * @param boolean $json: Return a JSON string instead of an array - default: false
- * @param boolean $skipFirst: Skip the first element in the dynNestedStack - default: false
+ * @param boolean $json: Return a JSON string instead of an array - default: FALSE
+ * @param boolean $skipFirst: Skip the first element in the dynNestedStack - default: FALSE
* @return mixed Returns an associative array by default. If $json is TRUE, it will be returned as JSON string.
*/
function getDynNestedStack($json = FALSE, $skipFirst = FALSE) {
include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tceforms.php']);
}
-?>
\ No newline at end of file
+?>