* Fixed various things in file processing, t3lib_extFileFunc et al.
authorKasper Skårhøj <kasper@typo3.org>
Wed, 26 May 2004 23:35:27 +0000 (23:35 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Wed, 26 May 2004 23:35:27 +0000 (23:35 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@325 709f56b5-9817-0410-a4d7-c38de5d9e867

21 files changed:
ChangeLog
TODO.txt
t3lib/class.t3lib_basicfilefunc.php
t3lib/class.t3lib_bedisplaylog.php
t3lib/class.t3lib_befunc.php
t3lib/class.t3lib_div.php
t3lib/class.t3lib_extfilefunc.php
t3lib/class.t3lib_extmgm.php
t3lib/class.t3lib_extobjbase.php
t3lib/class.t3lib_iconworks.php
t3lib/class.t3lib_parsehtml.php
t3lib/class.t3lib_tcemain.php
typo3/alt_clickmenu.php
typo3/class.db_list.inc
typo3/file_edit.php
typo3/file_newfolder.php
typo3/file_rename.php
typo3/file_upload.php
typo3/mod/web/perm/index.php
typo3/tce_db.php
typo3/tce_file.php

index e49d3c2..4ffd639 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-05-27  Kasper Skårhøj,,,  <kasper@typo3.com>
+
+       * Fixed various things in file processing, t3lib_extFileFunc et al.
+
 2004-05-24  Kasper Skårhøj,,,  <kasper@typo3.com>
 
        * Added API for custom RTE transformations. Documented in upcoming "TYPO3 Core API".
index 4a52056..f7ff99e 100755 (executable)
--- a/TODO.txt
+++ b/TODO.txt
@@ -326,7 +326,7 @@ XQCR: t3lib/class.t3lib_diff.php
 XQCR: t3lib/class.t3lib_div.php
                t3lib/class.t3lib_dmailer.php   [Jan-Erik?]
                t3lib/class.t3lib_exec.php              [Rene]
-               t3lib/class.t3lib_extfilefunc.php
+-QCR: t3lib/class.t3lib_extfilefunc.php
 -QCR: t3lib/class.t3lib_extmgm.php
 -QCR: t3lib/class.t3lib_extobjbase.php
 XQCR: t3lib/class.t3lib_foldertree.php
index 3ed377f..25d713f 100644 (file)
@@ -88,7 +88,7 @@ class t3lib_basicFileFunctions        {
        var $f_ext = Array();                   // See comment in header
        var $mounts = Array();                  // See comment in header
        var $webPath ='';                               // Set to DOCUMENT_ROOT.
-       var $isInit=0;                                  // Set to true after start();
+       var $isInit = 0;                                // Set to true after init()/start();
 
 
 
@@ -137,7 +137,7 @@ class t3lib_basicFileFunctions      {
 
                $this->mounts = $mounts;
                $this->webPath = t3lib_div::getIndpEnv('TYPO3_DOCUMENT_ROOT');
-               $this->isInit=1;
+               $this->isInit = 1;
        }
 
        /**
@@ -149,11 +149,11 @@ class t3lib_basicFileFunctions    {
        function getTotalFileInfo($wholePath)   {
                $theuser = getmyuid();
                $info = t3lib_div::split_fileref($wholePath);
-               $info['tstamp']=@filectime($wholePath);
-               $info['size']=@filesize($wholePath);
-               $info['type']=@filetype($wholePath);
-               $info['owner']=@fileowner($wholePath);
-               $info['perms']=@fileperms($wholePath);
+               $info['tstamp'] = @filectime($wholePath);
+               $info['size'] = @filesize($wholePath);
+               $info['type'] = @filetype($wholePath);
+               $info['owner'] = @fileowner($wholePath);
+               $info['perms'] = @fileperms($wholePath);
                $info['writeable'] = ($info['perms']&2 || ($theuser==$info['owner'] && $info['perms']&128));
                $info['readable'] = ($info['perms']&4 || ($theuser==$info['owner'] && $info['perms']&256));
                return $info;
index 6e75a9d..131ba47 100644 (file)
  * @see tx_belog_webinfo, SC_mod_tools_log_index
  */
 class t3lib_BEDisplayLog {
-       var $lastTimeLabel='';
-       var $lastUserLabel='';
-       var $lastTypeLabel='';
-       var $lastActionLabel='';
+       var $lastTimeLabel = '';
+       var $lastUserLabel = '';
+       var $lastTypeLabel = '';
+       var $lastActionLabel = '';
 
        var $detailsOn = 1;     // If detailsOn, %s is substituted with values from the data-array (see getDetails())
        var $stripPath = 1;     // This strips the path from any value in the data-array when the data-array is parsed through stripPath()
@@ -92,6 +92,8 @@ class t3lib_BEDisplayLog {
                3 => 'Secur!'
        );
 
+       var $be_user_Array = array();           // Username array (set externally)
+
        /**
         * Initialize the log table array with header labels.
         *
@@ -132,7 +134,7 @@ class t3lib_BEDisplayLog {
        function getUserLabel($code)    {
                if ($this->lastUserLabel!=$code)        {
                        $this->lastUserLabel=$code;
-                       $label=$GLOBALS['be_user_Array'][$code]['username'];
+                       $label = $this->be_user_Array[$code]['username'];
                        return $label ? $label : '['.$code.']';
                } else return '.';
        }
index 62ea7b6..d33c4fd 100755 (executable)
  *
  *
  *
- *  160: class t3lib_BEfunc
+ *  162: class t3lib_BEfunc
  *
  *              SECTION: SQL-related, selecting records, searching
- *  181:     function deleteClause($table)
+ *  182:     function deleteClause($table)
  *  205:     function getRecord($table,$uid,$fields='*',$where='')
- *  228:     function getRecordRaw($table,$where='',$fields='*')
- *  251:     function getRecordsByField($theTable,$theField,$theValue,$whereClause='',$groupBy='',$orderBy='',$limit='')
- *  284:     function searchQuery($searchWords,$fields,$table='')
- *  300:     function listQuery($field,$value)
- *  313:     function splitTable_Uid($str)
- *  329:     function getSQLselectableList ($in_list,$tablename,$default_tablename)
- *  358:     function BEenableFields($table,$inv=0)
+ *  227:     function getRecordRaw($table,$where='',$fields='*')
+ *  249:     function getRecordsByField($theTable,$theField,$theValue,$whereClause='',$groupBy='',$orderBy='',$limit='')
+ *  281:     function searchQuery($searchWords,$fields,$table='')
+ *  296:     function listQuery($field,$value)
+ *  308:     function splitTable_Uid($str)
+ *  323:     function getSQLselectableList($in_list,$tablename,$default_tablename)
+ *  351:     function BEenableFields($table,$inv=0)
  *
  *              SECTION: SQL-related, DEPRECIATED functions
- *  422:     function mm_query($select,$local_table,$mm_table,$foreign_table,$whereClause='',$groupBy='',$orderBy='',$limit='')
- *  444:     function DBcompileInsert($table,$fields_values)
- *  458:     function DBcompileUpdate($table,$where,$fields_values)
+ *  415:     function mm_query($select,$local_table,$mm_table,$foreign_table,$whereClause='',$groupBy='',$orderBy='',$limit='')
+ *  437:     function DBcompileInsert($table,$fields_values)
+ *  451:     function DBcompileUpdate($table,$where,$fields_values)
  *
  *              SECTION: Page tree, TCA related
- *  488:     function BEgetRootLine ($uid,$clause='')
- *  540:     function getRecordPath($uid, $clause, $titleLimit, $fullTitleLimit=0)
- *  578:     function getExcludeFields()
- *  613:     function readPageAccess($id,$perms_clause)
- *  643:     function getTCAtypes($table,$rec,$useFieldNameAsKey=0)
- *  697:     function getTCAtypeValue($table,$rec)
- *  721:     function getSpecConfParts($str, $defaultExtras)
- *  752:     function getSpecConfParametersFromArray($pArr)
- *  777:     function getFlexFormDS($conf,$row,$table)
+ *  480:     function BEgetRootLine($uid,$clause='')
+ *  526:     function openPageTree($pid,$clearExpansion)
+ *  571:     function getRecordPath($uid, $clause, $titleLimit, $fullTitleLimit=0)
+ *  608:     function getExcludeFields()
+ *  642:     function readPageAccess($id,$perms_clause)
+ *  671:     function getTCAtypes($table,$rec,$useFieldNameAsKey=0)
+ *  724:     function getTCAtypeValue($table,$rec)
+ *  747:     function getSpecConfParts($str, $defaultExtras)
+ *  777:     function getSpecConfParametersFromArray($pArr)
+ *  803:     function getFlexFormDS($conf,$row,$table)
  *
  *              SECTION: Caching related
- *  882:     function storeHash($hash,$data,$ident)
- *  903:     function getHash($hash,$expTime)
+ *  907:     function storeHash($hash,$data,$ident)
+ *  927:     function getHash($hash,$expTime)
  *
  *              SECTION: TypoScript related
- *  940:     function getPagesTSconfig($id,$rootLine='',$returnPartArray=0)
- *  991:     function updatePagesTSconfig($id,$pageTS,$TSconfPrefix,$impParams='')
- * 1047:     function implodeTSParams($p,$k='')
+ *  963:     function getPagesTSconfig($id,$rootLine='',$returnPartArray=0)
+ * 1014:     function updatePagesTSconfig($id,$pageTS,$TSconfPrefix,$impParams='')
+ * 1069:     function implodeTSParams($p,$k='')
  *
  *              SECTION: Users / Groups related
- * 1085:     function getUserNames($fields='username,usergroup,usergroup_cached_list,uid',$where='')
- * 1104:     function getGroupNames($fields='title,uid', $where='')
- * 1122:     function getListGroupNames($fields='title,uid')
- * 1142:     function blindUserNames($usernames,$groupArray,$excludeBlindedFlag=0)
- * 1176:     function blindGroupNames($groups,$groupArray,$excludeBlindedFlag=0)
+ * 1106:     function getUserNames($fields='username,usergroup,usergroup_cached_list,uid',$where='')
+ * 1124:     function getGroupNames($fields='title,uid', $where='')
+ * 1141:     function getListGroupNames($fields='title,uid')
+ * 1160:     function blindUserNames($usernames,$groupArray,$excludeBlindedFlag=0)
+ * 1193:     function blindGroupNames($groups,$groupArray,$excludeBlindedFlag=0)
  *
  *              SECTION: Output related
- * 1220:     function daysUntil($tstamp)
- * 1233:     function date($tstamp)
- * 1245:     function datetime($value)
- * 1258:     function time($value)
- * 1275:     function calcAge ($seconds,$labels)
- * 1302:     function dateTimeAge($tstamp,$prefix=1,$date='')
- * 1321:     function titleAttrib($content='',$hsc=0)
- * 1333:     function titleAltAttrib($content)
- * 1358:     function thumbCode($row,$table,$field,$backPath,$thumbScript='',$uploaddir='',$abs=0,$tparams='',$size='')
- * 1427:     function getThumbNail($thumbScript,$theFile,$tparams='',$size='')
- * 1445:     function titleAttribForPages($row,$perms_clause='',$includeAttrib=1)
- * 1503:     function getRecordIconAltText($row,$table='pages')
- * 1538:     function getLabelFromItemlist($table,$col,$key)
- * 1565:     function getItemLabel($table,$col,$printAllWrap='')
- * 1591:     function getRecordTitle($table,$row,$prep=0)
- * 1628:     function getProcessedValue($table,$col,$value,$fixed_lgd_chars=0,$defaultPassthrough=0)
- * 1723:     function getProcessedValueExtra($table,$fN,$fV,$fixed_lgd_chars=0)
- * 1748:     function getFileIcon($ext)
- * 1763:     function getCommonSelectFields($table,$prefix)
+ * 1236:     function daysUntil($tstamp)
+ * 1248:     function date($tstamp)
+ * 1259:     function datetime($value)
+ * 1271:     function time($value)
+ * 1287:     function calcAge($seconds,$labels)
+ * 1313:     function dateTimeAge($tstamp,$prefix=1,$date='')
+ * 1331:     function titleAttrib($content='',$hsc=0)
+ * 1344:     function titleAltAttrib($content)
+ * 1368:     function thumbCode($row,$table,$field,$backPath,$thumbScript='',$uploaddir='',$abs=0,$tparams='',$size='')
+ * 1436:     function getThumbNail($thumbScript,$theFile,$tparams='',$size='')
+ * 1453:     function titleAttribForPages($row,$perms_clause='',$includeAttrib=1)
+ * 1511:     function getRecordIconAltText($row,$table='pages')
+ * 1545:     function getLabelFromItemlist($table,$col,$key)
+ * 1571:     function getItemLabel($table,$col,$printAllWrap='')
+ * 1596:     function getRecordTitle($table,$row,$prep=0)
+ * 1632:     function getProcessedValue($table,$col,$value,$fixed_lgd_chars=0,$defaultPassthrough=0)
+ * 1726:     function getProcessedValueExtra($table,$fN,$fV,$fixed_lgd_chars=0)
+ * 1750:     function getFileIcon($ext)
+ * 1764:     function getCommonSelectFields($table,$prefix)
  * 1790:     function makeConfigForm($configArray,$defaults,$dataPrefix)
  *
  *              SECTION: Backend Modules API functions
- * 1867:     function helpTextIcon($table,$field,$BACK_PATH,$force=0)
- * 1889:     function helpText($table,$field,$BACK_PATH)
- * 1910:     function editOnClick($params,$backPath='',$requestUri='')
- * 1927:     function viewOnClick($id,$backPath='',$rootLine='',$anchor='',$altUrl='')
- * 1954:     function getModTSconfig($id,$TSref)
- * 1976:     function getFuncMenu($id,$elementName,$currentValue,$menuItems,$script='',$addparams='')
- * 2006:     function getFuncCheck($id,$elementName,$currentValue,$script='',$addparams='',$tagParams='')
- * 2027:     function getFuncInput($id,$elementName,$currentValue,$size=10,$script="",$addparams="")
- * 2044:     function unsetMenuItems($modTSconfig,$itemArray,$TSref)
- * 2068:     function getSetUpdateSignal($set='')
- * 2119:     function getModuleData($MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='')
+ * 1865:     function helpTextIcon($table,$field,$BACK_PATH,$force=0)
+ * 1886:     function helpText($table,$field,$BACK_PATH)
+ * 1906:     function editOnClick($params,$backPath='',$requestUri='')
+ * 1922:     function viewOnClick($id,$backPath='',$rootLine='',$anchor='',$altUrl='')
+ * 1948:     function getModTSconfig($id,$TSref)
+ * 1969:     function getFuncMenu($id,$elementName,$currentValue,$menuItems,$script='',$addparams='')
+ * 1998:     function getFuncCheck($id,$elementName,$currentValue,$script='',$addparams='',$tagParams='')
+ * 2018:     function getFuncInput($id,$elementName,$currentValue,$size=10,$script="",$addparams="")
+ * 2034:     function unsetMenuItems($modTSconfig,$itemArray,$TSref)
+ * 2057:     function getSetUpdateSignal($set='')
+ * 2108:     function getModuleData($MOD_MENU, $CHANGED_SETTINGS, $modName, $type='', $dontValidateList='', $setDefaultList='')
  *
  *              SECTION: Core
- * 2195:     function lockRecords($table='',$uid=0,$pid=0)
- * 2225:     function isRecordLocked($table,$uid)
- * 2266:     function exec_foreign_table_where_query($fieldValue,$field='',$TSconfig=array(),$prefix='')
- * 2348:     function getTCEFORM_TSconfig($table,$row)
- * 2396:     function getTSconfig_pidValue($table,$uid,$pid)
- * 2425:     function getPidForModTSconfig($table,$uid,$pid)
- * 2442:     function getTSCpid($table,$uid,$pid)
- * 2459:     function firstDomainRecord($rootLine)
- * 2482:     function getDomainStartPage($domain, $path='')
- * 2513:     function RTEsetup($RTEprop,$table,$field,$type='')
- * 2571:     function isModuleSetInTBE_MODULES($modName)
+ * 2183:     function lockRecords($table='',$uid=0,$pid=0)
+ * 2212:     function isRecordLocked($table,$uid)
+ * 2252:     function exec_foreign_table_where_query($fieldValue,$field='',$TSconfig=array(),$prefix='')
+ * 2333:     function getTCEFORM_TSconfig($table,$row)
+ * 2380:     function getTSconfig_pidValue($table,$uid,$pid)
+ * 2408:     function getPidForModTSconfig($table,$uid,$pid)
+ * 2424:     function getTSCpid($table,$uid,$pid)
+ * 2440:     function firstDomainRecord($rootLine)
+ * 2462:     function getDomainStartPage($domain, $path='')
+ * 2492:     function RTEsetup($RTEprop,$table,$field,$type='')
+ * 2510:     function &RTEgetObj()
+ * 2549:     function isModuleSetInTBE_MODULES($modName)
  *
  *              SECTION: Miscellaneous
- * 2621:     function typo3PrintError ($header,$text,$js='',$head=1)
- * 2668:     function getPathType_web_nonweb($path)
- * 2681:     function ADMCMD_previewCmds($pageinfo)
- * 2704:     function processParams($params)
- * 2731:     function getListOfBackendModules($name,$perms_clause,$backPath='',$script='index.php')
+ * 2598:     function typo3PrintError($header,$text,$js='',$head=1)
+ * 2644:     function getPathType_web_nonweb($path)
+ * 2656:     function ADMCMD_previewCmds($pageinfo)
+ * 2678:     function processParams($params)
+ * 2704:     function getListOfBackendModules($name,$perms_clause,$backPath='',$script='index.php')
  *
- * TOTAL FUNCTIONS: 78
+ * TOTAL FUNCTIONS: 80
  * (This index is automatically created/updated by the extension "extdeveval")
  *
  */
@@ -172,8 +174,7 @@ class t3lib_BEfunc  {
         * Returns the WHERE clause " AND NOT [tablename].[deleted-field]" if a deleted-field is configured in $TCA for the tablename, $table
         * This function should ALWAYS be called in the backend for selection on tables which are configured in TCA since it will ensure consistent selection of records, even if they are marked deleted (in which case the system must always treat them as non-existent!)
         * In the frontend a function, ->enableFields(), is known to filter hidden-field, start- and endtime and fe_groups as well. But that is a job of the frontend, not the backend. If you need filtering on those fields as well in the backend you can use ->BEenableFields() though.
-        *
-        * Usage: 80
+        * Usage: 71
         *
         * @param       string          Table name present in $TCA
         * @return      string          WHERE clause for filtering out deleted records, eg " AND NOT tablename.deleted"
@@ -193,8 +194,7 @@ class t3lib_BEfunc  {
         * Additional WHERE clauses can be added by $where (fx. ' AND blabla=1')
         * Will automatically check if records has been deleted and if so, not return anything.
         * $table must be found in $TCA
-        *
-        * Usage: 168
+        * Usage: 99
         *
         * @param       string          Table name present in $TCA
         * @param       integer         UID of record
@@ -217,7 +217,6 @@ class t3lib_BEfunc  {
         * $table does NOT need to be configured in $TCA
         * The query used is simply this:
         * $query='SELECT '.$fields.' FROM '.$table.' WHERE '.$where;
-        *
         * Usage: 5 (ext: sys_todos)
         *
         * @param       string          Table name (not necessarily in TCA)
@@ -236,7 +235,6 @@ class t3lib_BEfunc  {
         * Returns records from table, $theTable, where a field ($theField) equals the value, $theValue
         * The records are returned in an array
         * If no records were selected, the function returns nothing
-        *
         * Usage: 8
         *
         * @param       string          Table name present in $TCA
@@ -272,8 +270,7 @@ class t3lib_BEfunc  {
 
        /**
         * Returns a WHERE clause which will make an AND search for the words in the $searchWords array in any of the fields in array $fields.
-        *
-        * Usage: 1 (class t3lib_fullsearch)
+        * Usage: 0
         *
         * @param       array           Array of search words
         * @param       array           Array of fields
@@ -289,8 +286,7 @@ class t3lib_BEfunc  {
         * Returns a WHERE clause that can find a value ($value) in a list field ($field)
         * For instance a record in the database might contain a list of numbers, "34,234,5" (with no spaces between). This query would be able to select that record based on the value "34", "234" or "5" regardless of their positioni in the list (left, middle or right).
         * Is nice to look up list-relations to records or files in TYPO3 database tables.
-        *
-        * Usage: 3
+        * Usage: 0
         *
         * @param       string          Table field name
         * @param       string          Value to find in list
@@ -304,7 +300,6 @@ class t3lib_BEfunc  {
        /**
         * Makes an backwards explode on the $str and returns an array with ($table,$uid).
         * Example: tt_content_45       =>      array('tt_content',45)
-        *
         * Usage: 1
         *
         * @param       string          [tablename]_[uid] string to explode
@@ -318,7 +313,6 @@ class t3lib_BEfunc  {
        /**
         * Returns a list of pure integers based on $in_list being a list of records with table-names prepended.
         * Ex: $in_list = "pages_4,tt_content_12,45" would result in a return value of "4,45" if $tablename is "pages" and $default_tablename is 'pages' as well.
-        *
         * Usage: 1 (t3lib_userauthgroup)
         *
         * @param       string          Input list
@@ -326,7 +320,7 @@ class t3lib_BEfunc  {
         * @param       string          $default_tablename denotes what table the number '45' is from (if nothing is prepended on the value)
         * @return      string          List of ids
         */
-       function getSQLselectableList ($in_list,$tablename,$default_tablename)  {
+       function getSQLselectableList($in_list,$tablename,$default_tablename)   {
                $list = Array();
                if ((string)trim($in_list)!='') {
                        $tempItemArray = explode(',',trim($in_list));
@@ -348,7 +342,6 @@ class t3lib_BEfunc  {
         * Notice that "fe_groups" is not selected for - only disabled, starttime and endtime.
         * Notice that deleted-fields are NOT filtered - you must ALSO call deleteClause in addition.
         * $GLOBALS["SIM_EXEC_TIME"] is used for date.
-        *
         * Usage: 5
         *
         * @param       string          $table is the table from which to return enableFields WHERE clause. Table name must have a 'ctrl' section in $TCA.
@@ -478,14 +471,13 @@ class t3lib_BEfunc        {
         * Returns what is called the 'RootLine'. That is an array with information about the page records from a page id ($uid) and back to the root.
         * By default deleted pages are filtered.
         * This RootLine will follow the tree all the way to the root. This is opposite to another kind of root line known from the frontend where the rootline stops when a root-template is found.
-        *
-        * Usage: 13
+        * Usage: 1
         *
         * @param       integer         Page id for which to create the root line.
         * @param       string          $clause can be used to select other criteria. It would typically be where-clauses that stops the proces if we meet a page, the user has no reading access to.
         * @return      array           Root line array, all the way to the page tree root (or as far as $clause allows!)
         */
-       function BEgetRootLine ($uid,$clause='')        {
+       function BEgetRootLine($uid,$clause='') {
                $loopCheck = 100;
                $theRowArray = Array();
                $output=Array();
@@ -568,8 +560,7 @@ class t3lib_BEfunc  {
         * Returns the path (visually) of a page $uid, fx. "/First page/Second page/Another subpage"
         * Each part of the path will be limited to $titleLimit characters
         * Deleted pages are filtered out.
-        *
-        * Usage: 23
+        * Usage: 15
         *
         * @param       integer         Page uid for which to create record path
         * @param       string          $clause is additional where clauses, eg. "
@@ -610,7 +601,6 @@ class t3lib_BEfunc  {
        /**
         * Returns an array with the exclude-fields as defined in TCA
         * Used for listing the exclude-fields in be_groups forms
-        *
         * Usage: 2 (t3lib_tceforms + t3lib_transferdata)
         *
         * @return      array           Array of arrays with excludeFields (fieldname, table:fieldname) from all TCA entries
@@ -640,10 +630,9 @@ class t3lib_BEfunc {
        }
 
        /**
-        * Returns a page record (of page with $id) with an extra field "_thePath" set to the record path IF the WHERE clause, $perms_clause, selects the record.
+        * Returns a page record (of page with $id) with an extra field "_thePath" set to the record path IF the WHERE clause, $perms_clause, selects the record. Thus is works as an access check that returns a page record if access was granted, otherwise not.
         * If $id is zero a pseudo root-page with "_thePath" set is returned IF the current BE_USER is admin.
         * In any case ->isInWebMount must return true for the user (regardless of $perms_clause)
-        *
         * Usage: 21
         *
         * @param       integer         Page uid for which to check read-access
@@ -672,7 +661,6 @@ class t3lib_BEfunc  {
 
        /**
         * Returns the "types" configuration parsed into an array for the record, $rec, from table, $table
-        *
         * Usage: 6
         *
         * @param       string          Table name (present in TCA)
@@ -726,7 +714,6 @@ class t3lib_BEfunc  {
         * Returns the "type" value of $rec from $table which can be used to look up the correct "types" rendering section in $TCA
         * If no "type" field is configured in the "ctrl"-section of the $TCA for the table, zero is used.
         * If zero is not an index in the "types" section of $TCA for the table, then the $fieldValue returned will default to 1 (no matter if that is an index or not)
-        *
         * Usage: 7
         *
         * @param       string          Table name present in TCA
@@ -751,8 +738,7 @@ class t3lib_BEfunc  {
         * Parses a part of the field lists in the "types"-section of $TCA arrays, namely the "special configuration" at index 3 (position 4)
         * Elements are splitted by ":" and within those parts, parameters are splitted by "|".
         * Everything is returned in an array and you should rather see it visually than listen to me anymore now...  Check out example in Inside TYPO3
-        *
-        * Usage: 3
+        * Usage: 5
         *
         * @param       string          Content from the "types" configuration of TCA (the special configuration) - see description of function
         * @param       string          The ['defaultExtras'] value from field configuration
@@ -783,7 +769,6 @@ class t3lib_BEfunc  {
        /**
         * Takes an array of "[key]=[value]" strings and returns an array with the keys set as keys pointing to the value.
         * Better see it in action! Find example in Inside TYPO3
-        *
         * Usage: 6
         *
         * @param       array           Array of "[key]=[value]" strings to convert.
@@ -807,6 +792,7 @@ class t3lib_BEfunc  {
 
        /**
         * Finds the Data Structure for a FlexForm field
+        * Usage: 5
         *
         * @param       array           Field config array
         * @param       array           Record data
@@ -911,7 +897,6 @@ class t3lib_BEfunc  {
        /**
         * Stores the string value $data in the 'cache_hash' table with the hash key, $hash, and visual/symbolic identification, $ident
         * IDENTICAL to the function by same name found in t3lib_page:
-        *
         * Usage: 2
         *
         * @param       string          Hash key, 32 bytes hex
@@ -933,7 +918,6 @@ class t3lib_BEfunc  {
        /**
         * Retrieves the string content stored with hash key, $hash, in cache_hash
         * IDENTICAL to the function by same name found in t3lib_page:
-        *
         * Usage: 2
         *
         * @param       string          Hash key, 32 bytes hex
@@ -968,7 +952,6 @@ class t3lib_BEfunc  {
        /**
         * Returns the Page TSconfig for page with id, $id
         * Requires class "t3lib_TSparser"
-        *
         * Usage: 26 (spec. in ext info_pagetsconfig)
         *
         * @param       integer         Page uid for which to create Page TSconfig
@@ -1077,7 +1060,6 @@ class t3lib_BEfunc        {
 
        /**
         * Implodes a multi dimensional TypoScript array, $p, into a one-dimentional array (return value)
-        *
         * Usage: 3
         *
         * @param       array           TypoScript structure
@@ -1115,7 +1097,6 @@ class t3lib_BEfunc        {
        /**
         * Returns an array with be_users records of all user NOT DELETED sorted by their username
         * Keys in the array is the be_users uid
-        *
         * Usage: 14 (spec. ext. "beuser" and module "web_perm")
         *
         * @param       string          Optional $fields list (default: username,usergroup,usergroup_cached_list,uid) can be used to set the selected fields
@@ -1134,7 +1115,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns an array with be_groups records (title, uid) of all groups NOT DELETED sorted by their title
-        *
         * Usage: 8 (spec. ext. "beuser" and module "web_perm")
         *
         * @param       string          Field list
@@ -1153,7 +1133,6 @@ class t3lib_BEfunc        {
        /**
         * Returns an array with be_groups records (like ->getGroupNames) but:
         * - if the current BE_USER is admin, then all groups are returned, otherwise only groups that the current user is member of (usergroup_cached_list) will be returned.
-        *
         * Usage: 2 (module "web_perm" and ext. taskcenter)
         *
         * @param       string          Field list; $fields specify the fields selected (default: title,uid)
@@ -1171,7 +1150,6 @@ class t3lib_BEfunc        {
         * Returns the array $usernames with the names of all users NOT IN $groupArray changed to the uid (hides the usernames!).
         * If $excludeBlindedFlag is set, then these records are unset from the array $usernames
         * Takes $usernames (array made by t3lib_BEfunc::getUserNames()) and a $groupArray (array with the groups a certain user is member of) as input
-        *
         * Usage: 8
         *
         * @param       array           User names
@@ -1205,7 +1183,6 @@ class t3lib_BEfunc        {
 
        /**
         * Corresponds to blindUserNames but works for groups instead
-        *
         * Usage: 2 (module web_perm)
         *
         * @param       array           Group names
@@ -1251,7 +1228,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns the difference in days between input $tstamp and $EXEC_TIME
-        *
         * Usage: 2 (class t3lib_BEfunc)
         *
         * @param       integer         Time stamp, seconds
@@ -1264,7 +1240,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns $tstamp formatted as "ddmmyy" (According to $TYPO3_CONF_VARS['SYS']['ddmmyy'])
-        *
         * Usage: 11
         *
         * @param       integer         Time stamp, seconds
@@ -1276,7 +1251,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns $tstamp formatted as "ddmmyy hhmm" (According to $TYPO3_CONF_VARS['SYS']['ddmmyy'] AND $TYPO3_CONF_VARS['SYS']['hhmm'])
-        *
         * Usage: 28
         *
         * @param       integer         Time stamp, seconds
@@ -1289,7 +1263,6 @@ class t3lib_BEfunc        {
        /**
         * Returns $value (in seconds) formatted as hh:mm:ss
         * For instance $value = 3600 + 60*2 + 3 should return "01:02:03"
-        *
         * Usage: 1 (class t3lib_BEfunc)
         *
         * @param       integer         Time stamp, seconds
@@ -1304,15 +1277,14 @@ class t3lib_BEfunc      {
        }
 
        /**
-        * Returns the "age" of the number of $seconds inputted.
-        *
+        * Returns the "age" in minutes / hours / days / years of the number of $seconds inputted.
         * Usage: 15
         *
         * @param       integer         $seconds could be the difference of a certain timestamp and time()
         * @param       string          $labels should be something like ' min| hrs| days| yrs'. This value is typically delivered by this function call: $GLOBALS["LANG"]->sL("LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears")
         * @return      string          Formatted time
         */
-       function calcAge ($seconds,$labels)     {
+       function calcAge($seconds,$labels)      {
                $labelArr = explode('|',$labels);
                $prefix='';
                if ($seconds<0) {$prefix='-'; $seconds=abs($seconds);}
@@ -1331,7 +1303,6 @@ class t3lib_BEfunc        {
        /**
         * Returns a formatted timestamp if $tstamp is set.
         * The date/datetime will be followed by the age in parenthesis.
-        *
         * Usage: 3
         *
         * @param       integer         Time stamp, seconds
@@ -1350,8 +1321,7 @@ class t3lib_BEfunc        {
         * If no $content is given only the attribute name is returned.
         * The returned attribute with content will have a leading space char.
         * Warning: Be careful to submit empty $content var - that will return just the attribute name!
-        *
-        * Usage: 203
+        * Usage: 0
         *
         * @param       string          String to set as title-attribute. If no $content is given only the attribute name is returned.
         * @param       boolean         If $hsc is set, then content of the attribute is htmlspecialchar()'ed (which is good for XHTML and other reasons...)
@@ -1366,6 +1336,7 @@ class t3lib_BEfunc        {
 
        /**
         * Returns alt="" and title="" attributes with the value of $content.
+        * Usage: 7
         *
         * @param       string          Value for 'alt' and 'title' attributes (will be htmlspecialchars()'ed before output)
         * @return      string
@@ -1378,10 +1349,9 @@ class t3lib_BEfunc       {
        }
 
        /**
-        * Returns a linked image-tag for thumbnail(s) from a database row with a list of image files in a field
+        * Returns a linked image-tag for thumbnail(s)/fileicons/truetype-font-previews from a database row with a list of image files in a field
         * All $TYPO3_CONF_VARS['GFX']['imagefile_ext'] extension are made to thumbnails + ttf file (renders font-example)
         * Thumbsnails are linked to the show_item.php script which will display further details.
-        *
         * Usage: 7
         *
         * @param       array           $row is the database row from the table, $table.
@@ -1454,8 +1424,7 @@ class t3lib_BEfunc        {
        }
 
        /**
-        * Returns single image tag to thumbnail
-        *
+        * Returns single image tag to thumbnail using a thumbnail script (like thumbs.php)
         * Usage: 3
         *
         * @param       string          $thumbScript must point to "thumbs.php" relative to the script position
@@ -1474,7 +1443,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns title-attribute information for a page-record informing about id, alias, doktype, hidden, starttime, endtime, fe_group etc.
-        *
         * Usage: 8
         *
         * @param       array           Input must be a page row ($row) with the proper fields set (be sure - send the full range of fields for the table)
@@ -1534,7 +1502,6 @@ class t3lib_BEfunc        {
         * Returns title-attribute information for ANY record (from a table defined in TCA of course)
         * The included information depends on features of the table, but if hidden, starttime, endtime and fe_group fields are configured for, information about the record status in regard to these features are is included.
         * "pages" table can be used as well and will return the result of ->titleAttribForPages() for that page.
-        *
         * Usage: 10
         *
         * @param       array           Table row; $row is a row from the table, $table
@@ -1568,7 +1535,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns the label of the first found entry in an "items" array from $TCA (tablename=$table/fieldname=$col) where the value is $key
-        *
         * Usage: 9
         *
         * @param       string          Table name, present in $TCA
@@ -1595,7 +1561,6 @@ class t3lib_BEfunc        {
        /**
         * Returns the label-value for fieldname $col in table, $table
         * If $printAllWrap is set (to a "wrap") then it's wrapped around the $col value IF THE COLUMN $col DID NOT EXIST in TCA!, eg. $printAllWrap='<b>|</b>' and the fieldname was 'not_found_field' then the return value would be '<b>not_found_field</b>'
-        *
         * Usage: 17
         *
         * @param       string          Table name, present in $TCA
@@ -1621,7 +1586,6 @@ class t3lib_BEfunc        {
        /**
         * Returns the "title"-value in record, $row, from table, $table
         * The field(s) from which the value is taken is determined by the "ctrl"-entries 'label', 'label_alt' and 'label_alt_force'
-        *
         * Usage: 26
         *
         * @param       string          Table name, present in TCA
@@ -1656,7 +1620,6 @@ class t3lib_BEfunc        {
         * For instance a database record relation would be looked up to display the title-value of that record. A checkbox with a "1" value would be "Yes", etc.
         * $table/$col is tablename and fieldname
         * REMEMBER to pass the output through htmlspecialchars() if you output it to the browser! (To protect it from XSS attacks and be XHTML compliant)
-        *
         * Usage: 24
         *
         * @param       string          Table name, present in TCA
@@ -1751,7 +1714,6 @@ class t3lib_BEfunc        {
 
        /**
         * Same as ->getProcessedValue() but will go easy on fields like "tstamp" and "pid" which are not configured in TCA - they will be formatted by this function instead.
-        *
         * Usage: 2
         *
         * @param       string          Table name, present in TCA
@@ -1780,7 +1742,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns file icon name (from $FILEICONS) for the fileextension $ext
-        *
         * Usage: 10
         *
         * @param       string          File extension, lowercase
@@ -1794,7 +1755,6 @@ class t3lib_BEfunc        {
         * Returns fields for a table, $table, which would typically be interesting to select
         * This includes uid, the fields defined for title, icon-field.
         * Returned as a list ready for query ($prefix can be set to eg. "pages." if you are selecting from the pages table and want the table name prefixed)
-        *
         * Usage: 3
         *
         * @param       string          Table name, present in TCA
@@ -1820,7 +1780,6 @@ class t3lib_BEfunc        {
         * Makes a form for configuration of some values based on configuration found in the array $configArray, with default values from $defaults and a data-prefix $dataPrefix
         * <form>-tags must be supplied separately
         * Needs more documentation and examples, in particular syntax for configuration array. See Inside TYPO3. That's were you can expect to find example, if anywhere.
-        *
         * Usage: 1 (ext. direct_mail)
         *
         * @param       array           Field configuration code.
@@ -1892,11 +1851,9 @@ class t3lib_BEfunc       {
         *
         *******************************************/
 
-
        /**
         * Returns help-text icon if configured for.
         * TCA_DESCR must be loaded prior to this function and $BE_USER must have 'edit_showFieldHelp' set to 'icon', otherwise nothing is returned
-        *
         * Usage: 6
         *
         * @param       string          Table name
@@ -1919,8 +1876,7 @@ class t3lib_BEfunc        {
         * Returns CSH help text (description), if configured for.
         * TCA_DESCR must be loaded prior to this function and $BE_USER must have "edit_showFieldHelp" set to "text", otherwise nothing is returned
         * Will automatically call t3lib_BEfunc::helpTextIcon() to get the icon for the text.
-        *
-        * Usage: 10
+        * Usage: 4
         *
         * @param       string          Table name
         * @param       string          Field name
@@ -1940,7 +1896,6 @@ class t3lib_BEfunc        {
        /**
         * Returns a JavaScript string (for an onClick handler) which will load the alt_doc.php script that shows the form for editing of the record(s) you have send as params.
         * REMEMBER to always htmlspecialchar() content in href-properties to ampersands get converted to entities (XHTML requirement and XSS precaution)
-        *
         * Usage: 35
         *
         * @param       string          $params is parameters sent along to alt_doc.php. This requires a much more details description which you must seek in Inside TYPO3s documentation of the alt_doc.php API. And example could be '&edit[pages][123]=edit' which will show edit form for page record 123.
@@ -1955,7 +1910,7 @@ class t3lib_BEfunc        {
 
        /**
         * Returns a JavaScript string for viewing the page id, $id
-        *
+        * It will detect the correct domain name if needed and provide the link with the right back path. Also it will re-use any window already open.
         * Usage: 8
         *
         * @param       integer         $id is page id
@@ -1985,7 +1940,6 @@ class t3lib_BEfunc        {
        /**
         * Returns the merged User/Page TSconfig for page id, $id.
         * Please read details about module programming elsewhere!
-        *
         * Usage: 15
         *
         * @param       integer         Page uid
@@ -2003,7 +1957,6 @@ class t3lib_BEfunc        {
         * Returns a selector box "function menu" for a module
         * Requires the JS function jumpToUrl() to be available
         * See Inside TYPO3 for details about how to use / make Function menus
-        *
         * Usage: 50
         *
         * @param       string          $id is the "&id=" parameter value to be sent to the module
@@ -2032,7 +1985,6 @@ class t3lib_BEfunc        {
        /**
         * Checkbox function menu.
         * Works like ->getFuncMenu() but takes no $menuItem array since this is a simple checkbox.
-        *
         * Usage: 34
         *
         * @param       string          $id is the "&id=" parameter value to be sent to the module
@@ -2053,7 +2005,6 @@ class t3lib_BEfunc        {
        /**
         * Input field function menu
         * Works like ->getFuncMenu() / ->getFuncCheck() but displays a input field instead which updates the script "onchange"
-        *
         * Usage: 1
         *
         * @param       string          $id is the "&id=" parameter value to be sent to the module
@@ -2074,7 +2025,6 @@ class t3lib_BEfunc        {
        /**
         * Removes menu items from $itemArray if they are configured to be removed by TSconfig for the module ($modTSconfig)
         * See Inside TYPO3 about how to program modules and use this API.
-        *
         * Usage: 4
         *
         * @param       array           Module TS config array
@@ -2100,7 +2050,6 @@ class t3lib_BEfunc        {
         * Call to update the page tree frame (or something else..?) after
         * t3lib_BEfunc::getSetUpdateSignal('updatePageTree') -> will set the page tree to be updated.
         * t3lib_BEfunc::getSetUpdateSignal() -> will return some JavaScript that does the update (called in the typo3/template.php file, end() function)
-        *
         * Usage: 11
         *
         * @param       string          Whether to set or clear the update signal. When setting, this value contains strings telling WHAT to set. At this point it seems that the value "updatePageTree" is the only one it makes sense to set.
@@ -2223,7 +2172,6 @@ class t3lib_BEfunc        {
        /**
         * Unlock or Lock a record from $table with $uid
         * If $table and $uid is not set, then all locking for the current BE_USER is removed!
-        *
         * Usage: 5
         *
         * @param       string          Table name
@@ -2254,7 +2202,6 @@ class t3lib_BEfunc        {
        /**
         * Returns information about whether the record from table, $table, with uid, $uid is currently locked (edited by another user - which should issue a warning).
         * Notice: Locking is not strictly carried out since locking is abandoned when other backend scripts are activated - which means that a user CAN have a record "open" without having it locked. So this just serves as a warning that counts well in 90% of the cases, which should be sufficient.
-        *
         * Usage: 5
         *
         * @param       string          Table name
@@ -2293,7 +2240,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns select statement for MM relations (as used by TCEFORMs etc)
-        *
         * Usage: 3
         *
         * @param       array           Configuration array for the field, taken from $TCA
@@ -2378,7 +2324,6 @@ class t3lib_BEfunc        {
        /**
         * Returns TSConfig for the TCEFORM object in Page TSconfig.
         * Used in TCEFORMs
-        *
         * Usage: 4
         *
         * @param       string          Table name present in TCA
@@ -2424,7 +2369,6 @@ class t3lib_BEfunc        {
 
        /**
         * Find the real PID of the record (with $uid from $table). This MAY be impossible if the pid is set as a reference to the former record or a page (if two records are created at one time).
-        *
         * Usage: 2
         *
         * @param       string          Table name
@@ -2453,7 +2397,6 @@ class t3lib_BEfunc        {
 
        /**
         * Return $uid if $table is pages and $uid is integer - otherwise the $pid
-        *
         * Usage: 1
         *
         * @param       string          Table name
@@ -2470,7 +2413,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns the REAL pid of the record, if possible. If both $uid and $pid is strings, then pid=-1 is returned as an error indication.
-        *
         * Usage: 8
         *
         * @param       string          Table name
@@ -2491,7 +2433,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns first found domain record "domainName" (without trailing slash) if found in the input $rootLine
-        *
         * Usage: 2
         *
         * @param       array           Root line array
@@ -2513,7 +2454,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns the sys_domain record for $domain, optionally with $path appended.
-        *
         * Usage: 2
         *
         * @param       string          Domain name
@@ -2541,7 +2481,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns overlayered RTE setup from an array with TSconfig. Used in TCEforms and TCEmain
-        *
         * Usage: 8
         *
         * @param       array           The properties of Page TSconfig in the key "RTE."
@@ -2603,7 +2542,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns true if $modName is set and is found as a main- or submodule in $TBE_MODULES array
-        *
         * Usage: 1
         *
         * @param       string          Module name
@@ -2650,7 +2588,6 @@ class t3lib_BEfunc        {
 
        /**
         * Print error message with header, text etc.
-        *
         * Usage: 19
         *
         * @param       string          Header string
@@ -2659,11 +2596,11 @@ class t3lib_BEfunc      {
         * @param       boolean         Print header.
         * @return      void
         */
-       function typo3PrintError ($header,$text,$js='',$head=1) {
-               // This prints out a TYPO3 error message.
-               // If $js is set the message will be output in JavaScript
+       function typo3PrintError($header,$text,$js='',$head=1)  {
+                       // This prints out a TYPO3 error message.
+                       // If $js is set the message will be output in JavaScript
                if ($js)        {
-                       echo"alert('".t3lib_div::slashJS($header.'\n'.$text)."');";
+                       echo "alert('".t3lib_div::slashJS($header.'\n'.$text)."');";
                } else {
                        echo $head?'<html>
                                <head>
@@ -2700,7 +2637,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns "web" if the $path (absolute) is within the DOCUMENT ROOT - and thereby qualifies as a "web" folder.
-        *
         * Usage: 4
         *
         * @param       string          Path to evaluate
@@ -2712,7 +2648,6 @@ class t3lib_BEfunc        {
 
        /**
         * Creates ADMCMD parameters for the "viewpage" extension / "cms" frontend
-        *
         * Usage: 1
         *
         * @param       array           Page record
@@ -2736,7 +2671,6 @@ class t3lib_BEfunc        {
         * Returns an array with key=>values based on input text $params
         * $params is exploded by line-breaks and each line is supposed to be on the syntax [key] = [some value]
         * These pairs will be parsed into an array an returned.
-        *
         * Usage: 1
         *
         * @param       string          String of parameters on multiple lines to parse into key-value pairs (see function description)
@@ -2757,7 +2691,6 @@ class t3lib_BEfunc        {
 
        /**
         * Returns "list of backend modules". Most likely this will be obsolete soon / removed. Don't use.
-        *
         * Usage: 3
         *
         * @param       array           Module names in array. Must be "addslashes()"ed
index af4f06e..9294008 100755 (executable)
  *
  *
  *
- *  203: class t3lib_div
+ *  207: class t3lib_div
  *
  *              SECTION: GET/POST Variables
- *  232:     function _GP($var)
- *  246:     function _GET($var='')
- *  260:     function _POST($var='')
- *  273:     function _GETset($inputGet,$key='')
- *  297:     function GPvar($var,$strip=0)
- *  314:     function setGPvars($list,$strip=0)
- *  331:     function GParrayMerged($var)
+ *  237:     function _GP($var)
+ *  254:     function _GET($var='')
+ *  269:     function _POST($var='')
+ *  283:     function _GETset($inputGet,$key='')
+ *  306:     function GPvar($var,$strip=0)
+ *  322:     function setGPvars($list,$strip=0)
+ *  338:     function GParrayMerged($var)
  *
  *              SECTION: IMAGE FUNCTIONS
- *  376:     function gif_compress($theFile, $type)
- *  404:     function png_to_gif_by_imagemagick($theFile)
- *  428:     function read_png_gif($theFile,$output_png=0)
+ *  382:     function gif_compress($theFile, $type)
+ *  408:     function png_to_gif_by_imagemagick($theFile)
+ *  432:     function read_png_gif($theFile,$output_png=0)
  *
  *              SECTION: STRING FUNCTIONS
- *  477:     function fixed_lgd($string,$chars,$preStr='...')
- *  499:     function fixed_lgd_pre($string,$chars)
- *  513:     function breakTextForEmail($str,$implChar="\n",$charWidth=76)
- *  533:     function breakLinesForEmail($str,$implChar="\n",$charWidth=76)
- *  569:     function cmpIP($baseIP, $list)
- *  616:     function inList($in_list,$item)
- *  629:     function rmFromList($element,$list)
- *  648:     function intInRange($theInt,$min,$max=2000000000,$zeroValue=0)
- *  665:     function intval_positive($theInt)
- *  679:     function int_from_ver($verNumberStr)
- *  692:     function md5int($str)
- *  704:     function uniqueList($in_list)
- *  717:     function split_fileref($fileref)
- *  754:     function dirname($path)
- *  771:     function modifyHTMLColor($color,$R,$G,$B)
- *  792:     function modifyHTMLColorAll($color,$all)
- *  804:     function rm_endcomma($string)
- *  817:     function danish_strtoupper($string)
- *  832:     function convUmlauts($str)
- *  847:     function shortMD5($input, $len=10)
- *  859:     function testInt($var)
- *  872:     function isFirstPartOfStr($str,$partStr)
- *  889:     function formatSize($sizeInBytes,$labels='')
- *  925:     function convertMicrotime($microtime)
- *  939:     function splitCalc($string,$operators)
- *  961:     function calcPriority($string)
- * 1001:     function calcParenthesis($string)
- * 1028:     function htmlspecialchars_decode($value)
- * 1042:     function deHSCentities($str)
- * 1055:     function slashJS($string,$extended=0,$char="'")
- * 1069:     function rawUrlEncodeJS($str)
- * 1080:     function rawUrlEncodeFP($str)
- * 1092:     function validEmail($email)
- * 1108:     function formatForTextarea($content)
+ *  481:     function fixed_lgd($string,$origChars,$preStr='...')
+ *  506:     function fixed_lgd_pre($string,$chars)
+ *  520:     function fixed_lgd_cs($string,$chars)
+ *  537:     function breakTextForEmail($str,$implChar="\n",$charWidth=76)
+ *  556:     function breakLinesForEmail($str,$implChar="\n",$charWidth=76)
+ *  591:     function cmpIP($baseIP, $list)
+ *  633:     function cmpFQDN($baseIP, $list)
+ *  663:     function inList($in_list,$item)
+ *  675:     function rmFromList($element,$list)
+ *  693:     function intInRange($theInt,$min,$max=2000000000,$zeroValue=0)
+ *  709:     function intval_positive($theInt)
+ *  722:     function int_from_ver($verNumberStr)
+ *  734:     function md5int($str)
+ *  747:     function shortMD5($input, $len=10)
+ *  758:     function uniqueList()
+ *  778:     function split_fileref($fileref)
+ *  815:     function dirname($path)
+ *  831:     function modifyHTMLColor($color,$R,$G,$B)
+ *  851:     function modifyHTMLColorAll($color,$all)
+ *  862:     function rm_endcomma($string)
+ *  875:     function danish_strtoupper($string)
+ *  890:     function convUmlauts($str)
+ *  903:     function testInt($var)
+ *  915:     function isFirstPartOfStr($str,$partStr)
+ *  931:     function formatSize($sizeInBytes,$labels='')
+ *  966:     function convertMicrotime($microtime)
+ *  980:     function splitCalc($string,$operators)
+ * 1002:     function calcPriority($string)
+ * 1042:     function calcParenthesis($string)
+ * 1068:     function htmlspecialchars_decode($value)
+ * 1083:     function deHSCentities($str)
+ * 1096:     function slashJS($string,$extended=0,$char="'")
+ * 1109:     function rawUrlEncodeJS($str)
+ * 1121:     function rawUrlEncodeFP($str)
+ * 1132:     function validEmail($email)
+ * 1147:     function formatForTextarea($content)
  *
  *              SECTION: ARRAY FUNCTIONS
- * 1140:     function inArray($in_array,$item)
- * 1158:     function intExplode($delim, $string)
- * 1178:     function revExplode($delim, $string, $count=0)
- * 1199:     function trimExplode($delim, $string, $onlyNonEmptyValues=0)
- * 1224:     function uniqueArray($valueArray)
- * 1247:     function removeArrayEntryByValue($array,$cmpValue)
- * 1276:     function implodeArrayForUrl($name,$theArray,$str='',$skipBlank=0,$rawurlencodeParamName=0)
- * 1303:     function compileSelectedGetVarsFromArray($varList,$getArray,$GPvarAlt=1)
- * 1327:     function addSlashesOnArray(&$theArray)
- * 1352:     function stripSlashesOnArray(&$theArray)
- * 1375:     function slashArray($arr,$cmd)
- * 1392:     function array_merge_recursive_overrule ($arr0,$arr1,$notAddKeys=0)
- * 1422:     function array_merge($arr1,$arr2)
- * 1436:     function csvValues($row,$delim=',',$quote='"')
+ * 1178:     function inArray($in_array,$item)
+ * 1195:     function intExplode($delim, $string)
+ * 1214:     function revExplode($delim, $string, $count=0)
+ * 1234:     function trimExplode($delim, $string, $onlyNonEmptyValues=0)
+ * 1259:     function uniqueArray($valueArray)
+ * 1281:     function removeArrayEntryByValue($array,$cmpValue)
+ * 1309:     function implodeArrayForUrl($name,$theArray,$str='',$skipBlank=0,$rawurlencodeParamName=0)
+ * 1336:     function compileSelectedGetVarsFromArray($varList,$getArray,$GPvarAlt=1)
+ * 1359:     function addSlashesOnArray(&$theArray)
+ * 1383:     function stripSlashesOnArray(&$theArray)
+ * 1405:     function slashArray($arr,$cmd)
+ * 1421:     function array_merge_recursive_overrule($arr0,$arr1,$notAddKeys=0)
+ * 1450:     function array_merge($arr1,$arr2)
+ * 1463:     function csvValues($row,$delim=',',$quote='"')
  *
  *              SECTION: HTML/XML PROCESSING
- * 1479:     function get_tag_attributes($tag)
- * 1517:     function split_tag_attributes($tag)
- * 1552:     function implodeParams($arr,$xhtmlSafe=FALSE,$dontOmitBlankAttribs=FALSE)
- * 1580:     function wrapJS($string, $linebreak=TRUE)
- * 1609:     function xml2tree($string,$depth=999)
- * 1694:     function array2xml($array,$NSprefix='',$level=0,$docTag='phparray',$spaceInd=0, $options=array(),$parentTagName='')
- * 1776:     function xml2array($string,$NSprefix='')
- * 1863:     function xmlRecompileFromStructValArray($vals)
- * 1906:     function xmlGetHeaderAttribs($xmlData)
+ * 1505:     function get_tag_attributes($tag)
+ * 1542:     function split_tag_attributes($tag)
+ * 1576:     function implodeParams($arr,$xhtmlSafe=FALSE,$dontOmitBlankAttribs=FALSE)
+ * 1604:     function wrapJS($string, $linebreak=TRUE)
+ * 1634:     function xml2tree($string,$depth=999)
+ * 1720:     function array2xml($array,$NSprefix='',$level=0,$docTag='phparray',$spaceInd=0, $options=array(),$parentTagName='')
+ * 1803:     function xml2array($string,$NSprefix='')
+ * 1891:     function xmlRecompileFromStructValArray($vals)
+ * 1935:     function xmlGetHeaderAttribs($xmlData)
  *
  *              SECTION: FILES FUNCTIONS
- * 1939:     function getURL($url)
- * 1982:     function writeFile($file,$content)
- * 2002:     function mkdir($theNewFolder)
- * 2019:     function get_dirs($path)
- * 2045:     function getFilesInDir($path,$extensionList='',$prependPath=0,$order='')
- * 2098:     function getAllFilesAndFoldersInPath($fileArr,$path,$extList='',$regDirs=0,$recursivityLevels=99)
- * 2120:     function removePrefixPathFromList($fileArr,$prefixToRemove)
- * 2137:     function fixWindowsFilePath($theFile)
- * 2147:     function resolveBackPath($pathStr)
- * 2175:     function locationHeaderUrl($path)
+ * 1967:     function getURL($url)
+ * 2009:     function writeFile($file,$content)
+ * 2030:     function mkdir($theNewFolder)
+ * 2046:     function get_dirs($path)
+ * 2071:     function getFilesInDir($path,$extensionList='',$prependPath=0,$order='')
+ * 2125:     function getAllFilesAndFoldersInPath($fileArr,$path,$extList='',$regDirs=0,$recursivityLevels=99)
+ * 2148:     function removePrefixPathFromList($fileArr,$prefixToRemove)
+ * 2164:     function fixWindowsFilePath($theFile)
+ * 2175:     function resolveBackPath($pathStr)
+ * 2202:     function locationHeaderUrl($path)
  *
  *              SECTION: DEBUG helper FUNCTIONS
- * 2215:     function debug_ordvalue($string,$characters=100)
- * 2232:     function view_array($array_in)
- * 2260:     function print_array($array_in)
- * 2276:     function debug($var="",$brOrHeader=0)
+ * 2242:     function debug_ordvalue($string,$characters=100)
+ * 2259:     function view_array($array_in)
+ * 2287:     function print_array($array_in)
+ * 2302:     function debug($var="",$brOrHeader=0)
  *
  *              SECTION: SYSTEM INFORMATION
- * 2345:     function getThisUrl()
- * 2362:     function linkThisScript($getParams=array())
- * 2386:     function linkThisUrl($url,$getParams=array())
- * 2412:     function getIndpEnv($getEnvName)
- * 2604:     function milliseconds()
- * 2617:     function clientInfo($useragent='')
+ * 2371:     function getThisUrl()
+ * 2387:     function linkThisScript($getParams=array())
+ * 2411:     function linkThisUrl($url,$getParams=array())
+ * 2436:     function getIndpEnv($getEnvName)
+ * 2626:     function milliseconds()
+ * 2638:     function clientInfo($useragent='')
  *
  *              SECTION: TYPO3 SPECIFIC FUNCTIONS
- * 2706:     function getFileAbsFileName($filename,$onlyRelative=1,$relToTYPO3_mainDir=0)
- * 2742:     function validPathStr($theFile)
- * 2754:     function isAbsPath($path)
- * 2766:     function isAllowedAbsPath($path)
- * 2784:     function verifyFilenameAgainstDenyPattern($filename)
- * 2802:     function upload_copy_move($source,$destination)
- * 2830:     function upload_to_tempfile($uploadedFileName)
- * 2847:     function unlink_tempfile($uploadedTempFileName)
- * 2862:     function tempnam($filePrefix)
- * 2875:     function stdAuthCode($uid_or_record,$fields='')
- * 2909:     function loadTCA($table)
- * 2928:     function resolveSheetDefInDS($dataStructArray,$sheet='sDEF')
- * 2956:     function resolveAllSheetsInDS($dataStructArray)
- * 2986:     function callUserFunction($funcName,&$params,&$ref,$checkPrefix='user_',$silent=0)
- * 3165:     function makeInstanceService($serviceType, $serviceSubType='', $excludeServiceKeys='')
- * 3204:     function makeInstanceClassName($className)
- * 3224:     function plainMailEncoded($email,$subject,$message,$headers='',$enc='',$charset='ISO-8859-1',$dontEncodeSubject=0)
- * 3271:     function quoted_printable($string,$maxlen=76)
- * 3314:     function substUrlsInPlainText($message,$urlmode='76',$index_script_url='')
- * 3349:     function makeRedirectUrl($inUrl,$l=0,$index_script_url='')
- * 3377:     function freetypeDpiComp($font_size)
- * 3396:     function devLog($msg, $extKey, $severity=0, $dataVar=FALSE)
+ * 2726:     function getFileAbsFileName($filename,$onlyRelative=1,$relToTYPO3_mainDir=0)
+ * 2761:     function validPathStr($theFile)
+ * 2772:     function isAbsPath($path)
+ * 2783:     function isAllowedAbsPath($path)
+ * 2800:     function verifyFilenameAgainstDenyPattern($filename)
+ * 2818:     function upload_copy_move($source,$destination)
+ * 2847:     function upload_to_tempfile($uploadedFileName)
+ * 2865:     function unlink_tempfile($uploadedTempFileName)
+ * 2881:     function tempnam($filePrefix)
+ * 2894:     function stdAuthCode($uid_or_record,$fields='')
+ * 2928:     function loadTCA($table)
+ * 2948:     function resolveSheetDefInDS($dataStructArray,$sheet='sDEF')
+ * 2976:     function resolveAllSheetsInDS($dataStructArray)
+ * 3005:     function callUserFunction($funcName,&$params,&$ref,$checkPrefix='user_',$silent=0)
+ * 3103:     function &getUserObj($classRef,$checkPrefix='user_',$silent=0)
+ * 3161:     function &makeInstance($className)
+ * 3173:     function makeInstanceClassName($className)
+ * 3187:     function makeInstanceService($serviceType, $serviceSubType='', $excludeServiceKeys='')
+ * 3232:     function plainMailEncoded($email,$subject,$message,$headers='',$enc='',$charset='ISO-8859-1',$dontEncodeSubject=0)
+ * 3277:     function quoted_printable($string,$maxlen=76)
+ * 3319:     function substUrlsInPlainText($message,$urlmode='76',$index_script_url='')
+ * 3353:     function makeRedirectUrl($inUrl,$l=0,$index_script_url='')
+ * 3380:     function freetypeDpiComp($font_size)
+ * 3399:     function devLog($msg, $extKey, $severity=0, $dataVar=FALSE)
  *
- * TOTAL FUNCTIONS: 109
+ * TOTAL FUNCTIONS: 113
  * (This index is automatically created/updated by the extension "extdeveval")
  *
  */
@@ -224,6 +228,7 @@ class t3lib_div {
         * Strips slashes from all output, both strings and arrays.
         * This function substitutes t3lib_div::GPvar()
         * To enhancement security in your scripts, please consider using t3lib_div::_GET or t3lib_div::_POST if you already know by which method your data is arriving to the scripts!
+        * Usage: 537
         *
         * @param       string          GET/POST var to return
         * @return      mixed           POST var named $var and if not set, the GET var of the same name.
@@ -240,6 +245,7 @@ class t3lib_div {
        /**
         * Returns the global GET array (or value from) normalized to contain un-escaped values.
         * ALWAYS use this API function to acquire the GET variables!
+        * Usage: 27
         *
         * @param       string          Optional pointer to value in GET array (basically name of GET var)
         * @return      mixed           If $var is set it returns the value of $HTTP_GET_VARS[$var]. If $var is blank or zero, returns $HTTP_GET_VARS itself. In any case *slashes are stipped from the output!*
@@ -254,6 +260,7 @@ class t3lib_div {
        /**
         * Returns the global POST array (or value from) normalized to contain un-escaped values.
         * ALWAYS use this API function to acquire the POST variables!
+        * Usage: 41
         *
         * @param       string          Optional pointer to value in POST array (basically name of POST var)
         * @return      mixed           If $var is set it returns the value of $HTTP_POST_VARS[$var]. If $var is blank or zero, returns $HTTP_POST_VARS itself. In any case *slashes are stipped from the output!*
@@ -267,6 +274,7 @@ class t3lib_div {
 
        /**
         * Writes input value to $HTTP_GET_VARS / $_GET
+        * Usage: 2
         *
         * @param       array           Array to write to $HTTP_GET_VARS / $_GET. Values should NOT be escaped at input time (but will be escaped before writing according to TYPO3 standards).
         * @param       string          Alternative key; If set, this will not set the WHOLE GET array, but only the key in it specified by this value!
@@ -287,13 +295,12 @@ class t3lib_div {
         * GET/POST variable
         * Returns the 'GLOBAL' value of incoming data from POST or GET, with priority to POST (that is equalent to 'GP' order)
         * Strips slashes of string-outputs, but not arrays UNLESS $strip is set. If $strip is set all output will have escaped characters unescaped.
-        *
-        * Usage: 686
+        * Usage: 2
         *
         * @param       string          GET/POST var to return
         * @param       boolean         If set, values are stripped of return values that are *arrays!* - string/integer values returned are always strip-slashed()
         * @return      mixed           POST var named $var and if not set, the GET var of the same name.
-        * @depreciated         Use t3lib_div::_GP instead (ALWAYS delivers a value with un-escaped values!)
+        * @deprecated          Use t3lib_div::_GP instead (ALWAYS delivers a value with un-escaped values!)
         * @see _GP()
         */
        function GPvar($var,$strip=0)   {
@@ -305,13 +312,12 @@ class t3lib_div {
 
        /**
         * Sets global variables from HTTP_POST_VARS or HTTP_GET_VARS
-        *
-        * Usage: 9
+        * Usage: 0
         *
         * @param       string          List of GET/POST var keys to set globally
         * @param       boolean         If set, values are passed through stripslashes()
         * @return      void
-        * @depreciated
+        * @deprecated
         */
        function setGPvars($list,$strip=0)      {
                $vars = t3lib_div::trimExplode(',',$list,1);
@@ -322,13 +328,12 @@ class t3lib_div {
 
        /**
         * Returns the GET/POST global arrays merged with POST taking precedence.
-        *
         * Usage: 1
         *
         * @param       string          Key (variable name) from GET or POST vars
         * @return      array           Returns the GET vars merged recursively onto the POST vars.
         * @ignore
-        * @depreciated
+        * @deprecated
         */
        function GParrayMerged($var)    {
                $postA = is_array($GLOBALS['HTTP_POST_VARS'][$var]) ? $GLOBALS['HTTP_POST_VARS'][$var] : array();
@@ -367,8 +372,7 @@ class t3lib_div {
         *
         *              $theFile is expected to be a valid GIF-file!
         *              The function returns a code for the operation.
-        *
-        * Usage: 11
+        * Usage: 9
         *
         * @param       string          Filepath
         * @param       string          See description of function
@@ -394,9 +398,7 @@ class t3lib_div {
 
        /**
         * Converts a png file to gif
-        *
         * This converts a png file to gif IF the FLAG $GLOBALS['TYPO3_CONF_VARS']['FE']['png_to_gif'] is set true.
-        *
         * Usage: 5
         *
         * @param       string          $theFile        the filename with path
@@ -420,7 +422,7 @@ class t3lib_div {
        /**
         * Returns filename of the png/gif version of the input file (which can be png or gif).
         * If input file type does not match the wanted output type a conversion is made and temp-filename returned.
-        * Usage: 1
+        * Usage: 2
         *
         * @param       string          Filepath of image file
         * @param       boolean         If set, then input file is converted to PNG, otherwise to GIF
@@ -468,8 +470,7 @@ class t3lib_div {
         * Returns a new string of max. $chars length.
         * If the string is longer, it will be truncated and appended with '...'.
         * DEPRECIATED. Works ONLY for single-byte charsets! USE t3lib_div::fixed_lgd_cs() instead
-        *
-        * Usage: 119
+        * Usage: 39
         *
         * @param       string          $string         string to truncate
         * @param       integer         $chars  must be an integer with an absolute value of at least 4. if negative the string is cropped from the right end.
@@ -495,8 +496,7 @@ class t3lib_div {
         * If the string is longer, it will be truncated and prepended with '...'.
         * This works like fixed_lgd, but is truncated in the start of the string instead of the end
         * DEPRECIATED. Use either fixed_lgd() or fixed_lgd_cs() (with negative input value for $chars)
-        *
-        * Usage: 19
+        * Usage: 6
         *
         * @param       string          $string         string to truncate
         * @param       integer         $chars  must be an integer of at least 4
@@ -510,6 +510,7 @@ class t3lib_div {
        /**
         * Truncates a string with appended/prepended "..." and takes backend character set into consideration
         * Use only from backend!
+        * Usage: 75
         *
         * @param       string          $string         string to truncate
         * @param       integer         $chars  must be an integer with an absolute value of at least 4. if negative the string is cropped from the right end.
@@ -526,7 +527,6 @@ class t3lib_div {
 
        /**
         * Breaks up the text for emails
-        *
         * Usage: 1
         *
         * @param       string          The string to break up
@@ -545,8 +545,7 @@ class t3lib_div {
 
        /**
         * Breaks up a single line of text for emails
-        *
-        * Usage: 3
+        * Usage: 5
         *
         * @param       string          The string to break up
         * @param       string          The string to implode the broken lines with (default/typically \n)
@@ -583,8 +582,7 @@ class t3lib_div {
 
        /**
         * Match IP number with list of numbers with wildcard
-        *
-        * Usage: 8
+        * Usage: 10
         *
         * @param       string          $baseIP is the current remote IP address for instance, typ. REMOTE_ADDR
         * @param       string          $list is a comma-list of IP-addresses to match with. *-wildcard allowed instead of number, plus leaving out parts in the IP number is accepted as wildcard (eg. 192.168.*.* equals 192.168)
@@ -628,9 +626,9 @@ class t3lib_div {
        /**
         * Match fully qualified domain name with list of strings with wildcard
         *
-        * @param       string         $baseIP is the current remote IP address for instance, typ. REMOTE_ADDR
-        * @param       string          $list is a comma-list of domain names to match with. *-wildcard allowed but cannot be part of a string, so it must match the full host name (eg. myhost.*.com => correct, myhost.*domain.com => wrong)
-        * @return      boolean         True if a domain name mask from $list matches $baseIP
+        * @param       string          $baseIP is the current remote IP address for instance, typ. REMOTE_ADDR
+        * @param       string          $list is a comma-list of domain names to match with. *-wildcard allowed but cannot be part of a string, so it must match the full host name (eg. myhost.*.com => correct, myhost.*domain.com => wrong)
+        * @return      boolean         True if a domain name mask from $list matches $baseIP
         */
        function cmpFQDN($baseIP, $list)        {
                if (count(explode('.',$baseIP))==4)     {
@@ -655,10 +653,8 @@ class t3lib_div {
 
        /**
         * Check for item in list
-        *
         * Check if an item exists in a comma-separated list of items.
-        *
-        * Usage: 166
+        * Usage: 163
         *
         * @param       string          $in_list        comma-separated list of items (string)
         * @param       string          $item   item to check for
@@ -670,7 +666,6 @@ class t3lib_div {
 
        /**
         * Removes an item from a comma-separated list of items.
-        *
         * Usage: 1
         *
         * @param       string          $element        element to remove
@@ -687,8 +682,7 @@ class t3lib_div {
 
        /**
         * Forces the integer $theInt into the boundaries of $min and $max. If the $theInt is 'false' then the $zeroValue is applied.
-        *
-        * Usage: 226
+        * Usage: 224
         *
         * @param       integer         Input value
         * @param       integer         Lower limit
@@ -707,7 +701,6 @@ class t3lib_div {
 
        /**
         * Returns the $integer if greater than zero, otherwise returns zero.
-        *
         * Usage: 1
         *
         * @param       integer         Integer string to process
@@ -721,7 +714,6 @@ class t3lib_div {
 
        /**
         * Returns an integer from a three part version number, eg '4.12.3' -> 4012003
-        *
         * Usage: 2
         *
         * @param       string          Version number on format x.x.x
@@ -734,8 +726,7 @@ class t3lib_div {
 
        /**
         * Makes a positive integer hash out of the first 7 chars from the md5 hash of the input
-        *
-        * Usage: 0
+        * Usage: 5
         *
         * @param       string          String to md5-hash
         * @return      integer         Returns 28bit integer-hash
@@ -745,8 +736,20 @@ class t3lib_div {
        }
 
        /**
-        * Takes comma-separated lists and arrays and removes all duplicates
+        * Returns the first 10 positions of the MD5-hash               (changed from 6 to 10 recently)
         *
+        * Usage: 37
+        *
+        * @param       string          Input string to be md5-hashed
+        * @param       integer         The string-length of the output
+        * @return      string          Substring of the resulting md5-hash, being $len chars long (from beginning)
+        */
+       function shortMD5($input, $len=10)      {
+               return substr(md5($input),0,$len);
+       }
+
+       /**
+        * Takes comma-separated lists and arrays and removes all duplicates
         * Usage: 16
         *
         * @param       string          Accept multiple parameters wich can be comma-separated lists of values and arrays.
@@ -767,7 +770,6 @@ class t3lib_div {
 
        /**
         * Splits a reference to a file in 5 parts
-        *
         * Usage: 43
         *
         * @param       string          Filename/filepath to be analysed
@@ -817,8 +819,7 @@ class t3lib_div {
 
        /**
         * Modifies a HTML Hex color by adding/subtracting $R,$G and $B integers
-        *
-        * Usage: 37
+        * Usage: 11
         *
         * @param       string          A hexadecimal color code, #xxxxxx
         * @param       integer         Offset value 0-255
@@ -840,8 +841,7 @@ class t3lib_div {
 
        /**
         * Modifies a HTML Hex color by adding/subtracting $all integer from all R/G/B channels
-        *
-        * Usage: 4
+        * Usage: 6
         *
         * @param       string          A hexadecimal color code, #xxxxxx
         * @param       integer         Offset value 0-255 for all three channels.
@@ -854,8 +854,7 @@ class t3lib_div {
 
        /**
         * Removes comma (if present) in the end of string
-        *
-        * Usage: 4
+        * Usage: 2
         *
         * @param       string          String from which the comma in the end (if any) will be removed.
         * @return      string
@@ -895,22 +894,8 @@ class t3lib_div {
        }
 
        /**
-        * Returns the first 10 positions of the MD5-hash               (changed from 6 to 10 recently)
-        *
-        * Usage: 43
-        *
-        * @param       string          Input string to be md5-hashed
-        * @param       integer         The string-length of the output
-        * @return      string          Substring of the resulting md5-hash, being $len chars long (from beginning)
-        */
-       function shortMD5($input, $len=10)      {
-               return substr(md5($input),0,$len);
-       }
-
-       /**
         * Tests if the input is an integer.
-        *
-        * Usage: 74
+        * Usage: 77
         *
         * @param       mixed           Any input variable to test.
         * @return      boolean         Returns true if string is an integer
@@ -921,8 +906,7 @@ class t3lib_div {
 
        /**
         * Returns true if the first part of $str matches the string $partStr
-        *
-        * Usage: 58
+        * Usage: 59
         *
         * @param       string          Full string to check
         * @param       string          Reference string which must be found as the "first part" of the full string
@@ -938,8 +922,7 @@ class t3lib_div {
 
        /**
         * Formats the input integer $sizeInBytes as bytes/kilobytes/megabytes (-/K/M)
-        *
-        * Usage: 54
+        * Usage: 53
         *
         * @param       integer         Number of bytes to format.
         * @param       string          Labels for bytes, kilo, mega and giga separated by vertical bar (|) and possibly encapsulated in "". Eg: " | K| M| G" (which is the default value)
@@ -975,7 +958,6 @@ class t3lib_div {
 
        /**
         * Returns microtime input to milliseconds
-        *
         * Usage: 2
         *
         * @param       string          Microtime
@@ -1078,8 +1060,7 @@ class t3lib_div {
 
        /**
         * Inverse version of htmlspecialchars()
-        *
-        * Usage: 2
+        * Usage: 4
         *
         * @param       string          Value where &gt;, &lt;, &quot; and &amp; should be converted to regular chars.
         * @return      string          Converted result.
@@ -1094,6 +1075,7 @@ class t3lib_div {
 
        /**
         * Re-converts HTML entities if they have been converted by htmlspecialchars()
+        * Usage: 10
         *
         * @param       string          String which contains eg. "&amp;amp;" which should stay "&amp;". Or "&amp;#1234;" to "&#1234;". Or "&amp;#x1b;" to "&#x1b;"
         * @return      string          Converted result.
@@ -1104,7 +1086,7 @@ class t3lib_div {
 
        /**
         * This function is used to escape any ' -characters when transferring text to JavaScript!
-        * Usage: 6
+        * Usage: 3
         *
         * @param       string          String to escape
         * @param       boolean         If set, also backslashes are escaped.
@@ -1119,8 +1101,7 @@ class t3lib_div {
        /**
         * Version of rawurlencode() where all spaces (%20) are re-converted to space-characters.
         * Usefull when passing text to JavaScript where you simply url-encode it to get around problems with syntax-errors, linebreaks etc.
-        *
-        * Usage: 8
+        * Usage: 4
         *
         * @param       string          String to raw-url-encode with spaces preserved
         * @return      string          Rawurlencoded result of input string, but with all %20 (space chars) converted to real spaces.
@@ -1132,6 +1113,7 @@ class t3lib_div {
        /**
         * rawurlencode which preserves "/" chars
         * Usefull when filepaths should keep the "/" chars, but have all other special chars encoded.
+        * Usage: 5
         *
         * @param       string          Input string
         * @return      string          Output string
@@ -1142,8 +1124,7 @@ class t3lib_div {
 
        /**
         * Checking syntax of input email address
-        *
-        * Usage: 4
+        * Usage: 5
         *
         * @param       string          Input string to evaluate
         * @return      boolean         Returns true if the $email address (input string) is valid; Has a "@", domain name with at least one period and only allowed a-z characters.
@@ -1158,8 +1139,7 @@ class t3lib_div {
         * Formats a string for output between <textarea>-tags
         * All content outputted in a textarea form should be passed through this function
         * Not only is the content htmlspecialchar'ed on output but there is also a single newline added in the top. The newline is necessary because browsers will ignore the first newline after <textarea> if that is the first character. Therefore better set it!
-        *
-        * Usage: 30
+        * Usage: 23
         *
         * @param       string          Input string to be formatted.
         * @return      string          Formatted for <textarea>-tags
@@ -1188,7 +1168,6 @@ class t3lib_div {
        /**
         * Check if an item exists in an array
         * Please note that the order of parameters is reverse compared to the php4-function in_array()!!!
-        *
         * Usage: 3
         *
         * @param       array           $in_array               one-dimensional array of items
@@ -1207,8 +1186,7 @@ class t3lib_div {
        /**
         * Explodes a $string delimited by $delim and passes each item in the array through intval().
         * Corresponds to explode(), but with conversion to integers for all values.
-        *
-        * Usage: 86
+        * Usage: 76
         *
         * @param       string          Delimiter string to explode with
         * @param       string          The string to explode
@@ -1226,8 +1204,7 @@ class t3lib_div {
        /**
         * Reverse explode which explodes the string counting from behind.
         * Thus t3lib_div::revExplode(':','my:words:here',2) will return array('my:words','here')
-        *
-        * Usage: 6
+        * Usage: 8
         *
         * @param       string          Delimiter string to explode with
         * @param       string          The string to explode
@@ -1247,8 +1224,7 @@ class t3lib_div {
        /**
         * Explodes a string and trims all values for whitespace in the ends.
         * If $onlyNonEmptyValues is set, then all blank ('') values are removed.
-        *
-        * Usage: 239
+        * Usage: 256
         *
         * @param       string          Delimiter string to explode with
         * @param       string          The string to explode
@@ -1272,13 +1248,13 @@ class t3lib_div {
         * The keys in the array are substituted with some md5-hashes
         * If the value is trim(empty), the value is ignored.
         * Values are trimmed
-        * (Depreciated, use PHP function array_unique instead)
-        * Usage: 2
+        * (Deprecated, use PHP function array_unique instead)
+        * Usage: 1
         *
         * @param       array           Array of values to make unique
         * @return      array
         * @ignore
-        * @depreciated
+        * @deprecated
         */
        function uniqueArray($valueArray)       {
                $array_out=array();
@@ -1296,8 +1272,7 @@ class t3lib_div {
 
        /**
         * Removes the value $cmpValue from the $array if found there. Returns the modified array
-        *
-        * Usage: 2
+        * Usage: 3
         *
         * @param       array           Array containing the values
         * @param       string          Value to search for and if found remove array entry where found.
@@ -1322,7 +1297,6 @@ class t3lib_div {
 
        /**
         * Implodes a multidim-array into GET-parameters (eg. &param[key][key2]=value2&param[key][key3]=value3)
-        *
         * Usage: 24
         *
         * @param       string          Name prefix for entries. Set to blank if you wish none.
@@ -1377,8 +1351,7 @@ class t3lib_div {
         * This function traverses a multidimentional array and adds slashes to the values.
         * NOTE that the input array is and argument by reference.!!
         * Twin-function to stripSlashesOnArray
-        *
-        * Usage: 6
+        * Usage: 8
         *
         * @param       array           Multidimensional input array, (REFERENCE!)
         * @return      array
@@ -1402,8 +1375,7 @@ class t3lib_div {
         * This function traverses a multidimentional array and strips slashes to the values.
         * NOTE that the input array is and argument by reference.!!
         * Twin-function to addSlashesOnArray
-        *
-        * Usage: 7
+        * Usage: 10
         *
         * @param       array           Multidimensional input array, (REFERENCE!)
         * @return      array
@@ -1424,8 +1396,7 @@ class t3lib_div {
 
        /**
         * Either slashes ($cmd=add) or strips ($cmd=strip) array $arr depending on $cmd
-        *
-        * Usage: 6
+        * Usage: 0
         *
         * @param       array           Multidimensional input array
         * @param       string          "add" or "strip", depending on usage you wish.
@@ -1438,17 +1409,16 @@ class t3lib_div {
        }
 
        /**
-        * Merges two arrays recursively, overruling similar the values in the first array ($arr0) with the values of the second array ($arr1)
+        * Merges two arrays recursively and "binary safe" (integer keys are overridden as well), overruling similar the values in the first array ($arr0) with the values of the second array ($arr1)
         * In case of identical keys, ie. keeping the values of the second.
-        *
-        * Usage: 26
+        * Usage: 0
         *
         * @param       array           First array
         * @param       array           Second array, overruling the first array
         * @param       boolean         If set, keys that are NOT found in $arr0 (first array) will not be set. Thus only existing value can/will be overruled from second array.
         * @return      array           Resulting array where $arr1 values has overruled $arr0 values
         */
-       function array_merge_recursive_overrule ($arr0,$arr1,$notAddKeys=0) {
+       function array_merge_recursive_overrule($arr0,$arr1,$notAddKeys=0) {
                reset($arr1);
                while(list($key,$val) = each($arr1)) {
                        if(is_array($arr0[$key])) {
@@ -1470,9 +1440,8 @@ class t3lib_div {
        }
 
        /**
-        * An array_merge function where the keys are NOT renumbered as they happen to be with the real php-array_merge function
-        *
-        * Usage: 27
+        * An array_merge function where the keys are NOT renumbered as they happen to be with the real php-array_merge function. It is "binary safe" in the sense that integer keys are overridden as well.
+        * Usage: 16
         *
         * @param       array           First array
         * @param       array           Second array
@@ -1484,7 +1453,6 @@ class t3lib_div {
 
        /**
         * Takes a row and returns a CSV string of the values with $delim (default is ,) and $quote (default is ") as separator chars.
-        *
         * Usage: 5
         *
         * @param       array           Input array of values
@@ -1526,11 +1494,10 @@ class t3lib_div {
         *************************/
 
        /**
+        * Returns an array with all attributes of the input HTML tag as key/value pairs. Attributes are only lowercase a-z
         * $tag is either a whole tag (eg '<TAG OPTION ATTRIB=VALUE>') or the parameterlist (ex ' OPTION ATTRIB=VALUE>')
-        * Returns an array with all attributes as keys. Attributes are only lowercase a-z
         * If a attribute is empty (I call it 'an option'), then the value for the key is empty. You can check if it existed with isset()
-        *
-        * Usage: 9
+        * Usage: 8
         *
         * @param       string          HTML-tag string (or attributes only)
         * @return      array           Array with the attribute values.
@@ -1566,8 +1533,7 @@ class t3lib_div {
        /**
         * Returns an array with the 'components' from an attribute list from an HTML tag. The result is normally analyzed by get_tag_attributes
         * Removes tag-name if found
-        *
-        * Usage: 1
+        * Usage: 2
         *
         * @param       string          HTML-tag string (or attributes only)
         * @return      array           Array with the attribute values.
@@ -1600,8 +1566,7 @@ class t3lib_div {
 
        /**
         * Implodes attributes in the array $arr for an attribute list in eg. and HTML tag (with quotes)
-        *
-        * Usage: 10
+        * Usage: 14
         *
         * @param       array           Array with attribute key/value pairs, eg. "bgcolor"=>"red", "border"=>0
         * @param       boolean         If set the resulting attribute list will have a) all attributes in lowercase (and duplicates weeded out, first entry taking precedence) and b) all values htmlspecialchar()'ed. It is recommended to use this switch!
@@ -1659,6 +1624,7 @@ class t3lib_div {
 
        /**
         * Parses XML input into a PHP array with associative keys
+        * Usage: 0
         *
         * @param       string          XML data input
         * @param       integer         Number of element levels to resolve the XML into an array. Any further structure will be set as XML.
@@ -1736,9 +1702,10 @@ class t3lib_div {
         * This also means that only alphanumeric characters are allowed in the tag names AND only keys NOT starting with numbers (so watch your usage of keys!). However there are options you can set to avoid this problem.
         * Numeric keys are stored with the default tagname "numIndex" but can be overridden to other formats)
         * The function handles input values from the PHP array in a binary-safe way; All characters below 32 (except 9,10,13) will trigger the content to be converted to a base64-string
-        * The PHP variable type of the data is IS preserved as long as the types are strings, arrays, integers and booleans. Strings are the default type unless the "type" attribute is set.
+        * The PHP variable type of the data IS preserved as long as the types are strings, arrays, integers and booleans. Strings are the default type unless the "type" attribute is set.
         * The output XML has been tested with the PHP XML-parser and parses OK under all tested circumstances.
         * However using MSIE to read the XML output didn't always go well: One reason could be that the character encoding is not observed in the PHP data. The other reason may be if the tag-names are invalid in the eyes of MSIE. Also using the namespace feature will make MSIE break parsing. There might be more reasons...
+        * Usage: 5
         *
         * @param       array           The input PHP array with any kind of data; text, binary, integers. Not objects though.
         * @param       string          tag-prefix, eg. a namespace prefix like "T3:"
@@ -1826,6 +1793,7 @@ class t3lib_div {
        /**
         * Converts an XML string to a PHP array.
         * This is the reverse function of array2xml()
+        * Usage: 17
         *
         * @param       string          XML content to convert into an array
         * @param       string          The tag-prefix resolve, eg. a namespace like "T3:"
@@ -1915,6 +1883,7 @@ class t3lib_div {
 
        /**
         * This implodes an array of XML parts (made with xml_parse_into_struct()) into XML again.
+        * Usage: 2
         *
         * @param       array           A array of XML parts, see xml2tree
         * @return      string          Re-compiled XML data.
@@ -1958,6 +1927,7 @@ class t3lib_div {
 
        /**
         * Extract the encoding scheme as found in the first line of an XML document (typically)
+        * Usage: 1
         *
         * @param       string          XML data
         * @return      string          Encoding scheme (lowercase), if found.
@@ -1989,8 +1959,7 @@ class t3lib_div {
        /**
         * Reads the file or url $url and returns the content
         * If you are having trouble with proxys when reading URLs you can configure your way out of that with settings like $TYPO3_CONF_VARS['SYS']['curlUse'] etc.
-        *
-        * Usage: 79
+        * Usage: 83
         *
         * @param       string          Filepath/URL to read
         * @return      string          The content from the resource given as input.
@@ -2031,8 +2000,7 @@ class t3lib_div {
 
        /**
         * Writes $content to the file $file
-        *
-        * Usage: 31
+        * Usage: 30
         *
         * @param       string          Filepath to write to
         * @param       string          Content to write
@@ -2054,6 +2022,7 @@ class t3lib_div {
 
        /**
         * Wrapper function for mkdir, setting folder permissions according to $GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask']
+        * Usage: 6
         *
         * @param       string          Absolute path to folder, see PHP mkdir() function. Removes trailing slash internally.
         * @return      boolean         TRUE if @mkdir went well!
@@ -2069,8 +2038,7 @@ class t3lib_div {
        /**
         * Returns an array with the names of folders in a specific path
         * Will return 'error' (string) if there were an error with reading directory content.
-        *
-        * Usage: 13
+        * Usage: 11
         *
         * @param       string          Path to list directories from
         * @return      array           Returns an array with the directory entries as values. If no path, the return value is nothing.
@@ -2092,8 +2060,7 @@ class t3lib_div {
 
        /**
         * Returns an array with the names of files in a specific path
-        *
-        * Usage: 17
+        * Usage: 18
         *
         * @param       string          $path: Is the path to the file
         * @param       string          $extensionList is the comma list of extensions to read only (blank = all)
@@ -2146,6 +2113,7 @@ class t3lib_div {
 
        /**
         * Recursively gather all files and folders of a path.
+        * Usage: 5
         *
         * @param       array           $fileArr: Empty input array (will have files added to it)
         * @param       string          $path: The path to read recursively from (absolute) (include trailing slash!)
@@ -2171,6 +2139,7 @@ class t3lib_div {
 
        /**
         * Removes the absolute part of all files/folders in fileArr
+        * Usage: 2
         *
         * @param       array           $fileArr: The file array to remove the prefix from
         * @param       string          $prefixToRemove: The prefix path to remove (if found as first part of string!)
@@ -2187,7 +2156,6 @@ class t3lib_div {
 
        /**
         * Fixes a path for windows-backslashes and reduces double-slashes to single slashes
-        *
         * Usage: 2
         *
         * @param       string          File path to process
@@ -2198,7 +2166,9 @@ class t3lib_div {
        }
 
        /**
-        * Resolves "../" sections in the input path string
+        * Resolves "../" sections in the input path string.
+        * For example "fileadmin/directory/../other_directory/" will be resolved to "fileadmin/other_directory/"
+        * Usage: 2
         *
         * @param       string          File path in which "/../" is resolved
         * @return      string
@@ -2225,8 +2195,7 @@ class t3lib_div {
         * - If already having a scheme, nothing is prepended
         * - If having REQUEST_URI slash '/', then prefixing 'http://[host]' (relative to host)
         * - Otherwise prefixed with TYPO3_REQUEST_DIR (relative to current dir / TYPO3_REQUEST_DIR)
-        *
-        * Usage: 31
+        * Usage: 30
         *
         * @param       string          URL / path to prepend full URL addressing to.
         * @return      string
@@ -2264,7 +2233,7 @@ class t3lib_div {
 
        /**
         * Returns a string with a list of ascii-values for the first $characters characters in $string
-        * Usage: 5
+        * Usage: 0
         *
         * @param       string          String to show ASCII value for
         * @param       integer         Number of characters to show
@@ -2283,7 +2252,7 @@ class t3lib_div {
         * Returns HTML-code, which is a visual representation of a multidimensional array
         * use t3lib_div::print_array() in order to print an array
         * Returns false if $array_in is not an array
-        * Usage: 27
+        * Usage: 31
         *
         * @param       array           Array to view
         * @return      string          HTML output
@@ -2309,7 +2278,7 @@ class t3lib_div {
 
        /**
         * Prints an array
-        * Usage: 28
+        * Usage: 6
         *
         * @param       array           Array to print visually (in a table).
         * @return      void
@@ -2325,7 +2294,6 @@ class t3lib_div {
         * Prints $var in bold between two vertical lines
         * If not $var the word 'debug' is printed
         * If $var is an array, the array is printed by t3lib_div::print_array()
-        *
         * Usage: 8
         *
         * @param       mixed           Variable to print
@@ -2410,10 +2378,9 @@ class t3lib_div {
 
        /**
         * Returns the link-url to the current script.
-        * In $getParams you can set associative keys corresponding to the get-vars you wish to add to the url. If you set them empty, they will remove existing get-vars from the current url.
+        * In $getParams you can set associative keys corresponding to the GET-vars you wish to add to the URL. If you set them empty, they will remove existing GET-vars from the current URL.
         * REMEMBER to always htmlspecialchar() content in href-properties to ampersands get converted to entities (XHTML requirement and XSS precaution)
-        *
-        * Usage: 54
+        * Usage: 52
         *
         * @param       array           Array of GET parameters to include
         * @return      string
@@ -2462,8 +2429,7 @@ class t3lib_div {
        /**
         * Abstraction method which returns System Environment Variables regardless of server OS, CGI/MODULE version etc. Basically this is SERVER variables for most of them.
         * This should be used instead of getEnv() and HTTP_SERVER_VARS/ENV_VARS to get reliable values for all situations.
-        *
-        * Usage: 226
+        * Usage: 221
         *
         * @param       string          Name of the "environment variable"/"server variable" you wish to use. Valid values are SCRIPT_NAME, SCRIPT_FILENAME, REQUEST_URI, PATH_INFO, REMOTE_ADDR, REMOTE_HOST, HTTP_REFERER, HTTP_HOST, HTTP_USER_AGENT, HTTP_ACCEPT_LANGUAGE, QUERY_STRING, TYPO3_DOCUMENT_ROOT, TYPO3_HOST_ONLY, TYPO3_HOST_ONLY, TYPO3_REQUEST_HOST, TYPO3_REQUEST_URL, TYPO3_REQUEST_SCRIPT, TYPO3_REQUEST_DIR, TYPO3_SITE_URL, _ARRAY
         * @return      string          Value based on the input key, independent of server/os environment.
@@ -2653,10 +2619,8 @@ class t3lib_div {
 
        /**
         * milliseconds
-        *
         * microtime recalculated to t3lib_div::milliseconds(1/1000 sec)
-        *
-        * Usage: 39
+        * Usage: 20
         *
         * @return      integer
         */
@@ -2667,7 +2631,6 @@ class t3lib_div {
 
        /**
         * Client Browser Information
-        *
         * Usage: 4
         *
         * @param       string          Alternative User Agent string (if empty, t3lib_div::getIndpEnv('HTTP_USER_AGENT') is used)
@@ -2752,10 +2715,8 @@ class t3lib_div {
         *************************/
 
        /**
-        * Returns the absolute filename of $filename.
-        * Decodes the prefix EXT: for TYPO3 Extensions.
-        *
-        * Usage: 9
+        * Returns the absolute filename of a relative reference, resolves the "EXT:" prefix (way of referring to files inside extensions) and checks that the file is inside the PATH_site of the TYPO3 installation and implies a check with t3lib_div::validPathStr(). Returns false if checks failed. Does not check if the file exists.
+        * Usage: 24
         *
         * @param       string          The input filename/filepath to evaluate
         * @param       boolean         If $onlyRelative is set (which it is by default), then only return values relative to the current PATH_site is accepted.
@@ -2788,11 +2749,11 @@ class t3lib_div {
        }
 
        /**
+        * Checks for malicious file paths.
         * Returns true if no '//', '..' or '\' is in the $theFile
         * This should make sure that the path is not pointing 'backwards' and further doesn't contain double/back slashes.
-        * So it's compatible with  the UNIX style path strings valid for TYPO3 internally.
-        *
-        * Usage: 8
+        * So it's compatible with the UNIX style path strings valid for TYPO3 internally.
+        * Usage: 14
         *
         * @param       string          Filepath to evaluate
         * @return      boolean         True, if no '//', '..' or '\' is in the $theFile
@@ -2804,8 +2765,7 @@ class t3lib_div {
 
        /**
         * Checks if the $path is absolute or relative (detecting either '/' or 'x:/' as first part of string) and returns true if so.
-        *
-        * Usage: 9
+        * Usage: 8
         *
         * @param       string          Filepath to evaluate
         * @return      boolean
@@ -2816,8 +2776,7 @@ class t3lib_div {
 
        /**
         * Returns true if the path is absolute, without backpath '..' and within the PATH_site OR within the lockRootPath
-        *
-        * Usage: 1
+        * Usage: 5
         *
         * @param       string          Filepath to evaluate
         * @return      boolean
@@ -2834,7 +2793,6 @@ class t3lib_div {
 
        /**
         * Verifies the input filename againts the 'fileDenyPattern'. Returns true if OK.
-        *
         * Usage: 2
         *
         * @param       string          Filepath to evaluate
@@ -2850,7 +2808,7 @@ class t3lib_div {
 
        /**
         * Moves $source file to $destination if uploaded, otherwise try to make a copy
-        * Usage: 3
+        * Usage: 4
         *
         * @param       string          Source file, absolute path
         * @param       string          Destination file, absolute path
@@ -2881,6 +2839,7 @@ class t3lib_div {
         * Will move an uploaded file (normally in "/tmp/xxxxx") to a temporary filename in PATH_site."typo3temp/" from where TYPO3 can use it under safe_mode.
         * Use this function to move uploaded files to where you can work on them.
         * REMEMBER to use t3lib_div::unlink_tempfile() afterwards - otherwise temp-files will build up! They are NOT automatically deleted in PATH_site."typo3temp/"!
+        * Usage: 6
         *
         * @param       string          The temporary uploaded filename, eg. $GLOBALS['HTTP_POST_FILES']['[upload field name here]']['tmp_name']
         * @return      string          If a new file was successfully created, return its filename, otherwise blank string.
@@ -2898,6 +2857,7 @@ class t3lib_div {
         * Deletes (unlink) a temporary filename in 'PATH_site."typo3temp/"' given as input.
         * The function will check that the file exists, is in PATH_site."typo3temp/" and does not contain back-spaces ("../") so it should be pretty safe.
         * Use this after upload_to_tempfile() or tempnam() from this class!
+        * Usage: 9
         *
         * @param       string          Filepath for a file in PATH_site."typo3temp/". Must be absolute.
         * @return      boolean         Returns true if the file was unlink()'ed
@@ -2913,10 +2873,11 @@ class t3lib_div {
         * Create temporary filename (Create file with unique file name)
         * This function should be used for getting temporary filenames - will make your applications safe for open_basedir = on
         * REMEMBER to delete the temporary files after use! This is done by t3lib_div::unlink_tempfile()
+        * Usage: 7
         *
         * @param       string          Prefix to temp file (which will have no extension btw)
         * @return      string          result from PHP function tempnam() with PATH_site.'typo3temp/' set for temp path.
-        * @see unlink_tempfile()
+        * @see unlink_tempfile(), upload_to_tempfile()
         */
        function tempnam($filePrefix)   {
                return tempnam(PATH_site.'typo3temp/',$filePrefix);
@@ -2960,7 +2921,7 @@ class t3lib_div {
         * 1) must be configured table (the ctrl-section configured),
         * 2) columns must not be an array (which it is always if whole table loaded), and
         * 3) there is a value for dynamicConfigFile (filename in typo3conf)
-        * Usage: 92
+        * Usage: 84
         *
         * @param       string          Table name for which to load the full TCA array part into the global $TCA
         * @return      void
@@ -2979,6 +2940,7 @@ class t3lib_div {
        /**
         * Looks for a sheet-definition in the input data structure array. If found it will return the data structure for the sheet given as $sheet (if found).
         * If the sheet definition is in an external file that file is parsed and the data structure inside of that is returned.
+        * Usage: 5
         *
         * @param       array           Input data structure, possibly with a sheet-definition and references to external data source files.
         * @param       string          The sheet to return, preferably.
@@ -3031,8 +2993,7 @@ class t3lib_div {
        /**
         * Calls a userdefined function/method in class
         * Such a function/method should look like this: "function proc(&$params, &$ref)        {...}"
-        *
-        * Usage: 3
+        * Usage: 17
         *
         * @param       string          Function/Method reference, '[file-reference":"]["&"]class/function["->"method-name]'. You can prefix this reference 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->encodeSpURL". Finally; you can prefix the class name with "&" if you want to reuse a former instance of the same object call.
         * @param       mixed           Parameters to be pass along (typically an array) (REFERENCE!)
@@ -3129,14 +3090,10 @@ class t3lib_div {
                return $content;
        }
 
-
-
-
-
-
        /**
         * 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');". This will work ONLY if you prefix the class name with "&" as well. See description of function arguments.
+        * Usage: 5
         *
         * @param       string          Class reference, '[file-reference":"]["&"]class-name'. 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 $classRef later in another place in the code you will get a reference to the first created one!).
         * @param       string          Required prefix of class name. By default "tx_" is allowed.
@@ -3197,8 +3154,7 @@ class t3lib_div {
         * 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!
-        *
-        * Usage: 455
+        * Usage: 447
         *
         * @param       string          Class name to instantiate
         * @return      object          The object
@@ -3210,8 +3166,7 @@ class t3lib_div {
        /**
         * Return classname for new instance
         * Takes the class-extensions API of TYPO3 into account
-        *
-        * Usage: 18
+        * Usage: 17
         *
         * @param       string          Base Class name to evaluate
         * @return      string          Final class name to instantiate with "new [classname]"
@@ -3261,10 +3216,9 @@ class t3lib_div {
        }
 
        /**
-        * Simple substitute for the PHP function mail().
+        * Simple substitute for the PHP function mail() which allows you to specify encoding and character set
         * The fifth parameter, $enc, will allow you to specify 'base64' encryption for the output (set $enc=base64)
         * Further the output has the charset set to ISO-8859-1 by default.
-        *
         * Usage: 4
         *
         * @param       string          Email address to send to. (see PHP function mail())
@@ -3305,8 +3259,7 @@ class t3lib_div {
                                'Content-Transfer-Encoding: 8bit';
                        break;
                }
-               $headers=trim(implode(chr(10),t3lib_div::trimExplode(chr(10),$headers,1)));     // make sure no empty lines are there.
-#debug(array($email,$subject,$message,$headers));
+               $headers = trim(implode(chr(10),t3lib_div::trimExplode(chr(10),$headers,1)));   // make sure no empty lines are there.
 
                mail($email,$subject,$message,$headers);
        }
@@ -3316,7 +3269,6 @@ class t3lib_div {
         * This functions is buggy. It seems that in the part where the lines are breaked every 76th character, that it fails if the break happens right in a quoted_printable encode character!
         * (Originally taken from class.t3lib_htmlmail.php - which may be updated if this function should ever be improved!
         * See RFC 1521, section 5.1 Quoted-Printable Content-Transfer-Encoding
-        *
         * Usage: 2
         *
         * @param       string          Content to encode
@@ -3357,7 +3309,6 @@ class t3lib_div {
        /**
         * Takes a clear-text message body for a plain text email, finds all 'http://' links and if they are longer than 76 chars they are converted to a shorter URL with a hash parameter. The real parameter is stored in the database and the hash-parameter/URL will be redirected to the real parameter when the link is clicked.
         * This function is about preserving long links in messages.
-        *
         * Usage: 3
         *
         * @param       string          Message content
@@ -3392,7 +3343,6 @@ class t3lib_div {
 
        /**
         * Subfunction for substUrlsInPlainText() above.
-        *
         * Usage: 2
         *
         * @param       string          Input URL
@@ -3423,8 +3373,7 @@ class t3lib_div {
 
        /**
         * Function to compensate for FreeType2 96 dpi
-        *
-        * Usage: 16
+        * Usage: 21
         *
         * @param       integer         Fontsize for freetype function call
         * @return      integer         Compensated fontsize based on $GLOBALS['TYPO3_CONF_VARS']['GFX']['TTFdpi']
index 4324165..76f1d35 100755 (executable)
@@ -28,6 +28,7 @@
  * extending class to class t3lib_basicFileFunctions
  *
  * $Id$
+ * Revised for TYPO3 3.6 May/2004 by Kasper Skaarhoj
  *
  * @author     Kasper Skaarhoj <kasper@typo3.com>
  */
  *
  *
  *
- *  123: class t3lib_extFileFunctions extends t3lib_basicFileFunctions
- *  157:     function start($data)
- *  183:     function init_actionPerms($setup)
- *  216:     function mapData($inputArray)
- *  225:     function processData()
- *  274:     function printLogErrorMessages($redirect)
- *  343:     function findRecycler($theFile)
+ *  104: class t3lib_extFileFunctions extends t3lib_basicFileFunctions
+ *  148:     function start($fileCmds)
+ *  178:     function init_actionPerms($setup)
+ *  210:     function processData()
+ *  267:     function printLogErrorMessages($redirect)
+ *  325:     function findRecycler($theFile)
+ *  354:     function writeLog($action,$error,$details_nr,$details,$data)
  *
  *              SECTION: File operation functions
- *  385:     function func_upload($cmds)
- *  427:     function func_copy($cmds)
- *  517:     function func_move($cmds)
- *  608:     function func_delete($cmds)
- *  674:     function func_rename($cmds)
- *  722:     function func_newfolder($cmds)
- *  755:     function func_unzip($cmds)
- *  790:     function func_newfile($cmds)
- *  828:     function func_edit($cmds)
- *  877:     function writeLog($action,$error,$details_nr,$details,$data)
+ *  381:     function func_delete($cmds)
+ *  448:     function func_copy($cmds)
+ *  538:     function func_move($cmds)
+ *  631:     function func_rename($cmds)
+ *  677:     function func_newfolder($cmds)
+ *  707:     function func_newfile($cmds)
+ *  744:     function func_edit($cmds)
+ *  776:     function func_upload($cmds)
+ *  814:     function func_unzip($cmds)
  *
- * TOTAL FUNCTIONS: 16
+ * TOTAL FUNCTIONS: 15
  * (This index is automatically created/updated by the extension "extdeveval")
  *
  */
 
 
 /**
- * COMMENT:
+ * Contains functions for performing file operations like copying, pasting, uploading, moving, deleting etc. through the TCE
+ * Extending class to class t3lib_basicFileFunctions.
  *
  * see basicFileFunctions
- * see tce_file.php for SYNTAX!
+ * see document "TYPO3 Core API" for syntax
  *
- * This class contains functions primarily used by tce_file.php (Typo Core Engine for filemanipulation)
+ * This class contains functions primarily used by tce_file.php (TYPO3 Core Engine for file manipulation)
  * Functions include copying, moving, deleting, uploading and so on...
  *
  * Important internal variables:
  * $f_ext      (see basicFileFunctions)
  *     ... All fileoperations must be within the filemount-paths. Further the fileextension MUST validate true with the f_ext array
  *
- * $actionPerms        :       This array is self-explaning (look in the class below). It grants access to the functions. This could be set from outside in order to enabled functions to users. see also the function init_actionPerms() which takes input directly from the user-record
- * $maxCopyFileSize = 10000;   // max copy size for files
- * $maxMoveFileSize = 10000;   // max move size for files
- * $maxUploadFileSize = 10000; // max upload size for files. Remember that PHP has an inner limit often set to 2 MB
- *
- * $recyclerFN='_recycler_'            :       This is regarded to be the recycler folder
- *
  * The unzip-function allows unzip only if the destination path has it's f_ext[]['allow'] set to '*'!!
  * You are allowed to copy/move folders within the same 'space' (web/ftp).
  * You are allowed to copy/move folders between spaces (web/ftp) IF the destination has it's f_ext[]['allow'] set to '*'!
  *
- *
  * Advice:
  * You should always exclude php-files from the webspace. This will keep people from uploading, copy/moving and renaming files to the php3/php-extension.
  * You should never mount a ftp_space 'below' the webspace so that it reaches into the webspace. This is because if somebody unzips a zip-file in the ftp-space so that it reaches out into the webspace this will be a violation of the safety
- * Eg. THIS IS A BAD IDEA: you have an ftp-space that is '/www/' and a web-space that is '/www/htdocs/'
- *
- *
- *
- * Dependencies:
- * t3lib_div
- * t3lib_basicfilefunctions
- */
-
-/**
- * Contains functions for performing file operations like copying, pasting, uploading, moving, deleting etc. through the TCE
- * Extending class to class t3lib_basicFileFunctions.
+ * For example this is a bad idea: you have an ftp-space that is '/www/' and a web-space that is '/www/htdocs/'
  *
  * @author     Kasper Skaarhoj <kasper@typo3.com>
  * @package TYPO3
  * @subpackage t3lib
  */
 class t3lib_extFileFunctions extends t3lib_basicFileFunctions  {
-       var $maxCopyFileSize = 10000;           // kb
-       var $maxMoveFileSize = 10000;           // kb
-       var $maxUploadFileSize = 10000;         // kb
+
+               // External static variables:
+               // Notice; some of these are overridden in the start() method with values from $GLOBALS['TYPO3_CONF_VARS']['BE']
+       var $maxCopyFileSize = 10000;           // max copy size (kb) for files
+       var $maxMoveFileSize = 10000;           // max move size (kb) for files
+       var $maxUploadFileSize = 10000;         // max upload size (kb) for files. Remember that PHP has an inner limit often set to 2 MB
        var $unzipPath = '';                            // Path to unzip-program (with trailing '/')
-       var $dontCheckForUnique=0;                      // If set, the uploaded files will overwrite existing files.
+       var $dontCheckForUnique = 0;            // If set, the uploaded files will overwrite existing files.
 
-       var $actionPerms = Array(
+       var $actionPerms = Array(                               // This array is self-explaning (look in the class below). It grants access to the functions. This could be set from outside in order to enabled functions to users. See also the function init_actionPerms() which takes input directly from the user-record
                'deleteFile' => 0,                                      // Deleting files physically
                'deleteFolder' => 0,                            // Deleting foldes physically
                'deleteFolderRecursively' => 0,         // normally folders are deleted by the PHP-function rmdir(), but with this option a user deletes with 'rm -Rf ....' which is pretty wild!
@@ -144,41 +129,52 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions     {
                'renameFolder' => 0
        );
 
-       var $recyclerFN = '_recycler_';
+       var $recyclerFN = '_recycler_';         // This is regarded to be the recycler folder
        var $useRecycler = 1;                           // 0 = no, 1 = if available, 2 = always
-       var $PHPFileFunctions=0;                        // If set, all fileoperations are done by the default PHP-functions. This is necessary under windows! On UNIX the system commands by exec() can be used unless safe_mode is enabled
-       var $dont_use_exec_commands=0;          // This is necessary under windows!
+
+               // Internal, static:
+       var $PHPFileFunctions = 0;                      // If set, all fileoperations are done by the default PHP-functions. This is necessary under windows! On UNIX the system commands by exec() can be used unless safe_mode is enabled
+       var $dont_use_exec_commands = 0;        // This is necessary under windows!
+
+
+
 
 
        /**
-        * @param       [type]          $data: ...
-        * @return      [type]          ...
+        * Initialization of the class
+        *
+        * @param       array           The $file array with the commands to execute. See "TYPO3 Core API" document
+        * @return      void
         */
-       function start($data)   {
+       function start($fileCmds)       {
+
+                       // Configure settings from TYPO3_CONF_VARS:
                if (TYPO3_OS=='WIN' || $GLOBALS['TYPO3_CONF_VARS']['BE']['disable_exec_function'])      {
-                       $this->PHPFileFunctions=1;
-                       $this->dont_use_exec_commands=1;
+                       $this->PHPFileFunctions = 1;
+                       $this->dont_use_exec_commands = 1;
                } else {
                        $this->PHPFileFunctions = $GLOBALS['TYPO3_CONF_VARS']['BE']['usePHPFileFunctions'];
                }
-               $this->data = $data;
-               $this->datamap = $this->mapData($this->data);
+
                $this->unzipPath = $GLOBALS['TYPO3_CONF_VARS']['BE']['unzip_path'];
 
-               $maxFileSize=intval($GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize']);
+               $maxFileSize = intval($GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize']);
                if ($maxFileSize>0)     {
                        $this->maxCopyFileSize = $maxFileSize;
                        $this->maxMoveFileSize = $maxFileSize;
                        $this->maxUploadFileSize = $maxFileSize;
                }
+
+                       // Initializing file processing commands:
+               $this->fileCmdMap = $fileCmds;
        }
 
        /**
         * Sets up permission to perform file/directory operations.
         * See below or the be_user-table for the significanse of the various bits in $setup ($BE_USER->user['fileoper_perms'])
         *
-        * @param       [type]          $setup: ...
-        * @return      [type]          ...
+        * @param       integer         File permission integer from BE_USER object.
+        * @return      void
         */
        function init_actionPerms($setup)       {
                if (($setup&1)==1)      {               // Files: Upload,Copy,Move,Delete,Rename
@@ -208,30 +204,26 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions     {
        }
 
        /**
-        * If PHP4 then we just set the incoming data to the arrays as PHP4 submits multidimensional arrays
+        * Processing the command array in $this->fileCmdMap
         *
-        * @param       [type]          $inputArray: ...
-        * @return      [type]          ...
-        */
-       function mapData($inputArray)           {
-               if (is_array($inputArray)) {
-                       return $inputArray;
-               }
-       }
-
-       /**
-        * @return      [type]          ...
+        * @return      void
         */
        function processData()  {
-               if (!$this->isInit) return false;
-               if (is_array($this->datamap))   {
-                       #t3lib_div::stripSlashesOnArray($this->datamap);        // NOT needed anymore since $this->datamap is required to be stripped already!
-
-                       reset($this->datamap);
-                       while (list($action, $content) = each($this->datamap))  {
-                               if (is_array($content)) {
-                                       while(list($id, $cmdArr) = each($content))      {
+               if (!$this->isInit) return FALSE;
+
+               if (is_array($this->fileCmdMap))        {
+
+                               // Traverse each set of actions
+                       foreach($this->fileCmdMap as $action => $actionData)    {
+
+                                       // Traverse all action data. More than one file might be affected at the same time.
+                               if (is_array($actionData))      {
+                                       foreach($actionData as $cmdArr) {
+
+                                                       // Clear file stats
                                                clearstatcache();
+
+                                                       // Branch out based on command:
                                                switch ($action)        {
                                                        case 'delete':
                                                                $this->func_delete($cmdArr);
@@ -268,10 +260,12 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions     {
        }
 
        /**
-        * @param       [type]          $redirect: ...
-        * @return      [type]          ...
+        * Print log error messages from the operations of this script instance
+        *
+        * @param       string          Redirect URL (for creating link in message)
+        * @return      void            (Will exit on error)
         */
-       function printLogErrorMessages($redirect)       {
+       function printLogErrorMessages($redirect='')    {
 
                $res_log = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                                        '*',
@@ -288,76 +282,82 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions     {
                        $error_doc = t3lib_div::makeInstance('template');
                        $error_doc->backPath = '';
 
-                       $content.=$error_doc->startPage('tce_db.php Error output');
+                       $content.= $error_doc->startPage('tce_db.php Error output');
 
-                       $lines[]='<tr class="bgColor5"><td colspan=2 align=center><strong>Errors:</strong></td></tr>';
-                       reset($errorJS);
-                       while(list(,$line)=each($errorJS))      {
-                               $lines[]='<tr class="bgColor4"><td valign=top><img'.t3lib_iconWorks::skinImg('','gfx/icon_fatalerror.gif','width="18" height="16"').' alt="" /></td><td>'.htmlspecialchars($line).'</td></tr>';
-                       }
+                       $lines[] = '
+                                       <tr class="bgColor5">
+                                               <td colspan="2" align="center"><strong>Errors:</strong></td>
+                                       </tr>';
 
-                       $lines[]='<tr><td colspan=2 align=center><BR><form action=""><input type="submit" value="Continue" onClick="document.location=\''.$redirect.'\';return false;"></form></td></tr>';
-                       $content.= '<BR><BR><table border=0 cellpadding=1 cellspacing=1 width=300 align=center>'.implode('',$lines).'</table>';
-                       $content.= $error_doc->endPage();
-                       echo $content;
-                       exit;
-               } else {
+                       foreach($errorJS as $line)      {
+                               $lines[] = '
+                                       <tr class="bgColor4">
+                                               <td valign="top"><img'.t3lib_iconWorks::skinImg('','gfx/icon_fatalerror.gif','width="18" height="16"').' alt="" /></td>
+                                               <td>'.htmlspecialchars($line).'</td>
+                                       </tr>';
+                       }
 
-                       t3lib_BEfunc::getSetUpdateSignal('updateFolderTree');
+                       $lines[] = '
+                                       <tr>
+                                               <td colspan="2" align="center"><br />'.
+                                               '<form action=""><input type="submit" value="Continue" onclick="'.htmlspecialchars('document.location=\''.$redirect.'\';return false;').'" /></form>'.
+                                               '</td>
+                                       </tr>';
 
-                       if ($redirect)  {
-                               header('Location: '.t3lib_div::locationHeaderUrl($redirect));
-                               exit;
-                       }
+                       $content.= '
+                               <br /><br />
+                               <table border="0" cellpadding="1" cellspacing="1" width="300" align="center">
+                                       '.implode('',$lines).'
+                               </table>';
 
-                       echo '
-       <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-       <html>
-       <head>
-       <title>File Status script</title>
-       </head>
-       <body bgcolor="#F7F3EF">
-
-       <script language="javascript" type="text/javascript">
-       if (top.busy)   {
-               top.busy.loginRefreshed();
-       }
-       top.goToModule("file_list");
-       </script>
-       </body>
-       </html>
-                       ';
+                       $content.= $error_doc->endPage();
+                       echo $content;
                        exit;
                }
        }
 
        /**
-        * Takes a valid Path ($theFile)
         * Goes back in the path and checks in each directory if a folder named $this->recyclerFN (usually '_recycler_') is present.
-        * Returns the path (without trailing slash) of the closest recycle-folder if found. Else false.
         * If a folder in the tree happens to be a _recycler_-folder (which means that we're deleting something inside a _recycler_-folder) this is ignored
         *
-        * @param       [type]          $theFile: ...
-        * @return      [type]          ...
+        * @param       string          Takes a valid Path ($theFile)
+        * @return      string          Returns the path (without trailing slash) of the closest recycle-folder if found. Else false.
         */
        function findRecycler($theFile) {
                if ($this->isPathValid($theFile))       {
-                       $theFile=$this->cleanDirectoryName($theFile);
-                       $fI=t3lib_div::split_fileref($theFile);
-                       $c=0;
+                       $theFile = $this->cleanDirectoryName($theFile);
+                       $fI = t3lib_div::split_fileref($theFile);
+                       $c = 0;
                        while($this->checkPathAgainstMounts($fI['path']) && $c<20)      {
                                $rDir = $fI['path'].$this->recyclerFN;
                                if (@is_dir($rDir) && $this->recyclerFN!=$fI['file'])   {
                                        return $rDir;
                                }
-                               $theFile=$fI['path'];
-                               $theFile=$this->cleanDirectoryName($theFile);
-                               $fI=t3lib_div::split_fileref($theFile);
+                               $theFile = $fI['path'];
+                               $theFile = $this->cleanDirectoryName($theFile);
+                               $fI = t3lib_div::split_fileref($theFile);
                                $c++;
                        }
                }
        }
 
+       /**
+        * Logging actions
+        *
+        * @param       integer         The action number. See the functions in the class for a hint. Eg. edit is '9', upload is '1' ...
+        * @param       integer         The severity: 0 = message, 1 = error, 2 = System Error, 3 = security notice (admin)
+        * @param       integer         This number is unique for every combination of $type and $action. This is the error-message number, which can later be used to translate error messages.
+        * @param       string          This is the default, raw error message in english
+        * @param       array           Array with special information that may go into $details by "%s" marks / sprintf() when the log is shown
+        * @return      void
+        * @see class.t3lib_userauthgroup.php
+        */
+       function writeLog($action,$error,$details_nr,$details,$data)    {
+               $type = 2;      // Type value for tce_file.php
+               if (is_object($GLOBALS['BE_USER']))     {
+                       $GLOBALS['BE_USER']->writelog($type,$action,$error,$details_nr,$details,$data);
+               }
+       }
 
 
 
@@ -374,78 +374,104 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions    {
         **************************************/
 
        /**
-        * Upload of files (action=1)
-        * $cmds['data'] is the ID-number (points to the global var that holds the filename-ref  ($GLOBALS['HTTP_POST_FILES']['upload_'.$id]['name'])
-        * $cmds['target'] is the target directory
-        * Returns the new filename upon success
+        * Deleting files and folders (action=4)
         *
-        * @param       [type]          $cmds: ...
-        * @return      [type]          ...
+        * @param       array           $cmds['data'] is the the file/folder to delete
+        * @return      boolean         Returns true upon success
         */
-       function func_upload($cmds)     {
-               if (!$this->isInit) return false;
-               $id = $cmds['data'];
-               if ($GLOBALS['HTTP_POST_FILES']['upload_'.$id]['name']) {
-                       $theFile = $GLOBALS['HTTP_POST_FILES']['upload_'.$id]['tmp_name'];                              // filename of the uploaded file
-                       $theFileSize = $GLOBALS['HTTP_POST_FILES']['upload_'.$id]['size'];                              // filesize of the uploaded file
-                       $theName = $this->cleanFileName(stripslashes($GLOBALS['HTTP_POST_FILES']['upload_'.$id]['name']));      // The original filename
-                       if (is_uploaded_file($theFile) && $theName)     {       // Check the file
-                               if ($this->actionPerms['uploadFile'])   {
-                                       if ($theFileSize<($this->maxUploadFileSize*1024))       {
-                                               $fI = t3lib_div::split_fileref($theName);
-                                               $theTarget = $this->is_directory($cmds['target']);      // Check the target dir
-                                               if ($theTarget && $this->checkPathAgainstMounts($theTarget.'/'))        {
-                                                       if ($this->checkIfAllowed($fI['fileext'], $theTarget, $fI['file'])) {
-                                                               $theNewFile = $this->getUniqueName($theName, $theTarget, $this->dontCheckForUnique);
-                                                               if ($theNewFile)        {
-                                                                       t3lib_div::upload_copy_move($theFile,$theNewFile);
+       function func_delete($cmds)     {
+               if (!$this->isInit) return FALSE;
 
-                                                                       clearstatcache();
-                                                                       if (@is_file($theNewFile))      {
-                                                                               $this->writelog(1,0,1,"Uploading file '%s' to '%s'",Array($theName,$theNewFile, $id));
-                                                                               return $theNewFile;
-                                                                       } else $this->writelog(1,1,100,"Uploaded file could not be moved! Write-permission problem in '%s'?",Array($theTarget.'/'));
-                                                               } else $this->writelog(1,1,101,"No unique filename available in '%s'!",Array($theTarget.'/'));
-                                                       } else $this->writelog(1,1,102,"Fileextension '%s' is not allowed in '%s'!",Array($fI['fileext'],$theTarget.'/'));
-                                               } else $this->writelog(1,1,103,"Destination path '%s' was not within your mountpoints!",Array($theTarget.'/'));
-                                       } else $this->writelog(1,1,104,"The uploaded file exceeds the size-limit of %s bytes",Array($this->maxUploadFileSize*1024));
-                               } else $this->writelog(1,1,105,"You are not allowed to upload files!",'');
-                       } else $this->writelog(1,2,106,'The uploaded file did not exist!','');
+                       // Checking path:
+               $theFile = $cmds['data'];
+               if (!$this->isPathValid($theFile))      {
+                       $this->writelog(4,2,101,'Target "%s" had invalid path (".." and "//" is not allowed in path).',Array($theFile));
+                       return FALSE;
                }
+
+                       // Recycler moving or not?
+               if ($this->useRecycler && $recyclerPath=$this->findRecycler($theFile))  {
+                               // If a recycler is found, the deleted items is moved to the recycler and not just deleted.
+                       $newCmds=Array();
+                       $newCmds['data']=$theFile;
+                       $newCmds['target']=$recyclerPath;
+                       $newCmds['altName']=1;
+                       $this->func_move($newCmds);
+                       $this->writelog(4,0,4,'Item "%s" moved to recycler at "%s"',Array($theFile,$recyclerPath));
+                       return TRUE;
+               } elseif ($this->useRecycler != 2) {    // if $this->useRecycler==2 then we cannot delete for real!!
+                       if (@is_file($theFile)) {       // If we are deleting a file...
+                               if ($this->actionPerms['deleteFile'])   {
+                                       if ($this->checkPathAgainstMounts($theFile))    {
+                                               if (@unlink($theFile))  {
+                                                       $this->writelog(4,0,1,'File "%s" deleted',Array($theFile));
+                                                       return TRUE;
+                                               } else $this->writelog(4,1,110,'Could not delete file "%s". Write-permission problem?', Array($theFile));
+                                       } else $this->writelog(4,1,111,'Target was not within your mountpoints! T="%s"',Array($theFile));
+                               } else $this->writelog(4,1,112,'You are not allowed to delete files','');
+                               // FINISHED deleting file
+
+                       } elseif (@is_dir($theFile) && !$this->dont_use_exec_commands) {        // if we're deleting a folder
+                               if ($this->actionPerms['deleteFolder']) {
+                                       $theFile = $this->is_directory($theFile);
+                                       if ($theFile)   {
+                                               if ($this->checkPathAgainstMounts($theFile))    {       // I choose not to append '/' to $theFile here as this will prevent us from deleting mounts!! (which makes sense to me...)
+                                                       if ($this->actionPerms['deleteFolderRecursively'])      {
+                                                                       // No way to do this under windows
+                                                               $cmd = 'rm -Rf "'.$theFile.'"';
+                                                               exec($cmd);             // This is a quite critical command...
+                                                               clearstatcache();
+                                                               if (!@file_exists($theFile))    {
+                                                                       $this->writelog(4,0,2,'Directory "%s" deleted recursively!',Array($theFile));
+                                                                       return TRUE;
+                                                               } else $this->writelog(4,2,119,'Directory "%s" WAS NOT deleted recursively! Write-permission problem?',Array($theFile));
+                                                       } else {
+                                                               if (@rmdir($theFile))   {
+                                                                       $this->writelog(4,0,3,'Directory "%s" deleted',Array($theFile));
+                                                                       return TRUE;
+                                                               } else $this->writelog(4,1,120,'Could not delete directory! Write-permission problem? Is directory "%s" empty? (You are not allowed to delete directories recursively).',Array($theFile));
+                                                       }
+                                               } else $this->writelog(4,1,121,'Target was not within your mountpoints! T="%s"',Array($theFile));
+                                       } else $this->writelog(4,2,122,'Target seemed not to be a directory! (Shouldn\'t happen here!)','');
+                               } else $this->writelog(4,1,123,'You are not allowed to delete directories','');
+                               // FINISHED copying directory
+
+                       } else $this->writelog(4,2,130,'The item was not a file or directory! "%s"',Array($theFile));
+               } else $this->writelog(4,1,131,'No recycler found!','');
        }
 
        /**
         * Copying files and folders (action=2)
-        * $cmds['data'] is the the file/folder to copy
-        * $cmds['target'] is the path where to copy to
-        * $cmds['altName'] (boolean): If set, another filename is found in case the target already exists
-        * Returns the new filename upon success
         *
-        * @param       [type]          $cmds: ...
-        * @return      [type]          ...
+        * @param       array           $cmds['data'] is the the file/folder to copy. $cmds['target'] is the path where to copy to. $cmds['altName'] (boolean): If set, another filename is found in case the target already exists
+        * @return      string          Returns the new filename upon success
         */
        function func_copy($cmds)       {
-               if (!$this->isInit) return false;
+               if (!$this->isInit) return FALSE;
+
+                       // Initialize and check basic conditions:
                $theFile = $cmds['data'];
                $theDest = $this->is_directory($cmds['target']);        // Clean up destination directory
                $altName = $cmds['altName'];
                if (!$theDest)  {
-                       $this->writelog(2,2,100,"Destination '%s' was not a directory",Array($cmds['target']));
-                       return false;
+                       $this->writelog(2,2,100,'Destination "%s" was not a directory',Array($cmds['target']));
+                       return FALSE;
                }
                if (!$this->isPathValid($theFile) || !$this->isPathValid($theDest))     {
-                       $this->writelog(2,2,101,"Target or destination had invalid path ('..' and '//' is not allowed in path). T='%s', D='%s'",Array($theFile,$theDest));
-                       return false;
+                       $this->writelog(2,2,101,'Target or destination had invalid path (".." and "//" is not allowed in path). T="%s", D="%s"',Array($theFile,$theDest));
+                       return FALSE;
                }
+
+                       // Processing of file or directory.
                if (@is_file($theFile)) {       // If we are copying a file...
                        if ($this->actionPerms['copyFile'])     {
                                if (filesize($theFile) < ($this->maxCopyFileSize*1024)) {
-                                       $fI=t3lib_div::split_fileref($theFile);
+                                       $fI = t3lib_div::split_fileref($theFile);
                                        if ($altName)   {       // If altName is set, we're allowed to create a new filename if the file already existed
-                                               $theDestFile=$this->getUniqueName($fI['file'], $theDest);
-                                               $fI=t3lib_div::split_fileref($theDestFile);
+                                               $theDestFile = $this->getUniqueName($fI['file'], $theDest);
+                                               $fI = t3lib_div::split_fileref($theDestFile);
                                        } else {
-                                               $theDestFile=$theDest.'/'.$fI['file'];
+                                               $theDestFile = $theDest.'/'.$fI['file'];
                                        }
                                        if ($theDestFile && !@file_exists($theDestFile))        {
                                                if ($this->checkIfAllowed($fI['fileext'], $theDest, $fI['file'])) {
@@ -458,26 +484,26 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions     {
                                                                }
                                                                clearstatcache();
                                                                if (@is_file($theDestFile))     {
-                                                                       $this->writelog(2,0,1,"File '%s' copied to '%s'",Array($theFile,$theDestFile));
+                                                                       $this->writelog(2,0,1,'File "%s" copied to "%s"',Array($theFile,$theDestFile));
                                                                        return $theDestFile;
-                                                               } else $this->writelog(2,2,109,"File '%s' WAS NOT copied to '%s'! Write-permission problem?",Array($theFile,$theDestFile));
-                                                       } else  $this->writelog(2,1,110,"Target or destination was not within your mountpoints! T='%s', D='%s'",Array($theFile,$theDestFile));
-                                               } else $this->writelog(2,1,111,"Fileextension '%s' is not allowed in '%s'!",Array($fI['fileext'],$theDest.'/'));
-                                       } else $this->writelog(2,1,112,"File '%s' already exists!",Array($theDestFile));
-                               } else $this->writelog(2,1,113,"File '%s' exceeds the size-limit of %s bytes",Array($theFile,$this->maxCopyFileSize*1024));
-                       } else $this->writelog(2,1,114,"You are not allowed to copy files",'');
+                                                               } else $this->writelog(2,2,109,'File "%s" WAS NOT copied to "%s"! Write-permission problem?',Array($theFile,$theDestFile));
+                                                       } else  $this->writelog(2,1,110,'Target or destination was not within your mountpoints! T="%s", D="%s"',Array($theFile,$theDestFile));
+                                               } else $this->writelog(2,1,111,'Fileextension "%s" is not allowed in "%s"!',Array($fI['fileext'],$theDest.'/'));
+                                       } else $this->writelog(2,1,112,'File "%s" already exists!',Array($theDestFile));
+                               } else $this->writelog(2,1,113,'File "%s" exceeds the size-limit of %s bytes',Array($theFile,$this->maxCopyFileSize*1024));
+                       } else $this->writelog(2,1,114,'You are not allowed to copy files','');
                        // FINISHED copying file
 
                } elseif (@is_dir($theFile) && !$this->dont_use_exec_commands) {                // if we're copying a folder
                        if ($this->actionPerms['copyFolder'])   {
                                $theFile = $this->is_directory($theFile);
                                if ($theFile)   {
-                                       $fI=t3lib_div::split_fileref($theFile);
+                                       $fI = t3lib_div::split_fileref($theFile);
                                        if ($altName)   {       // If altName is set, we're allowed to create a new filename if the file already existed
-                                               $theDestFile=$this->getUniqueName($fI['file'], $theDest);
-                                               $fI=t3lib_div::split_fileref($theDestFile);
+                                               $theDestFile = $this->getUniqueName($fI['file'], $theDest);
+                                               $fI = t3lib_div::split_fileref($theDestFile);
                                        } else {
-                                               $theDestFile=$theDest.'/'.$fI['file'];
+                                               $theDestFile = $theDest.'/'.$fI['file'];
                                        }
                                        if ($theDestFile && !@file_exists($theDestFile))        {
                                                if (!t3lib_div::isFirstPartOfStr($theDestFile.'/',$theFile.'/'))        {                       // Check if the one folder is inside the other or on the same level... to target/dest is the same?
@@ -488,54 +514,54 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions     {
                                                                        exec($cmd);
                                                                        clearstatcache();
                                                                        if (@is_dir($theDestFile))      {
-                                                                               $this->writelog(2,0,2,"Directory '%s' copied to '%s'",Array($theFile,$theDestFile));
+                                                                               $this->writelog(2,0,2,'Directory "%s" copied to "%s"',Array($theFile,$theDestFile));
                                                                                return $theDestFile;
-                                                                       } else $this->writelog(2,2,119,"Directory '%s' WAS NOT copied to '%s'! Write-permission problem?",Array($theFile,$theDestFile));
-                                                               } else $this->writelog(2,1,120,"Target or destination was not within your mountpoints! T='%s', D='%s'",Array($theFile,$theDestFile));
-                                                       } else $this->writelog(2,1,121,"You don't have full access to the destination directory '%s'!",Array($theDest.'/'));
-                                               } else $this->writelog(2,1,122,"Destination cannot be inside the target! D='%s', T='%s'",Array($theDestFile.'/',$theFile.'/'));
-                                       } else $this->writelog(2,1,123,"Target '%s' already exists!",Array($theDestFile));
-                               } else $this->writelog(2,2,124,"Target seemed not to be a directory! (Shouldn't happen here!)",'');
-                       } else $this->writelog(2,1,125,"You are not allowed to copy directories",'');
+                                                                       } else $this->writelog(2,2,119,'Directory "%s" WAS NOT copied to "%s"! Write-permission problem?',Array($theFile,$theDestFile));
+                                                               } else $this->writelog(2,1,120,'Target or destination was not within your mountpoints! T="%s", D="%s"',Array($theFile,$theDestFile));
+                                                       } else $this->writelog(2,1,121,'You don\'t have full access to the destination directory "%s"!',Array($theDest.'/'));
+                                               } else $this->writelog(2,1,122,'Destination cannot be inside the target! D="%s", T="%s"',Array($theDestFile.'/',$theFile.'/'));
+                                       } else $this->writelog(2,1,123,'Target "%s" already exists!',Array($theDestFile));
+                               } else $this->writelog(2,2,124,'Target seemed not to be a directory! (Shouldn\'t happen here!)','');
+                       } else $this->writelog(2,1,125,'You are not allowed to copy directories','');
                        // FINISHED copying directory
 
                } else {
-                       $this->writelog(2,2,130,"The item '%s' was not a file or directory!",Array($theFile));
+                       $this->writelog(2,2,130,'The item "%s" was not a file or directory!',Array($theFile));
                }
        }
 
        /**
         * Moving files and folders (action=3)
-        * $cmds['data'] is the the file/folder to move
-        * $cmds['target'] is the path where to move to
-        * $cmds['altName'] (boolean): If set, another filename is found in case the target already exists
-        * Returns the new filename upon success
         *
-        * @param       [type]          $cmds: ...
-        * @return      [type]          ...
+        * @param       array           $cmds['data'] is the the file/folder to move. $cmds['target'] is the path where to move to. $cmds['altName'] (boolean): If set, another filename is found in case the target already exists
+        * @return      string          Returns the new filename upon success
         */
        function func_move($cmds)       {
-               if (!$this->isInit) return false;
+               if (!$this->isInit) return FALSE;
+
+                       // Initialize and check basic conditions:
                $theFile = $cmds['data'];
                $theDest = $this->is_directory($cmds['target']);        // Clean up destination directory
                $altName = $cmds['altName'];
                if (!$theDest)  {
-                       $this->writelog(3,2,100,"Destination '%s' was not a directory",Array($cmds['target']));
-                       return false;
+                       $this->writelog(3,2,100,'Destination "%s" was not a directory',Array($cmds['target']));
+                       return FALSE;
                }
                if (!$this->isPathValid($theFile) || !$this->isPathValid($theDest))     {
-                       $this->writelog(3,2,101,"Target or destination had invalid path ('..' and '//' is not allowed in path). T='%s', D='%s'",Array($theFile,$theDest));
-                       return false;
+                       $this->writelog(3,2,101,'Target or destination had invalid path (".." and "//" is not allowed in path). T="%s", D="%s"',Array($theFile,$theDest));
+                       return FALSE;
                }
+
+                       // Processing of file or directory:
                if (@is_file($theFile)) {       // If we are moving a file...
                        if ($this->actionPerms['moveFile'])     {
                                if (filesize($theFile) < ($this->maxMoveFileSize*1024)) {
-                                       $fI=t3lib_div::split_fileref($theFile);
+                                       $fI = t3lib_div::split_fileref($theFile);
                                        if ($altName)   {       // If altName is set, we're allowed to create a new filename if the file already existed
-                                               $theDestFile=$this->getUniqueName($fI['file'], $theDest);
-                                               $fI=t3lib_div::split_fileref($theDestFile);
+                                               $theDestFile = $this->getUniqueName($fI['file'], $theDest);
+                                               $fI = t3lib_div::split_fileref($theDestFile);
                                        } else {
-                                               $theDestFile=$theDest.'/'.$fI['file'];
+                                               $theDestFile = $theDest.'/'.$fI['file'];
                                        }
                                        if ($theDestFile && !@file_exists($theDestFile))        {
                                                if ($this->checkIfAllowed($fI['fileext'], $theDest, $fI['file'])) {
@@ -548,26 +574,26 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions     {
                                                                }
                                                                clearstatcache();
                                                                if (@is_file($theDestFile))     {
-                                                                       $this->writelog(3,0,1,"File '%s' moved to '%s'",Array($theFile,$theDestFile));
+                                                                       $this->writelog(3,0,1,'File "%s" moved to "%s"',Array($theFile,$theDestFile));
                                                                        return $theDestFile;
-                                                               } else $this->writelog(3,2,109,"File '%s' WAS NOT moved to '%s'! Write-permission problem?",Array($theFile,$theDestFile));
-                                                       } else $this->writelog(3,1,110,"Target or destination was not within your mountpoints! T='%s', D='%s'",Array($theFile,$theDestFile));
-                                               } else $this->writelog(3,1,111,"Fileextension '%s' is not allowed in '%s'!",Array($fI['fileext'],$theDest.'/'));
-                                       } else $this->writelog(3,1,112,"File '%s' already exists!",Array($theDestFile));
-                               } else $this->writelog(3,1,113,"File '%s' exceeds the size-limit of %s bytes",Array($theFile,$this->maxMoveFileSize*1024));
-                       } else $this->writelog(3,1,114,"You are not allowed to move files",'');
+                                                               } else $this->writelog(3,2,109,'File "%s" WAS NOT moved to "%s"! Write-permission problem?',Array($theFile,$theDestFile));
+                                                       } else $this->writelog(3,1,110,'Target or destination was not within your mountpoints! T="%s", D="%s"',Array($theFile,$theDestFile));
+                                               } else $this->writelog(3,1,111,'Fileextension "%s" is not allowed in "%s"!',Array($fI['fileext'],$theDest.'/'));
+                                       } else $this->writelog(3,1,112,'File "%s" already exists!',Array($theDestFile));
+                               } else $this->writelog(3,1,113,'File "%s" exceeds the size-limit of %s bytes',Array($theFile,$this->maxMoveFileSize*1024));
+                       } else $this->writelog(3,1,114,'You are not allowed to move files','');
                        // FINISHED moving file
 
                } elseif (@is_dir($theFile)) {  // if we're moving a folder
                        if ($this->actionPerms['moveFolder'])   {
                                $theFile = $this->is_directory($theFile);
                                if ($theFile)   {
-                                       $fI=t3lib_div::split_fileref($theFile);
+                                       $fI = t3lib_div::split_fileref($theFile);
                                        if ($altName)   {       // If altName is set, we're allowed to create a new filename if the file already existed
-                                               $theDestFile=$this->getUniqueName($fI['file'], $theDest);
-                                               $fI=t3lib_div::split_fileref($theDestFile);
+                                               $theDestFile = $this->getUniqueName($fI['file'], $theDest);
+                                               $fI = t3lib_div::split_fileref($theDestFile);
                                        } else {
-                                               $theDestFile=$theDest.'/'.$fI['file'];
+                                               $theDestFile = $theDest.'/'.$fI['file'];
                                        }
                                        if ($theDestFile && !@file_exists($theDestFile))        {
                                                if (!t3lib_div::isFirstPartOfStr($theDestFile.'/',$theFile.'/'))        {                       // Check if the one folder is inside the other or on the same level... to target/dest is the same?
@@ -581,98 +607,31 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions     {
                                                                        }
                                                                        clearstatcache();
                                                                        if (@is_dir($theDestFile))      {
-                                                                               $this->writelog(3,0,2,"Directory '%s' moved to '%s'",Array($theFile,$theDestFile));
+                                                                               $this->writelog(3,0,2,'Directory "%s" moved to "%s"',Array($theFile,$theDestFile));
                                                                                return $theDestFile;
-                                                                       } else $this->writelog(3,2,119,"Directory '%s' WAS NOT moved to '%s'! Write-permission problem?",Array($theFile,$theDestFile));
-                                                               } else $this->writelog(3,1,120,"Target or destination was not within your mountpoints! T='%s', D='%s'",Array($theFile,$theDestFile));
-                                                       } else $this->writelog(3,1,121,"You don't have full access to the destination directory '%s'!",Array($theDest.'/'));
-                                               } else $this->writelog(3,1,122,"Destination cannot be inside the target! D='%s', T='%s'",Array($theDestFile.'/',$theFile.'/'));
-                                       } else $this->writelog(3,1,123,"Target '%s' already exists!",Array($theDestFile));
-                               } else $this->writelog(3,2,124,"Target seemed not to be a directory! (Shouldn't happen here!)",'');
-                       } else $this->writelog(3,1,125,"You are not allowed to move directories",'');
+                                                                       } else $this->writelog(3,2,119,'Directory "%s" WAS NOT moved to "%s"! Write-permission problem?',Array($theFile,$theDestFile));
+                                                               } else $this->writelog(3,1,120,'Target or destination was not within your mountpoints! T="%s", D="%s"',Array($theFile,$theDestFile));
+                                                       } else $this->writelog(3,1,121,'You don\'t have full access to the destination directory "%s"!',Array($theDest.'/'));
+                                               } else $this->writelog(3,1,122,'Destination cannot be inside the target! D="%s", T="%s"',Array($theDestFile.'/',$theFile.'/'));
+                                       } else $this->writelog(3,1,123,'Target "%s" already exists!',Array($theDestFile));
+                               } else $this->writelog(3,2,124,'Target seemed not to be a directory! (Shouldn\'t happen here!)','');
+                       } else $this->writelog(3,1,125,'You are not allowed to move directories','');
                        // FINISHED moving directory
 
                } else {
-                       $this->writelog(3,2,130,"The item '%s' was not a file or directory!",Array($theFile));
-               }
-       }
-
-       /**
-        * Deleting files and folders (action=4)
-        * $cmds['data'] is the the file/folder to delete
-        * Returns true upon success
-        *
-        * @param       [type]          $cmds: ...
-        * @return      [type]          ...
-        */
-       function func_delete($cmds)     {
-               if (!$this->isInit) return false;
-               $theFile = $cmds['data'];
-               if (!$this->isPathValid($theFile))      {
-                       $this->writelog(4,2,101,"Target '%s' had invalid path ('..' and '//' is not allowed in path).",Array($theFile));
-                       return false;
+                       $this->writelog(3,2,130,'The item "%s" was not a file or directory!',Array($theFile));
                }
-               if ($this->useRecycler && $recyclerPath=$this->findRecycler($theFile))  {
-                               // If a recycler is found, the deleted items is moved to the recycler and not just deleted.
-                       $newCmds=Array();
-                       $newCmds['data']=$theFile;
-                       $newCmds['target']=$recyclerPath;
-                       $newCmds['altName']=1;
-                       $this->func_move($newCmds);
-                       $this->writelog(4,0,4,"Item '%s' moved to recycler at '%s'",Array($theFile,$recyclerPath));
-                       return true;
-               } elseif ($this->useRecycler != 2) {    // if $this->useRecycler==2 then we cannot delete for real!!
-                       if (@is_file($theFile)) {       // If we are deleting a file...
-                               if ($this->actionPerms['deleteFile'])   {
-                                       if ($this->checkPathAgainstMounts($theFile))    {
-                                               if (@unlink($theFile))  {
-                                                       $this->writelog(4,0,1,"File '%s' deleted",Array($theFile));
-                                                       return true;
-                                               } else $this->writelog(4,1,110,"Could not delete file '%s'. Write-permission problem?", Array($theFile));
-                                       } else $this->writelog(4,1,111,"Target was not within your mountpoints! T='%s'",Array($theFile));
-                               } else $this->writelog(4,1,112,"You are not allowed to delete files",'');
-                               // FINISHED deleting file
-
-                       } elseif (@is_dir($theFile) && !$this->dont_use_exec_commands) {        // if we're deleting a folder
-                               if ($this->actionPerms['deleteFolder']) {
-                                       $theFile = $this->is_directory($theFile);
-                                       if ($theFile)   {
-                                               if ($this->checkPathAgainstMounts($theFile))    {       // I choose not to append '/' to $theFile here as this will prevent us from deleting mounts!! (which makes sense to me...)
-                                                       if ($this->actionPerms['deleteFolderRecursively'])      {
-                                                                       // No way to do this under windows
-                                                               $cmd = 'rm -Rf "'.$theFile.'"';
-                                                               exec($cmd);             // This is a quite critical command...
-                                                               clearstatcache();
-                                                               if (!@file_exists($theFile))    {
-                                                                       $this->writelog(4,0,2,"Directory '%s' deleted recursively!",Array($theFile));
-                                                                       return true;
-                                                               } else $this->writelog(4,2,119,"Directory '%s' WAS NOT deleted recursively! Write-permission problem?",Array($theFile));
-                                                       } else {
-                                                               if (@rmdir($theFile))   {
-                                                                       $this->writelog(4,0,3,"Directory '%s' deleted",Array($theFile));
-                                                                       return true;
-                                                               } else $this->writelog(4,1,120,"Could not delete directory! Write-permission problem? Is directory '%s' empty?",Array($theFile));
-                                                       }
-                                               } else $this->writelog(4,1,121,"Target was not within your mountpoints! T='%s'",Array($theFile));
-                                       } else $this->writelog(4,2,122,"Target seemed not to be a directory! (Shouldn't happen here!)",'');
-                               } else $this->writelog(4,1,123,"You are not allowed to delete directories",'');
-                               // FINISHED copying directory
-
-                       } else $this->writelog(4,2,130,"The item was not a file or directory! '%s'",Array($theFile));
-               } else $this->writelog(4,1,131,"No recycler found!",'');
        }
 
        /**
         * Renaming files or foldes (action=5)
-        * $cmds['data'] is the new name
-        * $cmds['target'] is the target (file or dir)
-        * Returns the new filename upon success
         *
-        * @param       [type]          $cmds: ...
-        * @return      [type]          ...
+        * @param       array           $cmds['data'] is the new name. $cmds['target'] is the target (file or dir).
+        * @return      string          Returns the new filename upon success
         */
        function func_rename($cmds)     {
-               if (!$this->isInit) return false;
+               if (!$this->isInit) return FALSE;
+
                $theNewName = $this->cleanFileName($cmds['data']);
                if ($theNewName)        {
                        if ($this->checkFileNameLen($theNewName))       {
@@ -689,38 +648,36 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions     {
                                                                                $fI = t3lib_div::split_fileref($theRenameName);
                                                                                if ($this->checkIfAllowed($fI['fileext'], $fileInfo['path'], $fI['file'])) {
                                                                                        if (@rename($theTarget, $theRenameName))        {
-                                                                                               $this->writelog(5,0,1,"File renamed from '%s' to '%s'",Array($fileInfo['file'],$theNewName));
+                                                                                               $this->writelog(5,0,1,'File renamed from "%s" to "%s"',Array($fileInfo['file'],$theNewName));
                                                                                                return $theRenameName;
-                                                                                       } else $this->writelog(5,1,100,"File '%s' was not renamed! Write-permission problem in '%s'?",Array($theTarget,$fileInfo['path']));
-                                                                               } else $this->writelog(5,1,101,"Fileextension '%s' was not allowed!",Array($fI['fileext']));
-                                                                       } else $this->writelog(5,1,102,"You are not allowed to rename files!",'');
+                                                                                       } else $this->writelog(5,1,100,'File "%s" was not renamed! Write-permission problem in "%s"?',Array($theTarget,$fileInfo['path']));
+                                                                               } else $this->writelog(5,1,101,'Fileextension "%s" was not allowed!',Array($fI['fileext']));
+                                                                       } else $this->writelog(5,1,102,'You are not allowed to rename files!','');
                                                                } elseif ($type=='dir') {
                                                                        if ($this->actionPerms['renameFolder']) {
                                                                                if (@rename($theTarget, $theRenameName))        {
-                                                                                       $this->writelog(5,0,2,"Directory renamed from '%s' to '%s'",Array($fileInfo['file'],$theNewName));
+                                                                                       $this->writelog(5,0,2,'Directory renamed from "%s" to "%s"',Array($fileInfo['file'],$theNewName));
                                                                                        return $theRenameName;
-                                                                               } else $this->writelog(5,1,110,"Directory '%s' was not renamed! Write-permission problem in '%s'?",Array($theTarget,$fileInfo['path']));
-                                                                       } else $this->writelog(5,1,111,"You are not allowed to rename directories!",'');
+                                                                               } else $this->writelog(5,1,110,'Directory "%s" was not renamed! Write-permission problem in "%s"?',Array($theTarget,$fileInfo['path']));
+                                                                       } else $this->writelog(5,1,111,'You are not allowed to rename directories!','');
                                                                }
-                                                       } else $this->writelog(5,1,120,"Destination '%s' existed already!",Array($theRenameName));
-                                               } else $this->writelog(5,1,121,"Destination path '%s' was not within your mountpoints!",Array($fileInfo['path']));
-                                       } else $this->writelog(5,1,122,"Old and new name is the same (%s)",Array($theNewName));
-                               } else $this->writelog(5,2,123,"Target '%s' was neither a directory nor a file!",Array($theTarget));
-                       } else $this->writelog(5,1,124,"New name '%s' was too long (max %s characters)",Array($theNewName,$this->maxInputNameLen));
+                                                       } else $this->writelog(5,1,120,'Destination "%s" existed already!',Array($theRenameName));
+                                               } else $this->writelog(5,1,121,'Destination path "%s" was not within your mountpoints!',Array($fileInfo['path']));
+                                       } else $this->writelog(5,1,122,'Old and new name is the same (%s)',Array($theNewName));
+                               } else $this->writelog(5,2,123,'Target "%s" was neither a directory nor a file!',Array($theTarget));
+                       } else $this->writelog(5,1,124,'New name "%s" was too long (max %s characters)',Array($theNewName,$this->maxInputNameLen));
                }
        }
 
        /**
         * This creates a new folder. (action=6)
-        * $cmds['data'] is the foldername
-        * $cmds['target'] is the path where to create it
-        * Returns the new foldername upon success
         *
-        * @param       [type]          $cmds: ...
-        * @return      [type]          ...
+        * @param       array           $cmds['data'] is the foldername. $cmds['target'] is the path where to create it.
+        * @return      string          Returns the new foldername upon success
         */
        function func_newfolder($cmds)  {
-               if (!$this->isInit) return false;
+               if (!$this->isInit) return FALSE;
+
                $theFolder = $this->cleanFileName($cmds['data']);
                if ($theFolder) {
                        if ($this->checkFileNameLen($theFolder))        {
@@ -731,65 +688,26 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions     {
                                                if ($this->checkPathAgainstMounts($theNewFolder))       {
                                                        if (!@file_exists($theNewFolder))       {
                                                                if (t3lib_div::mkdir($theNewFolder)){
-                                                                       $this->writelog(6,0,1,"Directory '%s' created in '%s'",Array($theFolder,$theTarget.'/'));
+                                                                       $this->writelog(6,0,1,'Directory "%s" created in "%s"',Array($theFolder,$theTarget.'/'));
                                                                        return $theNewFolder;
-                                                               } else $this->writelog(6,1,100,"Directory '%s' not created. Write-permission problem in '%s'?",Array($theFolder,$theTarget.'/'));
-                                                       } else $this->writelog(6,1,101,"File or directory '%s' existed already!",Array($theNewFolder));
-                                               } else $this->writelog(6,1,102,"Destination path '%s' was not within your mountpoints!",Array($theTarget.'/'));
-                                       } else $this->writelog(6,1,103,"You are not allowed to create directories!",'');
-                               } else $this->writelog(6,2,104,"Destination '%s' was not a directory",Array($cmds['target']));
-                       } else $this->writelog(6,1,105,"New name '%s' was too long (max %s characters)",Array($theFolder,$this->maxInputNameLen));
+                                                               } else $this->writelog(6,1,100,'Directory "%s" not created. Write-permission problem in "%s"?',Array($theFolder,$theTarget.'/'));
+                                                       } else $this->writelog(6,1,101,'File or directory "%s" existed already!',Array($theNewFolder));
+                                               } else $this->writelog(6,1,102,'Destination path "%s" was not within your mountpoints!',Array($theTarget.'/'));
+                                       } else $this->writelog(6,1,103,'You are not allowed to create directories!','');
+                               } else $this->writelog(6,2,104,'Destination "%s" was not a directory',Array($cmds['target']));
+                       } else $this->writelog(6,1,105,'New name "%s" was too long (max %s characters)',Array($theFolder,$this->maxInputNameLen));
                }
        }
 
        /**
-        * Unzipping file (action=7)
-        * This is permitted only if the user has fullAccess or if the file resides
-        * $cmds['data'] is the zip-file
-        * $cmds['target'] is the target directory. If not set we'll default to the same directory as the file is in
-        * If target is not supplied the target will be the current directory
-        *
-        * @param       [type]          $cmds: ...
-        * @return      [type]          ...
-        */
-       function func_unzip($cmds)      {
-               if (!$this->isInit || $this->dont_use_exec_commands) return false;
-               $theFile = $cmds['data'];
-               if (@is_file($theFile)) {
-                       $fI=t3lib_div::split_fileref($theFile);
-                       if (!isset($cmds['target']))    {
-                               $cmds['target'] = $fI['path'];
-                       }
-                       $theDest = $this->is_directory($cmds['target']);        // Clean up destination directory
-                       if ($theDest)   {
-                               if ($this->actionPerms['unzipFile'])    {
-                                       if ($fI['fileext']=='zip')      {
-                                               if ($this->checkIfFullAccess($theDest)) {
-                                                       if ($this->checkPathAgainstMounts($theFile) && $this->checkPathAgainstMounts($theDest.'/'))     {
-                                                                       // No way to do this under windows.
-                                                               $cmd = $this->unzipPath.'unzip -qq "'.$theFile.'" -d "'.$theDest.'"';
-                                                               exec($cmd);
-                                                               $this->writelog(7,0,1,"Unzipping file '%s' in '%s'",Array($theFile,$theDest));
-                                                       } else $this->writelog(7,1,100,"File '%s' or destination '%s' was not within your mountpoints!",Array($theFile,$theDest));
-                                               } else $this->writelog(7,1,101,"You don't have full access to the destination directory '%s'!",Array($theDest));
-                                       } else $this->writelog(7,1,102,"Fileextension is not 'zip'",'');
-                               } else $this->writelog(7,1,103,"You are not allowed to unzip files",'');
-                       } else $this->writelog(7,2,104,"Destination '%s' was not a directory",Array($cmds['target']));
-               } else $this->writelog(7,2,105,"The file '%s' did not exist!",Array($theFile));
-       }
-
-       /**
         * This creates a new file. (action=8)
-        * $cmds['data'] is the new filename
-        * $cmds['target'] is the path where to create it
-        * Returns the new filename upon success
         *
-        * @param       [type]          $cmds: ...
-        * @return      [type]          ...
+        * @param       array           $cmds['data'] is the new filename. $cmds['target'] is the path where to create it
+        * @return      string          Returns the new filename upon success
         */
        function func_newfile($cmds)    {
                $extList = $GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext'];
-               if (!$this->isInit) return false;
+               if (!$this->isInit) return FALSE;
                $newName = $this->cleanFileName($cmds['data']);
                if ($newName)   {
                        if ($this->checkFileNameLen($newName))  {
@@ -805,28 +723,27 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions     {
                                                                        if (t3lib_div::inList($extList, $fI['fileext']))        {
                                                                                if (t3lib_div::writeFile($theNewFile,''))       {
                                                                                        clearstatcache();
-                                                                                       $this->writelog(8,0,1,"File created: '%s'",Array($fI['file']));
-                                                                               } else $this->writelog(8,1,100,"File '%s' was not created! Write-permission problem in '%s'?",Array($fI['file'], $theTarget));
-                                                                       } else $this->writelog(8,1,107,"Fileextension '%s' is not a textfile format! (%s)",Array($fI['fileext'], $extList));
-                                                               } else $this->writelog(8,1,106,"Fileextension '%s' was not allowed!",Array($fI['fileext']));
-                                                       } else $this->writelog(8,1,101,"File '%s' existed already!",Array($theNewFile));
-                                               } else $this->writelog(8,1,102,"Destination path '%s' was not within your mountpoints!",Array($theTarget.'/'));
-                                       } else $this->writelog(8,1,103,"You are not allowed to create files!",'');
-                               } else $this->writelog(8,2,104,"Destination '%s' was not a directory",Array($cmds['target']));
-                       } else $this->writelog(8,1,105,"New name '%s' was too long (max %s characters)",Array($newName,$this->maxInputNameLen));
+                                                                                       $this->writelog(8,0,1,'File created: "%s"',Array($fI['file']));
+                                                                                       return $theNewFile;
+                                                                               } else $this->writelog(8,1,100,'File "%s" was not created! Write-permission problem in "%s"?',Array($fI['file'], $theTarget));
+                                                                       } else $this->writelog(8,1,107,'Fileextension "%s" is not a textfile format! (%s)',Array($fI['fileext'], $extList));
+                                                               } else $this->writelog(8,1,106,'Fileextension "%s" was not allowed!',Array($fI['fileext']));
+                                                       } else $this->writelog(8,1,101,'File "%s" existed already!',Array($theNewFile));
+                                               } else $this->writelog(8,1,102,'Destination path "%s" was not within your mountpoints!',Array($theTarget.'/'));
+                                       } else $this->writelog(8,1,103,'You are not allowed to create files!','');
+                               } else $this->writelog(8,2,104,'Destination "%s" was not a directory',Array($cmds['target']));
+                       } else $this->writelog(8,1,105,'New name "%s" was too long (max %s characters)',Array($newName,$this->maxInputNameLen));
                }
        }
 
        /**
         * Editing textfiles or foldes (action=9)
-        * $cmds['data'] is the new content
-        * $cmds['target'] is the target (file or dir)
         *
-        * @param       [type]          $cmds: ...
-        * @return      [type]          ...
+        * @param       array           $cmds['data'] is the new content. $cmds['target'] is the target (file or dir)
+        * @return      boolean         Returns true on success
         */
        function func_edit($cmds)       {
-               if (!$this->isInit) return false;
+               if (!$this->isInit) return FALSE;
                $theTarget = $cmds['target'];
                $content = $cmds['data'];
                $extList = $GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext'];
@@ -841,45 +758,87 @@ class t3lib_extFileFunctions extends t3lib_basicFileFunctions     {
                                                if (t3lib_div::inList($extList, $fileInfo['fileext']))  {
                                                        if (t3lib_div::writeFile($theTarget,$content))  {
                                                                clearstatcache();
-                                                               $this->writelog(9,0,1,"File saved to '%s', bytes: %s, MD5: %s ",Array($fileInfo['file'],@filesize($theTarget),md5($content)));
-                                                       } else $this->writelog(9,1,100,"File '%s' was not saved! Write-permission problem in '%s'?",Array($theTarget,$fileInfo['path']));
-                                               } else $this->writelog(9,1,102,"Fileextension '%s' is not a textfile format! (%s)",Array($fI['fileext'], $extList));
-                                       } else $this->writelog(9,1,103,"Fileextension '%s' was not allowed!",Array($fI['fileext']));
+                                                               $this->writelog(9,0,1,'File saved to "%s", bytes: %s, MD5: %s ',Array($fileInfo['file'],@filesize($theTarget),md5($content)));
+                                                               return TRUE;
+                                                       } else $this->writelog(9,1,100,'File "%s" was not saved! Write-permission problem in "%s"?',Array($theTarget,$fileInfo['path']));
+                                               } else $this->writelog(9,1,102,'Fileextension "%s" is not a textfile format! (%s)',Array($fI['fileext'], $extList));
+                                       } else $this->writelog(9,1,103,'Fileextension "%s" was not allowed!',Array($fI['fileext']));
                                } else $this->writelog(9,1,104,'You are not allowed to edit files!','');
