Fixed bug# 3397: FORM submit as image is not valid xhtml; Fixed restriction to langua...
authorMartin Kutschker <martin.t.kutschker@blackbox.net>
Wed, 28 Jun 2006 15:18:33 +0000 (15:18 +0000)
committerMartin Kutschker <martin.t.kutschker@blackbox.net>
Wed, 28 Jun 2006 15:18:33 +0000 (15:18 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@1547 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_content.php

index fc4800b..a22a5f1 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,12 @@
 
+2006-06-28  Martin Kutschker  <martin.t.kutschker@blackbox.net>
+
+       * Fix bug# 3397: FORM submit as image is not valid xhtml
+       * Fixed restriction to languages in Frontend editing
+
 2006-06-28 Bernhard Kraft  <kraftb@kraftb.at>
 
-       * Fix bug #3162: Cropscale fails, if one dimesion has already the right size (thanks to Stefan Geith)
+       * Fix bug #3162: Cropscale fails, if one dimension has already the right size (thanks to Stefan Geith)
 
 2006-06-28 Karsten Dambekalns <karsten@typo3.org>
 
index fb05664..d6899de 100755 (executable)
@@ -701,7 +701,7 @@ class tslib_cObj {
         * @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=352&cHash=379c60f8bc
         */
        function FILE($conf)    {
-               $theValue = $this->fileResource($this->stdWrap($conf['file'],$conf['file.']), trim($this->getAltParam($conf)));
+               $theValue = $this->fileResource($this->stdWrap($conf['file'],$conf['file.']), trim($this->getAltParam($conf, false)));
                if ($conf['linkWrap'])  {
                        $theValue = $this->linkWrap($theValue,$conf['linkWrap']);
                }
@@ -1875,11 +1875,17 @@ class tslib_cObj {
                                        case 'submit':
                                                $value=trim($parts[2]);
                                                if ($conf['image.'])    {
-                                                       $this->data[$this->currentValKey]=$value;
-                                                       $image=$this->IMAGE($conf['image.']);
-                                               } else $image='';
-                                               if($image)      {
-                                                       $fieldCode = str_replace('<img','<input type="image"'.$addParams.' name="'.$confData['fieldname'].'"' ,$image);
+                                                       $this->data[$this->currentValKey] = $value;
+                                                       $image = $this->IMG_RESOURCE($conf['image.']);
+                                                       $params = $conf['image.']['params'] ? ' '.$conf['image.']['params'] : '';
+                                                       $params .= $this->getAltParam($conf['image.'], false);
+                                                       $params .= $addParams;
+                                               } else {
+                                                       $image = '';
+                                               }
+                                               if ($image)     {
+                                                       $fieldCode=sprintf('<input type="image" name="%s"%s src="%s"%s />',
+                                                               $confData['fieldname'], $elementIdAttribute, $image, $params);
                                                } else  {
                                                        $fieldCode=sprintf('<input type="submit" name="%s"%s value="%s"%s />',
                                                                $confData['fieldname'], $elementIdAttribute, t3lib_div::deHSCentities(htmlspecialchars($value)), $addParams);
@@ -2789,14 +2795,15 @@ class tslib_cObj {
        }
 
        /**
-        * An abstraction method which creates an alt or title parameter for an HTML img tag.
+        * An abstraction method which creates an alt or title parameter for an HTML img, applet, area or input element and the FILE content element.
         * From the $conf array it implements the properties "altText", "titleText" and "longdescURL"
         *
         * @param       array           TypoScript configuration properties
+        * @param       boolean         If set, the longdesc attribute will be generated - must only be used for img elements!
         * @return      string          Parameter string containing alt and title parameters (if any)
-        * @see IMGTEXT(), cImage()
+        * @see IMGTEXT(), FILE(), FORM(), cImage(), filelink()
         */
-       function getAltParam($conf)     {
+       function getAltParam($conf, $longDesc=true)     {
                $altText = trim($this->stdWrap($conf['altText'], $conf['altText.']));
                $titleText = trim($this->stdWrap($conf['titleText'],$conf['titleText.']));
                $longDesc = trim($this->stdWrap($conf['longdescURL'],$conf['longdescURL.']));
@@ -6838,7 +6845,7 @@ class tslib_cObj {
                } else {
                        $lang = -1;
                }
-               if (!$BE_USER->checkLanguageAccess($GLOBALS['TSFE']->sys_language_uid)) { return $content; }
+               if (!$BE_USER->checkLanguageAccess($lang)       { return $content; }
 
                if (!$conf['onlyCurrentPid'] || $dataArr['pid']==$GLOBALS['TSFE']->id)  {
                                // Permissions:
@@ -7037,7 +7044,7 @@ class tslib_cObj {
                        } else {
                                $lang = -1;
                        }
-                       if (!$BE_USER->checkLanguageAccess($GLOBALS['TSFE']->sys_language_uid)) { $mayEdit = 0; }
+                       if (!$BE_USER->checkLanguageAccess($lang)       { $mayEdit = 0; }
                }
 
                if ($GLOBALS['TSFE']->displayFieldEditIcons && $table && $mayEdit && $fieldList)        {