Added <span title=""> to path in backend modules in Web main module; you can now...
authorKasper Skårhøj <kasper@typo3.org>
Thu, 25 Mar 2004 07:16:11 +0000 (07:16 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Thu, 25 Mar 2004 07:16:11 +0000 (07:16 +0000)
Added RTE API and changed the "rte" extension to use that.
Added t3lib_div::getUserObj() which returns an OBJECT , instead of executing a method call like callUserFunc() does.

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@150 709f56b5-9817-0410-a4d7-c38de5d9e867

24 files changed:
ChangeLog
t3lib/class.t3lib_befunc.php
t3lib/class.t3lib_div.php
t3lib/class.t3lib_parsehtml.php
t3lib/class.t3lib_parsehtml_proc.php
t3lib/class.t3lib_rteapi.php [new file with mode: 0755]
t3lib/class.t3lib_syntaxhl.php
t3lib/class.t3lib_tceforms.php
t3lib/class.t3lib_tcemain.php
t3lib/class.t3lib_transferdata.php
t3lib/class.t3lib_userauthgroup.php
t3lib/config_default.php
typo3/class.db_list_extra.inc
typo3/db_list.php
typo3/mod/web/func/index.php
typo3/mod/web/info/index.php
typo3/mod/web/perm/index.php
typo3/sysext/cms/layout/class.tx_cms_layout.php
typo3/sysext/cms/layout/db_layout.php
typo3/sysext/cms/tbl_tt_content.php
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/lang/locallang_core.php
typo3/template.php
typo3/wizard_rte.php

index b733329..e5d01d1 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-03-24  Kasper Skårhøj,,,  <kasper@typo3.com>
+
+       * Added <span title=""> to path in backend modules in Web main module; you can now see the full path (non-truncated) as title text.
+
+2004-03-24  Kasper Skårhøj,,,  <kasper@typo3.com>
+
+       * Added RTE API and changed the "rte" extension to use that. 
+       * Added t3lib_div::getUserObj() which returns an OBJECT , instead of executing a method call like callUserFunc() does. 
+
 2004-03-23  Kasper Skårhøj,,,  <kasper@typo3.com>
 
        * Fixed problem in Extension Manager where files and directories was not written with correct permissions. I also added t3lib_div::mkdir() general function for creating directories.
index dded52a..822c69c 100755 (executable)
@@ -10,7 +10,7 @@
 *  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 
  *
  *              SECTION: Page tree, TCA related
  *  488:     function BEgetRootLine ($uid,$clause='')  
- *  539:     function getRecordPath($uid,$clause,$titleLimit)  
+ *  539:     function getRecordPath($uid,$clause,$titleLimit)
  *  564:     function getExcludeFields()       
  *  599:     function readPageAccess($id,$perms_clause)        
- *  629:     function getTCAtypes($table,$rec,$useFieldNameAsKey=0)    
+ *  629:     function getTCAtypes($table,$rec,$useFieldNameAsKey=0)
  *  675:     function getTCAtypeValue($table,$rec)     
  *  698:     function getSpecConfParts($str)   
  *  723:     function getSpecConfParametersFromArray($pArr)    
  * 2317:     function getTCEFORM_TSconfig($table,$row) 
  * 2365:     function getTSconfig_pidValue($table,$uid,$pid)   
  * 2394:     function getPidForModTSconfig($table,$uid,$pid)   
- * 2411:     function getTSCpid($table,$uid,$pid)      
+ * 2411:     function getTSCpid($table,$uid,$pid)
  * 2428:     function firstDomainRecord($rootLine)     
  * 2451:     function getDomainStartPage($domain, $path='')    
- * 2482:     function RTEsetup($RTEprop,$table,$field,$type='')        
+ * 2482:     function RTEsetup($RTEprop,$table,$field,$type='')
  * 2503:     function isModuleSetInTBE_MODULES($modName)       
  *
  *              SECTION: Miscellaneous
@@ -534,23 +534,31 @@ class t3lib_BEfunc        {
         * @param       integer         Page uid for which to create record path
         * @param       string          $clause is additional where clauses, eg. "
         * @param       integer         Title limit
-        * @return      string          Path of record
+        * @param       integer         Title limit of Full title (typ. set to 1000 or so)
+        * @return      mixed           Path of record (string) OR array with short/long title if $fullTitleLimit is set.
         */
-       function getRecordPath($uid,$clause,$titleLimit)        {
-               if (!$titleLimit) {$titleLimit=1000;}
+       function getRecordPath($uid, $clause, $titleLimit, $fullTitleLimit=0)   {
+               if (!$titleLimit) { $titleLimit=1000; }
+
                $loopCheck = 100;
-               $output='/';
+               $output = $fullOutput = '/';
                while ($uid!=0 && $loopCheck>0) {
                        $loopCheck--;
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('pid,title', 'pages', 'uid='.intval($uid).t3lib_BEfunc::deleteClause('pages').' AND '.$clause);
                        if ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                $uid = $row['pid'];
-                               $output='/'.t3lib_div::fixed_lgd(strip_tags($row['title']),$titleLimit).$output;
+                               $output = '/'.t3lib_div::fixed_lgd(strip_tags($row['title']),$titleLimit).$output;
+                               if ($fullTitleLimit)    $fullOutput = '/'.t3lib_div::fixed_lgd(strip_tags($row['title']),$fullTitleLimit).$fullOutput;
                        } else {
                                break;
                        }
                }
-               return $output;
+
+               if ($fullTitleLimit)    {
+                       return array($output, $fullOutput);
+               } else {
+                       return $output;
+               }
        }
 
        /**
@@ -598,17 +606,17 @@ class t3lib_BEfunc        {
         */
        function readPageAccess($id,$perms_clause)      {
                if ((string)$id!='')    {
-                       $id=intval($id);
+                       $id = intval($id);
                        if (!$id)       {
                                if ($GLOBALS['BE_USER']->isAdmin())     {
-                                       $path='/';
-                                       $pageinfo['_thePath']=$path;
+                                       $path = '/';
+                                       $pageinfo['_thePath'] = $path;
                                        return $pageinfo;
                                }
                        } else {
-                               $pageinfo = t3lib_BEfunc::getRecord('pages',$id,'*',($perms_clause?' AND '.$perms_clause:''));
+                               $pageinfo = t3lib_BEfunc::getRecord('pages',$id,'*',($perms_clause ? ' AND '.$perms_clause : ''));
                                if ($pageinfo['uid'] && $GLOBALS['BE_USER']->isInWebMount($id,$perms_clause))   {
-                                       $pageinfo['_thePath']=t3lib_BEfunc::getRecordPath (intval($pageinfo['uid']),$perms_clause,15);
+                                       list($pageinfo['_thePath'],$pageinfo['_thePathFull']) = t3lib_BEfunc::getRecordPath(intval($pageinfo['uid']), $perms_clause, 15, 1000);
                                        return $pageinfo;
                                }
                        }
@@ -631,6 +639,7 @@ class t3lib_BEfunc  {
 
                t3lib_div::loadTCA($table);
                if ($TCA[$table])       {
+
                                // Get type value:
                        $fieldValue = t3lib_BEfunc::getTCAtypeValue($table,$rec);
 
@@ -638,24 +647,31 @@ class t3lib_BEfunc        {
                        $typesConf = $TCA[$table]['types'][$fieldValue];
 
                                // Get fields list and traverse it
-                       $fieldList = explode(',',$typesConf['showitem']);
-                       $altFieldList=array();
-                       reset($fieldList);
-                       while(list($k,$v)=each($fieldList))     {
-                               $vParts=explode(';',$v);
-                               $specConfParts = t3lib_BEfunc::getSpecConfParts($vParts[3]);
+                       $fieldList = explode(',', $typesConf['showitem']);
+                       $altFieldList = array();
+
+                               // Traverse fields in types config and parse the configuration into a nice array:
+                       foreach($fieldList as $k => $v) {
+                               list($pFieldName, $pAltTitle, $pPalette, $pSpec) = t3lib_div::trimExplode(';', $v);
+                               $defaultExtras = is_array($TCA[$table]['columns'][$pFieldName]) ? $TCA[$table]['columns'][$pFieldName]['defaultExtras'] : '';
+                               $specConfParts = t3lib_BEfunc::getSpecConfParts($pSpec, $defaultExtras);
+
                                $fieldList[$k]=array(
-                                       'field'=>trim($vParts[0]),
-                                       'title'=>trim($vParts[1]),
-                                       'palette'=>trim($vParts[2]),
-                                       'spec'=>$specConfParts,
-                                       'origString'=>$v
+                                       'field' => $pFieldName,
+                                       'title' => $pAltTitle,
+                                       'palette' => $pPalette,
+                                       'spec' => $specConfParts,
+                                       'origString' => $v
                                );
                                if ($useFieldNameAsKey) {
-                                       $altFieldList[$fieldList[$k]['field']]=$fieldList[$k];
+                                       $altFieldList[$fieldList[$k]['field']] = $fieldList[$k];
                                }
                        }
-                       if ($useFieldNameAsKey) $fieldList=$altFieldList;
+                       if ($useFieldNameAsKey) {
+                               $fieldList = $altFieldList;
+                       }
+
+                               // Return array:
                        return $fieldList;
                }
        }
@@ -678,9 +694,9 @@ class t3lib_BEfunc  {
                        // If no field-value, set it to zero. If there is no type matching the field-value (which now may be zero...) test field-value '1' as default.
                t3lib_div::loadTCA($table);
                if ($TCA[$table])       {
-                       $field=$TCA[$table]['ctrl']['type'];
-                       $fieldValue = $field?($rec[$field]?$rec[$field]:0):0;
-                       if (!is_array($TCA[$table]['types'][$fieldValue]))      $fieldValue=1;
+                       $field = $TCA[$table]['ctrl']['type'];
+                       $fieldValue = $field ? ($rec[$field] ? $rec[$field] : 0) : 0;
+                       if (!is_array($TCA[$table]['types'][$fieldValue]))      $fieldValue = 1;
                        return $fieldValue;
                }
        }
@@ -693,21 +709,28 @@ class t3lib_BEfunc        {
         * Usage: 3
         *
         * @param       string          Content from the "types" configuration of TCA (the special configuration) - see description of function
+        * @param       string          The ['defaultExtras'] value from field configuration
         * @return      array
         */
-       function getSpecConfParts($str) {
-               if (trim($str)) {
-                       $specConfParts = explode(':',$str);
-                       reset($specConfParts);
-                       while(list($k2,$v2) = each($specConfParts))     {
+       function getSpecConfParts($str, $defaultExtras) {
+
+                       // Add defaultExtras:
+               $specConfParts = t3lib_div::trimExplode(':', $defaultExtras.':'.$str, 1);
+
+               if (count($specConfParts))      {
+                       foreach($specConfParts as $k2 => $v2)   {
+                               unset($specConfParts[$k2]);
                                if (ereg('(.*)\[(.*)\]',$v2,$reg))      {
-                                       unset($specConfParts[$k2]);
-                                       $specConfParts[$reg[1]] = array(
-                                               'parameters'=>explode('|',$reg[2])
+                                       $specConfParts[trim($reg[1])] = array(
+                                               'parameters' => t3lib_div::trimExplode('|', $reg[2], 1)
                                        );
+                               } else {
+                                       $specConfParts[trim($v2)] = 1;
                                }
                        }
-               } else { $specConfParts = array(); }
+               } else {
+                       $specConfParts = array();
+               }
                return $specConfParts;
        }
 
@@ -2120,7 +2143,6 @@ class t3lib_BEfunc        {
                        } else {die ('No menu!');}
        
                        if ($changed)   {
-//debug('write!');
                                $GLOBALS['BE_USER']->pushModuleData($modName,$settings);
                        }
                        
@@ -2404,13 +2426,13 @@ class t3lib_BEfunc      {
         * @param       string          Table name
         * @param       integer         Record uid
         * @param       integer         Record pid
-        * @return      integer
+        * @return      array           Array of two integers; first is the REAL PID of a record and if its a new record negative values are resolved to the true PID, second value is the PID value for TSconfig (uid if table is pages, otherwise the pid)
         * @internal
         * @see t3lib_TCEmain::setHistory(), t3lib_TCEmain::process_datamap()
         */
        function getTSCpid($table,$uid,$pid)    {
                        // If pid is negative (referring to another record) the pid of the other record is fetched and returned.
-               $cPid = t3lib_BEfunc::getTSconfig_pidValue($table,$uid,$pid);   
+               $cPid = t3lib_BEfunc::getTSconfig_pidValue($table,$uid,$pid);
                        // $TScID is the id of $table=pages, else it's the pid of the record.
                $TScID = t3lib_BEfunc::getPidForModTSconfig($table,$uid,$cPid);
 
@@ -2493,6 +2515,43 @@ class t3lib_BEfunc       {
        }
 
        /**
+        * Returns first possible RTE object if available.
+        *
+        * @return      mixed           If available, returns RTE object, otherwise an array of messages from possible RTEs
+        */
+       function &RTEgetObj()   {
+
+                       // If no RTE object has been set previously, try to create it:
+               if (!isset($GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj']))    {
+
+                               // Set the object string to blank by default:
+                       $GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj'] = array();
+
+                               // Traverse registered RTEs:
+                       if (is_array($GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_reg']))     {
+                               foreach($GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_reg'] as $extKey => $rteObjCfg)  {
+                                       $rteObj = &t3lib_div::getUserObj($rteObjCfg['objRef']);
+                                       if (is_object($rteObj)) {
+                                               if ($rteObj->isAvailable())     {
+                                                       $GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj'] = &$rteObj;
+                                                       break;
+                                               } else {
+                                                       $GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj'] = array_merge($GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj'], $rteObj->errorLog);
+                                               }
+                                       }
+                               }
+                       }
+
+                       if (!count($GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj']))    {
+                               $GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj'][] = 'No RTEs configured at all';
+                       }
+               }
+
+                       // Return RTE object (if any!)
+               return $GLOBALS['TYPO3_CONF_VARS']['T3_VAR']['RTEobj'];
+       }
+
+       /**
         * Returns true if $modName is set and is found as a main- or submodule in $TBE_MODULES array
         *
         * Usage: 1
index 48aaad5..7d53833 100755 (executable)
  * 2874:     function loadTCA($table)  
  * 2893:     function resolveSheetDefInDS($dataStructArray,$sheet='sDEF')      
  * 2921:     function resolveAllSheetsInDS($dataStructArray)   
- * 2950:     function callUserFunction($funcName,&$params,&$ref,$checkPrefix='user_',$silent=0)        
- * 3053:     function makeInstanceService($serviceType, $serviceSubType='', $excludeServiceKeys='')    
- * 3092:     function makeInstanceClassName($className)        
+ * 2950:     function callUserFunction($funcName,&$params,&$ref,$checkPrefix='user_',$silent=0)
+ * 3053:     function makeInstanceService($serviceType, $serviceSubType='', $excludeServiceKeys='')
+ * 3092:     function makeInstanceClassName($className)
  * 3112:     function plainMailEncoded($email,$subject,$message,$headers='',$enc='',$charset='ISO-8859-1',$dontEncodeSubject=0)        
  * 3159:     function quoted_printable($string,$maxlen=76)     
  * 3202:     function substUrlsInPlainText($message,$urlmode='76',$index_script_url='')        
@@ -1985,7 +1985,7 @@ class t3lib_div {
 
                                // Setting file system mode of file:
                        if (@is_file($file) && TYPO3_OS!='WIN') {
-                               chmod($file, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask']));
+                               @chmod($file, octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['fileCreateMask']));             // "@" is there because file is not necessarily OWNED by the user
                        }
 
                        return true;
@@ -2968,6 +2968,7 @@ class t3lib_div {
         * @param       string          Required prefix of class or function name
         * @param       boolean         If set, not debug() error message is shown if class/function is not present.
         * @return      mixed           Content from method/function call
+        * @see getUserObj()
         */
        function callUserFunction($funcName,&$params,&$ref,$checkPrefix='user_',$silent=0)      {
 
@@ -2985,7 +2986,7 @@ class t3lib_div {
                if (strstr($funcName,':'))      {
                        list($file,$funcRef) = t3lib_div::revExplode(':',$funcName,2);
                        $requireFile = t3lib_div::getFileAbsFileName($file);
-                       require_once($requireFile);
+                       if ($requireFile) require_once($requireFile);
                } else {
                        $funcRef = $funcName;
                }
@@ -2996,7 +2997,7 @@ class t3lib_div {
                        !t3lib_div::isFirstPartOfStr(trim($funcRef),'tx_')
                        )       {
                        if (!$silent)   debug("Function '".$funcRef."' was not prepended with '".$checkPrefix."'",1);
-                       return $content;
+                       return FALSE;
                }
 
                        // Call function or method:
@@ -3045,6 +3046,62 @@ class t3lib_div {
        }
 
        /**
+        * Creates and returns reference to a user defined object.
+        * This function can return an object reference if you like. Just prefix the function call with "&": "$objRef = &t3lib_div::getUserObj('EXT:myext/class.tx_myext_myclass.php:>tx_myext_myclass');"
+        *
+        * @param       string          Class reference, [file-reference]:[[">"]class-reference]. You can prefix the class name with "[file-reference]:" and t3lib_div::getFileAbsFileName() will then be used to resolve the filename and subsequently include it by "require_once()" which means you don't have to worry about including the class file either! Example: "EXT:realurl/class.tx_realurl.php:>tx_realurl". Finally; for the class name you can prefix it with ">" and you will reuse the previous instance of the object identified by the full reference string (meaning; if you ask for the same object later in another place in the code you will get a reference to the first created one!).
+        * @param       string          Required prefix of class name
+        * @param       boolean         If set, not debug() error message is shown if class/function is not present.
+        * @return      object          The instance of the class asked for. Instance is created with t3lib_div::makeInstance
+        * @see callUserFunction()
+        */
+       function &getUserObj($classRef,$checkPrefix='user_',$silent=0)  {
+
+                       // Check persistent object and if found, call directly and exit.
+               if (is_object($GLOBALS['T3_VAR']['getUserObj'][$classRef]))     {
+                       return $GLOBALS['T3_VAR']['getUserObj'][$classRef];
+               } else {
+
+                               // Check file-reference prefix; if found, require_once() the file (should be library of code)
+                       if (strstr($classRef,':'))      {
+                               list($file,$class) = t3lib_div::revExplode(':',$classRef,2);
+                               $requireFile = t3lib_div::getFileAbsFileName($file);
+                               if ($requireFile)       require_once($requireFile);
+                       } else {
+                               $class = $classRef;
+                       }
+
+                               // Check for persistent object token, ">"
+                       if (substr($class,0,1)=='>')    {
+                               $class = substr($class,1);
+                               $storePersistentObject = TRUE;
+                       } else $storePersistentObject = FALSE;
+
+                               // Check prefix is valid:
+                       if ($checkPrefix &&
+                               !t3lib_div::isFirstPartOfStr(trim($class),$checkPrefix) &&
+                               !t3lib_div::isFirstPartOfStr(trim($class),'tx_')
+                               )       {
+                               if (!$silent)   debug("Function '".$class."' was not prepended with '".$checkPrefix."'",1);
+                               return FALSE;
+                       }
+
+                               // Check if class/method exists:
+                       if (class_exists($class))       {
+                               $classObj = t3lib_div::makeInstance($class);
+                                       // If persistent object should be created, set reference:
+                               if ($storePersistentObject)     {
+                                       $GLOBALS['T3_VAR']['getUserObj'][$classRef] = &$classObj;
+                               }
+
+                               return $classObj;
+                       } else {
+                               if (!$silent)   debug("<strong>ERROR:</strong> No class named: ".$class,1);
+                       }
+               }
+       }
+
+       /**
         * Make instance of class
         * Takes the class-extensions API of TYPO3 into account
         * Please USE THIS instead of the PHP "new" keyword. Eg. "$obj = new myclass;" should be "$obj = t3lib_div::makeInstance("myclass")" instead!
index eb5b2dc..cea2b57 100644 (file)
  *
  *
  *
- *  100: class t3lib_parsehtml 
- *  117:     function getSubpart($content, $marker)    
- *  145:     function substituteSubpart($content,$marker,$subpartContent,$recursive=1,$keepMarker=0)   
- *  210:     function splitIntoBlock($tag,$content,$eliminateExtraEndTags=0)   
- *  269:     function splitTags($tag,$content) 
- *  303:     function getAllParts($parts,$tag_parts=1,$include_tag=1)  
- *  322:     function removeFirstAndLastTag($str)      
- *  341:     function getFirstTag($str)        
- *  356:     function getFirstTagName($str,$preserveCase=FALSE)        
- *  376:     function checkTagTypeCounts($content,$blockTags='a,b,blockquote,body,div,em,font,form,h1,h2,h3,h4,h5,h6,i,li,map,ol,option,p,pre,select,span,strong,table,td,textarea,tr,u,ul', $soloTags='br,hr,img,input,area') 
- *  450:     function HTMLcleaner($content, $tags=array(),$keepAll=0,$hSC=0,$addConfig=array())        
- *  645:     function get_tag_attributes($tag,$deHSC=0)        
- *  687:     function split_tag_attributes($tag)       
- *  724:     function bidir_htmlspecialchars($value,$dir)      
- *  746:     function prefixResourcePath($main_prefix,$content,$alternatives=array())  
- *  814:     function prefixRelPath($prefix,$srcVal)   
- *  832:     function cleanFontTags($value,$keepFace=0,$keepSize=0,$keepColor=0)       
- *  863:     function mapTags($value,$tags=array(),$ltChar='<',$ltChar2='<')   
- *  880:     function unprotectTags($content,$tagList='')      
- *  913:     function stripTagsExcept($value,$tagList) 
- *  936:     function caseShift($str,$flag,$cacheKey='')       
- *  960:     function compileTagAttribs($tagAttrib,$meta=array(), $xhtmlClean=0)       
- *  989:     function get_tag_attributes_classic($tag,$deHSC=0)        
- * 1002:     function HTMLparserConfig($TSconfig,$keepTags=array())    
- * 1126:     function XHTML_clean($content)    
- * 1149:     function processTag($value,$conf,$endTag,$protected=0)    
- * 1196:     function processContent($value,$dir,$conf)        
+ *  106: class t3lib_parsehtml 
+ *  123:     function getSubpart($content, $marker)    
+ *  151:     function substituteSubpart($content,$marker,$subpartContent,$recursive=1,$keepMarker=0)   
  *
- * TOTAL FUNCTIONS: 26
+ *              SECTION: Parsing HTML code
+ *  223:     function splitIntoBlock($tag,$content,$eliminateExtraEndTags=0)   
+ *  284:     function splitIntoBlockRecursiveProc($tag,$content,&$procObj,$callBackContent,$callBackTags,$level=0)     
+ *  319:     function splitTags($tag,$content) 
+ *  353:     function getAllParts($parts,$tag_parts=1,$include_tag=1)  
+ *  372:     function removeFirstAndLastTag($str)      
+ *  391:     function getFirstTag($str)        
+ *  406:     function getFirstTagName($str,$preserveCase=FALSE)        
+ *  421:     function get_tag_attributes($tag,$deHSC=0)        
+ *  463:     function split_tag_attributes($tag)       
+ *  506:     function checkTagTypeCounts($content,$blockTags='a,b,blockquote,body,div,em,font,form,h1,h2,h3,h4,h5,h6,i,li,map,ol,option,p,pre,select,span,strong,table,td,textarea,tr,u,ul', $soloTags='br,hr,img,input,area') 
+ *
+ *              SECTION: Clean HTML code
+ *  597:     function HTMLcleaner($content, $tags=array(),$keepAll=0,$hSC=0,$addConfig=array())        
+ *  791:     function bidir_htmlspecialchars($value,$dir)      
+ *  813:     function prefixResourcePath($main_prefix,$content,$alternatives=array())  
+ *  881:     function prefixRelPath($prefix,$srcVal)   
+ *  899:     function cleanFontTags($value,$keepFace=0,$keepSize=0,$keepColor=0)       
+ *  930:     function mapTags($value,$tags=array(),$ltChar='<',$ltChar2='<')   
+ *  947:     function unprotectTags($content,$tagList='')      
+ *  980:     function stripTagsExcept($value,$tagList) 
+ * 1003:     function caseShift($str,$flag,$cacheKey='')       
+ * 1027:     function compileTagAttribs($tagAttrib,$meta=array(), $xhtmlClean=0)       
+ * 1056:     function get_tag_attributes_classic($tag,$deHSC=0)        
+ * 1069:     function indentLines($content, $number=1, $indentChar="\t")       
+ * 1086:     function HTMLparserConfig($TSconfig,$keepTags=array())    
+ * 1210:     function XHTML_clean($content)    
+ * 1233:     function processTag($value,$conf,$endTag,$protected=0)    
+ * 1280:     function processContent($value,$dir,$conf)        
+ *
+ * TOTAL FUNCTIONS: 28
  * (This index is automatically created/updated by the extension "extdeveval")
  *
  */
@@ -196,6 +202,13 @@ class t3lib_parsehtml {
 
 
 
+
+       /************************************
+        *
+        * Parsing HTML code
+        *
+        ************************************/
+
        /**
         * Returns an array with the $content divided by tag-blocks specified with the list of tags, $tag
         * Even numbers in the array are outside the blocks, Odd numbers are block-content.
@@ -257,6 +270,43 @@ class t3lib_parsehtml {
        }
 
        /**
+        * Splitting content into blocks *recursively* and processing tags/content with call back functions.
+        *
+        * @param       string          Tag list, see splitIntoBlock()
+        * @param       string          Content, see splitIntoBlock()
+        * @param       object          Object where call back methods are.
+        * @param       string          Name of call back method for content; "function callBackContent($str,$level)"
+        * @param       string          Name of call back method for tags; "function callBackTags($tags,$level)"
+        * @param       integer         Indent level
+        * @return      string          Processed content
+        * @see splitIntoBlock()
+        */
+       function splitIntoBlockRecursiveProc($tag,$content,&$procObj,$callBackContent,$callBackTags,$level=0)   {
+               $parts = $this->splitIntoBlock($tag,$content,TRUE);
+               foreach($parts as $k => $v)     {
+                       if ($k%2)       {
+                               $firstTagName = $this->getFirstTagName($v, TRUE);
+                               $tagsArray = array();
+                               $tagsArray['tag_start'] = $this->getFirstTag($v);
+                               $tagsArray['tag_end'] = '</'.$firstTagName.'>';
+                               $tagsArray['tag_name'] = strtolower($firstTagName);
+                               $tagsArray['add_level'] = 1;
+
+                               if ($callBackTags)      $tagsArray = $procObj->$callBackTags($tagsArray,$level);
+
+                               $parts[$k] =
+                                       $tagsArray['tag_start'].
+                                       $this->splitIntoBlockRecursiveProc($tag,$this->removeFirstAndLastTag($v),$procObj,$callBackContent,$callBackTags,$level+$tagsArray['add_level']).
+                                       $tagsArray['tag_end'];
+                       } else {
+                               if ($callBackContent)   $parts[$k] = $procObj->$callBackContent($parts[$k],$level);
+                       }
+               }
+
+               return implode('',$parts);
+       }
+
+       /**
         * Returns an array with the $content divided by tag-blocks specified with the list of tags, $tag
         * Even numbers in the array are outside the blocks, Odd numbers are block-content.
         * Use ->getAllParts() and ->removeFirstAndLastTag() to process the content if needed.
@@ -359,8 +409,88 @@ class t3lib_parsehtml {
                        
                return trim($tag);
        }
+
+       /**
+        * Returns an array with all attributes as keys. Attributes are only lowercase a-z
+        * If a attribute is empty (shorthand), then the value for the key is empty. You can check if it existed with isset()
+        *
+        * @param       string          Tag: $tag is either a whole tag (eg '<TAG OPTION ATTRIB=VALUE>') or the parameterlist (ex ' OPTION ATTRIB=VALUE>')
+        * @param       boolean         If set, the attribute values are de-htmlspecialchar'ed. Should actually always be set!
+        * @return      array           array(Tag attributes,Attribute meta-data)
+        */
+       function get_tag_attributes($tag,$deHSC=0)      {
+               list($components,$metaC) = $this->split_tag_attributes($tag);
+               $name = '';      // attribute name is stored here
+               $valuemode = '';
+               $attributes=array();
+               $attributesMeta=array();
+               if (is_array($components))      {
+                       while (list($key,$val) = each ($components))    {
+                               if ($val != '=')        {       // Only if $name is set (if there is an attribute, that waits for a value), that valuemode is enabled. This ensures that the attribute is assigned it's value
+                                       if ($valuemode) {
+                                               if ($name)      {
+                                                       $attributes[$name] = $deHSC?t3lib_div::htmlspecialchars_decode($val):$val;
+                                                       $attributesMeta[$name]['dashType']=$metaC[$key];
+                                                       $name = '';
+                                               }
+                                       } else {
+                                               if ($namekey = ereg_replace('[^a-zA-Z0-9_-]','',$val))  {
+                                                       $name = strtolower($namekey);
+                                                       $attributesMeta[$name]=array();
+                                                       $attributesMeta[$name]['origTag']=$namekey;
+                                                       $attributes[$name] = '';
+                                               }
+                                       }
+                                       $valuemode = '';
+                               } else {
+                                       $valuemode = 'on';
+                               }
+                       }
+                       if (is_array($attributes))      reset($attributes);
+                       return array($attributes,$attributesMeta);
+               }
+       }
        
        /**
+        * Returns an array with the 'components' from an attribute list. The result is normally analyzed by get_tag_attributes
+        * Removes tag-name if found
+        *
+        * @param       string          The tag or attributes
+        * @return      array
+        * @access private
+        * @see t3lib_div::split_tag_attributes()
+        */
+       function split_tag_attributes($tag)     {
+               $tag_tmp = trim(eregi_replace ('^<[^[:space:]]*','',trim($tag)));
+                       // Removes any > in the end of the string
+               $tag_tmp = trim(eregi_replace ('>$','',$tag_tmp));
+
+               $metaValue = array();
+               $value = array();
+               while (strcmp($tag_tmp,''))     {       // Compared with empty string instead , 030102
+                       $firstChar=substr($tag_tmp,0,1);
+                       if (!strcmp($firstChar,'"') || !strcmp($firstChar,"'")) {
+                               $reg=explode($firstChar,$tag_tmp,3);
+                               $value[]=$reg[1];
+                               $metaValue[]=$firstChar;
+                               $tag_tmp=trim($reg[2]);
+                       } elseif (!strcmp($firstChar,'=')) {
+                               $value[] = '=';
+                               $metaValue[]='';
+                               $tag_tmp = trim(substr($tag_tmp,1));            // Removes = chars.
+                       } else {
+                                       // There are '' around the value. We look for the next ' ' or '>'
+                               $reg = split('[[:space:]=]',$tag_tmp,2);
+                               $value[] = trim($reg[0]);
+                               $metaValue[]='';
+                               $tag_tmp = trim(substr($tag_tmp,strlen($reg[0]),1).$reg[1]);
+                       }
+               }
+               if (is_array($value))   reset($value);
+               return array($value,$metaValue);
+       }
+
+       /**
         * Checks whether block/solo tags are found in the correct amounts in HTML content
         * Block tags are tags which are required to have an equal amount of start and end tags, eg. "<table>...</table>"
         * Solo tags are tags which are required to have ONLY start tags (possibly with an XHTML ending like ".../>")
@@ -413,6 +543,23 @@ class t3lib_parsehtml {
                return $analyzedOutput;
        }       
 
+
+
+
+
+
+
+
+
+
+
+
+       /*********************************
+        *
+        * Clean HTML code
+        *
+        *********************************/
+
        /**
         * Function that can clean up HTML content according to configuration given in the $tags array.
         *
@@ -635,86 +782,6 @@ class t3lib_parsehtml {
        }
 
        /**
-        * Returns an array with all attributes as keys. Attributes are only lowercase a-z
-        * If a attribute is empty (shorthand), then the value for the key is empty. You can check if it existed with isset()
-        *
-        * @param       string          Tag: $tag is either a whole tag (eg '<TAG OPTION ATTRIB=VALUE>') or the parameterlist (ex ' OPTION ATTRIB=VALUE>')
-        * @param       boolean         If set, the attribute values are de-htmlspecialchar'ed. Should actually always be set!
-        * @return      array           array(Tag attributes,Attribute meta-data)
-        */
-       function get_tag_attributes($tag,$deHSC=0)      {
-               list($components,$metaC) = $this->split_tag_attributes($tag);
-               $name = '';      // attribute name is stored here
-               $valuemode = '';
-               $attributes=array();
-               $attributesMeta=array();
-               if (is_array($components))      {
-                       while (list($key,$val) = each ($components))    {
-                               if ($val != '=')        {       // Only if $name is set (if there is an attribute, that waits for a value), that valuemode is enabled. This ensures that the attribute is assigned it's value
-                                       if ($valuemode) {
-                                               if ($name)      {
-                                                       $attributes[$name] = $deHSC?t3lib_div::htmlspecialchars_decode($val):$val;
-                                                       $attributesMeta[$name]['dashType']=$metaC[$key];
-                                                       $name = '';
-                                               }
-                                       } else {
-                                               if ($namekey = ereg_replace('[^a-zA-Z0-9_-]','',$val))  {
-                                                       $name = strtolower($namekey);
-                                                       $attributesMeta[$name]=array();
-                                                       $attributesMeta[$name]['origTag']=$namekey;
-                                                       $attributes[$name] = '';
-                                               }
-                                       }
-                                       $valuemode = '';
-                               } else {
-                                       $valuemode = 'on';
-                               }
-                       }
-                       if (is_array($attributes))      reset($attributes);
-                       return array($attributes,$attributesMeta);
-               }
-       }
-       
-       /**
-        * Returns an array with the 'components' from an attribute list. The result is normally analyzed by get_tag_attributes
-        * Removes tag-name if found
-        *
-        * @param       string          The tag or attributes
-        * @return      array
-        * @access private
-        * @see t3lib_div::split_tag_attributes()
-        */
-       function split_tag_attributes($tag)     {
-               $tag_tmp = trim(eregi_replace ('^<[^[:space:]]*','',trim($tag)));
-                       // Removes any > in the end of the string
-               $tag_tmp = trim(eregi_replace ('>$','',$tag_tmp));
-
-               $metaValue = array();
-               $value = array();
-               while (strcmp($tag_tmp,''))     {       // Compared with empty string instead , 030102
-                       $firstChar=substr($tag_tmp,0,1);
-                       if (!strcmp($firstChar,'"') || !strcmp($firstChar,"'")) {
-                               $reg=explode($firstChar,$tag_tmp,3);
-                               $value[]=$reg[1];
-                               $metaValue[]=$firstChar;
-                               $tag_tmp=trim($reg[2]);
-                       } elseif (!strcmp($firstChar,'=')) {
-                               $value[] = '=';
-                               $metaValue[]='';
-                               $tag_tmp = trim(substr($tag_tmp,1));            // Removes = chars.
-                       } else {
-                                       // There are '' around the value. We look for the next ' ' or '>'
-                               $reg = split('[[:space:]=]',$tag_tmp,2);
-                               $value[] = trim($reg[0]);
-                               $metaValue[]='';
-                               $tag_tmp = trim(substr($tag_tmp,strlen($reg[0]),1).$reg[1]);
-                       }
-               }
-               if (is_array($value))   reset($value);
-               return array($value,$metaValue);
-       }
-       
-       /**
         * Converts htmlspecialchars forth ($dir=1) AND back ($dir=-1)
         *
         * @param       string          Input value
@@ -992,6 +1059,23 @@ class t3lib_parsehtml {
        }
 
        /**
+        * Indents input content with $number instances of $indentChar
+        *
+        * @param       string          Content string, multiple lines.
+        * @param       integer         Number of indents
+        * @param       string          Indent character/string
+        * @return      string          Indented code (typ. HTML)
+        */
+       function indentLines($content, $number=1, $indentChar="\t")     {
+               $preTab = str_pad('', $number*strlen($indentChar), $indentChar);
+               $lines = explode(chr(10),str_replace(chr(13),'',$content));
+               while(list($k,$v) = each($lines))       {
+                       $lines[$k] = $preTab.$v;
+               }
+               return implode(chr(10), $lines);
+       }
+
+       /**
         * Converts TSconfig into an array for the HTMLcleaner function.
         *
         * @param       array           TSconfig for HTMLcleaner
@@ -1204,4 +1288,4 @@ class t3lib_parsehtml {
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_parsehtml.php'])        {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_parsehtml.php']);
 }
-?>
\ No newline at end of file
+?>
index 43b4a5f..4350871 100755 (executable)
@@ -40,8 +40,8 @@
  *
  *
  *  102: class t3lib_parsehtml_proc extends t3lib_parsehtml 
- *  137:     function init($elRef='',$recPid=0)        
- *  149:     function setRelPath($path)        
+ *  137:     function init($elRef='',$recPid=0)
+ *  149:     function setRelPath($path)
  *  173:     function evalWriteFile($pArr,$currentRecord)      
  *
  *              SECTION: Main function
@@ -106,7 +106,7 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
 
                // Internal, static:
        var $recPid = 0;                                // Set this to the pid of the record manipulated by the class.
-       var $elRef = '';                                // Element reference [table]:[field], eg. "tt_content:bodytext" 
+       var $elRef = '';                                // Element reference [table]:[field], eg. "tt_content:bodytext"
        var $relPath='';                                // Relative path
        var $relBackPath='';                    // Relative back-path
        var $procOptions = '';                  // Set to the TSconfig options coming from Page TSconfig
@@ -135,8 +135,8 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
         * @return      void
         */
        function init($elRef='',$recPid=0)      {
-               $this->recPid=$recPid;
-               $this->elRef=$elRef;
+               $this->recPid = $recPid;
+               $this->elRef = $elRef;
        }
 
        /**
@@ -1476,4 +1476,4 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_parsehtml_proc.php'])   {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_parsehtml_proc.php']);
 }
-?>
\ No newline at end of file
+?>
diff --git a/t3lib/class.t3lib_rteapi.php b/t3lib/class.t3lib_rteapi.php
new file mode 100755 (executable)
index 0000000..bd6595d
--- /dev/null
@@ -0,0 +1,208 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2004 Kasper Skaarhoj (kasper@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!
+***************************************************************/
+/**
+ * RTE API parent class.
+ *
+ * @author     Kasper Skårhøj <kasper@typo3.com>
+ */
+/**
+ * [CLASS/FUNCTION INDEX of SCRIPT]
+ *
+ *
+ *
+ *   64: class t3lib_rteapi 
+ *
+ *              SECTION: Main API functions;
+ *   93:     function isAvailable()    
+ *  118:     function drawRTE(&$pObj,$table,$field,$row,$PA,$specConf,$thisConfig,$RTEtypeVal,$RTErelPath,$thePidValue)        
+ *  151:     function transformContent($dirRTE,$value,$table,$field,$row,$specConf,$thisConfig,$RTErelPath,$pid)       
+ *
+ *              SECTION: Helper functions
+ *  196:     function triggerField($fieldName) 
+ *
+ * TOTAL FUNCTIONS: 4
+ * (This index is automatically created/updated by the extension "extdeveval")
+ *
+ */
+
+
+
+
+
+/**
+ * RTE base class: Delivers browser-detection, TCEforms binding and transformation routines for the "rte" extension, registering it with the RTE API in TYPO3 3.6.0
+ * See "rte" extension for usage.
+ *
+ * @author     Kasper Skaarhoj <kasper@typo3.com>
+ * @package TYPO3
+ * @subpackage t3lib
+ */
+class t3lib_rteapi {
+
+               // Internal, dynamic:
+       var $errorLog = array();                // Error messages regarding non-availability is collected here.
+
+               // Internal, static:
+       var $ID = '';                                   // Set this to the extension key of the RTE so it can identify itself.
+
+
+
+
+
+
+
+
+       /***********************************
+        *
+        * Main API functions;
+        * When you create alternative RTEs, simply override these functions in your parent class.
+        * See the "rte" or "rtehtmlarea" extension as an example!
+        *
+        **********************************/
+
+       /**
+        * Returns true if the RTE is available. Here you check if the browser requirements are met.
+        * If there are reasons why the RTE cannot be displayed you simply enter them as text in ->errorLog
+        *
+        * @return      boolean         TRUE if this RTE object offers an RTE in the current browser environment
+        */
+       function isAvailable()  {
+               global $CLIENT;
+
+               $this->errorLog = array();
+               if (!$CLIENT['FORMSTYLE'])      $this->errorLog[] = 'RTE API: Browser didn\'t support styles';
+
+               if (!count($this->errorLog))    return TRUE;
+       }
+
+       /**
+        * Draws the RTE as a form field or whatever is needed (inserts JavaApplet, creates iframe, renders ....)
+        * Default is to output the transformed content in a plain textarea field. This mode is great for debugging transformations!
+        *
+        * @param       object          Reference to parent object, which is an instance of the TCEforms.
+        * @param       string          The table name
+        * @param       string          The field name
+        * @param       array           The current row from which field is being rendered
+        * @param       array           Array of standard content for rendering form fields from TCEforms. See TCEforms for details on this. Includes for instance the value and the form field name, java script actions and more.
+        * @param       array           "special" configuration - what is found at position 4 in the types configuration of a field from record, parsed into an array.
+        * @param       array           Configuration for RTEs; A mix between TSconfig and otherwise. Contains configuration for display, which buttons are enabled, additional transformation information etc.
+        * @param       string          Record "type" field value.
+        * @param       string          Relative path for images/links in RTE; this is used when the RTE edits content from static files where the path of such media has to be transformed forth and back!
+        * @param       integer         PID value of record (true parent page id)
+        * @return      string          HTML code for RTE!
+        */
+       function drawRTE(&$pObj,$table,$field,$row,$PA,$specConf,$thisConfig,$RTEtypeVal,$RTErelPath,$thePidValue)      {
+
+                       // Transform value:
+               $value = $this->transformContent('rte',$PA['itemFormElValue'],$table,$field,$row,$specConf,$thisConfig,$RTErelPath,$thePidValue);
+
+                       // Create item:
+               $item = '
+                       '.$this->triggerField($PA['itemFormElName']).'
+                       <textarea name="'.htmlspecialchars($PA['itemFormElName']).'"'.$pObj->formWidthText('48','off').' rows="20" wrap="off" style="background-color: #99eebb;">'.
+                       t3lib_div::formatForTextarea($value).
+                       '</textarea>';
+
+                       // Return form item:
+               return $item;
+       }
+
+       /**
+        * Performs transformation of content to/from RTE. The keyword $dirRTE determines the direction.
+        * This function is called in two situations:
+        * a) Right before content from database is sent to the RTE (see ->drawRTE()) it might need transformation
+        * b) When content is sent from the RTE and into the database it might need transformation back again (going on in TCEmain class; You can't affect that.)
+        *
+        * @param       string          Keyword: "rte" means direction from db to rte, "db" means direction from Rte to DB
+        * @param       string          Value to transform.
+        * @param       string          The table name
+        * @param       string          The field name
+        * @param       array           The current row from which field is being rendered
+        * @param       array           "special" configuration - what is found at position 4 in the types configuration of a field from record, parsed into an array.
+        * @param       array           Configuration for RTEs; A mix between TSconfig and otherwise. Contains configuration for display, which buttons are enabled, additional transformation information etc.
+        * @param       string          Relative path for images/links in RTE; this is used when the RTE edits content from static files where the path of such media has to be transformed forth and back!
+        * @param       integer         PID value of record (true parent page id)
+        * @return      string          Transformed content
+        */
+       function transformContent($dirRTE,$value,$table,$field,$row,$specConf,$thisConfig,$RTErelPath,$pid)     {
+
+#debug(array($dirRTE,$value,$table,$field,$row,$specConf,$thisConfig,$RTErelPath,$pid));
+
+               if ($specConf['rte_transform']) {
+                       $p = t3lib_BEfunc::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
+                       if ($p['mode']) {       // There must be a mode set for transformation
+#debug($p['mode'],'MODE');
+
+                                       // Initialize transformation:
+                               $parseHTML = t3lib_div::makeInstance('t3lib_parsehtml_proc');
+                               $parseHTML->init($table.':'.$field, $pid);
+                               $parseHTML->setRelPath($RTErelPath);
+
+                                       // Perform transformation:
+                               $value = $parseHTML->RTE_transform($value, $specConf, $dirRTE, $thisConfig);
+                       }
+               }
+
+#debug(array($dirRTE,$value),'OUT: '.$dirRTE);
+               return $value;
+       }
+
+
+
+
+
+
+
+
+
+
+
+
+       /***********************************
+        *
+        * Helper functions
+        *
+        **********************************/
+
+       /**
+        * Trigger field - this field tells the TCEmain that processing should be done on this value!
+        *
+        * @param       string          Field name of the RTE field.
+        * @return      string          <input> field of type "hidden" with a flag telling the TCEmain that this fields content should be traansformed back to database state.
+        */
+       function triggerField($fieldName)       {
+
+               $triggerFieldName = ereg_replace('\[([^]]+)\]$','[_TRANSFORM_\1]', $fieldName);
+               return '<input type="hidden" name="'.htmlspecialchars($triggerFieldName).'" value="RTE" />';
+       }
+}
+
+// Include extension?
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rte/class.tx_rte_base.php'])  {
+       include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/rte/class.tx_rte_base.php']);
+}
+?>
index d6d340c..1955605 100644 (file)
@@ -112,8 +112,10 @@ class t3lib_syntaxhl {
                'T3FlexForms' => array('<span style="font-weight: bold;">','</span>'),
                'meta' => array('<span style="font-weight: bold; color: #800080;">','</span>'),
                'data' => array('<span style="font-weight: bold; color: #800080;">','</span>'),
+               'el' => array('<span style="font-weight: bold; color: #80a000;">','</span>'),
+               'numIndex' => array('<span style="color: #333333;">','</span>'),
                '_unknown' => array('<span style="font-style: italic; color: #666666;">','</span>'),
-               
+
 
                'sDEF'  => array('<span style="font-weight: bold; color: #008000;">','</span>'),
                'level:sheet' => array('<span style="font-weight: bold; color: #008000;">','</span>'),
@@ -123,8 +125,8 @@ class t3lib_syntaxhl {
 
                'level:fieldname' => array('<span style="font-weight: bold; color: #666666;">','</span>'),
 
-               'vDEF'  => array('<span style="font-weight: bold; color: #800000;">','</span>'),
-               'level:value' => array('<span style="font-weight: bold; color: #800000;">','</span>'),
+               'vDEF'  => array('<span style="font-weight: bold; color: #008080;">','</span>'),
+               'level:value' => array('<span style="font-weight: bold; color: #008080;">','</span>'),
 
                'currentSheetId' => array('<span style="color: #000080;">','</span>'),
                'currentLangId' => array('<span style="color: #000080;">','</span>'),
@@ -300,16 +302,22 @@ class t3lib_syntaxhl {
                        $app='fieldname';
                } elseif($app=='fieldname')     {
                        $app='value';
+               } elseif($app=='el' || $app=='numIndex')        {
+                       $app='fieldname';
                }
-               
-                       // Traverse structure:          
+
+                       // Traverse structure:
                foreach($struct as $k => $v)    {
                        if ($k%2)       {
                                $wrap = array('','');
 
-                                       // Default wrap:                                
+                               if ($v['tagName'] == 'numIndex')        {
+                                       $app = 'numIndex';
+                               }
+
+                                       // Default wrap:
                                $wrap = $this->FF_wrapTags[$v['tagName']];
-                               
+
                                        // If no wrap defined, us "unknown" definition
                                if (!is_array($wrap))   {
                                        switch($app)    {
@@ -325,6 +333,10 @@ class t3lib_syntaxhl {
                                        }
                                }
 
+                               if ($v['tagName']=='el')        {
+                                       $app='el';
+                               }
+
                                $output.=$wrap[0].htmlspecialchars($v['tag']).$wrap[1];
                                $output.=$this->highLight_FF_markUpRecursively($v['sub'],$v['tagName'],$app);
                                $output.=$wrap[0].htmlspecialchars('</'.$v['tagName'].'>').$wrap[1];
@@ -414,4 +426,4 @@ class t3lib_syntaxhl {
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_syntaxhl.php']) {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_syntaxhl.php']);
 }
-?>
\ No newline at end of file
+?>
index 8d4c86f..12c18ec 100755 (executable)
  *  388:     function getMainFields($table,$row,$depth=0)      
  *  515:     function getListedFields($table,$row,$list)       
  *  556:     function getPaletteFields($table,$row,$palette,$header='',$itemList='',$collapsedHeader='')       
- *  632:     function getSingleField($table,$field,$row,$altName='',$palette=0,$extra='',$pal=0)       
+ *  632:     function getSingleField($table,$field,$row,$altName='',$palette=0,$extra='',$pal=0)
  *  760:     function getSingleField_SW($table,$field,$row,&$PA)
  *
  *              SECTION: Rendering of each TCEform field type
- *  831:     function getSingleField_typeInput($table,$field,$row,&$PA)        
- *  883:     function getSingleField_typeText($table,$field,$row,&$PA) 
- *  986:     function getSingleField_typeCheck($table,$field,$row,&$PA)        
- * 1045:     function getSingleField_typeRadio($table,$field,$row,&$PA)        
+ *  831:     function getSingleField_typeInput($table,$field,$row,&$PA)
+ *  883:     function getSingleField_typeText($table,$field,$row,&$PA)
+ *  986:     function getSingleField_typeCheck($table,$field,$row,&$PA)
+ * 1045:     function getSingleField_typeRadio($table,$field,$row,&$PA)
  * 1075:     function getSingleField_typeSelect($table,$field,$row,&$PA)
- * 1236:     function getSingleField_typeGroup($table,$field,$row,&$PA)        
- * 1380:     function getSingleField_typeNone($table,$field,$row,&$PA) 
- * 1434:     function getSingleField_typeFlex($table,$field,$row,&$PA) 
+ * 1236:     function getSingleField_typeGroup($table,$field,$row,&$PA)
+ * 1380:     function getSingleField_typeNone($table,$field,$row,&$PA)
+ * 1434:     function getSingleField_typeFlex($table,$field,$row,&$PA)
  * 1535:     function getSingleField_typeFlex_langMenu($languages,$elName,$selectedLanguage,$multi=1)  
  * 1554:     function getSingleField_typeFlex_sheetMenu($sArr,$elName,$sheetKey)       
  * 1584:     function getSingleField_typeFlex_draw($dataStruct,$editData,$cmdData,$table,$field,$row,&$PA,$formPrefix='',$level=0,$tRows=array())
- * 1734:     function getSingleField_typeUnknown($table,$field,$row,&$PA)      
- * 1749:     function getSingleField_typeUser($table,$field,$row,&$PA) 
+ * 1734:     function getSingleField_typeUnknown($table,$field,$row,&$PA)
+ * 1749:     function getSingleField_typeUser($table,$field,$row,&$PA)
  *
  *              SECTION: "Configuration" fetching/processing functions
  * 1783:     function getRTypeNum($table,$row) 
  * 1908:     function mergeFieldsWithAddedFields($fields,$fieldsToAdd) 
  * 1940:     function setTSconfig($table,$row,$field='')
  * 1962:     function getSpecConfForField($table,$row,$field)  
- * 1982:     function getSpecConfFromString($extraString)    
+ * 1982:     function getSpecConfFromString($extraString)
  *
  *              SECTION: Form element helper functions
  * 2014:     function dbFileIcons($fName,$mode,$allowed,$itemArray,$selector='',$params=array(),$onFocus='')   
- * 2123:     function renderWizards($itemKinds,$wizConf,$table,$row,$field,&$PA,$itemName,$specConf,$RTE=0)    
+ * 2123:     function renderWizards($itemKinds,$wizConf,$table,$row,$field,&$PA,$itemName,$specConf,$RTE=0)
  * 2286:     function getIcon($icon)   
  * 2317:     function wrapOpenPalette($header,$table,$row,$palette,$retFunc=0) 
  * 2341:     function checkBoxParams($itemName,$thisValue,$c,$iCount,$addFunc='')      
@@ -93,7 +93,7 @@
  *              SECTION: Item-array manipulation functions (check/select/radio)
  * 2496:     function initItemArray($fieldValue)
  * 2514:     function addItems($items,$iArray) 
- * 2536:     function procItems($items,$iArray,$config,$table,$row,$field)     
+ * 2536:     function procItems($items,$iArray,$config,$table,$row,$field)
  * 2560:     function addSelectOptionsToItemArray($items,$fieldValue,$TSconfig,$field)
  * 2638:     function addSelectOptionsToItemArray_makeModuleData($value)
  * 2660:     function foreignTable($items,$fieldValue,$TSconfig,$field,$pFFlag=0)      
  * 2737:     function setFancyDesign() 
  * 2764:     function setNewBEDesign() 
  * 2818:     function intoTemplate($inArr,$altTemplate='')     
- * 2842:     function addUserTemplateMarkers($marker,$table,$field,$row,&$PA)  
+ * 2842:     function addUserTemplateMarkers($marker,$table,$field,$row,&$PA)
  * 2853:     function wrapLabels($str) 
  * 2866:     function wrapTotal($c,$rec,$table)        
  * 2879:     function replaceTableWrap($arr,$rec,$table)       
  * 3061:     function restoreSchemes() 
  *
  *              SECTION: JavaScript related functions
- * 3091:     function JStop($formname='forms[0]')      
+ * 3091:     function JStop($formname='forms[0]')
  * 3131:     function JSbottom($formname='forms[0]')   
  * 3447:     function dbFileCon($formObj='document.forms[0]')  
  * 3555:     function printNeededJSFunctions() 
- * 3582:     function printNeededJSFunctions_top()     
+ * 3582:     function printNeededJSFunctions_top()
  *
  *              SECTION: Various helper functions
  * 3630:     function getDefaultRecord($table,$pid=0)  
  * 3669:     function getRecordPath($table,$rec)       
  * 3682:     function readPerms()      
  * 3696:     function sL($str) 
- * 3709:     function getLL($str)      
+ * 3709:     function getLL($str)
  * 3727:     function isPalettesCollapsed($table,$palette)     
- * 3742:     function isDisplayCondition($displayCond,$row)    
- * 3795:     function getTSCpid($table,$uid,$pid)      
+ * 3742:     function isDisplayCondition($displayCond,$row)
+ * 3795:     function getTSCpid($table,$uid,$pid)
  * 3809:     function doLoadTableDescr($table) 
  * 3821:     function getAvailableLanguages($onlyIsoCoded=1,$setDefault=1)     
  *
@@ -172,10 +172,8 @@ class t3lib_TCEforms       {
 
                // variables not commented yet.... (do so...)
        var $helpTextFontTag='<font color="#333333">';
-       var $RTEpath = 'ext/rte/app/';
        var $palFieldArr=array();
        var $disableWizards=0;
-       var $RTEdivStyle='';
        var $isPalettedoc=0;
        var $paletteMargin=1;
        var $defStyle = ''; // 'font-family:Verdana;font-size:10px;';
@@ -183,7 +181,6 @@ class t3lib_TCEforms        {
        var $cachedTSconfig_fieldLevel=array();
        var $transformedRow=array();
        var $extJSCODE='';
-       var $RTEwindows=array();
        var $printNeededJS = array();
        var $hiddenFieldAccum=array();
        var $TBE_EDITOR_fieldChanged_func='';
@@ -209,12 +206,11 @@ class t3lib_TCEforms      {
        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.
 
-       
+
                // INTERNAL, static
        var $prependFormFieldNames = 'data';            // The string to prepend formfield 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 $RTEbgColor= '#F6F2E6';                                     // The background color passed to the RTE
 
                
 
@@ -250,7 +246,10 @@ class t3lib_TCEforms       {
        var $renderDepth=0;                                                     // Keeps track of the rendering depth of nested records.
        var $savedSchemes=array();                                      // Color scheme buffer.
 
-
+               // Internal, registers for user defined functions etc.
+       var $additionalJS_pre = array();                        // Additional JavaScript, printed before 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.
 
 
 
@@ -266,21 +265,16 @@ class t3lib_TCEforms      {
        function t3lib_TCEforms()       {
                global $CLIENT;
                
-               $this->clientInfo=t3lib_div::clientInfo();
+               $this->clientInfo = t3lib_div::clientInfo();
+
                $this->RTEenabled = $GLOBALS['BE_USER']->isRTE();
                if (!$this->RTEenabled) {
-                       $this->RTEenabled_notReasons=
-                               (!t3lib_extMgm::isLoaded('rte') ? "- 'rte' extension is not loaded\n":'').
-                               ($CLIENT['BROWSER']!='msie' ? "- Browser is not MSIE\n":'').
-                               ($CLIENT['SYSTEM']!='win' ? "- Client system is not Windows\n":'').
-                               ($CLIENT['VERSION']<5 ? "- Browser version below 5\n":'').
-                               (!$GLOBALS['BE_USER']->uc['edit_RTE'] ? "- RTE is not enabled for user!\n":'').
-                               (!$GLOBALS['TYPO3_CONF_VARS']['BE']['RTEenabled'] ? '- RTE is not enabled in $TYPO3_CONF_VARS["BE"]["RTEenabled"]'.chr(10):'');
-                       $this->commentMessages[]='RTE NOT ENABLED IN SYSTEM due to:'.chr(10).$this->RTEenabled_notReasons;
+                       $this->RTEenabled_notReasons = implode(chr(10),$GLOBALS['BE_USER']->RTE_errors);
+                       $this->commentMessages[] = 'RTE NOT ENABLED IN SYSTEM due to:'.chr(10).$this->RTEenabled_notReasons;
                }
-               
+
                        // Default color scheme
-               $this->defColorScheme=array(
+               $this->defColorScheme = array(
                        $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,-10),      // Background for the palette field header
@@ -290,11 +284,11 @@ class t3lib_TCEforms      {
 
                        // Override / Setting defaults from TBE_STYLES array
                $this->resetSchemes();
-               
+
                        // Setting the current colorScheme to default.
-               $this->defColorScheme=$this->colorScheme;
+               $this->defColorScheme = $this->colorScheme;
        }
-       
+
        /**
         * Initialize various internal variables.
         *
@@ -304,7 +298,6 @@ class t3lib_TCEforms        {
                global $BE_USER;
                $this->prependFormFieldNames = 'data';
                $this->formName = 'editform';
-               $this->RTEbgColor = $GLOBALS['SOBE']->doc->bgColor;
                $this->setNewBEDesign();
                $this->docLarge = $BE_USER->uc['edit_wideDocument'] ? 1 : 0;
                $this->edit_showFieldHelp = $BE_USER->uc['edit_showFieldHelp'];
@@ -632,13 +625,13 @@ class t3lib_TCEforms      {
        function getSingleField($table,$field,$row,$altName='',$palette=0,$extra='',$pal=0)     {
                global $TCA,$BE_USER;
 
-               $out='';
-               $PA=array();
-               $PA['altName']=$altName;
+               $out = '';
+               $PA = array();
+               $PA['altName'] = $altName;
                $PA['palette'] = $palette;
                $PA['extra'] = $extra;
                $PA['pal'] = $pal;
-        
+
                        // Make sure to load full $TCA array for the table:
                t3lib_div::loadTCA($table);
 
@@ -647,23 +640,23 @@ class t3lib_TCEforms      {
 
                        // Now, check if this field is configured and editable (according to excludefields + other configuration)
                if (    is_array($PA['fieldConf']) &&
-                               (!$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']['type']!='passthrough' &&
                                ($this->RTEenabled || !$PA['fieldConf']['config']['showIfRTE']) &&
                                (!$PA['fieldConf']['displayCond'] || $this->isDisplayCondition($PA['fieldConf']['displayCond'],$row))
                        )       {
 
-                               // Fetching the TSconfig for the current table/field. This includes the $row which means that 
+                               // Fetching the TSconfig for the current table/field. This includes the $row which means that
                        $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'])  {
-                                       
+
                                        // Init variables:
                                $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['itemFormElValue']=$row[$field];            // The value to show in the form 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'])) ||
@@ -671,12 +664,12 @@ class t3lib_TCEforms      {
                                                && !$BE_USER->uc['noOnChangeAlertInTypeFields'])        {
                                        $alertMsgOnChange = 'if (confirm('.$GLOBALS['LANG']->JScharCode($this->getLL('m_onChangeAlert')).') && TBE_EDITOR_checkSubmit(-1)){ TBE_EDITOR_submitForm() };';
                                } else {$alertMsgOnChange='';}
-                               
+
                                        // Render as a hidden field?
                                if (in_array($field,$this->hiddenFieldListArr)) {
                                        $this->hiddenFieldAccum[]='<input type="hidden" name="'.$PA['itemFormElName'].'" value="'.htmlspecialchars($PA['itemFormElValue']).'" />';
                                } 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['pal'] && $this->isPalettesCollapsed($table,$PA['pal']))        {
@@ -688,7 +681,7 @@ class t3lib_TCEforms        {
                                        }
                                                // onFocus attribute to add to the field:
                                        $PA['onFocus'] = ($palJSfunc && !$BE_USER->uc['dontShowPalettesOnFocusInAB']) ? ' onfocus="'.htmlspecialchars($palJSfunc).'"' : '';
-                                       
+
                                                // Find item
                                        $item='';
                                        $PA['label'] = $PA['altName'] ? $PA['altName'] : $PA['fieldConf']['label'];
@@ -834,7 +827,7 @@ class t3lib_TCEforms        {
 
                $config = $PA['fieldConf']['config'];
 #              $specConf = $this->getSpecConfForField($table,$row,$field);
-               $specConf = $this->getSpecConfFromString($PA['extra']);
+               $specConf = $this->getSpecConfFromString($PA['extra'], $PA['fieldConf']['defaultExtras']);
                $size = t3lib_div::intInRange($config['size']?$config['size']:30,5,$this->maxInputWidth);
                $evalList = t3lib_div::trimExplode(',',$config['eval'],1);
 
@@ -901,7 +894,7 @@ class t3lib_TCEforms        {
                $RTEwouldHaveBeenLoaded = 0;    // Set true, if the RTE would have been loaded if it wasn't for the disable-RTE flag in the bottom of the page...
 
                        // "Extra" configuration; Returns configuration for the field based on settings found in the "types" fieldlist. Traditionally, this is where RTE configuration has been found.
-               $specConf = $this->getSpecConfFromString($PA['extra']);
+               $specConf = $this->getSpecConfFromString($PA['extra'], $PA['fieldConf']['defaultExtras']);
 
                        // Setting up the altItem form field, which is a hidden field containing the value
                $altItem = '<input type="hidden" name="'.htmlspecialchars($PA['itemFormElName']).'" value="'.htmlspecialchars($PA['itemFormElValue']).'" />';
@@ -910,7 +903,6 @@ class t3lib_TCEforms        {
                if ($this->RTEenabled) {
                        $p = t3lib_BEfunc::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
                        if (isset($specConf['richtext']) && (!$p['flag'] || !$row[$p['flag']])) {       // If the field is configured for RTE and if any flag-field is not set to disable it.
-
                                list($tscPID,$thePidValue) = $this->getTSCpid($table,$row['uid'],$row['pid']);
 
                                        // If the pid-value is not negative (that is, a pid could NOT be fetched)
@@ -918,29 +910,21 @@ class t3lib_TCEforms      {
                                        $RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($tscPID));
                                        $RTEtypeVal = t3lib_BEfunc::getTCAtypeValue($table,$row);
                                        $thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'],$table,$field,$RTEtypeVal);
+
                                        if (!$thisConfig['disabled'])   {
                                                if (!$this->disableRTE) {
-                                                       $RTEWidth = 460+($this->docLarge ? 150 : 0);
-                                                       $RTEdivStyle = $this->RTEdivStyle ? $this->RTEdivStyle : 'position:relative; left:0px; top:0px; height:380px; width:'.$RTEWidth.'px; border:solid 0px;';
-                                                       $rteURL = $this->backPath.$this->RTEpath.'rte.php?'.
-                                                                                       'elementId='.rawurlencode($PA['itemFormElName']).       // Form element name
-                                                                                       '&pid='.$row['pid'].                                                            // PID for record being edited.
-                                                                                       '&typeVal='.rawurlencode($RTEtypeVal).                          // TCA "types" value for record
-                                                                                       '&bgColor='.rawurlencode($this->colorScheme[0]).        // Background color
-                                                                                       '&sC='.rawurlencode($PA['extra']).                                      // Extra options; This is index 3 (part #4) of the TCA "types" configuration of the field. Can be parsed by
-                                                                                       '&formName='.rawurlencode($this->formName);                     // Form name
-
-                                                       $item = $altItem;
-                                                       $item.= '
-                                                               <div id="cdiv'.count($this->RTEwindows).'" style="'.htmlspecialchars($RTEdivStyle).'">
-                                                               <iframe
-                                                                       src="'.htmlspecialchars($rteURL).'"
-                                                                       id="'.$PA['itemFormElName'].'_RTE"
-                                                                       style="visibility:visible; position:absolute; left:0px; top:0px; height:100%; width:100%;"></iframe>
-                                                               </div>';
 
+                                                               // Find alternative relative path for RTE images/links:
+                                                       $eFile = t3lib_parsehtml_proc::evalWriteFile($specConf['static_write'], $row);
+                                                       $RTErelPath = is_array($eFile) ? dirname($eFile['relEditFile']) : '';
+
+                                                               // Get RTE object, draw form and set flag:
+                                                       $RTEobj = &t3lib_BEfunc::RTEgetObj();
+                                                       $item = $RTEobj->drawRTE($this,$table,$field,$row,$PA,$specConf,$thisConfig,$RTEtypeVal,$RTErelPath,$thePidValue);
+
+                                                               // Wizard:
                                                        $item = $this->renderWizards(array($item,$altItem),$config['wizards'],$table,$row,$field,$PA,$PA['itemFormElName'],$specConf,1);
-                                                       $this->RTEwindows[] = $PA['itemFormElName'];
+
                                                        $RTEwasLoaded = 1;
                                                } else {
                                                        $RTEwouldHaveBeenLoaded = 1;
@@ -949,24 +933,28 @@ class t3lib_TCEforms      {
                                        } else $this->commentMessages[] = $PA['itemFormElName'].': RTE is disabled by the Page TSconfig, "RTE"-key (eg. by RTE.default.disabled=0 or such)';
                                } else $this->commentMessages[] = $PA['itemFormElName'].': PID value could NOT be fetched. Rare error, normally with new records.';
                        } else {
-                               if (!isset($specConf['richtext']))      $this->commentMessages[]=$PA['itemFormElName'].': RTE was not configured for this field in TCA-types';
-                               if (!(!$p['flag'] || !$row[$p['flag']]))         $this->commentMessages[]=$PA['itemFormElName'].': Field-flag ('.$PA['flag'].') has been set to disable RTE!';
+                               if (!isset($specConf['richtext']))      $this->commentMessages[] = $PA['itemFormElName'].': RTE was not configured for this field in TCA-types';
+                               if (!(!$p['flag'] || !$row[$p['flag']]))         $this->commentMessages[] = $PA['itemFormElName'].': Field-flag ('.$PA['flag'].') has been set to disable RTE!';
                        }
                }
 
                        // Display ordinary field if RTE was not loaded.
                if (!$RTEwasLoaded) {
-                       if (strstr($PA['extra'],'nowrap'))      {
-                               $wrap = 'off';
+                       if ($specConf['rte_only'])      {       // Show message, if no RTE (field can only be edited with RTE!)
+                               $item = '<p><em>'.htmlspecialchars($this->getLL('l_noRTEfound')).'</em></p>';
                        } else {
-                               $wrap = ($config['wrap'] ? $config['wrap'] : 'virtual');
+                               if ($specConf['nowrap'])        {
+                                       $wrap = 'off';
+                               } else {
+                                       $wrap = ($config['wrap'] ? $config['wrap'] : 'virtual');
+                               }
+                               $iOnChange = implode('',$PA['fieldChangeFunc']);
+                               $item.= '
+                                                       <textarea name="'.$PA['itemFormElName'].'"'.$this->formWidthText($cols,$wrap).' rows="'.$rows.'" wrap="'.$wrap.'" onchange="'.htmlspecialchars($iOnChange).'"'.$PA['onFocus'].'>'.
+                                                       t3lib_div::formatForTextarea($PA['itemFormElValue']).
+                                                       '</textarea>';
+                               $item = $this->renderWizards(array($item,$altItem),$config['wizards'],$table,$row,$field,$PA,$PA['itemFormElName'],$specConf,$RTEwouldHaveBeenLoaded);
                        }
-                       $iOnChange = implode('',$PA['fieldChangeFunc']);
-                       $item.= '
-                                               <textarea name="'.$PA['itemFormElName'].'"'.$this->formWidthText($cols,$wrap).' rows="'.$rows.'" wrap="'.$wrap.'" onchange="'.htmlspecialchars($iOnChange).'"'.$PA['onFocus'].'>'.
-                                               t3lib_div::formatForTextarea($PA['itemFormElValue']).
-                                               '</textarea>';
-                       $item = $this->renderWizards(array($item,$altItem),$config['wizards'],$table,$row,$field,$PA,$PA['itemFormElName'],$specConf,$RTEwouldHaveBeenLoaded);
                }
 
                        // Return field HTML:
@@ -1000,7 +988,7 @@ class t3lib_TCEforms       {
                        $item.= '<table border="0" cellspacing="0" cellpadding="0">';
                        for ($c=0;$c<count($selItems);$c++) {
                                $p = $selItems[$c];
-                               if(!($c%$cols)) {$item.='<tr>';}
+                               if(!($c%$cols)) { $item.='<tr>'; }
                                $cBP = $this->checkBoxParams($PA['itemFormElName'],$thisValue,$c,count($selItems),implode('',$PA['fieldChangeFunc']));
                                $cBName = $PA['itemFormElName'].'_'.$c;
                                $item.= '<td nowrap="nowrap">'.
@@ -1014,7 +1002,7 @@ class t3lib_TCEforms      {
                                for ($c=0;$c<$rest;$c++) {
                                        $item.= '<td></td>';
                                }
-                               if ($c>0)       {$item.= '</tr>';}
+                               if ($c>0)       { $item.= '</tr>'; }
                        }
                        $item.= '</table>';
                } else {
@@ -1695,7 +1683,9 @@ class t3lib_TCEforms      {
                                                        $fakePA=array();
                                                        $fakePA['fieldConf']=array(
                                                                'label' => $this->sL($value['TCEforms']['label']),
-                                                               'config' => $value['TCEforms']['config']
+                                                               'config' => $value['TCEforms']['config'],
+                                                               'defaultExtras' => $value['TCEforms']['defaultExtras'],
+                                                               'displayCond' => $value['TCEforms']['displayCond'],     // Haven't tested this...
                                                        );
                                                        $fakePA['fieldChangeFunc']=$PA['fieldChangeFunc'];
                                                        $fakePA['onFocus']=$PA['onFocus'];
@@ -1961,8 +1951,8 @@ class t3lib_TCEforms      {
         */
        function getSpecConfForField($table,$row,$field)        {
                        // Finds the current "types" configuration for the table/row:
-               $types_fieldConfig=t3lib_BEfunc::getTCAtypes($table,$row);
-               
+               $types_fieldConfig = t3lib_BEfunc::getTCAtypes($table,$row);
+
                        // If this is an array, then traverse it:
                if (is_array($types_fieldConfig))       {
                        foreach($types_fieldConfig as $vconf)   {
@@ -1976,11 +1966,12 @@ class t3lib_TCEforms    {
         * Returns the "special" configuration of an "extra" string (non-parsed)
         *
         * @param       string          The "Part 4" of the fields configuration in "types" "showitem" lists.
+        * @param       string          The ['defaultExtras'] value from field configuration
         * @return      array           An array with the special options in.
         * @see getSpecConfForField(), t3lib_BEfunc::getSpecConfParts()
         */
-       function getSpecConfFromString($extraString)    {
-               return t3lib_BEfunc::getSpecConfParts($extraString);
+       function getSpecConfFromString($extraString, $defaultExtras)    {
+               return t3lib_BEfunc::getSpecConfParts($extraString, $defaultExtras);
        }
 
 
@@ -3083,33 +3074,29 @@ class t3lib_TCEforms    {
         ********************************************/
 
        /**
-        * JavaScript code used for input-field evaluation.
+        * JavaScript code added BEFORE the form is drawn:
         *
-        * @param       string          The identification of the form on the page.
         * @return      string          A <script></script> section with JavaScript.
         */
-       function JStop($formname='forms[0]')    {
-               if (count($this->RTEwindows))   {
+       function JStop()        {
+               if (count($this->additionalJS_pre))     {
                        $out.='
 
 
-                               <!--
-                                       JavaScript in top of page (before form):
-                                       Setting content in RTE!
-                               -->
+               <!--
+                       JavaScript in top of page (before form):
+               -->
 
-                               <script type="text/javascript">
-                                       /*<![CDATA[*/
-                                               var TBE_RTE_WINDOWS = new Array();
+               <script type="text/javascript">
+                       /*<![CDATA[*/
 
-                                               function TBE_EDITOR_setRTEref(RTEobj,theField,loadContent)      {       //
-                                                       TBE_RTE_WINDOWS[theField] = RTEobj;
-                                                       if (loadContent)        {
-                                                               RTEobj.setHTML(document.'.$formname.'[theField].value);
-                                                       }
-                                               }
-                                       /*]]>*/
-                               </script>
+                       '.implode('
+
+                               // NEXT:
+                       ',$this->additionalJS_pre).'
+
+                       /*]]>*/
+               </script>
                        ';
                }
                return $out;
@@ -3152,15 +3139,6 @@ class t3lib_TCEforms     {
                                $reqRangeCheck[]="                                      if (!TBE_EDITOR_checkRange(document.".$formname."['".$itemName."_list'],".$range[0].",".$range[1]."))   {OK=0;}";
                                $reqRangeSet[]="                                        if (!TBE_EDITOR_checkRange(document.".$formname."['".$itemName."_list'],".$range[0].",".$range[1]."))   {TBE_EDITOR_setImage('req_".$range['imgName']."','TBE_EDITOR_req');}";
                        }
-//     debug($reqRange);
-
-                       $RTEwinArr = array();
-                       $RTEwinArrTransfer = array();
-                       reset($this->RTEwindows);
-                       while(list(,$itemName)=each($this->RTEwindows)) {
-                               #$RTEwinArr[]="                                 TBE_RTE_WINDOWS['".$itemName."'] = 0;";         // THIS line was commented out to fix the following bug; Content wasn't saved in the RTE once in a while on slow machines. Reason. The TBE_RTE_WINDOWS variable would correctly be set to an object reference BUT in cases where the RTE window loaded BEFORE the general TCEform did not finish its rendering the initialization of the TBE_RTE_WINDOWS variable would OVERRIDE the object reference being set before! Not initializing (or initializing BEFORE the form is drawn) is the solution.
-                               $RTEwinArrTransfer[]="                                  if(TBE_RTE_WINDOWS['".$itemName."'])    { document.".$formname."['".$itemName."'].value = TBE_RTE_WINDOWS['".$itemName."'].getHTML(); } else { OK=0; }";
-                       }
 
                        $this->TBE_EDITOR_fieldChanged_func='TBE_EDITOR_fieldChanged_fName(fName,formObj[fName+"_list"]);';
 
@@ -3172,11 +3150,11 @@ class t3lib_TCEforms    {
                        <script type="text/javascript" src="'.$this->backPath.'t3lib/jsfunc.evalfield.js"></script>
                        <script type="text/javascript">
                                /*<![CDATA[*/
-                               
-                               var TBE_EDITOR_req=new Image();         TBE_EDITOR_req.src = "'.t3lib_iconWorks::skinImg($this->backPath,'gfx/required_h.gif','',1).'"; 
-                               var TBE_EDITOR_cm=new Image();          TBE_EDITOR_cm.src = "'.t3lib_iconWorks::skinImg($this->backPath,'gfx/content_client.gif','',1).'"; 
-                               var TBE_EDITOR_sel=new Image();         TBE_EDITOR_sel.src = "'.t3lib_iconWorks::skinImg($this->backPath,'gfx/content_selected.gif','',1).'"; 
-                               var TBE_EDITOR_clear=new Image();       TBE_EDITOR_clear.src = "'.$this->backPath.'clear.gif"; 
+
+                               var TBE_EDITOR_req=new Image();         TBE_EDITOR_req.src = "'.t3lib_iconWorks::skinImg($this->backPath,'gfx/required_h.gif','',1).'";
+                               var TBE_EDITOR_cm=new Image();          TBE_EDITOR_cm.src = "'.t3lib_iconWorks::skinImg($this->backPath,'gfx/content_client.gif','',1).'";
+                               var TBE_EDITOR_sel=new Image();         TBE_EDITOR_sel.src = "'.t3lib_iconWorks::skinImg($this->backPath,'gfx/content_selected.gif','',1).'";
+                               var TBE_EDITOR_clear=new Image();       TBE_EDITOR_clear.src = "'.$this->backPath.'clear.gif";
                                var TBE_REQUIRED=new Array();
 '.implode(chr(10),$reqLines).'
 
@@ -3185,7 +3163,8 @@ class t3lib_TCEforms      {
                                var TBE_RANGE_upper=new Array();
 '.implode(chr(10),$reqRange).'
 
-'.implode(chr(10),$RTEwinArr).'
+                               // $this->additionalJS_post:
+'.implode(chr(10),$this->additionalJS_post).'
 
                                var TBE_EDITOR_loadTime = 0;
                                var TBE_EDITOR_isChanged = 0;
@@ -3285,7 +3264,10 @@ class t3lib_TCEforms     {
                                                return false;
                                        }
                                        var OK=1;
-'.implode(chr(10),$RTEwinArrTransfer).'
+
+                                       // $this->additionalJS_post:
+'.implode(chr(10),$this->additionalJS_submit).'
+
                                        if(!OK) {
                                                if (!confirm(unescape("SYSTEM ERROR: One or more Rich Text Editors on the page could not be contacted. This IS an error, although it should not be regular.\nYou can save the form now by pressing OK, but you will loose the Rich Text Editor content if you do.\n\nPlease report the error to your administrator if it persists.")))  {
                                                        return false;
@@ -3714,7 +3696,7 @@ class t3lib_TCEforms      {
                        case 'm_':
                                return $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:mess.'.substr($str,2));
                        break;
-               } 
+               }
        }
 
        /**
@@ -3741,7 +3723,7 @@ class t3lib_TCEforms      {
         */
        function isDisplayCondition($displayCond,$row)  {
                $output = FALSE;
-               
+
                $parts = explode(':',$displayCond);
                switch((string)$parts[0])       {       // Type of condition:
                        case 'FIELD':
index e63130a..b1968c4 100755 (executable)
@@ -46,7 +46,7 @@
  *
  *              SECTION: PROCESSING DATA
  *  423:     function process_datamap() 
- *  586:     function fillInFieldArray($table,$id,$fieldArray,$incomingFieldArray,$realPid,$status,$tscPID)    
+ *  586:     function fillInFieldArray($table,$id,$fieldArray,$incomingFieldArray,$realPid,$status,$tscPID)
  *  757:     function checkModifyAccessList($table)    
  *  769:     function isRecordInWebMount($table,$id)   
  *  783:     function isInWebMount($pid)       
  * 1046:     function recordInfo($table,$id,$fieldList)        
  * 1063:     function getRecordProperties($table,$id)  
  * 1075:     function getRecordPropertiesFromRow($table,$row)  
- * 1094:     function setTSconfigPermissions($fieldArray,$TSConfig_p)  
+ * 1094:     function setTSconfigPermissions($fieldArray,$TSConfig_p)
  * 1110:     function newFieldArray($table)    
  * 1141:     function overrideFieldArray($table,$data) 
  * 1154:     function assemblePermissions($string)     
  *
  *              SECTION: Evaluation of input values
- * 1204:     function checkValue($table,$field,$value,$id,$status,$realPid,$currentRecord)     
- * 1264:     function checkValue_SW($res,$value,$tcaFieldConf,$table,$id,$curValue,$status,$realPid,$recFID,$field,$uploadedFiles,$currentRecord=array())      
- * 1303:     function checkValue_input($res,$value,$tcaFieldConf,$PP,$field='')        
- * 1341:     function checkValue_check($res,$value,$tcaFieldConf,$PP)  
- * 1364:     function checkValue_radio($res,$value,$tcaFieldConf,$PP)  
- * 1389:     function checkValue_group_select($res,$value,$tcaFieldConf,$PP,$uploadedFiles)    
- * 1471:     function checkValue_group_select_file($valueArray,$tcaFieldConf,$curValue,$uploadedFileArray,$status,$table,$id,$recFID)  
- * 1624:     function checkValue_flex($res,$value,$tcaFieldConf,$PP,$uploadedFiles,$curRecordArr,$field)       
- * 1681:     function checkValue_flexArray2Xml($array) 
+ * 1204:     function checkValue($table,$field,$value,$id,$status,$realPid,$currentRecord)
+ * 1264:     function checkValue_SW($res,$value,$tcaFieldConf,$table,$id,$curValue,$status,$realPid,$recFID,$field,$uploadedFiles,$currentRecord=array())
+ * 1303:     function checkValue_input($res,$value,$tcaFieldConf,$PP,$field='')
+ * 1341:     function checkValue_check($res,$value,$tcaFieldConf,$PP)
+ * 1364:     function checkValue_radio($res,$value,$tcaFieldConf,$PP)
+ * 1389:     function checkValue_group_select($res,$value,$tcaFieldConf,$PP,$uploadedFiles)
+ * 1471:     function checkValue_group_select_file($valueArray,$tcaFieldConf,$curValue,$uploadedFileArray,$status,$table,$id,$recFID)
+ * 1624:     function checkValue_flex($res,$value,$tcaFieldConf,$PP,$uploadedFiles,$curRecordArr,$field)
+ * 1681:     function checkValue_flexArray2Xml($array)
  * 1698:     function _DELETE_FLEX_FORMdata(&$valueArrayToRemoveFrom,$deleteCMDS)      
  *
  *              SECTION: Helper functions for evaluation functions.
  * 1746:     function getUnique($table,$field,$value,$id,$newPid=0)    
- * 1784:     function checkValue_input_Eval($value,$evalArray,$is_in)  
- * 1872:     function checkValue_group_select_processDBdata($valueArray,$tcaFieldConf,$id,$status,$type)       
- * 1905:     function checkValue_group_select_explodeSelectGroupValue($value)  
- * 1928:     function checkValue_flex_procInData($dataPart,$dataPart_current,$uploadedFiles,$dataStructArray,$pParams,$callBackFunc='')        
- * 1965:     function checkValue_flex_procInData_travDS(&$dataValues,$dataValues_current,$uploadedFiles,$DSelements,$pParams,$callBackFunc='') 
+ * 1784:     function checkValue_input_Eval($value,$evalArray,$is_in)
+ * 1872:     function checkValue_group_select_processDBdata($valueArray,$tcaFieldConf,$id,$status,$type)
+ * 1905:     function checkValue_group_select_explodeSelectGroupValue($value)
+ * 1928:     function checkValue_flex_procInData($dataPart,$dataPart_current,$uploadedFiles,$dataStructArray,$pParams,$callBackFunc='')
+ * 1965:     function checkValue_flex_procInData_travDS(&$dataValues,$dataValues_current,$uploadedFiles,$DSelements,$pParams,$callBackFunc='')
  *
  *              SECTION: Storing data to Database Layer
  * 2076:     function updateDB($table,$id,$fieldArray) 
  * 3708:     function tableAdminOnly($table)   
  * 3722:     function getInterfacePagePositionID($uid) 
  * 3755:     function isReferenceField($conf)  
- * 3765:     function getTCEMAIN_TSconfig($tscPID)     
- * 3779:     function getTableEntries($table,$TSconfig)        
+ * 3765:     function getTCEMAIN_TSconfig($tscPID)
+ * 3779:     function getTableEntries($table,$TSconfig)
  * 3793:     function setHistory($table,$id,$logId)            
  * 3830:     function clearHistory($table,$id,$keepEntries=10,$maxAgeSeconds=604800)           
  * 3878:     function log($table,$recuid,$action,$recpid,$error,$details,$details_nr=0,$data=array(),$event_pid=-1,$NEWid='') 
@@ -207,7 +207,7 @@ class t3lib_TCEmain {
        var $checkSimilar=1;                    // Boolean: If set, only fields which are different from the database values are saved! In fact, if a whole input array is similar, it's not saved then.
        var $dontProcessTransformations=0;      // Boolean: If set, then transformations are NOT performed on the input.
        var $disableRTE = 0;                    // Boolean: If set, the RTE is expected to have been disabled in the interface which submitted information. Thus transformations related to the RTE is not done.
-       
+
        var $pMap = Array(              // Permission mapping
                'show' => 1,                    // 1st bit
                'edit' => 2,                    // 2nd bit
@@ -220,18 +220,18 @@ class t3lib_TCEmain       {
                'group' => 'show,edit,new,editcontent',
                'everybody' => ''
        );
-       
+
 
        var $alternativeFileName=array();               // Use this array to force another name onto a file. Eg. if you set ['/tmp/blablabal'] = 'my_file.txt' and '/tmp/blablabal' is set for a certain file-field, then 'my_file.txt' will be used as the name instead.
        var $data_disableFields=array();                // If entries are set in this array corresponding to fields for update, they are ignored and thus NOT updated. You could set this array from a series of checkboxes with value=0 and hidden fields before the checkbox with 1. Then an empty checkbox will disable the field.
        var $defaultValues=array();                             // You can set this array on the form $defaultValues[$table][$field] = $value to override the default values fetched from TCA. You must set this externally.
        var $overrideValues=array();                    // You can set this array on the form $overrideValues[$table][$field] = $value to override the incoming data. You must set this externally. You must make sure the fields in this array are also found in the table, because it's not checked. All columns can be set by this array!
-       
+
                // *********
                // internal
                // *********
        var $fileFunc;          // May contain an object
-       var $last_log_id;       
+       var $last_log_id;
        var $BE_USER;           // The user-object the the script uses. If not set from outside, this is set to the current global $BE_USER.
        var $userid;            // will be set to uid of be_user executing this script
        var $username;          // will be set to username of be_user executing this script
@@ -258,8 +258,8 @@ class t3lib_TCEmain {
        var $dbAnalysisStore=array();
        var $removeFilesStore=array();
        var $copiedFileMap=array();
-       
 
+       var $checkValue_currentRecord=array();          // Set to "currentRecord" during checking of values.
 
 
        /**
@@ -527,7 +527,7 @@ class t3lib_TCEmain {
                                                        // **************************************
                                                if ($recordAccess)      {
 //debug('tce_main',-2);
-                                                       list($tscPID)=t3lib_BEfunc::getTSCpid($table,$id,$old_pid_value ? $old_pid_value : $fieldArray['pid']); // Here the "pid" is sent IF NOT the old pid was a string pointing to a place in the subst-id array.
+                                                       list($tscPID) = t3lib_BEfunc::getTSCpid($table,$id,$old_pid_value ? $old_pid_value : $fieldArray['pid']);       // Here the "pid" is sent IF NOT the old pid was a string pointing to a place in the subst-id array.
                                                        $TSConfig = $this->getTCEMAIN_TSconfig($tscPID);
 //debug($TSConfig);
                                                        if ($status=='new' && $table=='pages' && is_array($TSConfig['permissions.']))   {
@@ -535,11 +535,11 @@ class t3lib_TCEmain       {
                                                        }
 
 //debug(array($table,$tscPID));
-                                               
+
                                                        $fieldArray = $this->fillInFieldArray($table,$id,$fieldArray,$incomingFieldArray,$theRealPid,$status,$tscPID);
                                                        $fieldArray = $this->overrideFieldArray($table,$fieldArray);
 
-                                                               // Setting system fields 
+                                                               // Setting system fields
                                                        if ($status=='new')     {
                                                                if ($TCA[$table]['ctrl']['crdate'])     {
                                                                        $fieldArray[$TCA[$table]['ctrl']['crdate']]=time();
@@ -600,6 +600,7 @@ class t3lib_TCEmain {
                } else {
                        $currentRecord = $checkValueRecord = $this->recordInfo($table,$id,'*'); // We must use the current values as basis for this!
                }
+               $this->checkValue_currentRecord = $checkValueRecord;
 
                        /*
                                In the following all incoming value-fields are tested:
@@ -612,7 +613,7 @@ class t3lib_TCEmain {
                        */
                foreach($incomingFieldArray as $field => $fieldValue)   {
                        if (!in_array($table.'-'.$field, $this->exclude_array) && !$this->data_disableFields[$table][$id][$field])      {       // The field must be editable.
-                       
+
 
                                        // Stripping slashes - will probably be removed the day $this->stripslashes_values is removed as an option...
                                if ($this->stripslashes_values) {
@@ -620,7 +621,7 @@ class t3lib_TCEmain {
                                                t3lib_div::stripSlashesOnArray($fieldValue);
                                        } else $fieldValue = stripslashes($fieldValue);
                                }
-                       
+
                                switch ($field) {
                                        case 'uid':
                                        case 'pid':
@@ -652,7 +653,7 @@ class t3lib_TCEmain {
                                        default:
                                                if (isset($TCA[$table]['columns'][$field]))     {
                                                                // Evaluating the value.
-                                                       $res = $this->checkValue($table,$field,$fieldValue,$id,$status,$realPid, $checkValueRecord);
+                                                       $res = $this->checkValue($table,$field,$fieldValue,$id,$status,$realPid,$tscPID);
                                                        if (isset($res['value']))       {
                                                                $fieldArray[$field]=$res['value'];
                                                        }
@@ -662,11 +663,7 @@ class t3lib_TCEmain        {
                        }
                }
 
-
-               // Checking for RTE-transformations of fields:
-
-//debug($currentRecord);
-//                     debug($id);
+                       // Checking for RTE-transformations of fields:
                $types_fieldConfig = t3lib_BEfunc::getTCAtypes($table,$currentRecord);
                $theTypeString = t3lib_BEfunc::getTCAtypeValue($table,$currentRecord);
                if (is_array($types_fieldConfig))       {
@@ -677,6 +674,30 @@ class t3lib_TCEmain        {
 //debug($eFile);
                                        // RTE transformations:
                                if (!$this->dontProcessTransformations) {
+                                       if (isset($fieldArray[$vconf['field']]))        {
+                                                       // Look for transformation flag:
+                                               switch((string)$incomingFieldArray['_TRANSFORM_'.$vconf['field']])      {
+                                                       case 'RTE':
+                                                               $RTEsetup = $this->BE_USER->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($tscPID));
+                                                               $thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'],$table,$vconf['field'],$theTypeString);
+
+                                                                       // Set alternative relative path for RTE images/links:
+                                                               $RTErelPath = is_array($eFile) ? dirname($eFile['relEditFile']) : '';
+
+                                                                       // Get RTE object, draw form and set flag:
+                                                               $RTEobj = &t3lib_BEfunc::RTEgetObj();
+                                                               if (is_object($RTEobj)) {
+                                                                       $fieldArray[$vconf['field']] = $RTEobj->transformContent('db',$fieldArray[$vconf['field']],$table,$vconf['field'],$currentRecord,$vconf['spec'],$thisConfig,$RTErelPath,$currentRecord['pid']);
+                                                               } else {
+                                                                       debug('NO RTE OBJECT FOUND!');
+                                                               }
+                                                       break;
+                                               }
+                                       }
+
+                                       // These transformations has been removed and the one above inserted; content is now transformed if a flag is sent with the field, typ. "_TRANSFORM_".[fieldname] = "RTE"
+                                       // This is more safe, doesn't require us to calculate if a transformation has to be done and finally; it is now possible to use RTEs in FlexForms as well!
+/*
                                        if ($vconf['spec']['richtext'] && !$this->disableRTE)   {
                                                        // Cross transformation?
                                                $this->crossRTEtransformation=0;        // Crosstransformation is, when a record is saved, the CType has changed and the other type might also use the RTE - then the transformation of THAT rte is used instead. This is usefull only if we know the TBE interface did it, because in that interface the CType value changes the interface and allows extended options in RTE without first saving the type-shift.
@@ -708,6 +729,7 @@ class t3lib_TCEmain {
                                                        }
                                                }
                                        }
+                                       */
                                }
 
                                        // Write file configuration:
@@ -1198,16 +1220,16 @@ class t3lib_TCEmain     {
         * @param       string          The record-uid, mainly - but not exclusively - used for logging
         * @param       string          'update' or 'new' flag
         * @param       [type]          $realPid: ...
-        * @param       array           The "current record". If an element already exists this is simply a lookup for record with $id in $table. For NEW records this is the *default values* overlaid with the *incoming value* unprocessed.
+        * @param       integer         $tscPID
         * @return      array           Returns the evaluated $value as key "value" in this array. Can be checked with isset($res['value']) ...
         */
-       function checkValue($table,$field,$value,$id,$status,$realPid,$currentRecord)   {
+       function checkValue($table,$field,$value,$id,$status,$realPid,$tscPID)  {
                global $TCA, $PAGES_TYPES;
                t3lib_div::loadTCA($table);
 
                $res = Array(); // result array
                $recFID = $table.':'.$id.':'.$field;
-               
+
                        // Processing special case of field pages.doktype
                if ($table=='pages' && $field=='doktype')       {
                                // If the user may not use this specific doktype, we issue a warning
@@ -1233,16 +1255,16 @@ class t3lib_TCEmain     {
                        // Get current value:
                $curValueRec = $this->recordInfo($table,$id,$field);
                $curValue = $curValueRec[$field];
-                                                       
+
                        // Getting config for the field
                $tcaFieldConf = $TCA[$table]['columns'][$field]['config'];
-               
+
                        // Preform processing:
-               $res = $this->checkValue_SW($res,$value,$tcaFieldConf,$table,$id,$curValue,$status,$realPid,$recFID,$field,$this->uploadedFileArray[$table][$id][$field],$currentRecord);
+               $res = $this->checkValue_SW($res,$value,$tcaFieldConf,$table,$id,$curValue,$status,$realPid,$recFID,$field,$this->uploadedFileArray[$table][$id][$field],$tscPID);
 
                return $res;
        }
-       
+
        /**
         * Branches out evaluation of a field value based on its type as configured in TCA
         * Can be called for FlexForm pseudo fields as well, BUT must not have $field set if so.
@@ -1258,31 +1280,33 @@ class t3lib_TCEmain     {
         * @param       [type]          $recFID: ...
         * @param       string          Field name. Must NOT be set if the call is for a flexform field (since flexforms are not allowed within flexforms).
         * @param       [type]          $uploadedFiles: ...
-        * @param       array           The "current record". If an element already exists this is simply a lookup for record with $id in $table. For NEW records this is the *default values* overlaid with the *incoming value* unprocessed.
         * @return      array           Returns the evaluated $value as key "value" in this array.
         */
-       function checkValue_SW($res,$value,$tcaFieldConf,$table,$id,$curValue,$status,$realPid,$recFID,$field,$uploadedFiles,$currentRecord=array())    {
+       function checkValue_SW($res,$value,$tcaFieldConf,$table,$id,$curValue,$status,$realPid,$recFID,$field,$uploadedFiles,$tscPID)   {
+
+               $PP = array($table,$id,$curValue,$status,$realPid,$recFID,$tscPID);
+
                switch ($tcaFieldConf['type']) {
                        case 'text':
                        case 'passthrough':
                                $res['value'] = $value;
                        break;
                        case 'input':
-                               $res = $this->checkValue_input($res,$value,$tcaFieldConf,array($table,$id,$curValue,$status,$realPid,$recFID),$field);
+                               $res = $this->checkValue_input($res,$value,$tcaFieldConf,$PP,$field);
                        break;
                        case 'check':
-                               $res = $this->checkValue_check($res,$value,$tcaFieldConf,array($table,$id,$curValue,$status,$realPid,$recFID));
+                               $res = $this->checkValue_check($res,$value,$tcaFieldConf,$PP);
                        break;
                        case 'radio':
-                               $res = $this->checkValue_radio($res,$value,$tcaFieldConf,array($table,$id,$curValue,$status,$realPid,$recFID));
+                               $res = $this->checkValue_radio($res,$value,$tcaFieldConf,$PP);
                        break;
                        case 'group':
                        case 'select':
-                               $res = $this->checkValue_group_select($res,$value,$tcaFieldConf,array($table,$id,$curValue,$status,$realPid,$recFID),$uploadedFiles);
+                               $res = $this->checkValue_group_select($res,$value,$tcaFieldConf,$PP,$uploadedFiles);
                        break;
                        case 'flex':
                                if ($field)     {       // FlexForms are only allowed for real fields.
-                                       $res = $this->checkValue_flex($res,$value,$tcaFieldConf,array($table,$id,$curValue,$status,$realPid,$recFID),$uploadedFiles,$currentRecord,$field);
+                                       $res = $this->checkValue_flex($res,$value,$tcaFieldConf,$PP,$uploadedFiles,$field);
                                }
                        break;
                }
@@ -1305,17 +1329,17 @@ class t3lib_TCEmain     {
 
                        // Secures the string-length to be less than max. Will probably make problems with multi-byte strings!
                if (intval($tcaFieldConf['max'])>0)     {$value = substr($value,0,intval($tcaFieldConf['max']));}
-               
+
                        // Checking range of value:
                if ($tcaFieldConf['range'] && $value!=$tcaFieldConf['checkbox'])        {       // If value is not set to the allowed checkbox-value then it is checked against the ranges
                        if (isset($tcaFieldConf['range']['upper'])&&$value>$tcaFieldConf['range']['upper'])     {$value=$tcaFieldConf['range']['upper'];}
                        if (isset($tcaFieldConf['range']['lower'])&&$value<$tcaFieldConf['range']['lower'])     {$value=$tcaFieldConf['range']['lower'];}
                }
-               
+
                        // Process evaluation settings:
                $evalCodesArray = t3lib_div::trimExplode(',',$tcaFieldConf['eval'],1);
                $res = $this->checkValue_input_Eval($value,$evalCodesArray,$tcaFieldConf['is_in']);
-               
+
                        // Process UNIQUE settings:
                if ($field)     {       // Field is NOT set for flexForms - which also means that uniqueInPid and unique is NOT available for flexForm fields!
                        if ($res['value'] && in_array('uniqueInPid',$evalCodesArray))   {
@@ -1325,7 +1349,7 @@ class t3lib_TCEmain       {
                                $res['value'] = $this->getUnique($table,$field,$res['value'],$id);
                        }
                }
-               
+
                return $res;
        }
 
@@ -1621,19 +1645,20 @@ class t3lib_TCEmain     {
         * @param       string          Field name
         * @return      array           Modified $res array
         */
-       function checkValue_flex($res,$value,$tcaFieldConf,$PP,$uploadedFiles,$curRecordArr,$field)     {
+       function checkValue_flex($res,$value,$tcaFieldConf,$PP,$uploadedFiles,$field)   {
                list($table,$id,$curValue,$status,$realPid,$recFID) = $PP;
 
                if (is_array($value))   {
 
                                // Get current value array:
-                       $dataStructArray = t3lib_BEfunc::getFlexFormDS($tcaFieldConf,$curRecordArr,$table);
+                       $dataStructArray = t3lib_BEfunc::getFlexFormDS($tcaFieldConf,$this->checkValue_currentRecord,$table);
+#debug($this->checkValue_currentRecord);
                        $currentValueArray = t3lib_div::xml2array($curValue);
                        if (!is_array($currentValueArray))      $currentValueArray = array();
                        if (is_array($currentValueArray['meta']['currentLangId']))              unset($currentValueArray['meta']['currentLangId']);     // Remove all old meta for languages...
 
                                // Evaluation of input values:
-                       $value['data'] = $this->checkValue_flex_procInData($value['data'],$currentValueArray['data'],$uploadedFiles['data'],$dataStructArray,array($table,$id,$curValue,$status,$realPid,$recFID));
+                       $value['data'] = $this->checkValue_flex_procInData($value['data'],$currentValueArray['data'],$uploadedFiles['data'],$dataStructArray,$PP);
 
                                // Create XML and convert charsets from input value:
                        $xmlValue = $this->checkValue_flexArray2Xml($value);
@@ -2010,7 +2035,7 @@ class t3lib_TCEmain       {
                                                                                        $uploadedFiles[$key][$vKey]
                                                                                );
                                                        } else {        // Default
-                                                               list($CVtable,$CVid,$CVcurValue,$CVstatus,$CVrealPid,$CVrecFID) = $pParams;
+                                                               list($CVtable,$CVid,$CVcurValue,$CVstatus,$CVrealPid,$CVrecFID,$CVtscPID) = $pParams;
 
                                                                $res = $this->checkValue_SW(
                                                                                        array(),
@@ -2023,14 +2048,43 @@ class t3lib_TCEmain     {
                                                                                        $CVrealPid,
                                                                                        $CVrecFID,
                                                                                        '',
-                                                                                       $uploadedFiles[$key][$vKey]
+                                                                                       $uploadedFiles[$key][$vKey],
+                                                                                       array(),
+                                                                                       $CVtscPID
                                                                                );
+
+                                                                       // Look for RTE transformation of field:
+                                                               if ($dataValues[$key]['_TRANSFORM_'.$vKey] == 'RTE' && !$this->dontProcessTransformations)      {
+
+                                                                               // Unsetting trigger field - we absolutely don't want that into the data storage!
+                                                                       unset($dataValues[$key]['_TRANSFORM_'.$vKey]);
+
+                                                                       if (isset($res['value']))       {
+
+                                                                                       // Calculating/Retrieving some values here:
+                                                                               list(,,$recFieldName) = explode(':', $CVrecFID);
+                                                                               $theTypeString = t3lib_BEfunc::getTCAtypeValue($CVtable,$this->checkValue_currentRecord);
+                                                                               $specConf = t3lib_BEfunc::getSpecConfParts('',$dsConf['TCEforms']['defaultExtras']);
+
+                                                                                       // Find, thisConfig:
+                                                                               $RTEsetup = $this->BE_USER->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($CVtscPID));
+                                                                               $thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'],$CVtable,$recFieldName,$theTypeString);
+
+                                                                                       // Get RTE object, draw form and set flag:
+                                                                               $RTEobj = &t3lib_BEfunc::RTEgetObj();
+                                                                               if (is_object($RTEobj)) {
+                                                                                       $res['value'] = $RTEobj->transformContent('db',$res['value'],$CVtable,$recFieldName,$this->checkValue_currentRecord,$specConf,$thisConfig,'',$CVrealPid);
+                                                                               } else {
+                                                                                       debug('NO RTE OBJECT FOUND!');
+                                                                               }
+                                                                       }
+                                                               }
                                                        }
 
-                                                               // Evaluating the value.
+                                                               // Adding the value:
                                                        if (isset($res['value']))       {
                                                                $dataValues[$key][$vKey] = $res['value'];
-                                                       }               
+                                                       }
                                                }
                                        }
                                }
index 9300bd3..2a372d2 100755 (executable)
@@ -46,7 +46,7 @@
  *  318:     function renderRecord_groupProc($data,$fieldConfig,$TSconfig,$table,$row,$field)
  *  369:     function renderRecord_selectProc($data,$fieldConfig,$TSconfig,$table,$row,$field)
  *  431:     function renderRecord_flexProc($data,$fieldConfig,$TSconfig,$table,$row,$field)
- *  460:     function renderRecord_typesProc($totalRecordContent,$types_fieldConfig,$tscPID,$table,$pid)       
+ *  460:     function renderRecord_typesProc($totalRecordContent,$types_fieldConfig,$tscPID,$table,$pid)
  *
  *              SECTION: FlexForm processing functions
  *  544:     function renderRecord_flexProc_procInData($dataPart,$dataStructArray,$pParams)
@@ -482,6 +482,9 @@ class t3lib_transferData {
                                }
                        }
 
+
+                       // MOVED TO the individual extensions (see TCEforms)
+/*
                                // RTE transformation
                        if ($vconf['spec']['rte_transform'] && !$this->disableRTE)      {
                                $p=t3lib_BEfunc::getSpecConfParametersFromArray($vconf['spec']['rte_transform']['parameters']);
@@ -508,8 +511,9 @@ class t3lib_transferData {
                                        }
                                }
                        }
+*/
                }
-               
+
                return $totalRecordContent;
        }
        
index 06ad6fb..ae895b1 100755 (executable)
  *              SECTION: Permission checking functions:
  *  170:     function isAdmin()        
  *  182:     function isMemberOfGroup($groupId)        
- *  204:     function doesUserHaveAccess($row,$perms)  
+ *  204:     function doesUserHaveAccess($row,$perms)
  *  221:     function isInWebMount($id,$readPerms='',$exitOnError=0)   
  *  248:     function modAccess($conf,$exitOnError)    
  *  284:     function getPagePermsClause($perms)       
  *  310:     function calcPerms($row)  
- *  332:     function isRTE()  
+ *  332:     function isRTE()
  *  358:     function check ($type,$value)     
  *  375:     function isPSet($lCP,$table,$type='')     
  *  392:     function mayMakeShortcut()        
@@ -140,7 +140,7 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
        var $userTSUpdated=0;                           // Set internally if the user TSconfig was parsed and needs to be cached.
        var $userTS_dontGetCached=0;            // Set this from outside if you want the user TSconfig to ALWAYS be parsed and not fetched from cache.
        
-
+       var $RTE_errors = array();                      // RTE availability errors collected.
 
 
 
@@ -201,7 +201,7 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
         * @param       integer         $perms is the binary representation of the permission we are going to check. Every bit in this number represents a permission that must be set. See function explanation.
         * @return      boolean         True or False upon evaluation
         */
-       function doesUserHaveAccess($row,$perms)        {       
+       function doesUserHaveAccess($row,$perms)        {
                $userPerms = $this->calcPerms($row);
                return ($userPerms & $perms)==$perms;
        }
@@ -223,10 +223,10 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
                $id = intval($id);
                if (!$readPerms)        $readPerms = $this->getPagePermsClause(1);
                if ($id>0)      {
-                       $wM=$this->returnWebmounts();
-                       $rL=t3lib_BEfunc::BEgetRootLine($id,' AND '.$readPerms);
-                       reset($rL);
-                       while(list(,$v)=each($rL))      {
+                       $wM = $this->returnWebmounts();
+                       $rL = t3lib_BEfunc::BEgetRootLine($id,' AND '.$readPerms);
+
+                       foreach($rL as $v)      {
                                if ($v['uid'] && in_array($v['uid'],$wM))       {
                                        return $v['uid'];
                                }
@@ -326,25 +326,34 @@ class t3lib_userAuthGroup extends t3lib_userAuth {
        /**
         * Returns true if the RTE (Rich Text Editor) can be enabled for the user
         * Strictly this is not permissions being checked but rather a series of settings like a loaded extension, browser/client type and a configuration option in ->uc[edit_RTE]
+        * The reasons for a FALSE return can be found in $this->RTE_errors
         *
         * @return      boolean
         */
        function isRTE()        {
                global $CLIENT;
-               if (
-                       t3lib_extMgm::isLoaded('rte') && 
-                       $CLIENT['BROWSER']=='msie' && 
-                       $CLIENT['SYSTEM']=='win' && 
-                       $CLIENT['VERSION']>=5 && 
-                       $this->uc['edit_RTE'] &&
-                       $GLOBALS['TYPO3_CONF_VARS']['BE']['RTEenabled']
-                       )       {
-                               return 1;
+
+                       // Start:
+               $this->RTE_errors = array();
+               if (!$this->uc['edit_RTE'])
+                       $this->RTE_errors[] = 'RTE is not enabled for user!';
+               if (!$GLOBALS['TYPO3_CONF_VARS']['BE']['RTEenabled'])
+                       $this->RTE_errors[] = 'RTE is not enabled in $TYPO3_CONF_VARS["BE"]["RTEenabled"]';
+
+
+                       // Acquire RTE object:
+               $RTE = &t3lib_BEfunc::RTEgetObj();
+               if (!is_object($RTE))   {
+                       $this->RTE_errors = array_merge($this->RTE_errors, $RTE);
+               }
+
+               if (!count($this->RTE_errors))  {
+                       return TRUE;
                } else {
-                       return 0;
+                       return FALSE;
                }
        }
-       
+
        /**
         * Returns true if the $value is found in the list in a $this->groupData[] index pointed to by $type (array key).
         * Can thus be users to check for modules, exclude-fields, select/modify permissions for tables etc.
@@ -909,4 +918,4 @@ This is a dump of the failures:
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_userauthgroup.php'])    {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_userauthgroup.php']);
 }
-?>
\ No newline at end of file
+?>
index 69f88f6..4a55fea 100755 (executable)
@@ -48,29 +48,28 @@ $TYPO3_CONF_VARS = Array(
                'TTFdpi' => '72',                                               // Integer. Enter how many dpi the FreeType module uses. Freetype1 should be set to 72. Freetype2 should be set to 96 (otherwise fonts are rendered way bigger than FreeType1). This works as a global scaling factor for Freetype.
        ),
        'SYS' => Array(                 // System related concerning both frontend and backend.
-               'textfile_ext' => 'txt,html,htm,css,inc,php,php3,tmpl,js,sql',  // Text file extensions. Those that can be edited. php,php3 cannot be edited in webspace if they are disallowed! Notice:
-               'contentTable' => '',                                   // This is the page-content table (Normally 'tt_content')
                'sitename' => 'TYPO3',                                  // Name of the base-site. This title shows up in the root of the tree structure if you're an 'admin' backend user.
-               'ddmmyy' => 'd-m-y',                                    // Format of Date-Month-Year - see php-function date()
-               'hhmm' => 'H:i',                                                // Format of Hours-minutes - see php-function date()
                'encryptionKey' => '',                                  // Insert some unique string here! Used in eg. direct mail module to generate a md5 hash in combination with uid. This string should be kept secret although it's not as critical as a password.
                'doNotCheckReferer' => 0,                               // Boolean. If set, it's NOT checked numerous places that the refering host is the same as the current. This is an option you should set if you have problems with proxies not passing the HTTP_REFERER variable.
                'recursiveDomainSearch' => 0,                   // Boolean. If set, the search for domain records will be done recursively by stripping parts of the host name off until a matching domain record is found.
-               'report_error_html' => chr(10).'Please report this error to the <a href="mailto:dev@typo3.com">TYPO3 Development Team</a>',
-               'T3instID' => 'N/A',                                    // A unique installation ID - not used yet. The idea is that a TYPO3 installation can identify itself by this ID string to the Extension Repository on TYPO3.org so that we can keep a realistic count of serious TYPO3 installations.
                'devIPmask' => '192.168.*,127.0.0.1',   // Defines a list of IP addresses which will allow development-output to display. The debug() function will use this as a filter. See the function t3lib_div::cmpIP() for details on syntax. Setting this to blank value will deny all. Setting to '*' will allow all.
+               'enable_DLOG' => FALSE,                                 // Whether the developer log is enabled. See constant "TYPO3_DLOG"
+               'ddmmyy' => 'd-m-y',                                    // Format of Date-Month-Year - see php-function date()
+               'hhmm' => 'H:i',                                                // Format of Hours-minutes - see php-function date()
+               'loginCopyrightWarrantyProvider' => '',         // String: If you provide warranty for TYPO3 to your customers insert you (company) name here. It will appear in the login-dialog as the warranty provider. (You must also set URL below).
+               'loginCopyrightWarrantyURL' => '',              // String: Add the URL where you explain the extend of the warranty you provide. This URL is displayed in the login dialog as the place where people can learn more about the conditions of your warranty. Must be set (more than 10 chars) in addition with the 'loginCopyrightWarrantyProvider' message.
+               'loginCopyrightShowVersion' => 0,               // Boolean: If set, the current TYPO3 version is shown.
                'curlUse' => 0,                                                 // Boolean: If set, try to use Curl to fetch external URLs (implemented by Arco <arco@appeltaart.mine.nu>)
                'curlProxyServer' => '',                                // String: Proxyserver as http://proxy:port/.
                'curlProxyTunnel' => 0,                                 // Boolean: If set, use a tunneled connection through the proxy (usefull for websense etc.).
                'curlProxyUserPass' => '',                              // String: Proxyserver authentication user:pass.
                'form_enctype' => 'multipart/form-data',        // String: This is the default form encoding type for most forms in TYPO3. It allows for file uploads to be in the form. However if file-upload is disabled for your PHP version even ordinary data sent with this encryption will not get to the server. So if you have file_upload disabled, you will have to change this to eg. 'application/x-www-form-urlencoded'
-               'loginCopyrightWarrantyProvider' => '',         // String: If you provide warranty for TYPO3 to your customers insert you (company) name here. It will appear in the login-dialog as the warranty provider. (You must also set URL below).
-               'loginCopyrightWarrantyURL' => '',              // String: Add the URL where you explain the extend of the warranty you provide. This URL is displayed in the login dialog as the place where people can learn more about the conditions of your warranty. Must be set (more than 10 chars) in addition with the 'loginCopyrightWarrantyProvider' message.
-               'loginCopyrightShowVersion' => 0,               // Boolean: If set, the current TYPO3 version is shown.
+               'textfile_ext' => 'txt,html,htm,css,inc,php,php3,tmpl,js,sql',  // Text file extensions. Those that can be edited. php,php3 cannot be edited in webspace if they are disallowed! Notice:
+               'contentTable' => '',                                   // This is the page-content table (Normally 'tt_content')
+               'T3instID' => 'N/A',                                    // A unique installation ID - not used yet. The idea is that a TYPO3 installation can identify itself by this ID string to the Extension Repository on TYPO3.org so that we can keep a realistic count of serious TYPO3 installations.
                'binPath' => '',                                                // String, comma seperated list: list of absolute paths where external programs should be searched for
                't3lib_cs_convMethod' => '',                    // String (values: "iconv", "recode", "mbstring", default is homemade PHP-code). Defines which of these PHP-features to use for various Charset conversing functions in t3lib_cs. Will speed up charset conversion radically.
                't3lib_cs_utils' => '',                                 // String (values: "iconv", "recode", "mbstring", default is homemade PHP-code). Defines which of these PHP-features to use for various Charset processing functions in t3lib_cs. Will speed up charset functions radically.
-               'enable_DLOG' => FALSE,                                 // Whether the developer log is enabled. See constant "TYPO3_DLOG"
        ),
        'EXT' => Array (        // Options related to the Extension Management
                'noEdit' => 1,                                                  // Boolean: If set, the Extension Manager does NOT allow extension files to be edited! (Otherwise both local and global extensions can be edited.)
@@ -92,7 +91,9 @@ $TYPO3_CONF_VARS = Array(
                'unzip_path' => '',                                             // Path to "unzip".
                'diff_path' => 'diff',                                  // Path to "diff". For Windows this program can be downloaded here: http://unxutils.sourceforge.net/
                'fileadminDir' => 'fileadmin/',                 // Path to the fileadmin dir. This is relative to PATH_site. (Automatically mounted for admin-users if set)
+               'RTEenabled' => 1,                                              // Boolean. If set, the Rich Text editor will be an option in the backend. Notice that the editor must be enabled per-user and options are configurable. See admin guide.
                'RTE_imageStorageDir' => 'uploads/',    // Default storage directory for Rich Text Editor files
+               'RTE_reg' => array(),                                   // Contains arrays of possible RTEs available (keys=extKey, values=cfg-array). Each array contains a key, "objRef", which contains a user function call with prefixed script path and instanciating a persistent global object. This can report back if browser requirements are OK, draw the RTE and do the transformations needed.
                'staticFileEditPath' => 'fileadmin/static/',    // Path to directory with static files for editing (see table sys_staticfiles_edit). Relative to PATH_site.
                'lockRootPath' => '',                                   // First part of the userHomePath/groupHomePath. Observe that the first part of 'userHomePath' and 'groupHomePath' must be the value of 'lockRootPath'. Eg. '/home/typo3/'. This path is also used to evaluate if paths outside the PATH_site should be allowed. Ending slash required!
                'userHomePath' => '',                                   // Path to the directory where TYPO3 backend-users have their home-dirs.  Eg. '/home/typo3/users/'. A home for backend user 2 would be: '/home/typo3/users/2/'. Ending slash required!
@@ -110,7 +111,6 @@ $TYPO3_CONF_VARS = Array(
                'usePHPFileFunctions' => 1,                             // Boolean. If set, all fileoperations are done by the default PHP-functions. Default on UNIX is using the system commands by exec(). You need to set this flag under safe_mode.
                'compressionLevel' => 0,                                // Determines output compression. Requires zlib in your php4 install. Range 1-9, where 1 is least compression (approx. 50%) and 9 is greatest compression (approx 33%). 'true' as value will set the compression based on system load (works with Linux, freebsd). Good default value is 3. For more info, see class in t3lib/class.gzip_encode.php written by Sandy McArthur, Jr. <Leknor@Leknor.com>
                'maxFileSize' => '10000',                               // Integer. If set this is the max fileoperation filesize in kb's set in t3lib/extFileFunctions.
-               'RTEenabled' => 1,                                              // Boolean. If set, the Rich Text editor will be an option in the backend. Notice that the editor must be enabled per-user and options are configurable. See admin guide.
                'forceCharset' => '',                                   // String. Normally the charset of the backend users language selection is used. If you set this value to a charset found in t3lib/csconvtbl/ (or "utf-8") the backend (and database) will ALWAYS use this charset. Always use a lowercase value.
                'installToolPassword' => '',                    // String. This is the md5-hashed password for the Install Tool. Set this to '' and access will be totally denied. PLEASE consider to externally password protect the typo3/install/ folder, eg. with a .htaccess file.
                'trackBeUser' => 0,                                             // Boolean. If set, every invokation of a backend script is logged in sys_trackbeuser. This is used to get a view of the backend users behaviour. Mostly for debugging, support and user interaction analysis. Requires 'beuser_tracking' extension.
@@ -162,7 +162,7 @@ $TYPO3_CONF_VARS = Array(
                'userFuncClassPrefix' => 'user_',               // This prefix must be the first part of any function or class name called from TypoScript, for instance in the stdWrap function.
                'addRootLineFields' => '',                              // Comma-list of fields from the 'pages'-table. These fields are added to the select query for fields in the rootline.
                'checkFeUserPid' => 1,                                  // Boolean. If set, the pid of fe_user logins must be sent in the form as the field 'pid' and then the user must be located in the pid. Default is 1 from Typo32+. If you unset this, you should change the fe_users.username eval-flag 'uniqueInPid' to 'unique' in $TCA. This will do: $TCA['fe_users']['columns']['username']['config']['eval']= 'nospace,lower,required,unique';
-               'lockIP' => 0,                                                  // Boolean. If set, fe_users are locked to their REMOTE_ADDR IP for their session. Enhances security but may throw of users that may change IP during their session.
+               'lockIP' => 0,                                                  // Boolean. If set, fe_users are locked to their REMOTE_ADDR IP for their session. Enhances security but may throw off users that may change IP during their session.
                'defaultUserTSconfig' => '',                    // Enter lines of default frontend user/group TSconfig.
                'defaultTypoScript_constants' => '',    // Enter lines of default TypoScript, constants-field.
                'defaultTypoScript_constants.' => Array(),      // Lines of TS to include after a static template with the uid = the index in the array (Constants)
index dad0608..7b26f17 100755 (executable)
@@ -40,7 +40,7 @@
  *
  *
  *   89: class localRecordList extends recordList 
- *  121:     function writeTop($row,$path)     
+ *  121:     function writeTop($row,$path)
  *  295:     function getTable($table,$id,$rowlist)    
  *  476:     function renderListRow($table,$row,$cc,$titleCol,$thumbsCol)      
  *  539:     function renderListHeader($table,$currentIdList)  
@@ -115,10 +115,9 @@ class localRecordList extends recordList {
         * Writes the top of the full listing
         *
         * @param       array           Current page record
-        * @param       string          Path string (the page root line visually...)
         * @return      void            (Adds content to internal variable, $this->HTMLcode)
         */
-       function writeTop($row,$path)   {
+       function writeTop($row) {
                global $LANG;
                
                        // Makes the code for the pageicon in the top
@@ -237,7 +236,7 @@ class localRecordList extends recordList {
                if ($this->id)  {       // If there IS a real page...:
                
                                // Setting title of page + the "Go up" link:
-                       $theData[$titleCol].='<br />'.htmlspecialchars(t3lib_div::fixed_lgd_pre($path,$this->fixedL));
+                       $theData[$titleCol].='<br /><span title="'.htmlspecialchars($row['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_pre($row['_thePath'],$this->fixedL)).'</span>';
                        $theData['up'][]='<a href="'.htmlspecialchars($this->listURL($row['pid'])).'">'.
                                                        '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/i/pages_up.gif','width="18" height="16"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel',1).'" alt="" />'.
                                                        '</a>';
@@ -1172,4 +1171,4 @@ class localRecordList extends recordList {
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.db_list_extra.inc'])  {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.db_list_extra.inc']);
 }
-?>
\ No newline at end of file
+?>
index f6157d7..fb886be 100755 (executable)
@@ -273,8 +273,8 @@ class SC_db_list {
                        $dblist->setDispFields();
                                
                                // Render the page header:
-                       $dblist->writeTop($this->pageinfo,t3lib_BEfunc::getRecordPath (intval($this->pageinfo['uid']),$this->perms_clause,15));
-                       
+                       $dblist->writeTop($this->pageinfo);
+
                                // Render the list of tables:
                        $dblist->generateList($this->id,$this->table);
                        
@@ -440,4 +440,4 @@ foreach($SOBE->include_once as $INC_FILE)   include_once($INC_FILE);
 $SOBE->clearCache();
 $SOBE->main();
 $SOBE->printContent();
-?>
\ No newline at end of file
+?>
index ed53b14..6e408c0 100755 (executable)
@@ -118,8 +118,10 @@ class SC_mod_web_func_index extends t3lib_SCbase {
 
                        $this->doc->form='<form action="index.php" method="post"><input type="hidden" name="id" value="'.$this->id.'">';
 
-                       $headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path').': '.t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50);
-               
+                       $headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.
+                               $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path').': '.
+                               '<span title="'.htmlspecialchars($this->pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50)).'</span>';
+
                                // Draw the header.
                        $this->content.=$this->doc->startPage($LANG->getLL('title'));
                        $this->content.=$this->doc->header($LANG->getLL('title'));
@@ -198,4 +200,4 @@ $SOBE->checkSubExtObj();    // Checking second level external objects
 
 $SOBE->main();
 $SOBE->printContent();
-?>
\ No newline at end of file
+?>
index a34584b..36a963b 100755 (executable)
@@ -125,8 +125,10 @@ class SC_mod_web_info_index extends t3lib_SCbase {
                        $this->doc->JScode.=$CMparts[0];
                        $this->doc->postCode.= $CMparts[2];
 
-                       $headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path',1).': '.t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50);
-               
+                       $headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.
+                               $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path',1).': '.
+                               '<span title="'.htmlspecialchars($this->pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50)).'</span>';
+
                                // Draw the header.
                        $this->doc->form='<form action="" method="post">';
                        $this->content.=$this->doc->startPage($LANG->getLL('title'));
@@ -203,4 +205,4 @@ $SOBE->checkSubExtObj();    // Checking second level external objects
 
 $SOBE->main();
 $SOBE->printContent();
-?>
\ No newline at end of file
+?>
index 9675b04..4ab46fe 100755 (executable)
@@ -244,7 +244,9 @@ class SC_mod_web_perm_index {
                        $this->content.=$this->doc->spacer(5);
                        $this->content.=$this->doc->section('',
                                $this->doc->funcMenu(
-                                       $this->doc->getHeader('pages',$this->pageinfo,htmlspecialchars($this->pageinfo['_thePath'])).'<br />'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path',1).': '.htmlspecialchars(t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50)),
+                                       $this->doc->getHeader('pages',$this->pageinfo,htmlspecialchars($this->pageinfo['_thePath'])).'<br />'.
+                                               $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path',1).': '.
+                                               '<span title="'.htmlspecialchars($this->pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50)).'</span>',
                                        t3lib_BEfunc::getFuncMenu($this->id,'SET[mode]',$this->MOD_SETTINGS['mode'],$this->MOD_MENU['mode'])
                                ));
                        $this->content.=$this->doc->divider(5);
@@ -742,4 +744,4 @@ $SOBE->printContent();
 if ($TYPO3_CONF_VARS['BE']['compressionLevel'])        {
        new gzip_encode($TYPO3_CONF_VARS['BE']['compressionLevel']);
 }
-?>
\ No newline at end of file
+?>
index e334a6b..a0db1d5 100755 (executable)
@@ -87,7 +87,7 @@
  * 2033:     function noEditIcon($label='noEditItems') 
  * 2042:     function cleanTableNames()        
  * 2078:     function isRTEforField($table,$row,$field)
- * 2107:     function getSpecConfForField($table,$row,$field)  
+ * 2107:     function getSpecConfForField($table,$row,$field)
  *
  *              SECTION: External renderings
  * 2144:     function getPageInfoBox($rec,$edit=0)     
@@ -2077,9 +2077,9 @@ class tx_cms_layout extends recordList {
         */
        function isRTEforField($table,$row,$field){
                $specConf = $this->getSpecConfForField($table,$row,$field);
-               $p=t3lib_BEfunc::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
+               $p = t3lib_BEfunc::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
                if (isset($specConf['richtext']) && (!$p['flag'] || !$row[$p['flag']])) {
-                       list($tscPID,$thePidValue)=t3lib_BEfunc::getTSCpid($table,$row['uid'],$row['pid']);
+                       list($tscPID,$thePidValue) = t3lib_BEfunc::getTSCpid($table,$row['uid'],$row['pid']);
                        if ($thePidValue>=0)    {       // If the pid-value is not negative (that is, a pid could NOT be fetched)
                                $RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($tscPID));
                                $RTEtypeVal = t3lib_BEfunc::getTCAtypeValue($table,$row);
@@ -2107,26 +2107,26 @@ class tx_cms_layout extends recordList {
        function getSpecConfForField($table,$row,$field)        {
 
                        // Get types-configuration for the record:
-               $types_fieldConfig=t3lib_BEfunc::getTCAtypes($table,$row);
-               
+               $types_fieldConfig = t3lib_BEfunc::getTCAtypes($table,$row);
+
                        // Find the given field and return the spec key value if found:
                if (is_array($types_fieldConfig))       {
                        foreach($types_fieldConfig as $vconf)   {
                                if ($vconf['field']==$field)    return $vconf['spec'];
                        }
                }
-       }       
-       
-       
-       
-       
-       
-       
-       
-       
-       
-       
-       
+       }
+
+
+
+
+
+
+
+
+
+
+
        
        /*****************************************
         *
@@ -2369,4 +2369,4 @@ class tx_cms_layout extends recordList {
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/layout/class.tx_cms_layout.php']) {
        include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/layout/class.tx_cms_layout.php']);
 }
-?>
\ No newline at end of file
+?>
index d435feb..65528e0 100755 (executable)
@@ -53,7 +53,7 @@
  *  362:     function clearCache()     
  *  377:     function main()   
  *  475:     function renderQuickEdit()        
- *  839:     function renderListContent()      
+ *  839:     function renderListContent()
  * 1104:     function printContent()   
  *
  *              SECTION: Other functions
@@ -843,19 +843,19 @@ class SC_db_layout {
                $dblist = t3lib_div::makeInstance('tx_cms_layout');
                $dblist->backPath = $BACK_PATH;
                $dblist->thumbs = $this->imagemode;
-               $dblist->no_noWrap=1;
+               $dblist->no_noWrap = 1;
                
                $this->pointer = t3lib_div::intInRange($this->pointer,0,100000);
                $dblist->script = 'db_layout.php';
                $dblist->showIcon = 0;
                $dblist->setLMargin=0;
                $dblist->doEdit = $this->CALC_PERMS&16 ? 1 : 0;
-               $dblist->agePrefixes=$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears');
-               $dblist->id=$this->id;
+               $dblist->agePrefixes = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears');
+               $dblist->id = $this->id;
                $dblist->nextThree = t3lib_div::intInRange($this->modTSconfig['properties']['editFieldsAtATime'],0,10);
                $dblist->option_showBigButtons = $this->modTSconfig['properties']['disableBigButtons'] ? 0 : 1;
                $dblist->option_newWizard = $this->modTSconfig['properties']['disableNewContentElementWizard'] ? 0 : 1;
-               if (!$dblist->nextThree)        $dblist->nextThree= 1;
+               if (!$dblist->nextThree)        $dblist->nextThree = 1;
                
 
                        // Create menu for selecting a table to jump to (this is, if more than just pages/tt_content elements are found on the page!)
@@ -923,14 +923,14 @@ class SC_db_layout {
                                                $dblist->tt_contentConfig['single'] =1; // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
                                                $dblist->tt_contentConfig['showSingleCol']=current($colList);   // The column(s) to show if single mode (under each other)
                                        }
-                                       $dblist->tt_contentConfig['cols']= implode(',',$colList);               // The order of the rows: Default is left(1), Normal(0), right(2), margin(3)
-                                       $dblist->tt_contentConfig['showHidden']=$this->MOD_SETTINGS['tt_content_showHidden'];
+                                       $dblist->tt_contentConfig['cols'] = implode(',',$colList);              // The order of the rows: Default is left(1), Normal(0), right(2), margin(3)
+                                       $dblist->tt_contentConfig['showHidden'] = $this->MOD_SETTINGS['tt_content_showHidden'];
                                        $dblist->tt_contentConfig['sys_language_uid'] = intval($this->current_sys_language);
                                        
                                                // If the function menu is set to "Language":
                                        if ($this->MOD_SETTINGS['function']==2) {
-                                               $dblist->tt_contentConfig['single']=0;
-                                               $dblist->tt_contentConfig['languageMode']=1;
+                                               $dblist->tt_contentConfig['single'] = 0;
+                                               $dblist->tt_contentConfig['languageMode'] = 1;
                                                $dblist->tt_contentConfig['languageCols'] = $this->MOD_MENU['language'];
                                                $dblist->tt_contentConfig['languageColsPointer'] = $this->current_sys_language;
                                        }
@@ -939,7 +939,7 @@ class SC_db_layout {
        
                                // Start the dblist object:
                        $dblist->start($this->id,$table,$this->pointer,$this->search_field,$this->search_levels,$this->showLimit);
-                       $dblist->counter=$CMcounter;
+                       $dblist->counter = $CMcounter;
                        $dblist->ext_function = $this->MOD_SETTINGS['function'];
                        
                                // Generate the list of elements here:
@@ -952,29 +952,30 @@ class SC_db_layout {
                                                        ($h_func_b?'<img src="clear.gif" width="1" height="10" alt="" /><br />'.$h_func_b:'');
                                                        
                                // ... and any accumulated JavaScript goes the same way!
-                       $tableJSOutput[$table]=$dblist->JScode;
-                       
+                       $tableJSOutput[$table] = $dblist->JScode;
+
                                // Increase global counter:
-                       $CMcounter+=$dblist->counter;
+                       $CMcounter+= $dblist->counter;
                                                                                        
                                // Reset variables after operation:
                        $dblist->HTMLcode='';
                        $dblist->JScode='';
-                       $h_func='';
-                       $h_func_b='';
+                       $h_func = '';
+                       $h_func_b = '';
                }       // END: traverse tables
 
 
                        // For Context Sensitive Menus:
-               $CMparts=$this->doc->getContextMenuCode();
+               $CMparts = $this->doc->getContextMenuCode();
                $this->doc->bodyTagAdditions = $CMparts[1];
-               $this->doc->JScode.=$CMparts[0];
+               $this->doc->JScode.= $CMparts[0];
                $this->doc->postCode.= $CMparts[2];
        
 
                        // Draw the page header.
                $headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.
-                                               $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path',1).': '.htmlspecialchars(t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50));
+                                               $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path',1).': '.
+                                               '<span title="'.htmlspecialchars($this->pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_pre($this->pageinfo['_thePath'],50)).'</span>';
 
 
                        // Create icon "toolbar" for common operations like creating/moving elements/pages etc.
@@ -1201,4 +1202,4 @@ foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);
 $SOBE->clearCache();
 $SOBE->main();
 $SOBE->printContent();
-?>
\ No newline at end of file
+?>
index 9be946b..f81882f 100755 (executable)
@@ -966,4 +966,4 @@ $TCA['tt_content'] = Array (
 
 
 
-?>
\ No newline at end of file
+?>
index 4bba4ab..559a38d 100755 (executable)
@@ -6092,7 +6092,6 @@ class tslib_cObj {
                                        $tceforms->doSaveFieldName = 'TSFE_EDIT[doSave]';
                                        $tceforms->formName = $formName;
                                        $tceforms->backPath = TYPO3_mainDir;
-                                       $tceforms->RTEbgColor= '#ABBBB4';
                                        $tceforms->setFancyDesign();
                                        $tceforms->defStyle = 'font-family:Verdana;font-size:10px;';
                                        $tceforms->edit_showFieldHelp = $GLOBALS['BE_USER']->uc['edit_showFieldHelp'];
index 1659e39..b0db819 100755 (executable)
@@ -22,6 +22,7 @@ $LOCAL_LANG = Array (
 The fields are marked with a yellow exclamation mark.',
                'labels.fieldsChanged' => 'There are unsaved changes in the form!
 Do you want to continue WITHOUT saving?',
+               'labels.noRTEfound' => 'Notice: You cannot edit this field since it can only be edited with a Rich Text Editor, but no editor was available or editing with an RTE has been disabled.',
                'labels.showPalettes' => 'Show secondary options (palettes)',
                'labels.showDescriptions' => 'Show field descriptions',
                'labels.disableRTE' => 'Disable Rich Text Editor (RTE)',
@@ -184,4 +185,4 @@ Would you like to save now in order to refresh the display?',
        'he' => 'EXT',
        'ua' => 'EXT',
 );
-?>
\ No newline at end of file
+?>
index 42dad9c..94a24da 100755 (executable)
@@ -49,8 +49,8 @@
  *  341:     function isCMlayers()     
  *  351:     function thisBlur()       
  *  361:     function helpStyle()      
- *  378:     function getHeader($table,$row,$path,$noViewPageIcon=0,$tWrap=array('',''))       
- *  404:     function getFileheader($title,$path,$iconfile)    
+ *  378:     function getHeader($table,$row,$path,$noViewPageIcon=0,$tWrap=array('',''))
+ *  404:     function getFileheader($title,$path,$iconfile)
  *  419:     function makeShortcutIcon($gvList,$setList,$modName,$motherModName="")    
  *  452:     function makeShortcutUrl($gvList,$setList)        
  *  473:     function formWidth($size=48,$textarea=0,$styleOverride='') 
@@ -160,7 +160,7 @@ class template {
        var $backPath = '';                             // 'backPath' pointing back to the PATH_typo3
        var $form = '';                                 // This can be set to the HTML-code for a formtag. Useful when you need a form to span the whole page; Inserted exactly after the body-tag.
        var $JScode = '';                               // Additional header code (eg. a JavaScript section) could be accommulated in this var. It will be directly outputted in the header.
-       var $JScodeArray = array();             // Similar to $JScode but for use as array with assioziative keys to prevent double inclusion of JS code. a <script> tag is automatically wrapped around.
+       var $JScodeArray = array();             // Similar to $JScode but for use as array with associative keys to prevent double inclusion of JS code. a <script> tag is automatically wrapped around.
        var $postCode = '';                             // Additional 'page-end' code could be accommulated in this var. It will be outputted at the end of page before </body> and some other internal page-end code.
        var $docType = '';                              // Doc-type used in the header. Default is HTML 4. You can also set it to 'strict', 'xhtml_trans', or 'xhtml_frames'.
 
@@ -378,8 +378,8 @@ class template {
        function getHeader($table,$row,$path,$noViewPageIcon=0,$tWrap=array('',''))     {
                global $TCA;
                if (is_array($row) && $row['uid'])      {
-                       $iconImgTag=t3lib_iconWorks::getIconImage($table,$row,$this->backPath,'title="'.htmlspecialchars($path).'"');
-                       $title= strip_tags($row[$TCA[$table]['ctrl']['label']]);
+                       $iconImgTag = t3lib_iconWorks::getIconImage($table,$row,$this->backPath,'title="'.htmlspecialchars($path).'"');
+                       $title = strip_tags($row[$TCA[$table]['ctrl']['label']]);
                        $viewPage = $noViewPageIcon ? '' : $this->viewPageIcon($row['uid'],$this->backPath,'');
                        if ($table=='pages')    $path.=' - '.t3lib_BEfunc::titleAttribForPages($row,'',0);
                } else {
index 42783c9..1f5ba73 100755 (executable)
@@ -150,10 +150,15 @@ class SC_wizard_rte {
                        $tceforms = t3lib_div::makeInstance('t3lib_TCEforms');
                        $tceforms->initDefaultBEMode(); // Init...
                        $tceforms->disableWizards = 1;  // SPECIAL: Disables all wizards - we are NOT going to need them.
-                       $tceforms->RTEdivStyle = 'position:relative; left:0px; top:0px; height:100%; width:100%; border:solid 0px;';    // SPECIAL: Setting style for the RTE <DIV> layer containing the IFRAME
-#                      $tceforms->RTEdivStyle = 'position:relative; left:0px; top:0px; height:600px; width:100%; border:solid 0px;';   // SPECIAL: Setting style for the RTE <DIV> layer containing the IFRAME
                        $tceforms->colorScheme[0]=$this->doc->bgColor;  // SPECIAL: Setting background color of the RTE to ordinary background
-               
+
+                               // Initialize style for RTE object:
+                       $RTEobj = &t3lib_BEfunc::RTEgetObj();   // Getting reference to the RTE object used to render the field!
+                       if ($RTEobj->ID == 'rte')       {
+                               $RTEobj->RTEdivStyle = 'position:relative; left:0px; top:0px; height:100%; width:100%; border:solid 0px;';      // SPECIAL: Setting style for the RTE <DIV> layer containing the IFRAME
+       #                       $RTEobj->RTEdivStyle = 'position:relative; left:0px; top:0px; height:600px; width:100%; border:solid 0px;';     // SPECIAL: Setting style for the RTE <DIV> layer containing the IFRAME
+                       }
+
                                // Fetching content of record:
                        $trData = t3lib_div::makeInstance('t3lib_transferData');
                        $trData->lockRecords=1;
@@ -296,4 +301,4 @@ $SOBE = t3lib_div::makeInstance('SC_wizard_rte');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-?>
\ No newline at end of file
+?>