Index: t3lib/class.t3lib_tceforms.php =================================================================== --- t3lib/class.t3lib_tceforms.php (revision 4708) +++ t3lib/class.t3lib_tceforms.php (working copy) @@ -184,6 +184,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 +6064,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,157 @@ + + */ + +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