[!!!][-FEATURE] Remove resources from TypoScript records
authorGeorg Ringer <mail@ringerge.org>
Fri, 2 Mar 2012 20:07:19 +0000 (21:07 +0100)
committerSusanne Moog <typo3@susannemoog.de>
Sun, 8 Jul 2012 19:27:56 +0000 (21:27 +0200)
This patch drops the functionality that resources (like images)
can be uploaded and bound to TypoScript templates. This feature
was hardly ever used and is bloated through the core.

Change-Id: Ib4c0c107d10fb3dbe9b2ad02691df05709a14ae6
Resolves: #34471
Releases: 6.0
Reviewed-on: http://review.typo3.org/9322
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Felix Kopp
Tested-by: Felix Kopp
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
13 files changed:
NEWS.txt
t3lib/class.t3lib_tsparser_ext.php
t3lib/class.t3lib_tsstyleconfig.php
t3lib/class.t3lib_tstemplate.php
typo3/sysext/cms/ext_tables.sql
typo3/sysext/cms/tbl_cms.php
typo3/sysext/em/classes/install/class.tx_em_install.php
typo3/sysext/install/mod/class.tx_install.php
typo3/sysext/install/report/class.tx_install_report_installstatus.php
typo3/sysext/t3editor/classes/ts_codecompletion/class.tx_t3editor_codecompletion.php
typo3/sysext/tstemplate_ceditor/class.tx_tstemplateceditor.php
typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php
typo3/sysext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php

index f476b41..9ea8b25 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -95,6 +95,17 @@ TYPO3 will not clean the history (table "sys_history") on its own anymore.
 This can lead to a large amount of data in this table. Please consider using
 the garbage collection scheduler task to remove old entries.
 
+* Removed TypoScript resources
+
+The ancient feature to add images and other resources directly to TypoScript
+records is dropped and the handling removed. This old feature - accessible
+from the 'Info/modify' tab in the Template module - was hardly ever used
+and was partly broken.
+If this feature was still in use, it is recommended to not drop the
+resource field from table sys_template during upgrading, fix the using
+TypoScript to refer to resources located in fileadmin or similar directly,
+and afterwards to finally delete the resource field in the install tool.
+
 ===============================================================================
 Changes and Improvements
 ===============================================================================
