Commit 4de11ff3 authored by Kasper Skårhøj's avatar Kasper Skårhøj
Browse files

* Fixed various things in file processing, t3lib_extFileFunc et al.


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@325 709f56b5-9817-0410-a4d7-c38de5d9e867
parent c71bb19a
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".
......
......@@ -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
......
......@@ -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;
......
......@@ -79,10 +79,10 @@
* @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 '.';
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -40,45 +40,45 @@
* 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
......
......@@ -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'
*
......
......@@ -39,15 +39,15 @@
*
*
* 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
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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),
......
......@@ -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>';
......
......@@ -48,10 +48,10 @@
*
*/
$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=\'\';" />