-                       } else $this->writelog(9,1,121,"Destination path '%s' was not within your mountpoints!",Array($fileInfo['path']));
-               } else $this->writelog(9,2,123,"Target '%s' was not a file!",Array($theTarget));
+                       } else $this->writelog(9,1,121,'Destination path "%s" was not within your mountpoints!',Array($fileInfo['path']));
+               } else $this->writelog(9,2,123,'Target "%s" was not a file!',Array($theTarget));
        }
 
        /**
-        * Logging actions
-        *
-        * Log messages:
-        * [action]-[details_nr.]
-        *
-        * REMEMBER to UPDATE the real messages set in tools/log/localconf_log.php
-        *
-        * 9-1: File saved to '%s', bytes: %s, MD5: %s
-        *
-        * $action:             The action number. See the functions in the class for a hint. Eg. edit is '9', upload is '1' ...
-        * $error:              The severity: 0 = message, 1 = error, 2 = System Error, 3 = security notice (admin)
-        * $details_nr: This number is unique for every combination of $type and $action. This is the error-message number, which can later be used to translate error messages.
-        * $details:    This is the default, raw error message in english
-        * $data:               Array with special information that may go into $details by '%s' marks / sprintf() when the log is shown
+        * Upload of files (action=1)
         *
-        * @param       [type]          $action: ...
-        * @param       [type]          $error: ...
-        * @param       [type]          $details_nr: ...
-        * @param       [type]          $details: ...
-        * @param       [type]          $data: ...
-        * @return      [type]          ...
-        * @see class.t3lib_userauthgroup.php
+        * @param       array           $cmds['data'] is the ID-number (points to the global var that holds the filename-ref  ($GLOBALS['HTTP_POST_FILES']['upload_'.$id]['name']). $cmds['target'] is the target directory
+        * @return      string          Returns the new filename upon success
         */
