Index: t3lib/class.t3lib_tceforms.php =================================================================== --- t3lib/class.t3lib_tceforms.php (revision 4698) +++ t3lib/class.t3lib_tceforms.php (working copy) @@ -38,133 +38,142 @@ * * * - * 196: class t3lib_TCEforms - * 302: function t3lib_TCEforms() - * 338: function initDefaultBEmode() + * 206: class t3lib_TCEforms + * 334: function t3lib_TCEforms() + * 398: 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) + * 445: function getSoloField($table,$row,$theFieldToReturn) + * 484: function getMainFields($table,$row,$depth=0) + * 714: function getListedFields($table,$row,$list) + * 756: function getPaletteFields($table,$row,$palette,$header='',$itemList='',$collapsedHeader=NULL) + * 803: function getSingleField($table,$field,$row,$altName='',$palette=0,$extra='',$pal=0) + * 984: 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) + * 1067: function getSingleField_typeInput($table,$field,$row,&$PA) + * 1175: function getSingleField_typeText($table,$field,$row,&$PA) + * 1318: function getSingleField_typeCheck($table,$field,$row,&$PA) + * 1386: function getSingleField_typeRadio($table,$field,$row,&$PA) + * 1422: function getSingleField_typeSelect($table,$field,$row,&$PA) + * 1514: function getSingleField_typeSelect_single($table,$field,$row,&$PA,$config,$selItems,$nMV_label) + * 1675: function getSingleField_typeSelect_checkbox($table,$field,$row,&$PA,$config,$selItems,$nMV_label) + * 1830: function getSingleField_typeSelect_singlebox($table,$field,$row,&$PA,$config,$selItems,$nMV_label) + * 1940: function getSingleField_typeSelect_multiple($table,$field,$row,&$PA,$config,$selItems,$nMV_label) + * 2050: function getSingleField_typeGroup($table,$field,$row,&$PA) + * 2255: function getSingleField_typeNone($table,$field,$row,&$PA) + * 2271: function getSingleField_typeNone_render($config,$itemValue) + * 2333: function getSingleField_typeFlex($table,$field,$row,&$PA) + * 2468: function getSingleField_typeFlex_langMenu($languages,$elName,$selectedLanguage,$multi=1) + * 2487: function getSingleField_typeFlex_sheetMenu($sArr,$elName,$sheetKey) + * 2522: function getSingleField_typeFlex_draw($dataStruct,$editData,$table,$field,$row,&$PA,$formPrefix='',$level=0,$idPrefix='ID',$toggleClosed=FALSE) + * 2804: function getSingleField_typeUnknown($table,$field,$row,&$PA) + * 2819: function getSingleField_typeUser($table,$field,$row,&$PA) * * SECTION: Field content processing - * 2496: function formatValue ($config, $itemValue) + * 2848: 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='') + * 2944: function getRTypeNum($table,$row) + * 2970: function rearrange($fields) + * 2996: function getExcludeElements($table,$row,$typeNum) + * 3044: function getFieldsToAdd($table,$row,$typeNum) + * 3069: function mergeFieldsWithAddedFields($fields,$fieldsToAdd) + * 3101: function setTSconfig($table,$row,$field='') + * 3123: function overrideFieldConf($fieldConfig, $TSconfig) + * 3154: function getSpecConfForField($table,$row,$field) + * 3175: function getSpecConfFromString($extraString, $defaultExtras) + * 3189: public 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) + * 3245: function registerDefaultLanguageData($table,$rec) + * 3287: function getLanguageOverlayRawValue($table, $row, $field, $fieldConf) + * 3315: function renderDefaultLanguageContent($table,$field,$row,$item) + * 3351: function renderDefaultLanguageDiff($table,$field,$row,$item) + * 3391: function renderVDEFDiff($vArray,$vDEFkey) * * 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) + * 3435: function dbFileIcons($fName,$mode,$allowed,$itemArray,$selector='',$params=array(),$onFocus='',$table='',$field='',$uid='') + * 3597: function getClipboardElements($allowed,$mode) + * 3646: function getClickMenu($str,$table,$uid='') + * 3667: function renderWizards($itemKinds,$wizConf,$table,$row,$field,&$PA,$itemName,$specConf,$RTE=0) + * 3871: function getIcon($icon) + * 3898: function optionTagStyle($iconString) + * 3921: function extractValuesOnlyFromValueLabelList($itemFormElValue) + * 3943: function wrapOpenPalette($header,$table,$row,$palette,$retFunc) + * 3959: function wrapPaletteField($code,$table,$row,$palette,$collapsed ) + * 3976: function checkBoxParams($itemName,$thisValue,$c,$iCount,$addFunc='') + * 3990: function elName($itemName) + * 4004: function noTitle($str,$wrapParts=array()) + * 4013: function blur() + * 4022: function thisReturnUrl() + * 4035: function getSingleHiddenField($table,$field,$row) + * 4057: function formWidth($size=48,$textarea=0) + * 4084: function formWidthText($size=48,$wrap='') + * 4100: function formElStyle($type) + * 4111: function formElClass($type) + * 4122: function formElStyleClassValue($type, $class=FALSE) + * 4146: function insertDefStyle($type) + * 4166: function getDynTabMenu($parts, $idString, $dividersToTabsBehaviour = 1) * * 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) + * 4205: function initItemArray($fieldValue) + * 4223: function addItems($items,$iArray) + * 4245: function procItems($items,$iArray,$config,$table,$row,$field) + * 4269: function addSelectOptionsToItemArray($items,$fieldValue,$TSconfig,$field) + * 4489: function addSelectOptionsToItemArray_makeModuleData($value) + * 4511: 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() + * 4595: function setNewBEDesign() + * 4649: function intoTemplate($inArr,$altTemplate='') + * 4673: function addUserTemplateMarkers($marker,$table,$field,$row,&$PA) + * 4684: function wrapLabels($str) + * 4697: function wrapTotal($c,$rec,$table) + * 4710: function replaceTableWrap($arr,$rec,$table) + * 4747: function wrapBorder(&$out_array,&$out_pointer) + * 4769: function rplColorScheme($inTemplate) + * 4789: function getDivider() + * 4799: function printPalette($palArr) + * 4850: function helpTextIcon($table,$field,$force=0) + * 4875: function helpText($table,$field) + * 4898: function helpTextIcon_typeFlex($field, $fieldTitle, $cshFile) + * 4928: function helpText_typeFlex($field, $fieldTitle, $cshFile) + * 4952: function setColorScheme($scheme) + * 4976: function resetSchemes() + * 4987: function storeSchemes() + * 4999: 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() + * 5029: function JStop() + * 5081: function JSbottom($formname='forms[0]', $update = false) + * 5269: function dbFileCon($formObj='document.forms[0]') + * 5488: function printNeededJSFunctions() + * 5517: function printNeededJSFunctions_top() + * 5531: public function loadJavascriptLib($lib) * * 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) + * 5577: function getDefaultRecord($table,$pid=0) + * 5616: function getRecordPath($table,$rec) + * 5630: function readPerms() + * 5644: function sL($str) + * 5657: function getLL($str) + * 5678: function isPalettesCollapsed($table,$palette) + * 5694: function isDisplayCondition($displayCond,$row,$ffValueKey='') + * 5798: function getTSCpid($table,$uid,$pid) + * 5812: function doLoadTableDescr($table) + * 5824: function getAvailableLanguages($onlyIsoCoded=1,$setDefault=1) + * 5864: function getLanguageIcon($table,$row,$sys_language_uid) + * 5896: function previewFieldValue($value, $config) + * 5943: function getAdditionalPreviewLanguages() + * 5976: function pushToDynNestedStack($type, $ident) + * 5989: function popFromDynNestedStack($type=null, $ident=null) + * 6008: function getDynNestedStack($json=false, $skipFirst=false) + * 6027: protected function registerRequiredProperty($type, $name, $value) + * 6047: protected function registerNestedElement($itemName, $setLevel=true) + * 6067: public function addStyleSheet($key, $href, $title='', $relation='stylesheet') * - * - * 5417: class t3lib_TCEforms_FE extends t3lib_TCEforms - * 5425: function wrapLabels($str) - * 5435: function printPalette($palArr) - * 5460: function setFancyDesign() - * - * TOTAL FUNCTIONS: 100 + * TOTAL FUNCTIONS: 113 * (This index is automatically created/updated by the extension "extdeveval") * */ @@ -184,6 +193,11 @@ require_once(PATH_t3lib.'class.t3lib_diff.php'); require_once(PATH_t3lib.'class.t3lib_tceforms_inline.php'); + /** + * Frontend version of TCEForms has been moved into its own file and should + * be included directly by calling scripts. + */ +require_once(PATH_t3lib.'class.t3lib_tceforms_fe.php'); /** @@ -6059,112 +6073,6 @@ } - - - - - - - -/** - * Extension class for the rendering of TCEforms in the frontend - * - * @author Kasper Skaarhoj - */ -class t3lib_TCEforms_FE extends t3lib_TCEforms { - - /** - * Function for wrapping labels. - * - * @param string The string to wrap - * @return string - */ - function wrapLabels($str) { - return ''.$str.''; - } - - /** - * Prints the palette in the frontend editing (forms-on-page?) - * - * @param array The palette array to print - * @return string HTML output - */ - function printPalette($palArr) { - $out=''; - reset($palArr); - $bgColor=' bgcolor="#D6DAD0"'; - while(list(,$content)=each($palArr)) { - $hRow[]=' '.$content['NAME'].''; - $iRow[]=''. - ''. - ''. - ''.$content['ITEM'].$content['HELP_ICON'].''; - } - $out=' - '.implode('',$hRow).' - '.implode('',$iRow).' -
'; - - return $out; - } - - /** - * Sets the fancy front-end design of the editor. - * Frontend - * - * @return void - */ - function setFancyDesign() { - $this->fieldTemplate=' - - ###FIELD_HELP_ICON######FIELD_NAME######FIELD_HELP_TEXT### - - - ###FIELD_ITEM######FIELD_PAL_LINK_ICON### - '; - - $this->totalWrap='
|
'; - - $this->palFieldTemplate=' - - ###FIELD_PALETTE### - '; - $this->palFieldTemplateHeader=' - - ###FIELD_HEADER### - '; - } - - /** - * Includes a javascript library that exists in the core /typo3/ directory. The - * backpath is automatically applied. - * This method adds the library to $GLOBALS['TSFE']->additionalHeaderData[$lib]. - * - * @param string $lib: Library name. Call it with the full path like "contrib/prototype/prototype.js" to load it - * @return void - */ - public function loadJavascriptLib($lib) { - if (!isset($GLOBALS['TSFE']->additionalHeaderData[$lib])) { - $GLOBALS['TSFE']->additionalHeaderData[$lib] = ''; - } - } - - /** - * Insert additional style sheet link - * - * @param string $key: some key identifying the style sheet - * @param string $href: uri to the style sheet file - * @param string $title: value for the title attribute of the link element - * @return string $relation: value for the rel attribute of the link element - * @return void - */ - public function addStyleSheet($key, $href, $title='', $relation='stylesheet') { - if (!isset($GLOBALS['TSFE']->additionalHeaderData[$key])) { - $GLOBALS['TSFE']->additionalHeaderData[$key] = ''; - } - } -} - if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tceforms.php']) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tceforms.php']); } Index: t3lib/class.t3lib_tceforms_fe.php =================================================================== --- t3lib/class.t3lib_tceforms_fe.php (revision 0) +++ t3lib/class.t3lib_tceforms_fe.php (revision 0) @@ -0,0 +1,314 @@ + + */ + +require_once(PATH_t3lib . 'class.t3lib_tceforms.php'); + + +/** + * Extension class for the rendering of TCEforms in the frontend + * + * @author Kasper Skaarhoj + */ +class t3lib_TCEforms_FE extends t3lib_TCEforms { + + /** + * Function for wrapping labels. + * + * @param string The string to wrap + * @return string + */ + public function wrapLabels($str) { + return '' . $str . ''; + } + + /** + * Prints the palette in the frontend editing (forms-on-page?) + * + * @param array The palette array to print + * @return string HTML output + */ + public function printPalette(array $paletteArray) { + $out = ''; + $bgColor = ' bgcolor="#D6DAD0"'; + foreach($paletteArray as $content) { + $hRow[] = ' ' . $content['NAME'] . ''; + $iRow[] = '' . + '' . + '' . + '' . $content['ITEM'] . $content['HELP_ICON'] . ''; + } + $out = ' + ' . implode('', $hRow) . ' + ' . implode('', $iRow) . ' +
'; + + return $out; + } + + /** + * Sets the fancy front-end design of the editor. + * Frontend + * + * @return void + */ + public function setFancyDesign() { + $this->fieldTemplate = ' + + ###FIELD_HELP_ICON######FIELD_NAME######FIELD_HELP_TEXT### + + + ###FIELD_ITEM######FIELD_PAL_LINK_ICON### + '; + + $this->totalWrap = '
|
'; + + $this->palFieldTemplate = ' + + ###FIELD_PALETTE### + '; + $this->palFieldTemplateHeader = ' + + ###FIELD_HEADER### + '; + } + + /** + * Includes a javascript library that exists in the core /typo3/ directory. The + * backpath is automatically applied. + * This method adds the library to $GLOBALS['TSFE']->additionalHeaderData[$lib]. + * + * @param string $lib: Library name. Call it with the full path like "contrib/prototype/prototype.js" to load it + * @return void + */ + public function loadJavascriptLib($lib) { + if (!isset($GLOBALS['TSFE']->additionalHeaderData[$lib])) { + $GLOBALS['TSFE']->additionalHeaderData[$lib] = ''; + } + } + + /** + * Insert additional style sheet link + * + * @param string $key: some key identifying the style sheet + * @param string $href: uri to the style sheet file + * @param string $title: value for the title attribute of the link element + * @return string $relation: value for the rel attribute of the link element + * @return void + */ + public function addStyleSheet($key, $href, $title='', $relation='stylesheet') { + if (!isset($GLOBALS['TSFE']->additionalHeaderData[$key])) { + $GLOBALS['TSFE']->additionalHeaderData[$key] = ''; + } + } +} + +if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tceforms_fe.php']) { + include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tceforms_fe.php']); +} + +?> + + */ + +require_once(PATH_t3lib . 'class.t3lib_tceforms.php'); + + +/** + * Extension class for the rendering of TCEforms in the frontend + * + * @author Kasper Skaarhoj + */ +class t3lib_TCEforms_FE extends t3lib_TCEforms { + + /** + * Function for wrapping labels. + * + * @param string The string to wrap + * @return string + */ + public function wrapLabels($str) { + return '' . $str . ''; + } + + /** + * Prints the palette in the frontend editing (forms-on-page?) + * + * @param array The palette array to print + * @return string HTML output + */ + public function printPalette(array $paletteArray) { + $out = ''; + $bgColor = ' bgcolor="#D6DAD0"'; + foreach($paletteArray as $content) { + $hRow[] = ' ' . $content['NAME'] . ''; + $iRow[] = '' . + '' . + '' . + '' . $content['ITEM'] . $content['HELP_ICON'] . ''; + } + $out = ' + ' . implode('', $hRow) . ' + ' . implode('', $iRow) . ' +
'; + + return $out; + } + + /** + * Sets the fancy front-end design of the editor. + * Frontend + * + * @return void + */ + public function setFancyDesign() { + $this->fieldTemplate = ' + + ###FIELD_HELP_ICON######FIELD_NAME######FIELD_HELP_TEXT### + + + ###FIELD_ITEM######FIELD_PAL_LINK_ICON### + '; + + $this->totalWrap = '
|
'; + + $this->palFieldTemplate = ' + + ###FIELD_PALETTE### + '; + $this->palFieldTemplateHeader = ' + + ###FIELD_HEADER### + '; + } + + /** + * Includes a javascript library that exists in the core /typo3/ directory. The + * backpath is automatically applied. + * This method adds the library to $GLOBALS['TSFE']->additionalHeaderData[$lib]. + * + * @param string $lib: Library name. Call it with the full path like "contrib/prototype/prototype.js" to load it + * @return void + */ + public function loadJavascriptLib($lib) { + if (!isset($GLOBALS['TSFE']->additionalHeaderData[$lib])) { + $GLOBALS['TSFE']->additionalHeaderData[$lib] = ''; + } + } + + /** + * Insert additional style sheet link + * + * @param string $key: some key identifying the style sheet + * @param string $href: uri to the style sheet file + * @param string $title: value for the title attribute of the link element + * @return string $relation: value for the rel attribute of the link element + * @return void + */ + public function addStyleSheet($key, $href, $title='', $relation='stylesheet') { + if (!isset($GLOBALS['TSFE']->additionalHeaderData[$key])) { + $GLOBALS['TSFE']->additionalHeaderData[$key] = ''; + } + } +} + +if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tceforms_fe.php']) { + include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_tceforms_fe.php']); +} + +?> \ No newline at end of file