index 51a36a3..14fa79b 100644 (file)
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-/**
- * TSParser extension class to t3lib_TStemplate
- *
- * Contains functions for the TS module in TYPO3 backend
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
 
 /**
  * TSParser extension class to t3lib_TStemplate
+ * Contains functions for the TS module in TYPO3 backend
  *
  * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
@@ -83,8 +77,6 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
                'cscript' => Array('Content: \'Script\'', 'mp'),
                'chtml' => Array('Content: \'HTML\'', 'mq')
        );
-       var $resourceDimensions = array();
-       var $dirResources = array();
 
        var $backend_info = 1;
 
@@ -108,10 +100,8 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
        var $ext_lineNumberOffset_mode = '';
                // Dont change...
        var $ext_dontCheckIssetValues = 0;
-       var $ext_noCEUploadAndCopying = 0;
        var $ext_printAll = 0;
        var $ext_CEformName = 'forms[0]';
-       var $ext_defaultOnlineResourceFlag = 0;
        var $doNotSortCategoriesBeforeMakingForm = FALSE;
 
                // Ts analyzer
@@ -1019,10 +1009,6 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
                                $f = substr($iFile, strlen(PATH_site));
                                $tFile = $GLOBALS['BACK_PATH'] . '../' . $f;
                        }
-               } else {
-                       $f = 'uploads/tf/' . $this->extractFromResources($this->setup['resources'], $imgConf);
-                       $iFile = PATH_site . $f;
-                       $tFile = $GLOBALS['BACK_PATH'] . '../' . $f;
                }
                $imageInfo = @getImagesize($iFile);
                return '<img src="' . $tFile . '" ' . $imageInfo[3] . '>';
@@ -1031,75 +1017,6 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
        /**
         * [Describe function...]
         *
-        * @return      [type]          ...
-        */
-       function ext_resourceDims() {
-               if ($this->setup['resources']) {
-                       $rArr = explode(',', $this->setup['resources']);
-                       foreach ($rArr as $c => $val) {
-                               $val = trim($val);
-                               $theFile = PATH_site . 'uploads/tf/' . $val;
-                               if ($val && @is_file($theFile)) {
-                                       $imgInfo = @getimagesize($theFile);
-                               }
-                               if (is_array($imgInfo)) {
-                                       $this->resourceDimensions[$val] = ' (' . $imgInfo[0] . 'x' . $imgInfo[1] . ')';
-                               }
-                       }
-               }
-               foreach ($this->dirResources as $c => $val) {
-                       $val = trim($val);
-                       $imgInfo = @getimagesize(PATH_site . $val);
-                       if (is_array($imgInfo)) {
-                               $this->resourceDimensions[$val] = ' (' . $imgInfo[0] . 'x' . $imgInfo[1] . ')';
-                       }
-               }
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @param       [type]          $path: ...
-        * @return      [type]          ...
-        */
-       function ext_readDirResources($path) {
-               $path = trim($path);
-               if ($path && strstr($path, $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'])) {
-                       $path = rtrim($path, '/');
-                       $this->readDirectory(PATH_site . $path);
-               }
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @param       [type]          $path: ...
-        * @param       [type]          $type: ...
-        * @return      [type]          ...
-        */
-       function readDirectory($path, $type = 'file') {
-               if (@is_dir($path)) {
-                       $d = @dir($path);
-                       $tempArray = Array();
-                       if (is_object($d)) {
-                               while ($entry = $d->read()) {
-                                       if ($entry != '.' && $entry != '..') {
-                                                       // Because of odd PHP-error where  <BR>-tag is sometimes placed after a filename!!
-                                               $wholePath = $path . '/' . $entry;
-                                               if (file_exists($wholePath) && (!$type || filetype($wholePath) == $type)) {
-                                                       $fI = t3lib_div::split_fileref($wholePath);
-                                                       $this->dirResources[] = substr($wholePath, strlen(PATH_site));
-                                               }
-                                       }
-                               }
-                               $d->close();
-                       }
-               }
-       }
-
-       /**
-        * [Describe function...]
-        *
         * @param       [type]          $params: ...
         * @return      [type]          ...
         */
@@ -1130,7 +1047,6 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
                if (is_array($this->categories[$category])) {
 
                        $help = $this->helpConfig;
-                       $this->rArr = explode(',', $this->setup['resources'] . ',' . implode($this->dirResources, ','));
 
                        if (!$this->doNotSortCategoriesBeforeMakingForm) {
                                asort($this->categories[$category]);
@@ -1262,73 +1178,15 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
                                                case 'file':
                                                        $p_field = '<option value=""></option>';
                                                        $theImage = '';
-                                                       $selectThisFile = $this->extractFromResources($this->setup['resources'], $params['value']);
-                                                       if ($params['value'] && !$selectThisFile) {
-                                                               if (in_array($params['value'], $this->dirResources)) {
-                                                                       $selectThisFile = $params['value'];
-                                                               }
-                                                       }
+
                                                                // extensionlist
                                                        $extList = $typeDat['paramstr'];
                                                        $p_field = '<option value="">(' . $extList . ')</option>';
                                                        if ($extList == 'IMAGE_EXT') {
                                                                $extList = $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'];
                                                        }
-                                                       $onlineResourceFlag = $this->ext_defaultOnlineResourceFlag;
-
-                                                       foreach ($this->rArr as $c => $val) {
-                                                               $val = trim($val);
-                                                               $fI = t3lib_div::split_fileref($val);
-                                                               if ($val && (!$extList || t3lib_div::inList($extList, $fI['fileext']))) {
-                                                                       if ($onlineResourceFlag <= 0 && strstr($fI['path'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'])) {
-                                                                               if ($onlineResourceFlag < 0) {
-                                                                                       $p_field .= '<option value=""></option>';
-                                                                               }
-                                                                               $p_field .= '<option value="">__' . $fI['path'] . '__:</option>';
-                                                                               $onlineResourceFlag = 1;
-                                                                       }
-                                                                       $dims = $this->resourceDimensions[$val];
-                                                                       $sel = '';
-
-                                                                               // Check if $params['value'] is in the list of resources.
-                                                                       if ($selectThisFile && $selectThisFile == $val) {
-                                                                               $sel = ' selected';
-                                                                               if ($onlineResourceFlag <= 0) {
-                                                                                       $theImage = t3lib_BEfunc::thumbCode(
-                                                                                               array(
-                                                                                                       'resources' => $selectThisFile
-                                                                                               ),
-                                                                                               'sys_template',
-                                                                                               'resources',
-                                                                                               $GLOBALS['BACK_PATH'],
-                                                                                               ''
-                                                                                       );
-                                                                               } else {
-                                                                                       $theImage = t3lib_BEfunc::thumbCode(
-                                                                                               array(
-                                                                                                       'resources' => $fI['file']
-                                                                                               ),
-                                                                                               'sys_template',
-                                                                                               'resources',
-                                                                                               $GLOBALS['BACK_PATH'],
-                                                                                               '',
-                                                                                               $fI['path']
-                                                                                       );
-                                                                               }
-                                                                       }
-
-                                                                       if ($onlineResourceFlag <= 0) {
-                                                                               $onlineResourceFlag--;
-                                                                                       // Value is set with a *
-                                                                               $val = $this->ext_setStar($val);
-                                                                               $p_field .= '<option value="' . htmlspecialchars($val) . '"' . $sel . '>' . $val . $dims . '</option>';
-                                                                       } else {
-                                                                               $p_field .= '<option value="' . htmlspecialchars($val) . '"' . $sel . '>' . $fI['file'] . $dims . '</option>';
-                                                                       }
-                                                               }
-                                                       }
 
-                                                       if (trim($params['value']) && !$selectThisFile) {
+                                                       if (trim($params['value'])) {
                                                                $val = $params['value'];
                                                                $p_field .= '<option value=""></option>';
                                                                $p_field .= '<option value="' . htmlspecialchars($val) . '" selected>' . $val . '</option>';
@@ -1336,32 +1194,6 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
 
                                                        $p_field = '<select id="' . $fN . '" name="' . $fN . '" onChange="uFormUrl(' . $aname . ')">' . $p_field . '</select>';
                                                        $p_field .= $theImage;
-
-                                                       if (!$this->ext_noCEUploadAndCopying) {
-                                                                       // Copy a resource
-                                                               $copyFile = $this->extractFromResources($this->setup['resources'], $params['value']);
-                                                               if (!$copyFile) {
-                                                                       if ($params['value']) {
-                                                                               $copyFile = PATH_site . $this->ext_detectAndFixExtensionPrefix($params['value']);
-                                                                       }
-                                                               } else {
-                                                                       $copyFile = '';
-                                                               }
-
-                                                               if ($copyFile && @is_file($copyFile)) {
-                                                                       $p_field .= '<img src="clear.gif" width="20" ' . 'height="1" alt="" />' .
-                                                                                               t3lib_iconWorks::getSpriteIcon('actions-edit-copy') . '<input type="checkbox" ' .
-                                                                                               'name="_copyResource[' . $params['name'] . ']" value="' . htmlspecialchars($copyFile) .
-                                                                                               '" onclick="uFormUrl(' . $aname . ');if (this.checked && !confirm(\'' .
-                                                                                               t3lib_div::slashJS(htmlspecialchars(sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_tsparser.xml:tsparser_ext.make_copy'), $params['value']))) .
-                                                                                               '\')) this.checked=false;" />';
-                                                               }
-
-                                                                       // Upload?
-                                                               $p_field .= '<br />';
-                                                               $p_field .= '<input id="' . $fN . '" type="file" name="upload_' . $fN . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth() .
-                                                                                       ' onChange="uFormUrl(' . $aname . ')" size="50" />';
-                                                       }
                                                break;
                                                case 'user':
                                                        $userFunction = $typeDat['paramstr'];
@@ -1591,7 +1423,7 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
         * [Describe function...]
         *
         * @param       [type]          $http_post_vars: ...
-        * @param       [type]          $http_post_files: ...
+        * @param       array (not used anymore)
         * @param       [type]          $theConstants: ...
         * @param       [type]          $tplRow: ...
         * @return      [type]          ...
@@ -1599,7 +1431,6 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
        function ext_procesInput($http_post_vars, $http_post_files, $theConstants, $tplRow) {
                $data = $http_post_vars['data'];
                $check = $http_post_vars['check'];
-               $copyResource = $http_post_vars['_copyResource'];
                $Wdata = $http_post_vars['Wdata'];
                $W2data = $http_post_vars['W2data'];
                $W3data = $http_post_vars['W3data'];
@@ -1683,26 +1514,6 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
                                                                        $var = $typeDat['paramstr'] ? $typeDat['paramstr'] : 1;
                                                                }
                                                        break;
-                                                       case 'file':
-                                                               if (!$this->ext_noCEUploadAndCopying) {
-                                                                       if ($http_post_files['upload_data']['name'][$key] && $http_post_files['upload_data']['tmp_name'][$key] != 'none') {
-                                                                               $var = $this->upload_copy_file(
-                                                                                       $typeDat,
-                                                                                       $tplRow,
-                                                                                       trim($http_post_files['upload_data']['name'][$key]),
-                                                                                       $http_post_files['upload_data']['tmp_name'][$key]
-                                                                               );
-                                                                       }
-                                                                       if ($copyResource[$key]) {
-                                                                               $var = $this->upload_copy_file(
-                                                                                       $typeDat,
-                                                                                       $tplRow,
-                                                                                       basename($copyResource[$key]),
-                                                                                       $copyResource[$key]
-                                                                               );
-                                                                       }
-                                                               }
-                                                       break;
                                                }
                                                if ($this->ext_printAll || strcmp($theConstants[$key]['value'], $var)) {
                                                                // Put value in, if changed.
@@ -1730,58 +1541,6 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
        /**
         * [Describe function...]
         *
-        * @param       [type]          $typeDat: ...
-        * @param       [type]          $tplRow: ...
-        * @param       [type]          $theRealFileName: ...
-        * @param       [type]          $tmp_name: ...
-        * @return      [type]          ...
-        */
-       function upload_copy_file($typeDat, &$tplRow, $theRealFileName, $tmp_name) {
-
-                       // extensions
-               $extList = $typeDat['paramstr'];
-               if ($extList == 'IMAGE_EXT') {
-                       $extList = $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'];
-               }
-               $fI = t3lib_div::split_fileref($theRealFileName);
-               if ($theRealFileName && (!$extList || t3lib_div::inList($extList, $fI['fileext']))) {
-                               // If there is an uploaded file, move it.
-                       $tmp_upload_name = t3lib_div::upload_to_tempfile($tmp_name);
-
-                               // Saving resource
-                       $alternativeFileName = array();
-                       $alternativeFileName[$tmp_upload_name] = $theRealFileName;
-                               // Making list of resources
-                       $resList = $tplRow['resources'];
-                       $resList = $tmp_upload_name . ',' . $resList;
-                       $resList = implode(t3lib_div::trimExplode(',', $resList, 1), ',');
-                               // Making data-array
-                       $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
-
-                       $recData = array();
-                       $recData['sys_template'][$saveId]['resources'] = $resList;
-                               // Saving
-                       $tce = t3lib_div::makeInstance('t3lib_TCEmain');
-                       $tce->stripslashes_values = 0;
-                       $tce->alternativeFileName = $alternativeFileName;
-                       $tce->start($recData, Array());
-                       $tce->process_datamap();
-
-                       t3lib_div::unlink_tempfile($tmp_upload_name);
-
-                       $tmpRow = t3lib_BEfunc::getRecordWSOL('sys_template', $saveId, 'resources');
-
-                       $tplRow['resources'] = $tmpRow['resources'];
-
-                               // Setting the value
-                       $var = $this->ext_setStar($theRealFileName);
-               }
-               return $var;
-       }
-
-       /**
-        * [Describe function...]
-        *
         * @param       [type]          $id: ...
         * @param       [type]          $perms_clause: ...
         * @return      [type]          ...
@@ -1794,36 +1553,6 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
                        }
                }
        }
-
-       /**
-        * [Describe function...]
-        *
-        * @param       [type]          $val: ...
-        * @return      [type]          ...
-        */
-       function ext_setStar($val) {
-               $fParts = explode('.', strrev($val), 2);
-               $val = preg_replace('/_[0-9][0-9]$/', '', strrev($fParts[1])) . '*.' . strrev($fParts[0]);
-               return $val;
-       }
-
-       /**
-        * [Describe function...]
-        *
-        * @param       [type]          $value: ...
-        * @return      [type]          ...
-        */
-       function ext_detectAndFixExtensionPrefix($value) {
-               if (substr($value, 0, 4) == 'EXT:') {
-                       $parts = explode('/', substr($value, 4), 2);
-
-                       $extPath = t3lib_extMgm::siteRelPath($parts[0]);
-                       $value = $extPath . $parts[1];
-                       return $value;
-               } else {
-                       return $value;
-               }
-       }
 }
 
-?>
\ No newline at end of file
+?>
index b7e1fb4..939e6fc 100644 (file)
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
-/**
- * Provides a simplified layer for making Constant Editor style configuration forms
- *
- * @author Kasper Skårhøj <kasperYYYY@typo3.com>
- */
 
 /**
  * Provides a simplified layer for making Constant Editor style configuration forms
@@ -42,9 +37,7 @@ class t3lib_tsStyleConfig extends t3lib_tsparser_ext {
        var $categories = array();
        var $ext_dontCheckIssetValues = 1;
        var $ext_CEformName = 'tsStyleConfigForm';
-       var $ext_noCEUploadAndCopying = 1;
        var $ext_printAll = 1;
-       var $ext_defaultOnlineResourceFlag = 1;
 
        var $ext_incomingValues = array();
 
@@ -221,21 +214,6 @@ class t3lib_tsStyleConfig extends t3lib_tsparser_ext {
        /**
         * [Describe function...]
         *
-        * @param       [type]          $absPath: ...
-        * @return      [type]          ...
-        */
-       function ext_loadResources($absPath) {
-               $this->ext_readDirResources($GLOBALS['TYPO3_CONF_VARS']['MODS']['web_ts']['onlineResourceDir']);
-               if (is_dir($absPath)) {
-                       $absPath = rtrim($absPath, '/');
-                       $this->readDirectory($absPath);
-               }
-               $this->ext_resourceDims();
-       }
-
-       /**
-        * [Describe function...]
-        *
         * @param       [type]          $key: ...
         * @param       [type]          $var: ...
         * @return      [type]          ...
@@ -255,4 +233,4 @@ class t3lib_tsStyleConfig extends t3lib_tsparser_ext {
        }
 }
 
-?>
\ No newline at end of file
+?>
index 0b3a790..bf69296 100644 (file)
@@ -64,7 +64,6 @@ class t3lib_TStemplate {
        var $ext_regComments = FALSE;
 
                // Constants:
-       var $uplPath = 'uploads/tf/';
        var $tempPath = 'typo3temp/';
        var $menuclasses = 'gmenu,tmenu,imgmenu,jsmenu';
 
@@ -133,8 +132,6 @@ class t3lib_TStemplate {
        var $outermostRootlineIndexWithTemplate = 0;
                // Array of arrays with title/uid of templates in hierarchy
        var $rowSum;
-               // Resources for the template hierarchy in a comma list
-       var $resources = '';
                // The current site title field.
        var $sitetitle = '';
                // Tracking all conditions found during parsing of TypoScript. Used for the "all" key in currentPageData
@@ -544,10 +541,6 @@ class t3lib_TStemplate {
                $this->clearList_const[] = $templateID;
                $this->clearList_setup[] = $templateID;
 
-                       // Add resources and sitetitle if found:
-               if (trim($row['resources'])) {
-                       $this->resources = $row['resources'] . ',' . $this->resources;
-               }
                if (trim($row['sitetitle'])) {
                        $this->sitetitle = $row['sitetitle'];
                }
@@ -734,7 +727,6 @@ class t3lib_TStemplate {
                $this->processIncludes();
 
                        // These vars are also set lateron...
-               $this->setup['resources'] = $this->resources;
                $this->setup['sitetitle'] = $this->sitetitle;
 
                        // ****************************
@@ -833,10 +825,6 @@ class t3lib_TStemplate {
                        // ****************************************************************
 
                        // These vars are allready set after 'processTemplate', but because $config->setup overrides them (in the line above!), we set them again. They are not changed compared to the value they had in the top of the page!
-               unset($this->setup['resources']);
-               unset($this->setup['resources.']);
-               $this->setup['resources'] = implode(',', t3lib_div::trimExplode(',', $this->resources, 1));
-
                unset($this->setup['sitetitle']);
                unset($this->setup['sitetitle.']);
                $this->setup['sitetitle'] = $this->sitetitle;
@@ -1142,45 +1130,7 @@ class t3lib_TStemplate {
                        } elseif ($this->tt_track) {
                                $GLOBALS['TT']->setTSlogMessage('"' . $this->getFileName_backPath . $file . '" is not a file (non-uploads/.. resource, did not exist).', 3);
                        }
-               } else { // Here it is uploaded media:
-                       $outFile = $this->extractFromResources($this->setup['resources'], $file);
-                       if ($outFile) {
-                               if (@is_file($this->uplPath . $outFile)) {
-                                       $this->fileCache[$hash] = $this->uplPath . $outFile;
-                                       return $this->uplPath . $outFile;
-                               } elseif ($this->tt_track) {
-                                       $GLOBALS['TT']->setTSlogMessage('"' . $this->uplPath . $outFile . '" is not a file (did not exist).', 3);
-                               }
-                       } elseif ($this->tt_track) {
-                               $GLOBALS['TT']->setTSlogMessage('"' . $file . '" is not a file (uploads/.. resource).', 3);
-                       }
-               }
-       }
-
-       /**
-        * Searches for the TypoScript resource filename in the list of resource filenames.
-        *
-        * @param string $res The resource file name list (from $this->setup['resources'])
-        * @param string $file The resource value to match
-        * @return string If found, this will be the resource filename that matched. Typically this file is found in "uploads/tf/"
-        * @access private
-        * @see getFileName()
-        */
-       function extractFromResources($res, $file) {
-               if (t3lib_div::inList($res, $file)) {
-                       $outFile = $file;
-               } elseif (strstr($file, '*')) {
-                       $fileparts = explode('*', $file);
-                       $c = count($fileparts);
-                       $files = t3lib_div::trimExplode(',', $res);
-                       foreach ($files as $file) {
-                               if (preg_match('/^' . quotemeta($fileparts[0]) . '.*' . quotemeta($fileparts[$c - 1]) . '$/', $file)) {
-                                       $outFile = $file;
-                                       break;
-                               }
-                       }
                }
-               return $outFile;
        }
 
        /**
@@ -1539,4 +1489,4 @@ class t3lib_TStemplate {
                }
        }
 }
-?>
\ No newline at end of file
+?>
index 2db5407..a58ca28 100755 (executable)
@@ -244,7 +244,6 @@ CREATE TABLE sys_template (
   include_static_file text,
   constants text,
   config text,
-  resources text,
   nextLevel varchar(5) DEFAULT '' NOT NULL,
   description text,
   basedOn tinytext,
index d56f9de..7e3babf 100755 (executable)
@@ -849,7 +849,7 @@ if ((!isset($GLOBALS['TYPO3_CONF_VARS']['INSTALL']['wizardDone']['Tx_Install_Upd
 $TCA['sys_template'] = array(
        'ctrl' => $TCA['sys_template']['ctrl'],
        'interface' => array(
-               'showRecordFieldList' => 'title,clear,root,basedOn,nextLevel,resources,sitetitle,description,hidden,starttime,endtime'
+               'showRecordFieldList' => 'title,clear,root,basedOn,nextLevel,sitetitle,description,hidden,starttime,endtime'
        ),
        'columns' => array(
                'title' => array(
@@ -930,20 +930,6 @@ $TCA['sys_template'] = array(
                        ),
                        'defaultExtras' => 'fixed-font : enable-tab',
                ),
-               'resources' => array(
-                       'label' => 'LLL:EXT:cms/locallang_tca.xml:sys_template.resources',
-                       'config' => array(
-                               'type' => 'group',
-                               'internal_type' => 'file',
-                               'allowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'].',html,htm,ttf,pfb,pfm,txt,css,tmpl,inc,ico,js,xml',
-                               'max_size' => $GLOBALS['TYPO3_CONF_VARS']['BE']['maxFileSize'],
-                               'uploadfolder' => 'uploads/tf',
-                               'show_thumbs' => '1',
-                               'size' => '7',
-                               'maxitems' => '100',
-                               'minitems' => '0'
-                       )
-               ),
                'nextLevel' => array(
                        'label' => 'LLL:EXT:cms/locallang_tca.xml:sys_template.nextLevel',
                        'config' => array(
@@ -1153,4 +1139,4 @@ $TCA['backend_layout'] = array(
 );
 
 
-?>
\ No newline at end of file
+?>
index 511acd8..11b1ac0 100644 (file)
@@ -1352,9 +1352,6 @@ class tx_em_Install {
                                $GLOBALS['BACK_PATH']
                        );
 
-                               // Load the list of resources.
-                       $tsStyleConfig->ext_loadResources($absPath . 'res/');
-
                                // Load current value:
                        $arr = unserialize($TYPO3_CONF_VARS['EXT']['extConf'][$extKey]);
                        $arr = is_array($arr) ? $arr : array();
@@ -1669,4 +1666,4 @@ class tx_em_Install {
                }
        }
 }
-?>
\ No newline at end of file
+?>
index b0b3517..380a57f 100644 (file)
@@ -2837,7 +2837,6 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                        'uploads/' => array('Location for uploaded files from RTE, in the subdirectories for uploaded files of content elements.', 2),
                        'uploads/pics/' => array('Typical location for uploaded files (images especially).', 0),
                        'uploads/media/' => array('Typical location for uploaded files (non-images especially).', 0),
-                       'uploads/tf/' => array('Typical location for uploaded files (TS template resources).', 0),
                        $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] => array('Location for local files such as templates, independent uploads etc.', -1),
                        $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] . '_temp_/' => array('Typical temporary location for default upload of files by administrators.', 0),
                );
@@ -8556,4 +8555,4 @@ $out="
                }
        }
 }
-?>
\ No newline at end of file
+?>
index 3ac1533..d885cfe 100644 (file)
@@ -85,7 +85,6 @@ class tx_install_report_InstallStatus implements tx_reports_StatusProvider {
                        'uploads/'             => 2,
                        'uploads/pics/'        => 0,
                        'uploads/media/'       => 0,
-                       'uploads/tf/'          => 0,
                        $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] => -1,
                        $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'] . '_temp_/'    => 0,
                );
index 117f894..e552199 100644 (file)
@@ -123,7 +123,6 @@ class tx_t3editor_codecompletion {
                $tsParser->ext_regLinenumbers = FALSE;
                $tsParser->bType = $bType;
                $tsParser->resourceCheck = 1;
-               $tsParser->uplPath = PATH_site . $tsParser->uplPath;
                $tsParser->removeFromGetFilePath = PATH_site;
                $tsParser->generateConfig();
 
@@ -171,4 +170,4 @@ class tx_t3editor_codecompletion {
        }
 }
 
-?>
\ No newline at end of file
+?>
index 71ea9a5..c3fea1c 100644 (file)
@@ -124,7 +124,7 @@ class tx_tstemplateceditor extends t3lib_extobjbase {
                                // Update template ?
                        if (t3lib_div::_POST('submit') || (t3lib_utility_Math::canBeInterpretedAsInteger(t3lib_div::_POST('submit_x')) && t3lib_utility_Math::canBeInterpretedAsInteger(t3lib_div::_POST('submit_y')))) {
                                $tmpl->changed = 0;
-                               $tmpl->ext_procesInput(t3lib_div::_POST(), $_FILES, $theConstants, $tplRow);
+                               $tmpl->ext_procesInput(t3lib_div::_POST(), array(), $theConstants, $tplRow);
                                if ($tmpl->changed) {
                                                // Set the data to be saved
                                        $recData = array();
@@ -132,9 +132,7 @@ class tx_tstemplateceditor extends t3lib_extobjbase {
                                                // Create new  tce-object
                                        $tce = t3lib_div::makeInstance('t3lib_TCEmain');
                                        $tce->stripslashes_values = 0;
-                                               // Initialize
                                        $tce->start($recData, Array());
-                                               // Saved the stuff
                                        $tce->process_datamap();
                                                // Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
                                        $tce->clear_cacheCmd('all');
@@ -144,10 +142,6 @@ class tx_tstemplateceditor extends t3lib_extobjbase {
                                }
                        }
 
-                               // Output edit form
-                       $tmpl->ext_readDirResources($TYPO3_CONF_VARS['MODS']['web_ts']['onlineResourceDir']);
-                       $tmpl->ext_resourceDims();
-
                                // Resetting the menu (start). I wonder if this in any way is a violation of the menu-system. Haven't checked. But need to do it here, because the menu is dependent on the categories available.
                        $this->pObj->MOD_MENU['constant_editor_cat'] = $tmpl->ext_getCategoryLabelArray();
 
@@ -177,11 +171,6 @@ class tx_tstemplateceditor extends t3lib_extobjbase {
                        $category = $this->pObj->MOD_SETTINGS['constant_editor_cat'];
                        $tmpl->ext_getTSCE_config($category);
 
-                               // NOT WORKING:
-                       if ($BE_USER_modOptions['properties']['constantEditor.']['example'] == 'top') {
-                               $theOutput = $this->displayExample($theOutput);
-                       }
-
                        $printFields = trim($tmpl->ext_printFields($theConstants, $category));
                        if ($printFields) {
                                $theOutput .= $this->pObj->doc->section('', $printFields);
@@ -196,4 +185,4 @@ class tx_tstemplateceditor extends t3lib_extobjbase {
                return $theOutput;
        }
 }
-?>
\ No newline at end of file
+?>
index e98c493..bd308e7 100644 (file)
@@ -237,7 +237,6 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                                        // Set the data to be saved
                                $recData = array();
                                $alternativeFileName = array();
-                               $resList = $tplRow['resources'];
 
                                $tmp_upload_name = '';
                                        // Set this to blank
@@ -253,59 +252,10 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                                                        case 'description':
                                                                $recData['sys_template'][$saveId][$field] = $val;
                                                                break;
-                                                       case 'resources':
-                                                                       // If there is an uploaded file, move it.
-                                                               $tmp_upload_name = t3lib_div::upload_to_tempfile($_FILES['resources']['tmp_name']);
-                                                               if ($tmp_upload_name) {
-                                                                       if ($tmp_upload_name!='none' && $_FILES['resources']['name']) {
-                                                                               $alternativeFileName[$tmp_upload_name] = trim($_FILES['resources']['name']);
-                                                                               $resList = $tmp_upload_name.','.$resList;
-                                                                       }
-                                                               }
-                                                               break;
-                                                       case 'new_resource':
-                                                               $newName = trim(t3lib_div::_GP('new_resource'));
-                                                               if ($newName) {
-                                                                       $newName.= '.'.t3lib_div::_GP('new_resource_ext');
-                                                                       $tmp_newresource_name = t3lib_div::tempnam('new_resource_');
-                                                                       $alternativeFileName[$tmp_newresource_name] = $newName;
-                                                                       $resList = $tmp_newresource_name.','.$resList;
-                                                               }
-                                                               break;
-                                                       case 'makecopy_resource':
-                                                               if (is_array($val)) {
-                                                                       $resList = ','.$resList.',';
-                                                                       foreach ($val as $k => $file) {
-                                                                               $tmp_name = PATH_site . $GLOBALS['TCA']['sys_template']['columns']['resources']['config']['uploadfolder'] . '/' . $file;
-                                                                               $resList = $tmp_name.','.$resList;
-                                                                       }
-                                                               }
-                                                               break;
-                                                       case 'remove_resource':
-                                                               if (is_array($val)) {
-                                                                       $resList = ','.$resList.',';
-                                                                       foreach ($val as $k => $file) {
-                                                                               $resList = str_replace(','.$file.',', ',', $resList);
-                                                                       }
-                                                               }
-                                                               break;
-                                                       case 'totop_resource':
-                                                               if (is_array($val)) {
-                                                                       $resList = ','.$resList.',';
-                                                                       foreach ($val as $k => $file) {
-                                                                               $resList = str_replace(','.$file.',', ',', $resList);
-                                                                               $resList = ','.$file.$resList;
-                                                                       }
-                                                               }
-                                                               break;
                                                }
                                        }
                                }
-                               $resList=implode(',', t3lib_div::trimExplode(',', $resList, 1));
-                               if (strcmp($resList, $tplRow['resources'])) {
-                                       $recData['sys_template'][$saveId]['resources'] = $resList;
-                               }
-                               if (count($recData)) {
+                               if (count($recData))    {
 
                                        $recData['sys_template'][$saveId] = $this->processTemplateRowBeforeSaving($recData['sys_template'][$saveId]);
 
@@ -327,10 +277,6 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                                        $this->initialize_editor($this->pObj->id, $template_uid);
                                }
 
-                                       // Unlink any uploaded/new temp files there was:
-                               t3lib_div::unlink_tempfile($tmp_upload_name);
-                               t3lib_div::unlink_tempfile($tmp_newresource_name);
-
                                        // If files has been edited:
                                if (is_array($edit))            {
                                        if ($edit['filename'] && $tplRow['resources'] && t3lib_div::inList($tplRow['resources'], $edit['filename']))    {               // Check if there are resources, and that the file is in the resourcelist.
@@ -410,42 +356,6 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                                $theOutput.= $this->pObj->doc->spacer(15);
                                $theOutput.= $this->pObj->doc->section($GLOBALS['LANG']->getLL('description'), $outCode, TRUE);
                        }
-                       if ($e['resources']) {
-                                       // Upload
-                               $outCode = '<input type="File" name="resources"'.$this->pObj->doc->formWidth().' size="50">';
-                               $outCode.= '<input type="Hidden" name="data[resources]" value="1">';
-                               $outCode.= '<input type="Hidden" name="e[resources]" value="1">';
-                               $outCode.= '<BR>' . $GLOBALS['LANG']->getLL('allowedExtensions') . ' <strong>' . $GLOBALS['TCA']['sys_template']['columns']['resources']['config']['allowed'] . '</strong>';
-                               $outCode.= '<BR>' . $GLOBALS['LANG']->getLL('maxFilesize') . ' <strong>' . t3lib_div::formatSize($GLOBALS['TCA']['sys_template']['columns']['resources']['config']['max_size']*1024) . '</strong>';
-                               $theOutput.= $this->pObj->doc->spacer(15);
-                               $theOutput.= $this->pObj->doc->section($GLOBALS['LANG']->getLL('uploadResource'), $outCode, TRUE);
-
-                                       // New
-                               $opt = explode(',', $this->pObj->textExtensions);
-                               $optTags = '';
-                               foreach ($opt as $extVal) {
-                                       $optTags.= '<option value="'.$extVal.'">.'.$extVal.'</option>';
-                               }
-                               $outCode = '<input type="text" name="new_resource"'.$this->pObj->doc->formWidth(20).'>
-                                       <select name="new_resource_ext">'.$optTags.'</select>';
-                               $outCode.= '<input type="Hidden" name="data[new_resource]" value="1">';
-                               $theOutput.= $this->pObj->doc->spacer(15);
-                               $theOutput.= $this->pObj->doc->section($GLOBALS['LANG']->getLL('newTextResource'), $outCode, TRUE);
-
-                                       // Make copy
-                               $rL = $this->resourceListForCopy($this->pObj->id, $template_uid);
-                               if ($rL) {
-                                       $theOutput.= $this->pObj->doc->spacer(20);
-                                       $theOutput.= $this->pObj->doc->section($GLOBALS['LANG']->getLL('copyResource'), $rL);
-                               }
-
-                                       // Update resource list
-                               $rL = $this->procesResources($tplRow['resources'], 1);
-                               if ($rL) {
-                                       $theOutput.= $this->pObj->doc->spacer(20);
-                                       $theOutput.= $this->pObj->doc->section($GLOBALS['LANG']->getLL('updateResourceList'), $rL, TRUE);
-                               }
-                       }
                        if ($e['constants']) {
                                $outCode = '<textarea name="data[constants]" rows="'.$numberOfRows.'" wrap="off" class="fixed-font enable-tab"'.$this->pObj->doc->formWidthText(48, 'width:98%;height:70%', 'off').' class="fixed-font">'.t3lib_div::formatForTextarea($tplRow['constants']).'</textarea>';
                                $outCode.= '<input type="Hidden" name="e[constants]" value="1">';
@@ -539,11 +449,6 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                                'description'
                        );
                        $outCode.= $this->tableRow(
-                               $GLOBALS['LANG']->getLL('resources'),
-                               $this->procesResources($tplRow['resources']),
-                               'resources'
-                       );
-                       $outCode.= $this->tableRow(
                                $GLOBALS['LANG']->getLL('constants'),
                                sprintf($GLOBALS['LANG']->getLL('editToView'), (trim($tplRow[constants]) ? count(explode(LF, $tplRow[constants])) : 0)),
                                'constants'
index 368de83..8ea5dda 100644 (file)
@@ -345,7 +345,6 @@ class tx_tstemplateobjbrowser extends t3lib_extobjbase {
                $tmpl->ext_regComments = $this->pObj->MOD_SETTINGS['ts_browser_showComments'];
                $tmpl->bType = $bType;
                $tmpl->resourceCheck = 1;
-               $tmpl->uplPath = PATH_site . $tmpl->uplPath;
                $tmpl->removeFromGetFilePath = PATH_site;
 
                if ($this->pObj->MOD_SETTINGS['ts_browser_type'] == 'const') {
@@ -565,4 +564,4 @@ class tx_tstemplateobjbrowser extends t3lib_extobjbase {
                return $theOutput;
        }
 }
-?>
\ No newline at end of file
+?>