-       function writeLog($action,$error,$details_nr,$details,$data)    {
-               $type=2;        // Type value for tce_file.php
-               if (is_object($GLOBALS['BE_USER']))     {
-                       $GLOBALS['BE_USER']->writelog($type,$action,$error,$details_nr,$details,$data);
+       function func_upload($cmds)     {
+               if (!$this->isInit) return FALSE;
+               $id = $cmds['data'];
+               if ($GLOBALS['HTTP_POST_FILES']['upload_'.$id]['name']) {
+                       $theFile = $GLOBALS['HTTP_POST_FILES']['upload_'.$id]['tmp_name'];                              // filename of the uploaded file
+                       $theFileSize = $GLOBALS['HTTP_POST_FILES']['upload_'.$id]['size'];                              // filesize of the uploaded file
+                       $theName = $this->cleanFileName(stripslashes($GLOBALS['HTTP_POST_FILES']['upload_'.$id]['name']));      // The original filename
+                       if (is_uploaded_file($theFile) && $theName)     {       // Check the file
+                               if ($this->actionPerms['uploadFile'])   {
+                                       if ($theFileSize<($this->maxUploadFileSize*1024))       {
+                                               $fI = t3lib_div::split_fileref($theName);
+                                               $theTarget = $this->is_directory($cmds['target']);      // Check the target dir
+                                               if ($theTarget && $this->checkPathAgainstMounts($theTarget.'/'))        {
+                                                       if ($this->checkIfAllowed($fI['fileext'], $theTarget, $fI['file'])) {
+                                                               $theNewFile = $this->getUniqueName($theName, $theTarget, $this->dontCheckForUnique);
+                                                               if ($theNewFile)        {
+                                                                       t3lib_div::upload_copy_move($theFile,$theNewFile);
+                                                                       clearstatcache();
+                                                                       if (@is_file($theNewFile))      {
+                                                                               $this->writelog(1,0,1,'Uploading file "%s" to "%s"',Array($theName,$theNewFile, $id));
+                                                                               return $theNewFile;
+                                                                       } else $this->writelog(1,1,100,'Uploaded file could not be moved! Write-permission problem in "%s"?',Array($theTarget.'/'));
+                                                               } else $this->writelog(1,1,101,'No unique filename available in "%s"!',Array($theTarget.'/'));
+                                                       } else $this->writelog(1,1,102,'Fileextension "%s" is not allowed in "%s"!',Array($fI['fileext'],$theTarget.'/'));
+                                               } else $this->writelog(1,1,103,'Destination path "%s" was not within your mountpoints!',Array($theTarget.'/'));
+                                       } else $this->writelog(1,1,104,'The uploaded file exceeds the size-limit of %s bytes',Array($this->maxUploadFileSize*1024));
+                               } else $this->writelog(1,1,105,'You are not allowed to upload files!','');
+                       } else $this->writelog(1,2,106,'The uploaded file did not exist!','');
                }
        }
+
+       /**
+        * Unzipping file (action=7)
+        * This is permitted only if the user has fullAccess or if the file resides
+        *
+        * @param       array           $cmds['data'] is the zip-file. $cmds['target'] is the target directory. If not set we'll default to the same directory as the file is in.
+        * @return      boolean         Returns true on success
+        */
+       function func_unzip($cmds)      {
+               if (!$this->isInit || $this->dont_use_exec_commands) return FALSE;
+
+               $theFile = $cmds['data'];
+               if (@is_file($theFile)) {
+                       $fI = t3lib_div::split_fileref($theFile);
+                       if (!isset($cmds['target']))    {
+                               $cmds['target'] = $fI['path'];
+                       }
+                       $theDest = $this->is_directory($cmds['target']);        // Clean up destination directory
+                       if ($theDest)   {
+                               if ($this->actionPerms['unzipFile'])    {
+                                       if ($fI['fileext']=='zip')      {
+                                               if ($this->checkIfFullAccess($theDest)) {
+                                                       if ($this->checkPathAgainstMounts($theFile) && $this->checkPathAgainstMounts($theDest.'/'))     {
+                                                                       // No way to do this under windows.
+                                                               $cmd = $this->unzipPath.'unzip -qq "'.$theFile.'" -d "'.$theDest.'"';
+                                                               exec($cmd);
+                                                               $this->writelog(7,0,1,'Unzipping file "%s" in "%s"',Array($theFile,$theDest));
+                                                               return TRUE;
+                                                       } else $this->writelog(7,1,100,'File "%s" or destination "%s" was not within your mountpoints!',Array($theFile,$theDest));
+                                               } else $this->writelog(7,1,101,'You don\'t have full access to the destination directory "%s"!',Array($theDest));
+                                       } else $this->writelog(7,1,102,'Fileextension is not "zip"','');
+                               } else $this->writelog(7,1,103,'You are not allowed to unzip files','');
+                       } else $this->writelog(7,2,104,'Destination "%s" was not a directory',Array($cmds['target']));
+               } else $this->writelog(7,2,105,'The file "%s" did not exist!',Array($theFile));
+       }
 }
 
 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_extfilefunc.php'])      {
index b77da4f..81a51fb 100644 (file)
  *  113: class t3lib_extMgm
  *
  *              SECTION: PATHS and other evaluation
- *  129:     function isLoaded($key,$exitOnError=0)
- *  144:     function extPath($key,$script='')
- *  158:     function extRelPath($key)
- *  172:     function siteRelPath($key)
- *  183:     function getCN($key)
+ *  130:     function isLoaded($key,$exitOnError=0)
+ *  146:     function extPath($key,$script='')
+ *  161:     function extRelPath($key)
+ *  176:     function siteRelPath($key)
+ *  188:     function getCN($key)
  *
  *              SECTION: Adding BACKEND features
- *  215:     function addTCAcolumns($table,$columnArray,$addTofeInterface=0)
- *  238:     function addToAllTCAtypes($table,$str,$specificTypesList='',$beforeList='')
- *  289:     function allowTableOnStandardPages($table)
- *  305:     function addModule($main,$sub='',$position='',$path='')
- *  366:     function insertModuleFunction($modname,$className,$classPath,$title,$MM_key='function')
- *  383:     function addPageTSConfig($content)
- *  396:     function addUserTSConfig($content)
- *  410:     function addLLrefForTCAdescr($tca_descr_key,$file_ref)
+ *  221:     function addTCAcolumns($table,$columnArray,$addTofeInterface=0)
+ *  245:     function addToAllTCAtypes($table,$str,$specificTypesList='',$beforeList='')
+ *  297:     function allowTableOnStandardPages($table)
+ *  314:     function addModule($main,$sub='',$position='',$path='')
+ *  376:     function insertModuleFunction($modname,$className,$classPath,$title,$MM_key='function')
+ *  394:     function addPageTSConfig($content)
+ *  408:     function addUserTSConfig($content)
+ *  423:     function addLLrefForTCAdescr($tca_descr_key,$file_ref)
  *
  *              SECTION: Adding SERVICES features
- *  452:     function addService($extKey, $serviceType, $serviceKey, $info)
- *  517:     function findService($serviceType, $serviceSubType='', $excludeServiceKeys='')
- *  584:     function deactivateService($serviceType, $serviceKey)
+ *  465:     function addService($extKey, $serviceType, $serviceKey, $info)
+ *  530:     function findService($serviceType, $serviceSubType='', $excludeServiceKeys='')
+ *  597:     function deactivateService($serviceType, $serviceKey)
  *
  *              SECTION: Adding FRONTEND features
- *  623:     function addPlugin($itemArray,$type='list_type')
- *  647:     function addPiFlexFormValue($piKeyToMatch,$value)
- *  666:     function addToInsertRecords($table,$content_table='tt_content',$content_field='records')
- *  696:     function addPItoST43($key,$classFile='',$prefix='',$type='list_type',$cached=0)
- *  770:     function addStaticFile($extKey,$path,$title)
- *  788:     function addTypoScriptSetup($content)
- *  801:     function addTypoScriptConstants($content)
- *  817:     function addTypoScript($key,$type,$content,$afterStaticUid=0)
+ *  636:     function addPlugin($itemArray,$type='list_type')
+ *  661:     function addPiFlexFormValue($piKeyToMatch,$value)
+ *  681:     function addToInsertRecords($table,$content_table='tt_content',$content_field='records')
+ *  712:     function addPItoST43($key,$classFile='',$prefix='',$type='list_type',$cached=0)
+ *  787:     function addStaticFile($extKey,$path,$title)
+ *  806:     function addTypoScriptSetup($content)
+ *  820:     function addTypoScriptConstants($content)
+ *  837:     function addTypoScript($key,$type,$content,$afterStaticUid=0)
  *
  *              SECTION: INTERNAL EXTENSION MANAGEMENT:
- *  879:     function typo3_loadExtensions()
- *  958:     function _makeIncludeHeader($key,$file)
- *  978:     function isCacheFilesAvailable($cacheFilePrefix)
- *  990:     function isLocalconfWritable()
- * 1002:     function cannotCacheFilesWritable($cacheFilePrefix)
- * 1025:     function currentCacheFiles()
- * 1047:     function writeCacheFiles($extensions,$cacheFilePrefix)
+ *  900:     function typo3_loadExtensions()
+ *  979:     function _makeIncludeHeader($key,$file)
+ * 1000:     function isCacheFilesAvailable($cacheFilePrefix)
+ * 1013:     function isLocalconfWritable()
+ * 1026:     function cannotCacheFilesWritable($cacheFilePrefix)
+ * 1050:     function currentCacheFiles()
+ * 1073:     function writeCacheFiles($extensions,$cacheFilePrefix)
  *
  * TOTAL FUNCTIONS: 31
  * (This index is automatically created/updated by the extension "extdeveval")
@@ -121,6 +121,7 @@ class t3lib_extMgm {
 
        /**
         * Returns true if the extension with extension key $key is loaded.
+        * Usage: 109
         *
         * @param       string          Extension key to test
         * @param       boolean         If $exitOnError is true and the extension is not loaded the function will die with an error message
@@ -136,6 +137,7 @@ class t3lib_extMgm {
         * Returns the absolute path to the extension with extension key $key
         * If the extension is not loaded the function will die with an error message
         * Useful for internal fileoperations
+        * Usage: 136
         *
         * @param       string          Extension key
         * @param       string          $script is appended to the output if set.
@@ -151,6 +153,7 @@ class t3lib_extMgm {
         * Returns the relative path to the extension as measured from from the TYPO3_mainDir
         * If the extension is not loaded the function will die with an error message
         * Useful for images and links from backend
+        * Usage: 54
         *
         * @param       string          Extension key
         * @return      string
@@ -165,6 +168,7 @@ class t3lib_extMgm {
         * Returns the relative path to the extension as measured from the PATH_site (frontend)
         * If the extension is not loaded the function will die with an error message
         * Useful for images and links from the frontend
+        * Usage: 6
         *
         * @param       string          Extension key
         * @return      string
@@ -175,6 +179,7 @@ class t3lib_extMgm {
 
        /**
         * Returns the correct class name prefix for the extension key $key
+        * Usage: 3
         *
         * @param       string          Extension key
         * @return      string
@@ -206,6 +211,7 @@ class t3lib_extMgm {
         * This function adds the configuration needed for rendering of the field in TCEFORMS - but it does NOT add the field names to the types lists!
         * So to have the fields displayed you must also call fx. addToAllTCAtypes or manually add the fields to the types list.
         * FOR USE IN ext_tables.php FILES
+        * Usage: 4
         *
         * @param       string          $table is the table name of a table already present in $TCA with a columns section
         * @param       array           $columnArray is the array with the additional columns (typical some fields an extension wants to add)
@@ -222,12 +228,13 @@ class t3lib_extMgm {
        }
 
        /**
-        * Makes fields visible on the form, adding them to the end.
+        * Makes fields visible in the TCEforms, adding them to the end of (all) "types"-configurations
         *
         * Adds a string $str (comma list of field names) to all ["types"][xxx]["showitem"] entries for table $table (unless limited by $specificTypesList)
         * This is needed to have new fields shown automatically in the TCEFORMS of a record from $table.
         * Typically this function is called after having added new columns (database fields) with the addTCAcolumns function
         * FOR USE IN ext_tables.php FILES
+        * Usage: 1
         *
         * @param       string          Table name
         * @param       string          Field list to add.
@@ -279,9 +286,10 @@ class t3lib_extMgm {
 
 
        /**
-        * Add tablename to default list of allowed tables on pages.
+        * Add tablename to default list of allowed tables on pages (in $PAGES_TYPES)
         * Will add the $table to the list of tables allowed by default on pages as setup by $PAGES_TYPES['default']['allowedTables']
         * FOR USE IN ext_tables.php FILES
+        * Usage: 11
         *
         * @param       string          Table name
         * @return      void
@@ -295,6 +303,7 @@ class t3lib_extMgm {
        /**
         * Adds a module (main or sub) to the backend interface
         * FOR USE IN ext_tables.php FILES
+        * Usage: 18
         *
         * @param       string          $main is the main module key, $sub is the submodule key. So $main would be an index in the $TBE_MODULES array and $sub could be an element in the lists there.
         * @param       string          $sub is the submodule key. If $sub is not set a blank $main module is created.
@@ -354,6 +363,7 @@ class t3lib_extMgm {
         * The arguments values are generally determined by which function menu this is supposed to interact with
         * See Inside TYPO3 for information on how to use this function.
         * FOR USE IN ext_tables.php FILES
+        * Usage: 26
         *
         * @param       string          Module name
         * @param       string          Class name
@@ -376,6 +386,7 @@ class t3lib_extMgm {
         * Adds $content to the default Page TSconfig as set in $TYPO3_CONF_VARS[BE]['defaultPageTSconfig']
         * Prefixed with a [GLOBAL] line
         * FOR USE IN ext_tables.php/ext_locallang.php FILES
+        * Usage: 5
         *
         * @param       string          Page TSconfig content
         * @return      void
@@ -389,6 +400,7 @@ class t3lib_extMgm {
         * Adds $content to the default User TSconfig as set in $TYPO3_CONF_VARS[BE]['defaultUserTSconfig']
         * Prefixed with a [GLOBAL] line
         * FOR USE IN ext_tables.php/ext_locallang.php FILES
+        * Usage: 3
         *
         * @param       string          User TSconfig content
         * @return      void
@@ -402,6 +414,7 @@ class t3lib_extMgm {
         * Adds a reference to a locallang file with TCA_DESCR labels
         * FOR USE IN ext_tables.php FILES
         * eg. t3lib_extMgm::addLLrefForTCAdescr('pages','EXT:lang/locallang_csh_pages.php'); for the pages table or t3lib_extMgm::addLLrefForTCAdescr('_MOD_web_layout','EXT:cms/locallang_csh_weblayout.php'); for the Web > Page module.
+        * Usage: 31
         *
         * @param       string          Description key. Typically a database table (like "pages") but for applications can be other strings, but prefixed with "_MOD_")
         * @param       string          File reference to locallang file, eg. "EXT:lang/locallang_csh_pages.php"
@@ -610,11 +623,11 @@ class t3lib_extMgm {
 
        /**
         * Adds an entry to the list of plugins in content elements of type "Insert plugin"
-        *
         * Takes the $itemArray (label,value[,icon]) and adds to the items-array of $TCA[tt_content] elements with CType "listtype" (or another field if $type points to another fieldname)
         * If the value (array pos. 1) is already found in that items-array, the entry is substituted, otherwise the input array is added to the bottom.
         * Use this function to add a frontend plugin to this list of plugin-types - or more generally use this function to add an entry to any selectorbox/radio-button set in the TCEFORMS
         * FOR USE IN ext_tables.php FILES
+        * Usage: 13
         *
         * @param       array           Item Array
         * @param       string          Type (eg. "list_type") - basically a field from "tt_content" table
@@ -638,6 +651,7 @@ class t3lib_extMgm {
        /**
         * Adds an entry to the "ds" array of the tt_content field "pi_flexform".
         * This is used by plugins to add a flexform XML reference / content for use when they are selected as plugin.
+        * Usage: 0
         *
         * @param       string          The same value as the key for the plugin
         * @param       string          Either a reference to a flex-form XML file (eg. "FILE:EXT:newloginbox/flexform_ds.xml") or the XML directly.
@@ -657,6 +671,7 @@ class t3lib_extMgm {
         * Adds the $table tablename to the list of tables allowed to be includes by content element type "Insert records"
         * By using $content_table and $content_field you can also use the function for other tables.
         * FOR USE IN ext_tables.php FILES
+        * Usage: 9
         *
         * @param       string          Table name to allow for "insert record"
         * @param       string          Table name TO WHICH the $table name is applied. See $content_field as well.
@@ -675,7 +690,7 @@ class t3lib_extMgm {
         * Add PlugIn to Static Template #43
         *
         * When adding a frontend plugin you will have to add both an entry to the TCA definition of tt_content table AND to the TypoScript template which must initiate the rendering.
-        * Since the static template with uid 43 is the "content.default" and practically always used for rendering the content elements it's very useful to have this function automatically adding the necessary TypoScript for calling your plugin.
+        * Since the static template with uid 43 is the "content.default" and practically always used for rendering the content elements it's very useful to have this function automatically adding the necessary TypoScript for calling your plugin. It will also work for the extension "css_styled_content"
         * $type determines the type of frontend plugin:
         *              "list_type" (default)   - the good old "Insert plugin" entry
         *              "menu_type"     - a "Menu/Sitemap" entry
@@ -685,6 +700,7 @@ class t3lib_extMgm {
         *              "includeLib" - just includes the library for manual use somewhere in TypoScript.
         *      (Remember that your $type definition should correspond to the column/items array in $TCA[tt_content] where you added the selector item for the element! See addPlugin() function)
         * FOR USE IN ext_locallang.php FILES
+        * Usage: 2
         *
         * @param       string          $key is the extension key
         * @param       string          $classFile is the PHP-class filename relative to the extension root directory. If set to blank a default value is chosen according to convensions.
@@ -760,6 +776,7 @@ tt_content.'.$key.$prefix.' {
         * Call this method to add an entry in the static template list found in sys_templates
         * "static template files" are the modern equalent (provided from extensions) to the traditional records in "static_templates"
         * FOR USE IN ext_locallang.php FILES
+        * Usage: 3
         *
         * @param       string          $extKey is of course the extension key
         * @param       string          $path is the path where the template files (fixed names) include_static.txt (integer list of uids from the table "static_templates"), constants.txt, setup.txt and editorcfg.txt is found (relative to extPath, eg. 'static/')
@@ -781,6 +798,7 @@ tt_content.'.$key.$prefix.' {
         * Adds $content to the default TypoScript setup code as set in $TYPO3_CONF_VARS[FE]['defaultTypoScript_setup']
         * Prefixed with a [GLOBAL] line
         * FOR USE IN ext_locallang.php FILES
+        * Usage: 6
         *
         * @param       string          TypoScript Setup string
         * @return      void
@@ -794,6 +812,7 @@ tt_content.'.$key.$prefix.' {
         * Adds $content to the default TypoScript constants code as set in $TYPO3_CONF_VARS[FE]['defaultTypoScript_constants']
         * Prefixed with a [GLOBAL] line
         * FOR USE IN ext_locallang.php FILES
+        * Usage: 0
         *
         * @param       string          TypoScript Constants string
         * @return      void
@@ -807,6 +826,7 @@ tt_content.'.$key.$prefix.' {
         * Adds $content to the default TypoScript code for either setup, constants or editorcfg as set in $TYPO3_CONF_VARS[FE]['defaultTypoScript_*']
         * (Basically this function can do the same as addTypoScriptSetup and addTypoScriptConstants - just with a little more hazzle, but also with some more options!)
         * FOR USE IN ext_locallang.php FILES
+        * Usage: 7
         *
         * @param       string          $key is the extension key (informative only).
         * @param       string          $type is either "setup", "constants" or "editorcfg" and obviously determines which kind of TypoScript code we are adding.
@@ -870,8 +890,9 @@ tt_content.'.$key.$prefix.' {
         *              The returned value will be an array where each key is an extension key and the value is an array with filepaths for the extension.
         *              This array will later be set in the global var $TYPO3_LOADED_EXT
         *
-        * Usages of this function can be see in config_default.php
+        * Usages of this function can be seen in config_default.php
         * Extensions are always detected in the order local - global - system.
+        * Usage: 1
         *
         * @return      array           Extension Array
         * @internal
@@ -970,6 +991,7 @@ $_EXTCONF = $TYPO3_CONF_VARS[\'EXT\'][\'extConf\'][$_EXTKEY];
 
        /**
         * Returns true if both the localconf and tables cache file exists (with $cacheFilePrefix)
+        * Usage: 2
         *
         * @param       string          Prefix of the cache file to check
         * @return      boolean
@@ -983,6 +1005,7 @@ $_EXTCONF = $TYPO3_CONF_VARS[\'EXT\'][\'extConf\'][$_EXTKEY];
 
        /**
         * Returns true if the "localconf.php" file in "typo3conf/" is writable
+        * Usage: 1
         *
         * @return      boolean
         * @internal
@@ -994,6 +1017,7 @@ $_EXTCONF = $TYPO3_CONF_VARS[\'EXT\'][\'extConf\'][$_EXTKEY];
        /**
         * Returns an error string if typo3conf/ or cache-files with $cacheFilePrefix are NOT writable
         * Returns false if no problem.
+        * Usage: 1
         *
         * @param       string          Prefix of the cache file to check
         * @return      string
@@ -1018,6 +1042,7 @@ $_EXTCONF = $TYPO3_CONF_VARS[\'EXT\'][\'extConf\'][$_EXTKEY];
        /**
         * Returns an array with the two cache-files (0=>localconf, 1=>tables) from typo3conf/ if they (both) exist. Otherwise false.
         * Evaluation relies on $TYPO3_LOADED_EXT['_CACHEFILE']
+        * Usage: 2
         *
         * @return      array
         * @internal
@@ -1038,6 +1063,7 @@ $_EXTCONF = $TYPO3_CONF_VARS[\'EXT\'][\'extConf\'][$_EXTKEY];
        /**
         * Compiles/Creates the two cache-files in typo3conf/ based on $cacheFilePrefix
         * Returns a array with the key "_CACHEFILE" set to the $cacheFilePrefix value
+        * Usage: 1
         *
         * @param       array           Extension information array
         * @param       string          Prefix for the cache files
index 50a99f4..c2ca406 100755 (executable)
@@ -170,7 +170,7 @@ class t3lib_extobjbase {
        var $extClassConf;
 
        /**
-        * If this value is set it points to a key in the TCE_MODULES_EXT array (not on the top level..) where another classname/filepath/title can be defined for sub-subfunctions.
+        * If this value is set it points to a key in the TBE_MODULES_EXT array (not on the top level..) where another classname/filepath/title can be defined for sub-subfunctions.
         * This is a little hard to explain, so see it in action; it used in the extension 'func_wizards' in order to provide yet a layer of interfacing with the backend module.
         * The extension 'func_wizards' has this description: 'Adds the 'Wizards' item to the function menu in Web>Func. This is just a framework for wizard extensions.' - so as you can see it is designed to allow further connectivity - 'level 2'
         *
index 290d983..5da6891 100755 (executable)
  *
  *
  *   85: class t3lib_iconWorks
- *   99:     function getIconImage($table,$row=array(),$backPath,$params='',$shaded=FALSE)
- *  116:     function getIcon($table,$row=array(),$shaded=FALSE)
- *  251:     function skinImg($backPath,$src,$wHattribs='',$outputMode=0)
+ *  100:     function getIconImage($table,$row=array(),$backPath,$params='',$shaded=FALSE)
+ *  118:     function getIcon($table,$row=array(),$shaded=FALSE)
+ *  254:     function skinImg($backPath,$src,$wHattribs='',$outputMode=0)
  *
  *              SECTION: Other functions
- *  325:     function makeIcon($iconfile,$mode, $user, $protectSection,$absFile,$iconFileName_stateTagged)
- *  441:     function imagecopyresized(&$im, $cpImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY, $w, $h, $w, $h)
- *  474:     function imagecreatefrom($file)
- *  491:     function imagemake($im, $path)
+ *  328:     function makeIcon($iconfile,$mode, $user, $protectSection,$absFile,$iconFileName_stateTagged)
+ *  444:     function imagecopyresized(&$im, $cpImg, $Xstart, $Ystart, $cpImgCutX, $cpImgCutY, $w, $h, $w, $h)
+ *  477:     function imagecreatefrom($file)
+ *  494:     function imagemake($im, $path)
  *
  * TOTAL FUNCTIONS: 7
  * (This index is automatically created/updated by the extension "extdeveval")
@@ -87,6 +87,7 @@ class t3lib_iconWorks {
        /**
         * Returns an icon image tag, 18x16 pixels, based on input information.
         * This function is recommended to use in your backend modules.
+        * Usage: 60
         *
         * @param       string          The table name
         * @param       array           The table row ("enablefields" are at least needed for correct icon display and for pages records some more fields in addition!)
@@ -106,6 +107,7 @@ class t3lib_iconWorks       {
        /**
         * Creates the icon for input table/row
         * Returns filename for the image icon, relative to PATH_typo3
+        * Usage: 24
         *
         * @param       string          The table name
         * @param       array           The table row ("enablefields" are at least needed for correct icon display and for pages records some more fields in addition!)
@@ -240,6 +242,7 @@ class t3lib_iconWorks       {
        /**
         * Returns the src=... for the input $src value OR any alternative found in $TBE_STYLES['skinImg']
         * Used for skinning the TYPO3 backend with an alternative set of icons
+        * Usage: 336
         *
         * @param       string          Current backpath to PATH_typo3 folder
         * @param       string          Icon file name relative to PATH_typo3 folder
index a4a1387..7cae0ba 100644 (file)
@@ -318,13 +318,13 @@ class t3lib_parsehtml {
         * @see splitIntoBlock(), getAllParts(), removeFirstAndLastTag()
         */
        function splitTags($tag,$content)       {
-               $tags=t3lib_div::trimExplode(',',$tag,1);
-               $regexStr = '<('.implode('|',$tags).')(>|[[:space:]][^>]*>)';
+               $tags = t3lib_div::trimExplode(',',$tag,1);
+               $regexStr = '<('.implode('|',$tags).')(>|\/>|[[:space:]][^>]*>)';
                $parts = spliti($regexStr,$content);
 
-               $pointer=strlen($parts[0]);
-               $newParts=array();
-               $newParts[]=$parts[0];
+               $pointer = strlen($parts[0]);
+               $newParts = array();
+               $newParts[] = $parts[0];
                reset($parts);
                next($parts);
                while(list($k,$v)=each($parts)) {
@@ -332,12 +332,12 @@ class t3lib_parsehtml {
 
                                // Set tag:
                        $tag = substr($content,$pointer,$tagLen);       // New buffer set and pointer increased
-                       $newParts[]=$tag;
-                       $pointer+=strlen($tag);
+                       $newParts[] = $tag;
+                       $pointer+= strlen($tag);
 
                                // Set content:
-                       $newParts[]=$v;
-                       $pointer+=strlen($v);
+                       $newParts[] = $v;
+                       $pointer+= strlen($v);
                }
                return $newParts;
        }
index 321c01b..ff4d162 100755 (executable)
@@ -206,7 +206,7 @@ class t3lib_TCEmain {
 //     var $history=1;                                 // Bit-array: Bit0: History on/off. DEPENDS on checkSimilar to be set!
        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 $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
@@ -3933,10 +3933,10 @@ class t3lib_TCEmain     {
        }
 
        /**
-        * Print log messages from this request out.
+        * Print log error messages from the operations of this script instance
         *
-        * @param       [type]          $redirect: ...
-        * @return      [type]          ...
+        * @param       string          Redirect URL (for creating link in message)
+        * @return      void    (Will exit on error)
         */
        function printLogErrorMessages($redirect)       {
                $res_log = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
@@ -3954,16 +3954,34 @@ class t3lib_TCEmain     {
                        $error_doc = t3lib_div::makeInstance('template');
                        $error_doc->backPath = '';
 
-                       $content.=$error_doc->startPage('tce_db.php Error output');
+                       $content.= $error_doc->startPage('tce_db.php Error output');
+
+                       $lines[] = '
+                                       <tr class="bgColor5">
+                                               <td colspan="2" align="center"><strong>Errors:</strong></td>
+                                       </tr>';
 
-                       $lines[]='<tr class="bgColor5"><td colspan=2 align=center><strong>Errors:</strong></td></tr>';
-                       reset($errorJS);
-                       while(list(,$line)=each($errorJS))      {
-                               $lines[]='<tr class="bgColor4"><td valign=top><img'.t3lib_iconWorks::skinImg('','gfx/icon_fatalerror.gif','width="18" height="16"').' alt="" /></td><td>'.htmlspecialchars($line).'</td></tr>';
+                       foreach($errorJS as $line)      {
+                               $lines[] = '
+                                       <tr class="bgColor4">
+                                               <td valign="top"><img'.t3lib_iconWorks::skinImg('','gfx/icon_fatalerror.gif','width="18" height="16"').' alt="" /></td>
+                                               <td>'.htmlspecialchars($line).'</td>
+                                       </tr>';
                        }
 
-                       $lines[]='<tr><td colspan=2 align=center><BR><form action=""><input type="submit" value="Continue" onClick="document.location=\''.$redirect.'\';return false;"></form></td></tr>';
-                       $content.= '<BR><BR><table border=0 cellpadding=1 cellspacing=1 width=300 align=center>'.implode('',$lines).'</table>';
+                       $lines[] = '
+                                       <tr>
+                                               <td colspan="2" align="center"><br />'.
+                                               '<form action=""><input type="submit" value="Continue" onclick="'.htmlspecialchars('document.location=\''.$redirect.'\';return false;').'"></form>'.
+                                               '</td>
+                                       </tr>';
+
+                       $content.= '
+                               <br/><br/>
+                               <table border="0" cellpadding="1" cellspacing="1" width="300" align="center">
+                                       '.implode('',$lines).'
+                               </table>';
+
                        $content.= $error_doc->endPage();
                        echo $content;
                        exit;
index 999c195..eb52e18 100755 (executable)
@@ -624,7 +624,7 @@ class clickMenu {
                        }
                }
                if (!$editOnClick)      {
-                       $editOnClick="if(".$loc."){".$loc.".document.location=top.TS.PATH_typo3+'alt_doc.php?returnUrl='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'&edit[".$table."][".$uid."]=edit".$addParam."';}";
+                       $editOnClick='if('.$loc.'){'.$loc.".document.location=top.TS.PATH_typo3+'alt_doc.php?returnUrl='+top.rawurlencode(".$this->frameLocation($loc.'.document').")+'&edit[".$table."][".$uid."]=edit".$addParam."';}";
                }
 
                return $this->linkItem(
@@ -820,8 +820,9 @@ class clickMenu {
         * @internal
         */
        function FILE_launch($path,$script,$type,$image)        {
-               $loc='top.content'.(!$this->alwaysContentFrame?'.list_frame':'');
-               $editOnClick='if('.$loc.'){'.$loc.".document.location=top.TS.PATH_typo3+'".$script.'?target='.rawurlencode($path)."';}";
+               $loc = 'top.content'.(!$this->alwaysContentFrame?'.list_frame':'');
+
+               $editOnClick='if('.$loc.'){'.$loc.".document.location=top.TS.PATH_typo3+'".$script.'?target='.rawurlencode($path)."&returnUrl='+top.rawurlencode(".$this->frameLocation($loc.'.document').");}";
 
                return $this->linkItem(
                        $this->label($type),
index bb38900..044e6bb 100755 (executable)
@@ -535,7 +535,6 @@ class recordList extends t3lib_recordList {
                        case 'show':
                                        // "Show" link (only pages and tt_content elements)
                                if ($table=='pages' || $table=='tt_content')    {
-                                       $params = '&edit['.$table.']['.$row['uid'].']=edit';
                                        $code = '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($table=='tt_content'?$this->id.'#'.$row['uid']:$row['uid'])).'" title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPage',1).'">'.
                                                        $code.
                                                        '</a>';
index 2dd35d4..96d7156 100755 (executable)
  *
  */
 
-$BACK_PATH='';
-require ('init.php');
-require ('template.php');
-require_once (PATH_t3lib.'class.t3lib_basicfilefunc.php');
+$BACK_PATH = '';
+require('init.php');
+require('template.php');
+require_once(PATH_t3lib.'class.t3lib_basicfilefunc.php');
 
 
 
@@ -82,6 +82,7 @@ class SC_file_edit {
                // Internal, static: GPvar
        var $origTarget;                // Original input target
        var $target;                    // The original target, but validated.
+       var $returnUrl;         // Return URL of list module.
 
 
        /**
@@ -94,6 +95,7 @@ class SC_file_edit {
 
                        // Setting target, which must be a file reference to a file within the mounts.
                $this->target = $this->origTarget = t3lib_div::_GP('target');
+               $this->returnUrl = t3lib_div::_GP('returnUrl');
 
                        // Creating file management object:
                $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions');
@@ -156,13 +158,13 @@ class SC_file_edit {
                        $fileContent = t3lib_div::getUrl($this->target);
 
                                // making the formfields
-                       $hValue = 'file_edit.php?target='.rawurlencode($this->origTarget);
-                       $code='';
+                       $hValue = 'file_edit.php?target='.rawurlencode($this->origTarget).'&returnUrl='.rawurlencode($this->returnUrl);
+                       $code = '';
                        $code.='
                                <div id="c-submit">
                                        <input type="hidden" name="redirect" value="'.htmlspecialchars($hValue).'" />
                                        <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:file_edit.php.submit',1).'" />
-                                       <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:file_edit.php.saveAndClose',1).'" onclick="document.editform.redirect.value=\'\';" />
+                                       <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:file_edit.php.saveAndClose',1).'" onclick="document.editform.redirect.value=\''.htmlspecialchars($this->returnUrl).'\';" />
                                        <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.cancel',1).'" onclick="backToList(); return false;" />
                                </div>
                                ';
index a557fce..4b93d3f 100755 (executable)
 
 
 
-$BACK_PATH='';
-require ('init.php');
-require ('template.php');
-require_once (PATH_t3lib.'class.t3lib_basicfilefunc.php');
-
-
+$BACK_PATH = '';
+require('init.php');
+require('template.php');
+require_once(PATH_t3lib.'class.t3lib_basicfilefunc.php');
 
 
 
@@ -88,6 +86,7 @@ class SC_file_newfolder {
                // Internal, static (GPVar):
        var $number;
        var $target;            // Set with the target path inputted in &target
+       var $returnUrl;         // Return URL of list module.
 
                // Internal, dynamic:
        var $content;           // Accumulating content
@@ -105,6 +104,7 @@ class SC_file_newfolder {
                        // Initialize GPvars:
                $this->number = t3lib_div::_GP('number');
                $this->target = t3lib_div::_GP('target');
+               $this->returnUrl = t3lib_div::_GP('returnUrl');
 
                        // Init basic-file-functions object:
                $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions');
@@ -203,6 +203,7 @@ class SC_file_newfolder {
                        <div id="c-submitFolders">
                                <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.submit',1).'" />
                                <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.cancel',1).'" onclick="backToList(); return false;" />
+                               <input type="hidden" name="redirect" value="'.htmlspecialchars($this->returnUrl).'" />
                        </div>
                        ';
                $this->content.= $this->doc->section('',$code);
@@ -230,6 +231,7 @@ class SC_file_newfolder {
                        <div id="c-submitFiles">
                                <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:file_newfolder.php.newfile_submit',1).'" />
                                <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.cancel',1).'" onclick="backToList(); return false;" />
+                               <input type="hidden" name="redirect" value="'.htmlspecialchars($this->returnUrl).'" />
                        </div>
                        ';
 
index 8c7f62f..a138397 100755 (executable)
 
 
 
-$BACK_PATH='';
-require ('init.php');
-require ('template.php');
-require_once (PATH_t3lib.'class.t3lib_basicfilefunc.php');
-
+$BACK_PATH = '';
+require('init.php');
+require('template.php');
+require_once(PATH_t3lib.'class.t3lib_basicfilefunc.php');
 
 
 
@@ -83,6 +82,7 @@ class SC_file_rename {
 
                // Internal, static (GPVar):
        var $target;            // Set with the target path inputted in &target
+       var $returnUrl;         // Return URL of list module.
 
                // Internal, dynamic:
        var $content;           // Accumulating content
@@ -98,6 +98,7 @@ class SC_file_rename {
 
                        // Initialize GPvars:
                $this->target = t3lib_div::_GP('target');
+               $this->returnUrl = t3lib_div::_GP('returnUrl');
 
                        // Init basic-file-functions object:
                $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions');
@@ -171,6 +172,7 @@ class SC_file_rename {
                        <div id="c-submit">
                                <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:file_rename.php.submit',1).'" />
                                <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.cancel',1).'" onclick="backToList(); return false;" />
+                               <input type="hidden" name="redirect" value="'.htmlspecialchars($this->returnUrl).'" />
                        </div>
                ';
 
index e4a2498..361095f 100755 (executable)
 
 
 
-$BACK_PATH='';
-require ('init.php');
-require ('template.php');
-include ('sysext/lang/locallang_misc.php');
-require_once (PATH_t3lib.'class.t3lib_basicfilefunc.php');
-
+$BACK_PATH = '';
+require('init.php');
+require('template.php');
+include('sysext/lang/locallang_misc.php');
+require_once(PATH_t3lib.'class.t3lib_basicfilefunc.php');
 
 
 
@@ -90,6 +89,7 @@ class SC_file_upload {
                // Internal, static (GPVar):
        var $number;
        var $target;            // Set with the target path inputted in &target
+       var $returnUrl;         // Return URL of list module.
 
                // Internal, dynamic:
        var $content;           // Accumulating content
@@ -106,6 +106,7 @@ class SC_file_upload {
                        // Initialize GPvars:
                $this->number = t3lib_div::_GP('number');
                $this->target = t3lib_div::_GP('target');
+               $this->returnUrl = t3lib_div::_GP('returnUrl');
 
                        // Init basic-file-functions object:
                $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions');
@@ -212,6 +213,7 @@ class SC_file_upload {
                        <div id="c-submit">
                                <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:file_upload.php.submit',1).'" />
                                <input type="submit" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.cancel',1).'" onclick="backToList(); return false;" />
+                               <input type="hidden" name="redirect" value="'.htmlspecialchars($this->returnUrl).'" />
                        </div>
                ';
 
index 6a2c6e1..7404272 100755 (executable)
@@ -505,7 +505,7 @@ class SC_mod_web_perm_index {
 
                        // Traverse tree:
                foreach($tree->tree as $data)   {
-                       $cells=array();
+                       $cells = array();
 
                                // Background colors:
                        if ($this->lastEdited==$data['row']['uid'])     {$bgCol = ' class="bgColor-20"';} else {$bgCol = '';}
@@ -514,7 +514,7 @@ class SC_mod_web_perm_index {
                                // User/Group names:
                        $userN = $be_user_Array[$data['row']['perms_userid']] ? $be_user_Array[$data['row']['perms_userid']]['username'] : ($data['row']['perms_userid'] ? '<i>['.$data['row']['perms_userid'].']!</i>' : '');
                        $groupN = $be_group_Array[$data['row']['perms_groupid']] ? $be_group_Array[$data['row']['perms_groupid']]['title']  : ($data['row']['perms_groupid'] ? '<i>['.$data['row']['perms_groupid'].']!</i>' : '');
-                       $groupN=t3lib_div::fixed_lgd_cs($groupN,20);
+                       $groupN = t3lib_div::fixed_lgd_cs($groupN,20);
 
                                // Seeing if editing of permissions are allowed for that page:
                        $editPermsAllowed=($data['row']['perms_userid']==$BE_USER->user['uid'] || $BE_USER->isAdmin());
index 0f700bc..dc57828 100644 (file)
@@ -80,17 +80,17 @@ require_once (PATH_t3lib.'class.t3lib_tcemain.php');
 class SC_tce_db {
 
                // Internal, static: GPvar
-       var $flags;
-       var $data;
-       var $cmd;
-       var $mirror;
-       var $cacheCmd;
-       var $redirect;
-       var $prErr;
-       var $_disableRTE;
-       var $CB;
-       var $vC;
-       var $uPT;
+       var $flags;                     // Array. Accepts options to be set in TCE object. Currently it supports "reverseOrder" (boolean).
+       var $data;                      // Data array on the form [tablename][uid][fieldname] = value
+       var $cmd;                       // Command array on the form [tablename][uid][command] = value. This array may get additional data set internally based on clipboard commands send in CB var!
+       var $mirror;            // Array passed to ->setMirror.
+       var $cacheCmd;          // Cache command sent to ->clear_cacheCmd
+       var $redirect;          // Redirect URL. Script will redirect to this location after performing operations (unless errors has occured)
+       var $prErr;                     // Boolean. If set, errors will be printed on screen instead of redirection. Should always be used, otherwise you will see no errors if they happen.
+#      var $_disableRTE;
+       var $CB;                        // Clipboard command array. May trigger changes in "cmd"
+       var $vC;                        // Verification code
+       var $uPT;                       // Boolean. Update Page Tree Trigger. If set and the manipulated records are pages then the update page tree signal will be set.
 
                // Internal, dynamic:
        var $include_once=array();              // Files to include after init() function is called:
@@ -145,7 +145,7 @@ class SC_tce_db {
                        $this->tce->reverseOrder=1;
                }
 
-               $this->tce->disableRTE = $this->_disableRTE;
+#              $this->tce->disableRTE = $this->_disableRTE;
 
                        // Clipboard?
                if (is_array($this->CB))        {
index 1f4f986..dfaf1ca 100755 (executable)
@@ -84,7 +84,7 @@ class SC_tce_file {
 
                // Internal, dynamic:
        var $include_once=array();              // Used to set the classes to include after the init() function is called.
-
+       var $fileProcessor;                             // File processor object
 
 
 
@@ -104,7 +104,7 @@ class SC_tce_file {
 
                        // If clipboard is set, then include the clipboard class:
                if (is_array($this->CB))        {
-                       $this->include_once[]=PATH_t3lib.'class.t3lib_clipboard.php';
+                       $this->include_once[] = PATH_t3lib.'class.t3lib_clipboard.php';
                }
        }
 
@@ -138,22 +138,36 @@ class SC_tce_file {
                global $FILEMOUNTS,$TYPO3_CONF_VARS,$BE_USER;
 
                        // Initializing:
-               $fileProcessor = t3lib_div::makeInstance('t3lib_extFileFunctions');
-               $fileProcessor->init($FILEMOUNTS, $TYPO3_CONF_VARS['BE']['fileExtensions']);
-               $fileProcessor->init_actionPerms($BE_USER->user['fileoper_perms']);
-               $fileProcessor->dontCheckForUnique = $this->overwriteExistingFiles ? 1 : 0;
+               $this->fileProcessor = t3lib_div::makeInstance('t3lib_extFileFunctions');
+               $this->fileProcessor->init($FILEMOUNTS, $TYPO3_CONF_VARS['BE']['fileExtensions']);
+               $this->fileProcessor->init_actionPerms($BE_USER->user['fileoper_perms']);
+               $this->fileProcessor->dontCheckForUnique = $this->overwriteExistingFiles ? 1 : 0;
 
                        // Checking referer / executing:
                $refInfo = parse_url(t3lib_div::getIndpEnv('HTTP_REFERER'));
                $httpHost = t3lib_div::getIndpEnv('TYPO3_HOST_ONLY');
                if ($httpHost!=$refInfo['host'] && $this->vC!=$BE_USER->veriCode() && !$TYPO3_CONF_VARS['SYS']['doNotCheckReferer'])    {
-                       $fileProcessor->writeLog(0,2,1,'Referer host "%s" and server host "%s" did not match!',array($refInfo['host'],$httpHost));
+                       $this->fileProcessor->writeLog(0,2,1,'Referer host "%s" and server host "%s" did not match!',array($refInfo['host'],$httpHost));
                } else {
-                       $fileProcessor->start($this->file);
-                       $fileProcessor->processData();
+                       $this->fileProcessor->start($this->file);
+                       $this->fileProcessor->processData();
                }
+       }
+
+       /**
+        * Redirecting the user after the processing has been done.
+        * Might also display error messages directly, if any.
+        *
+        * @return      void
+        */
+       function finish()       {
+                       // Prints errors, if...
+               $this->fileProcessor->printLogErrorMessages($this->redirect);
 
-               $fileProcessor->printLogErrorMessages($this->redirect);
+               t3lib_BEfunc::getSetUpdateSignal('updateFolderTree');
+               if ($this->redirect) {
+                       Header('Location: '.t3lib_div::locationHeaderUrl($this->redirect));
+               }
        }
 }
 
@@ -182,4 +196,5 @@ foreach($SOBE->include_once as $INC_FILE)   include_once($INC_FILE);
 
 $SOBE->initClipboard();
 $SOBE->main();
+$SOBE->finish();
 ?>