Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Returns the location of the RTE
- *
- * @param string The table name
- * @param array The current row from which field is being rendered
- * @return array Config order!
- */
- function whereAmI($table,$row) {
- // Initial location is set to: Default config, then the table name
- $where = array('default',$table);
- // Custom location based on table name
- switch ($table) {
- case 'tt_content':
- // location based on tablename + tt_content column position is added
- $where[] = $table.'.colPos'.$row['colPos'];
- // TemplaVoila is installed
- if (t3lib_extMgm::isLoaded('templavoila')) {
- require_once(t3lib_extMgm::extPath('templavoila').'class.tx_templavoila_api.php');
- $tvAPI = t3lib_div::makeInstance('tx_templavoila_api');
- // Add all nested TV fields to location
- $tmp = array();
- $flex = array('table' => $table, 'uid' => $row['uid']);
- while ($flex['table'] == $table) {
- $flex = array_shift($tvAPI->flexform_getPointersByRecord($flex['uid'], $row['pid']));
- // location based on tablename + TV field name is added
- $tmp[] = $table.'.'.$flex['field'];
- }
- $where = array_merge($where,array_reverse($tmp));
- }
- break;
- }
- // A hook could be inserted here, to allow pre-processing of custom tables
- return $where;
- }
- function getTextarea($parentObject, $PA, $value, $config) {
- $code = $this->triggerField($PA['itemFormElName']);
- $code .= '<textarea id="RTEarea'.$parentObject->RTEcounter.'" class="tinymce_rte" name="'.htmlspecialchars($PA['itemFormElName']).'" rows="30" cols="100">'.t3lib_div::formatForTextarea($value).'</textarea>';
- if ( !$config['useFEediting'] ) {
- $config['init.']['window'] = 'self';
- $config['init.']['element_id'] = 'RTEarea' . $parentObject->RTEcounter;
- $config['init.']['reAddCss'] = 'true';
- $code .= '
- <script type="text/javascript">
- top.tinyMCE.execCommand("mceAddFrameControl", false, ' . $this->parseConfig($config['init.']) . ');
- </script>
- ';
- } else {
- $code .= $this->getCoreScript( $config );
- $code .= $this->getInitScript( $config['init.'] );
- }
- return $code;
- }
Add Comment
Please, Sign In to add comment