Added feature #15689: Allow easy use of lightbox style image enlargement in the frontend
authorSusanne Moog <typo3@susannemoog.de>
Mon, 13 Sep 2010 08:34:33 +0000 (08:34 +0000)
committerSusanne Moog <typo3@susannemoog.de>
Mon, 13 Sep 2010 08:34:33 +0000 (08:34 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@8782 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/css_styled_content/doc/manual.sxw
typo3/sysext/css_styled_content/static/constants.txt
typo3/sysext/css_styled_content/static/setup.txt

index 865eeb8..a258df6 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-09-13  Susanne Moog  <typo3@susanne-moog.de>
+
+       * Added feature #15689: Allow easy use of lightbox style image enlargement in the frontend
+
 2010-09-13  Ernesto Baschny <ernst@cron-it.de>
 
        * Fixed bug #15685: Enhancement of t3lib_div::testInt (#15020) introduced a different behaviour. This restores original behaviour. (Thanks to Helmut Hummel)
index 3b258ed..a347806 100644 (file)
@@ -3217,10 +3217,16 @@ class tslib_cObj {
 
                                $params .= '&md5=' . $md5_value . '&contentHash=' . $contentHash;
                                $url = $GLOBALS['TSFE']->absRefPrefix.'index.php?eID=tx_cms_showpic&file='.rawurlencode($imageFile).$params;
-                               if ($conf['JSwindow.']['altUrl'] || $conf['JSwindow.']['altUrl.'])      {
-                                       $altUrl = $this->stdWrap($conf['JSwindow.']['altUrl'], $conf['JSwindow.']['altUrl.']);
-                                       if ($altUrl)    {
-                                               $url = $altUrl . ($conf['JSwindow.']['altUrl_noDefaultParams'] ? '' : '?file='.rawurlencode($imageFile).$params);
+                               
+                               if ($conf['directImageLink']) {
+                                       $imgResourceConf = array(
+                                               'file' => $imageFile,
+                                               'file.' => $conf
+                                       );
+                                       $url = $this->IMG_RESOURCE($imgResourceConf);
+                                       if (!$url) {
+                                                       // if no imagemagick / gm is available
+                                               $url = $imageFile;
                                        }
                                }
 
@@ -3234,8 +3240,14 @@ class tslib_cObj {
                                } else {
                                        $target = '';
                                }
-
-                               if ($conf['JSwindow'])  {
+                               $conf['JSwindow'] = $this->stdWrap($conf['JSwindow'], $conf['JSwindow.']);
+                               if ($conf['JSwindow']) {
+                                       if ($conf['JSwindow.']['altUrl'] || $conf['JSwindow.']['altUrl.']) {
+                                               $altUrl = $this->stdWrap($conf['JSwindow.']['altUrl'], $conf['JSwindow.']['altUrl.']);
+                                               if ($altUrl)    {
+                                                       $url = $altUrl . ($conf['JSwindow.']['altUrl_noDefaultParams'] ? '' : '?file='.rawurlencode($imageFile).$params);
+                                               }
+                                       }
                                        $gifCreator = t3lib_div::makeInstance('tslib_gifbuilder');
                                        $gifCreator->init();
                                        $gifCreator->mayScaleUp = 0;
@@ -3248,8 +3260,8 @@ class tslib_cObj {
                                        $a2='</a>';
                                        $GLOBALS['TSFE']->setJS('openPic');
                                } else {
-                                       $a1='<a href="'.htmlspecialchars($url).'"'.$target.$GLOBALS['TSFE']->ATagParams.'>';
-                                       $a2='</a>';
+                                       $conf['linkParams.']['parameter'] = $url;
+                                       $string = $this->typoLink($string, $conf['linkParams.']);
                                }
 
                                $string = $this->stdWrap($string,$conf['stdWrap.']);
index 434878c..9d948f2 100755 (executable)
Binary files a/typo3/sysext/css_styled_content/doc/manual.sxw and b/typo3/sysext/css_styled_content/doc/manual.sxw differ
index 20250da..41c2f71 100644 (file)
@@ -39,9 +39,14 @@ styles.content.imgtext {
   linkWrap.width = 800m
   linkWrap.height = 600m
   linkWrap.effects =
-
-    # cat=content/cImage/x; type=boolean; label= Advanced, New window: If set, every click-enlarged image will open in it's own popup window and not the current popup window (which may have a wrong size for the image to fit in)
+    # cat=content/cImage/c2; type=boolean; label= Advanced, New window: If set, every click-enlarged image will open in it's own popup window and not the current popup window (which may have a wrong size for the image to fit in)
   linkWrap.newWindow = 0
+    # cat=content/cImage/c3; type=boolean; label= Lightbox click-enlarge rendering: Whether images with click-enlarge checked should be rendered lightbox-compliant
+  linkWrap.lightboxEnabled = 0
+    # cat=content/cImage/c4; type=string; label= Lightbox CSS class: Which CSS class to use for lightbox links (only applicable if lightbox rendering is enabled)
+  linkWrap.lightboxCssClass = lightbox
+    # cat=content/cImage/c5; type=string; label= Lightbox rel="" attribute: Which rel="" attribute to use for lightbox links (only applicable if lightbox rendering is enabled)
+  linkWrap.lightboxRelAttribute = lightbox[{field:uid}]
 
   captionSplit = 0
     # cat=content/cImage/e1; type=boolean; label= Images, text split: If this is checked, then the image text (caption, alt, title, longdesc) will be split by each line and they will appear on the corresponding images in the imagelist.
@@ -72,7 +77,7 @@ styles.content.imgtext {
   borderClass = csc-textpic-border  
     # cat=content/cImage/i5; type=boolean; label= Image row separation: Whether images should be rendered/wrapped in separated rows, e.g. inside a DIV.csc-textpic-imagerow element
   separateRows = 1
-    # cat=content/cImage/i5; type=boolean; label= Add clearer after intext images: Whether a clearer should be added after textpic elements of type intext-left or intext-right
+    # cat=content/cImage/i6; type=boolean; label= Add clearer after intext images: Whether a clearer should be added after textpic elements of type intext-left or intext-right
   addIntextClearer = 1
 }
 
index d4a81a4..9e542e1 100644 (file)
@@ -492,6 +492,9 @@ tt_content.image.20 {
 
                        JSwindow = 1
                        JSwindow.newWindow = {$styles.content.imgtext.linkWrap.newWindow}
+                       JSwindow.if.isFalse = {$styles.content.imgtext.linkWrap.lightboxEnabled}
+
+                       directImageLink = {$styles.content.imgtext.linkWrap.lightboxEnabled}
 
                        enable.field = image_zoom
                        enable.ifEmpty.typolink.parameter.field = image_link
@@ -502,6 +505,8 @@ tt_content.image.20 {
                        typolink.parameter.listNum.stdWrap.data = register : IMAGE_NUM_CURRENT
                        typolink.target = {$styles.content.links.target}
                        typolink.extTarget = {$styles.content.links.extTarget}
+                       
+                       linkParams.ATagParams.dataWrap =  class="{$styles.content.imgtext.linkWrap.lightboxCssClass}" rel="{$styles.content.imgtext.linkWrap.lightboxRelAttribute}"
                }
 
                altText = TEXT
@@ -720,8 +725,6 @@ tt_content.image.20 {
        stdWrap.prefixComment = 2 | Image block:
 }
 
-
-
 # *****************
 # CType: textpic
 # *****************