* Added possibility to copy database/file elements attached to records; You can now...
authorKasper Skårhøj <kasper@typo3.org>
Mon, 19 Apr 2004 10:37:06 +0000 (10:37 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Mon, 19 Apr 2004 10:37:06 +0000 (10:37 +0000)
* Fixed some other bugs around.

git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@203 709f56b5-9817-0410-a4d7-c38de5d9e867

12 files changed:
ChangeLog
TODO.txt
t3lib/class.t3lib_clipboard.php
t3lib/class.t3lib_tceforms.php
typo3/alt_clickmenu.php
typo3/alt_doc.php
typo3/stylesheet.css
typo3/sysext/cms/layout/class.tx_cms_layout.php
typo3/sysext/cms/layout/db_layout.php
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/cms/tslib/class.tslib_pibase.php
typo3/template.php

index 3e4430b..c23e7ff 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2004-04-19  Kasper Skårhøj,,,  <kasper@typo3.com>
+
+       * Added possibility to copy database/file elements attached to records; You can now click the icon of these elements in the editing forms and get a (limited) context menu for these elements.
+       * Fixed some other bugs around.
+
+2004-04-16  Kasper Skårhøj,,,  <kasper@typo3.com>
+
+       * fixed detection of schemes (http://, ftp:// etc) in "typolinks". Now email addresses are detected only if NOT prepended with a scheme. Also the presence of a scheme will make typolink function detect the input as a plain URL which should just be passed through untouched.
+
 2004-04-14  Kasper Skårhøj,,,  <kasper@typo3.com>
 
        * Mount Points (Mount pages) reworking:
index 485c584..a2bcfdc 100755 (executable)
--- a/TODO.txt
+++ b/TODO.txt
@@ -884,6 +884,15 @@ BACKEND TOOLS:
 - Global search and replace of records (Rene F?)
 - Export the complete typo3 site/database, in a big file like mycompletesite.t3d
 
+Repeated intervals extension:
+- Cron-job which alters the start/end times according to some schedule.
+- Configurable for any element of course
+
+New-Wizard:
+- An extension offering people to configure a wizard for creation of records. For instance you can configure to create a content element in three steps: First select type and header, then according to first choice, select more. Each screen has custom text/images/examples. Eventually the record is created. After creation there might be more options to set. In the end the wizard might fire up another application (like TemplaVoila) or a wizard or such.
+- Could be useful for: TemplaVoila Template Objects, Content Elements (like tables/forms/plugins), Pages of sorts.
+- Configuration could be in XML (since it needs a hierarchy)
+
 
 **************************************
 APPENDIX: PATTERN-control
index 2a16627..390d244 100755 (executable)
@@ -373,11 +373,11 @@ class t3lib_clipboard {
 
                                        if ($table=='_FILE')    {       // Rendering files/directories on the clipboard:
                                                if (@file_exists($v) && t3lib_div::isAllowedAbsPath($v))        {
-                                                       $fI=pathinfo($v);
+                                                       $fI = pathinfo($v);
                                                        $icon = is_dir($v) ? 'folder.gif' : t3lib_BEfunc::getFileIcon(strtolower($fI['extension']));
-                                                       $size=' ('.t3lib_div::formatSize(filesize($v)).'bytes)';
+                                                       $size = ' ('.t3lib_div::formatSize(filesize($v)).'bytes)';
                                                        $icon = '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/fileicons/'.$icon,'width="18" height="16"').' border="0" hspace="20" class="absmiddle" title="'.htmlspecialchars($fI['basename'].$size).'" alt="" />';
-                                                       $thumb= $this->clipData['_setThumb'] ? (t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],$fI['extension']) ? t3lib_BEfunc::getThumbNail($this->backPath.'thumbs.php',$v,' vspace="4"') : '') :'';
+                                                       $thumb = $this->clipData['_setThumb'] ? (t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],$fI['extension']) ? t3lib_BEfunc::getThumbNail($this->backPath.'thumbs.php',$v,' vspace="4"') : '') :'';
 
                                                        $lines[]='
                                                                <tr>
index e002297..04faff0 100755 (executable)
  *
  *
  *
- *  174: class t3lib_TCEforms
- *  272:     function t3lib_TCEforms()
- *  304:     function initDefaultBEmode()
+ *  175: class t3lib_TCEforms
+ *  274:     function t3lib_TCEforms()
+ *  306:     function initDefaultBEmode()
  *
  *              SECTION: Rendering the forms, fields etc
- *  349:     function getSoloField($table,$row,$theFieldToReturn)
- *  388:     function getMainFields($table,$row,$depth=0)
- *  515:     function getListedFields($table,$row,$list)
- *  556:     function getPaletteFields($table,$row,$palette,$header='',$itemList='',$collapsedHeader='')
- *  632:     function getSingleField($table,$field,$row,$altName='',$palette=0,$extra='',$pal=0)
- *  760:     function getSingleField_SW($table,$field,$row,&$PA)
+ *  351:     function getSoloField($table,$row,$theFieldToReturn)
+ *  390:     function getMainFields($table,$row,$depth=0)
+ *  517:     function getListedFields($table,$row,$list)
+ *  558:     function getPaletteFields($table,$row,$palette,$header='',$itemList='',$collapsedHeader='')
+ *  634:     function getSingleField($table,$field,$row,$altName='',$palette=0,$extra='',$pal=0)
+ *  762:     function getSingleField_SW($table,$field,$row,&$PA)
  *
  *              SECTION: Rendering of each TCEform field type
- *  831:     function getSingleField_typeInput($table,$field,$row,&$PA)
- *  883:     function getSingleField_typeText($table,$field,$row,&$PA)
- *  982:     function getSingleField_typeCheck($table,$field,$row,&$PA)
- * 1041:     function getSingleField_typeRadio($table,$field,$row,&$PA)
- * 1071:     function getSingleField_typeSelect($table,$field,$row,&$PA)
- * 1233:     function getSingleField_typeGroup($table,$field,$row,&$PA)
- * 1379:     function getSingleField_typeNone($table,$field,$row,&$PA)
- * 1395:     function getSingleField_typeNone_render($config,$itemValue)
- * 1452:     function getSingleField_typeFlex($table,$field,$row,&$PA)
- * 1553:     function getSingleField_typeFlex_langMenu($languages,$elName,$selectedLanguage,$multi=1)
- * 1572:     function getSingleField_typeFlex_sheetMenu($sArr,$elName,$sheetKey)
- * 1602:     function getSingleField_typeFlex_draw($dataStruct,$editData,$cmdData,$table,$field,$row,&$PA,$formPrefix='',$level=0,$tRows=array())
- * 1754:     function getSingleField_typeUnknown($table,$field,$row,&$PA)
- * 1769:     function getSingleField_typeUser($table,$field,$row,&$PA)
+ *  833:     function getSingleField_typeInput($table,$field,$row,&$PA)
+ *  885:     function getSingleField_typeText($table,$field,$row,&$PA)
+ *  984:     function getSingleField_typeCheck($table,$field,$row,&$PA)
+ * 1043:     function getSingleField_typeRadio($table,$field,$row,&$PA)
+ * 1073:     function getSingleField_typeSelect($table,$field,$row,&$PA)
+ * 1235:     function getSingleField_typeGroup($table,$field,$row,&$PA)
+ * 1389:     function getSingleField_typeNone($table,$field,$row,&$PA)
+ * 1405:     function getSingleField_typeNone_render($config,$itemValue)
+ * 1462:     function getSingleField_typeFlex($table,$field,$row,&$PA)
+ * 1563:     function getSingleField_typeFlex_langMenu($languages,$elName,$selectedLanguage,$multi=1)
+ * 1582:     function getSingleField_typeFlex_sheetMenu($sArr,$elName,$sheetKey)
+ * 1612:     function getSingleField_typeFlex_draw($dataStruct,$editData,$cmdData,$table,$field,$row,&$PA,$formPrefix='',$level=0,$tRows=array())
+ * 1764:     function getSingleField_typeUnknown($table,$field,$row,&$PA)
+ * 1779:     function getSingleField_typeUser($table,$field,$row,&$PA)
  *
  *              SECTION: "Configuration" fetching/processing functions
- * 1803:     function getRTypeNum($table,$row)
- * 1829:     function rearrange($fields)
- * 1855:     function getExcludeElements($table,$row,$typeNum)
- * 1903:     function getFieldsToAdd($table,$row,$typeNum)
- * 1928:     function mergeFieldsWithAddedFields($fields,$fieldsToAdd)
- * 1960:     function setTSconfig($table,$row,$field='')
- * 1982:     function getSpecConfForField($table,$row,$field)
- * 2003:     function getSpecConfFromString($extraString, $defaultExtras)
+ * 1813:     function getRTypeNum($table,$row)
+ * 1839:     function rearrange($fields)
+ * 1865:     function getExcludeElements($table,$row,$typeNum)
+ * 1913:     function getFieldsToAdd($table,$row,$typeNum)
+ * 1938:     function mergeFieldsWithAddedFields($fields,$fieldsToAdd)
+ * 1970:     function setTSconfig($table,$row,$field='')
+ * 1992:     function getSpecConfForField($table,$row,$field)
+ * 2013:     function getSpecConfFromString($extraString, $defaultExtras)
  *
  *              SECTION: Form element helper functions
- * 2035:     function dbFileIcons($fName,$mode,$allowed,$itemArray,$selector='',$params=array(),$onFocus='')
- * 2167:     function getClipboardElements($allowed,$mode)
- * 2218:     function renderWizards($itemKinds,$wizConf,$table,$row,$field,&$PA,$itemName,$specConf,$RTE=0)
- * 2388:     function getIcon($icon)
- * 2419:     function wrapOpenPalette($header,$table,$row,$palette,$retFunc=0)
- * 2443:     function checkBoxParams($itemName,$thisValue,$c,$iCount,$addFunc='')
- * 2457:     function elName($itemName)
- * 2468:     function noTitle($str,$wrapParts=array())
- * 2477:     function blur()
- * 2486:     function thisReturnUrl()
- * 2499:     function getSingleHiddenField($table,$field,$row)
- * 2521:     function formWidth($size=48,$textarea=0)
- * 2543:     function formWidthText($size=48,$wrap='')
- * 2558:     function formElStyle($type)
- * 2576:     function insertDefStyle($type)
+ * 2045:     function dbFileIcons($fName,$mode,$allowed,$itemArray,$selector='',$params=array(),$onFocus='')
+ * 2177:     function getClipboardElements($allowed,$mode)
+ * 2226:     function getClickMenu($str,$table,$uid='')
+ * 2247:     function renderWizards($itemKinds,$wizConf,$table,$row,$field,&$PA,$itemName,$specConf,$RTE=0)
+ * 2417:     function getIcon($icon)
+ * 2448:     function wrapOpenPalette($header,$table,$row,$palette,$retFunc=0)
+ * 2472:     function checkBoxParams($itemName,$thisValue,$c,$iCount,$addFunc='')
+ * 2486:     function elName($itemName)
+ * 2497:     function noTitle($str,$wrapParts=array())
+ * 2506:     function blur()
+ * 2515:     function thisReturnUrl()
+ * 2528:     function getSingleHiddenField($table,$field,$row)
+ * 2550:     function formWidth($size=48,$textarea=0)
+ * 2572:     function formWidthText($size=48,$wrap='')
+ * 2587:     function formElStyle($type)
+ * 2605:     function insertDefStyle($type)
  *
  *              SECTION: Item-array manipulation functions (check/select/radio)
- * 2607:     function initItemArray($fieldValue)
- * 2625:     function addItems($items,$iArray)
- * 2647:     function procItems($items,$iArray,$config,$table,$row,$field)
- * 2671:     function addSelectOptionsToItemArray($items,$fieldValue,$TSconfig,$field)
- * 2749:     function addSelectOptionsToItemArray_makeModuleData($value)
- * 2771:     function foreignTable($items,$fieldValue,$TSconfig,$field,$pFFlag=0)
+ * 2636:     function initItemArray($fieldValue)
+ * 2654:     function addItems($items,$iArray)
+ * 2676:     function procItems($items,$iArray,$config,$table,$row,$field)
+ * 2700:     function addSelectOptionsToItemArray($items,$fieldValue,$TSconfig,$field)
+ * 2778:     function addSelectOptionsToItemArray_makeModuleData($value)
+ * 2800:     function foreignTable($items,$fieldValue,$TSconfig,$field,$pFFlag=0)
  *
  *              SECTION: Template functions
- * 2848:     function setFancyDesign()
- * 2875:     function setNewBEDesign()
- * 2929:     function intoTemplate($inArr,$altTemplate='')
- * 2953:     function addUserTemplateMarkers($marker,$table,$field,$row,&$PA)
- * 2964:     function wrapLabels($str)
- * 2977:     function wrapTotal($c,$rec,$table)
- * 2990:     function replaceTableWrap($arr,$rec,$table)
- * 3012:     function wrapBorder(&$out_array,&$out_pointer)
- * 3033:     function rplColorScheme($inTemplate)
- * 3046:     function getDivider()
- * 3056:     function printPalette($palArr)
- * 3098:     function helpTextIcon($table,$field,$force=0)
- * 3114:     function helpText($table,$field)
- * 3136:     function setColorScheme($scheme)
- * 3150:     function resetSchemes()
- * 3161:     function storeSchemes()
- * 3172:     function restoreSchemes()
+ * 2877:     function setFancyDesign()
+ * 2904:     function setNewBEDesign()
+ * 2958:     function intoTemplate($inArr,$altTemplate='')
+ * 2982:     function addUserTemplateMarkers($marker,$table,$field,$row,&$PA)
+ * 2993:     function wrapLabels($str)
+ * 3006:     function wrapTotal($c,$rec,$table)
+ * 3019:     function replaceTableWrap($arr,$rec,$table)
+ * 3041:     function wrapBorder(&$out_array,&$out_pointer)
+ * 3062:     function rplColorScheme($inTemplate)
+ * 3075:     function getDivider()
+ * 3085:     function printPalette($palArr)
+ * 3127:     function helpTextIcon($table,$field,$force=0)
+ * 3143:     function helpText($table,$field)
+ * 3165:     function setColorScheme($scheme)
+ * 3179:     function resetSchemes()
+ * 3190:     function storeSchemes()
+ * 3201:     function restoreSchemes()
  *
  *              SECTION: JavaScript related functions
- * 3201:     function JStop()
- * 3252:     function JSbottom($formname='forms[0]')
- * 3563:     function dbFileCon($formObj='document.forms[0]')
- * 3671:     function printNeededJSFunctions()
- * 3698:     function printNeededJSFunctions_top()
+ * 3230:     function JStop()
+ * 3281:     function JSbottom($formname='forms[0]')
+ * 3592:     function dbFileCon($formObj='document.forms[0]')
+ * 3700:     function printNeededJSFunctions()
+ * 3727:     function printNeededJSFunctions_top()
  *
  *              SECTION: Various helper functions
- * 3746:     function getDefaultRecord($table,$pid=0)
- * 3785:     function getRecordPath($table,$rec)
- * 3798:     function readPerms()
- * 3812:     function sL($str)
- * 3825:     function getLL($str)
- * 3843:     function isPalettesCollapsed($table,$palette)
- * 3858:     function isDisplayCondition($displayCond,$row)
- * 3911:     function getTSCpid($table,$uid,$pid)
- * 3925:     function doLoadTableDescr($table)
- * 3937:     function getAvailableLanguages($onlyIsoCoded=1,$setDefault=1)
+ * 3775:     function getDefaultRecord($table,$pid=0)
+ * 3814:     function getRecordPath($table,$rec)
+ * 3827:     function readPerms()
+ * 3841:     function sL($str)
+ * 3854:     function getLL($str)
+ * 3872:     function isPalettesCollapsed($table,$palette)
+ * 3887:     function isDisplayCondition($displayCond,$row)
+ * 3940:     function getTSCpid($table,$uid,$pid)
+ * 3954:     function doLoadTableDescr($table)
+ * 3966:     function getAvailableLanguages($onlyIsoCoded=1,$setDefault=1)
  *
  *
- * 3979: class t3lib_TCEforms_FE extends t3lib_TCEforms
- * 3987:     function wrapLabels($str)
- * 3997:     function printPalette($palArr)
+ * 4008: class t3lib_TCEforms_FE extends t3lib_TCEforms
+ * 4016:     function wrapLabels($str)
+ * 4026:     function printPalette($palArr)
  *
- * TOTAL FUNCTIONS: 85
+ * TOTAL FUNCTIONS: 86
  * (This index is automatically created/updated by the extension "extdeveval")
  *
  */
@@ -203,6 +204,7 @@ class t3lib_TCEforms        {
        var $fieldOrder='';                                     // Overrule the field order set in TCA[types][showitem], eg for tt_content this value, 'bodytext,image', would make first the 'bodytext' field, then the 'image' field (if set for display)... and then the rest in the old order.
        var $doPrintPalette=1;                          // If set to false, palettes will NEVER be rendered.
        var $clipObj=FALSE;                                     // Set to initialized clipboard object; Then the element browser will offer a link to paste in records from clipboard.
+       var $enableClickMenu=FALSE;                     // Enable click menu on reference icons.
 
        var $form_rowsToStylewidth = 9.58;      // Form field width compensation: Factor from NN4 form field widths to style-aware browsers (like NN6+ and MSIE, with the $CLIENT[FORMSTYLE] value set)
        var $form_largeComp = 1.33;                     // Form field width compensation: Compensation for large documents, doc-tab (editing)
@@ -1190,7 +1192,7 @@ class t3lib_TCEforms      {
                                // Put together the select form with selected elements:
                        $selector_itemListStyle = isset($config['itemListStyle']) ? ' style="'.htmlspecialchars($config['itemListStyle']).'"' : ' style="'.$this->defaultMultipleSelectorStyle.'"';
                        $size = $config['autoSizeMax'] ? t3lib_div::intInRange(count($itemArray)+1,t3lib_div::intInRange($size,1),$config['autoSizeMax']) : $size;
-                       $thumbnails='<select name="'.$PA['itemFormElName'].'_sel"'.$this->insertDefStyle('select').($size?' size="'.$size.'"':'').' onchange="'.htmlspecialchars($sOnChange).'"'.$PA['onFocus'].$selector_itemListStyle.'>';
+                       $thumbnails = '<select name="'.$PA['itemFormElName'].'_sel"'.$this->insertDefStyle('select').($size?' size="'.$size.'"':'').' onchange="'.htmlspecialchars($sOnChange).'"'.$PA['onFocus'].$selector_itemListStyle.'>';
                        foreach($selItems as $p)        {
                                $thumbnails.= '<option value="'.htmlspecialchars($p[1]).'">'.htmlspecialchars($p[0]).'</option>';
                        }
@@ -1246,117 +1248,125 @@ class t3lib_TCEforms  {
                $this->requiredElements[$PA['itemFormElName']] = array($minitems,$maxitems,'imgName'=>$table.'_'.$row['uid'].'_'.$field);
                $info='';
 
-                       // If the element is of the internal type "file":
-               if ($config['internal_type']=='file')   {
+                       // Acting according to either "file" or "db" type:
+               switch((string)$config['internal_type'])        {
+                       case 'file':    // If the element is of the internal type "file":
 
-                               // Creating string showing allowed types:
-                       $tempFT = t3lib_div::trimExplode(',',$allowed,1);
-                       reset($tempFT);
-                       if (!count($tempFT))    {$info.='*';}
-                       while(list(,$ext)=each($tempFT))        {
-                               if ($ext)       {
-                                       $info.=strtoupper($ext).' ';
+                                       // Creating string showing allowed types:
+                               $tempFT = t3lib_div::trimExplode(',',$allowed,1);
+                               if (!count($tempFT))    {$info.='*';}
+                               foreach($tempFT as $ext)        {
+                                       if ($ext)       {
+                                               $info.=strtoupper($ext).' ';
+                                       }
                                }
-                       }
-                               // Creating string, showing disallowed types:
-                       $tempFT_dis = t3lib_div::trimExplode(',',$disallowed,1);
-                       reset($tempFT_dis);
-                       if (count($tempFT_dis)) {$info.='<br />';}
-                       while(list(,$ext)=each($tempFT_dis))    {
-                               if ($ext)       {
-                                       $info.='-'.strtoupper($ext).' ';
+                                       // Creating string, showing disallowed types:
+                               $tempFT_dis = t3lib_div::trimExplode(',',$disallowed,1);
+                               if (count($tempFT_dis)) {$info.='<br />';}
+                               foreach($tempFT_dis as $ext)    {
+                                       if ($ext)       {
+                                               $info.='-'.strtoupper($ext).' ';
+                                       }
                                }
-                       }
 
-                               // Making the array of file items:
-                       $itemArray=t3lib_div::trimExplode(',',$PA['itemFormElValue'],1);
+                                       // Making the array of file items:
+                               $itemArray = t3lib_div::trimExplode(',',$PA['itemFormElValue'],1);
 
-                               // Showing thumbnails:
-                       $thumbsnail='';
-                       if ($show_thumbs)       {
-                               reset($itemArray);
-                               $imgs=array();
-                               while(list(,$imgRead)=each($itemArray)) {
-                                       $imgP = explode('|',$imgRead);
-
-                                       $rowCopy=array();
-                                       $rowCopy[$field] = $imgP[0];
-                                       $imgs[]= '<span class="nobr">'.t3lib_BEfunc::thumbCode($rowCopy,$table,$field,$this->backPath,'thumbs.php',$config['uploadfolder'],0,' align="middle"').$imgP[0].'</span>';
-                               }
-                               $thumbsnail = implode('<br />',$imgs);
-                       }
+                                       // Showing thumbnails:
+                               $thumbsnail = '';
+                               if ($show_thumbs)       {
+                                       $imgs = array();
+                                       foreach($itemArray as $imgRead) {
+                                               $imgP = explode('|',$imgRead);
 
-                               // Creating the element:
-                       $params=array(
-                               'size' => $size,
-                               'dontShowMoveIcons' => ($maxitems<=1),
-                               'autoSizeMax' => t3lib_div::intInRange($config['autoSizeMax'],0),
-                               'maxitems' => $maxitems,
-                               'style' => isset($config['selectedListStyle']) ? ' style="'.htmlspecialchars($config['selectedListStyle']).'"' : ' style="'.$this->defaultMultipleSelectorStyle.'"',
-                               'info' => $info,
-                               'thumbnails' => $thumbsnail
-                       );
-                       $item.= $this->dbFileIcons($PA['itemFormElName'],'file',implode(',',$tempFT),$itemArray,'',$params,$PA['onFocus']);
+                                               $rowCopy = array();
+                                               $rowCopy[$field] = $imgP[0];
 
-                               // Adding the upload field:
-                       if ($this->edit_docModuleUpload)        $item.='<input type="file" name="'.$PA['itemFormElName_file'].'"'.$this->formWidth().' size="60" />';
-               }
+                                                       // Icon + clickmenu:
+                                               $absFilePath = t3lib_div::getFileAbsFileName($config['uploadfolder'].'/'.$imgP[0]);
 
-                       // If the element is of the internal type "db":
-               if ($config['internal_type']=='db')     {
+                                               $fI = pathinfo($imgP[0]);
+                                               $fileIcon = t3lib_BEfunc::getFileIcon(strtolower($fI['extension']));
+                                               $fileIcon = '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/fileicons/'.$fileIcon,'width="18" height="16"').' class="absmiddle" title="'.htmlspecialchars($fI['basename'].($absFilePath ? ' ('.t3lib_div::formatSize(filesize($absFilePath)).'bytes)' : ' - FILE NOT FOUND!')).'" alt="" />';
 
-                               // Creating string showing allowed types:
-                       $tempFT = t3lib_div::trimExplode(',',$allowed,1);
-                       if (!strcmp(trim($tempFT[0]),'*'))      {
-                               $info.='<span class="nobr">&nbsp;&nbsp;&nbsp;&nbsp;'.
-                                               htmlspecialchars($this->getLL('l_allTables')).
-                                               '</span><br />';
-                       } else {
-                               while(list(,$theT)=each($tempFT))       {
-                                       if ($theT)      {
-                                               $info.='<span class="nobr">&nbsp;&nbsp;&nbsp;&nbsp;'.
-                                                               t3lib_iconWorks::getIconImage($theT,array(),$this->backPath,'align="top"').
-                                                               htmlspecialchars($this->sL($GLOBALS['TCA'][$theT]['ctrl']['title'])).
-                                                               '</span><br />';
+                                               $imgs[] = '<span class="nobr">'.t3lib_BEfunc::thumbCode($rowCopy,$table,$field,$this->backPath,'thumbs.php',$config['uploadfolder'],0,' align="middle"').
+                                                                       ($absFilePath ? $this->getClickMenu($fileIcon, $absFilePath) : $fileIcon).
+                                                                       $imgP[0].
+                                                                       '</span>';
                                        }
+                                       $thumbsnail = implode('<br />',$imgs);
                                }
-                       }
 
-                       $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
-                       $itemArray=array();
-                       $imgs=array();
+                                       // Creating the element:
+                               $params = array(
+                                       'size' => $size,
+                                       'dontShowMoveIcons' => ($maxitems<=1),
+                                       'autoSizeMax' => t3lib_div::intInRange($config['autoSizeMax'],0),
+                                       'maxitems' => $maxitems,
+                                       'style' => isset($config['selectedListStyle']) ? ' style="'.htmlspecialchars($config['selectedListStyle']).'"' : ' style="'.$this->defaultMultipleSelectorStyle.'"',
+                                       'info' => $info,
+                                       'thumbnails' => $thumbsnail
+                               );
+                               $item.= $this->dbFileIcons($PA['itemFormElName'],'file',implode(',',$tempFT),$itemArray,'',$params,$PA['onFocus']);
+
+                                       // Adding the upload field:
+                               if ($this->edit_docModuleUpload)        $item.='<input type="file" name="'.$PA['itemFormElName_file'].'"'.$this->formWidth().' size="60" />';
+                       break;
+                       case 'db':      // If the element is of the internal type "db":
+
+                                       // Creating string showing allowed types:
+                               $tempFT = t3lib_div::trimExplode(',',$allowed,1);
+                               if (!strcmp(trim($tempFT[0]),'*'))      {
+                                       $info.='<span class="nobr">&nbsp;&nbsp;&nbsp;&nbsp;'.
+                                                       htmlspecialchars($this->getLL('l_allTables')).
+                                                       '</span><br />';
+                               } else {
+                                       while(list(,$theT)=each($tempFT))       {
+                                               if ($theT)      {
+                                                       $info.='<span class="nobr">&nbsp;&nbsp;&nbsp;&nbsp;'.
+                                                                       t3lib_iconWorks::getIconImage($theT,array(),$this->backPath,'align="top"').
+                                                                       htmlspecialchars($this->sL($GLOBALS['TCA'][$theT]['ctrl']['title'])).
+                                                                       '</span><br />';
+                                               }
+                                       }
+                               }
 
-                               // Thumbnails:
-                       $temp_itemArray = t3lib_div::trimExplode(',',$PA['itemFormElValue'],1);
-                       foreach($temp_itemArray as $dbRead)     {
-                               $recordParts = explode('|',$dbRead);
-                               list($this_table,$this_uid) = t3lib_BEfunc::splitTable_Uid($recordParts[0]);
-                               $itemArray[] = array('table'=>$this_table, 'id'=>$this_uid);
+                               $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
+                               $itemArray = array();
+                               $imgs = array();
+
+                                       // Thumbnails:
+                               $temp_itemArray = t3lib_div::trimExplode(',',$PA['itemFormElValue'],1);
+                               foreach($temp_itemArray as $dbRead)     {
+                                       $recordParts = explode('|',$dbRead);
+                                       list($this_table,$this_uid) = t3lib_BEfunc::splitTable_Uid($recordParts[0]);
+                                       $itemArray[] = array('table'=>$this_table, 'id'=>$this_uid);
+                                       if ($show_thumbs)       {
+                                               $rr = t3lib_BEfunc::getRecord($this_table,$this_uid);
+                                               $imgs[] = '<span class="nobr">'.
+                                                               $this->getClickMenu(t3lib_iconWorks::getIconImage($this_table,$rr,$this->backPath,'align="top" title="'.htmlspecialchars(t3lib_BEfunc::getRecordPath($rr['pid'],$perms_clause,15)).'"'),$this_table, $this_uid).
+                                                               '&nbsp;'.
+                                                               $this->noTitle($rr[$GLOBALS['TCA'][$this_table]['ctrl']['label']],array('<em>','</em>')).
+                                                               '</span>';
+                                       }
+                               }
+                               $thumbsnail='';
                                if ($show_thumbs)       {
-                                       $rr = t3lib_BEfunc::getRecord($this_table,$this_uid);
-                                       $imgs[]='<span class="nobr">'.
-                                                       t3lib_iconWorks::getIconImage($this_table,$rr,$this->backPath,'align="top" title="'.htmlspecialchars(t3lib_BEfunc::getRecordPath($rr['pid'],$perms_clause,15)).'"').
-                                                       '&nbsp;'.
-                                                       $this->noTitle($rr[$GLOBALS['TCA'][$this_table]['ctrl']['label']],array('<em>','</em>')).
-                                                       '</span>';
+                                       $thumbsnail = implode('<br />',$imgs);
                                }
-                       }
-                       $thumbsnail='';
-                       if ($show_thumbs)       {
-                               $thumbsnail = implode('<br />',$imgs);
-                       }
 
-                               // Creating the element:
-                       $params=array(
-                               'size' => $size,
-                               'dontShowMoveIcons' => ($maxitems<=1),
-                               'autoSizeMax' => t3lib_div::intInRange($config['autoSizeMax'],0),
-                               'maxitems' => $maxitems,
-                               'style' => isset($config['selectedListStyle']) ? ' style="'.htmlspecialchars($config['selectedListStyle']).'"' : ' style="'.$this->defaultMultipleSelectorStyle.'"',
-                               'info' => $info,
-                               'thumbnails' => $thumbsnail
-                       );
-                       $item.= $this->dbFileIcons($PA['itemFormElName'],'db',implode(',',$tempFT),$itemArray,'',$params,$PA['onFocus']);
+                                       // Creating the element:
+                               $params = array(
+                                       'size' => $size,
+                                       'dontShowMoveIcons' => ($maxitems<=1),
+                                       'autoSizeMax' => t3lib_div::intInRange($config['autoSizeMax'],0),
+                                       'maxitems' => $maxitems,
+                                       'style' => isset($config['selectedListStyle']) ? ' style="'.htmlspecialchars($config['selectedListStyle']).'"' : ' style="'.$this->defaultMultipleSelectorStyle.'"',
+                                       'info' => $info,
+                                       'thumbnails' => $thumbsnail
+                               );
+                               $item.= $this->dbFileIcons($PA['itemFormElName'],'db',implode(',',$tempFT),$itemArray,'',$params,$PA['onFocus']);
+                       break;
                }
 
                        // Wizards:
@@ -2169,38 +2179,57 @@ class t3lib_TCEforms    {
                $output = array();
 
                if (is_object($this->clipObj))  {
-                       if ($mode=='file')      {
-                               $elFromTable = $this->clipObj->elFromTable('_FILE');
-                               $allowedExts = t3lib_div::trimExplode(',', $allowed, 1);
-
-                               if ($allowedExts)       {       // If there are a set of allowed extensions, filter the content:
-                                       foreach($elFromTable as $elValue)       {
-                                               $pI = pathinfo($elValue);
-                                               $ext = strtolower($pI['extension']);
-                                               if (in_array($ext, $allowedExts))       {
-                                                       $output[] = $elValue;
+                       switch($mode)   {
+                               case 'file':
+                                       $elFromTable = $this->clipObj->elFromTable('_FILE');
+                                       $allowedExts = t3lib_div::trimExplode(',', $allowed, 1);
+
+                                       if ($allowedExts)       {       // If there are a set of allowed extensions, filter the content:
+                                               foreach($elFromTable as $elValue)       {
+                                                       $pI = pathinfo($elValue);
+                                                       $ext = strtolower($pI['extension']);
+                                                       if (in_array($ext, $allowedExts))       {
+                                                               $output[] = $elValue;
+                                                       }
                                                }
+                                       } else {        // If all is allowed, insert all: (This does NOT respect any disallowed extensions, but those will be filtered away by the backend TCEmain)
+                                               $output = $elFromTable;
                                        }
-                               } else {        // If all is allowed, insert all: (This does NOT respect any disallowed extensions, but those will be filtered away by the backend TCEmain)
-                                       $output = $elFromTable;
-                               }
-                       } else {
-                               $allowedTables = t3lib_div::trimExplode(',', $allowed, 1);
-                               if (!strcmp(trim($allowedTables[0]),'*'))       {       // All tables allowed for relation:
-                                       $output = $this->clipObj->elFromTable('');
-                               } else {        // Only some tables, filter them:
-                                       foreach($allowedTables as $tablename)   {
-                                               $elFromTable = $this->clipObj->elFromTable($tablename);
-                                               $output = array_merge($output,$elFromTable);
+                               break;
+                               case 'db':
+                                       $allowedTables = t3lib_div::trimExplode(',', $allowed, 1);
+                                       if (!strcmp(trim($allowedTables[0]),'*'))       {       // All tables allowed for relation:
+                                               $output = $this->clipObj->elFromTable('');
+                                       } else {        // Only some tables, filter them:
+                                               foreach($allowedTables as $tablename)   {
+                                                       $elFromTable = $this->clipObj->elFromTable($tablename);
+                                                       $output = array_merge($output,$elFromTable);
+                                               }
                                        }
-                               }
-                               $output = array_keys($output);
+                                       $output = array_keys($output);
+                               break;
                        }
                }
 
                return $output;
        }
 
+       /**
+        * Wraps the icon of a relation item (database record or file) in a link opening the context menu for the item.
+        * Icons will be wrapped only if $this->enableClickMenu is set. This must be done only if a global SOBE object exists and if the necessary JavaScript for displaying the context menus has been added to the page header.
+        *
+        * @param       string          The icon HTML to wrap
+        * @param       string          Table name (eg. "pages" or "tt_content") OR the absolute path to the file
+        * @param       integer         The uid of the record OR if file, just blank value.
+        * @return      string          HTML
+        */
+       function getClickMenu($str,$table,$uid='')      {
+               if ($this->enableClickMenu)     {
+                       $onClick = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($str,$table,$uid,1,'','+copy,info,edit,view', TRUE);
+                       return '<a href="#" onclick="'.htmlspecialchars($onClick).'">'.$str.'</a>';
+               }
+       }
+
        /**
         * Rendering wizards for form fields.
         *
index 30faba0..e2d8f5b 100755 (executable)
  *
  *
  *
- *  123: class clickMenu
- *  155:     function init($item)
- *  198:     function doDisplayTopFrameCM()
+ *  125: class clickMenu
+ *  157:     function init($item)
+ *  200:     function doDisplayTopFrameCM()
  *
  *              SECTION: DATABASE
- *  226:     function printDBClickMenu($table,$uid)
- *  313:     function printNewDBLevel($table,$uid)
- *  350:     function externalProcessingOfDBMenuItems($menuItems)
- *  362:     function processingByExtClassArray($menuItems,$table,$uid)
- *  381:     function urlRefForCM($url,$retUrl='',$hideCM=1)
- *  398:     function DB_copycut($table,$uid,$type)
- *  421:     function DB_paste($table,$uid,$type,$elInfo)
- *  442:     function DB_info($table,$uid)
- *  458:     function DB_history($table,$uid)
- *  477:     function DB_perms($table,$uid,$rec)
- *  496:     function DB_db_list($table,$uid,$rec)
- *  515:     function DB_moveWizard($table,$uid,$rec)
- *  536:     function DB_newWizard($table,$uid,$rec)
- *  559:     function DB_editAccess($table,$uid)
- *  577:     function DB_editPageHeader($uid)
- *  595:     function DB_edit($table,$uid)
- *  637:     function DB_new($table,$uid)
- *  662:     function DB_hideUnhide($table,$rec,$hideField)
- *  686:     function DB_delete($table,$uid,$elInfo)
- *  707:     function DB_view($id,$anchor='')
+ *  228:     function printDBClickMenu($table,$uid)
+ *  315:     function printNewDBLevel($table,$uid)
+ *  352:     function externalProcessingOfDBMenuItems($menuItems)
+ *  364:     function processingByExtClassArray($menuItems,$table,$uid)
+ *  383:     function urlRefForCM($url,$retUrl='',$hideCM=1)
+ *  400:     function DB_copycut($table,$uid,$type)
+ *  429:     function DB_paste($table,$uid,$type,$elInfo)
+ *  450:     function DB_info($table,$uid)
+ *  466:     function DB_history($table,$uid)
+ *  485:     function DB_perms($table,$uid,$rec)
+ *  504:     function DB_db_list($table,$uid,$rec)
+ *  523:     function DB_moveWizard($table,$uid,$rec)
+ *  544:     function DB_newWizard($table,$uid,$rec)
+ *  567:     function DB_editAccess($table,$uid)
+ *  585:     function DB_editPageHeader($uid)
+ *  603:     function DB_edit($table,$uid)
+ *  645:     function DB_new($table,$uid)
+ *  670:     function DB_hideUnhide($table,$rec,$hideField)
+ *  694:     function DB_delete($table,$uid,$elInfo)
+ *  715:     function DB_view($id,$anchor='')
  *
  *              SECTION: FILE
- *  736:     function printFileClickMenu($path)
- *  800:     function externalProcessingOfFileMenuItems($menuItems)
- *  814:     function FILE_launch($path,$script,$type,$image)
- *  833:     function FILE_copycut($path,$type)
- *  853:     function FILE_delete($path)
- *  875:     function FILE_paste($path,$target,$elInfo)
+ *  744:     function printFileClickMenu($path)
+ *  808:     function externalProcessingOfFileMenuItems($menuItems)
+ *  822:     function FILE_launch($path,$script,$type,$image)
+ *  841:     function FILE_copycut($path,$type)
+ *  867:     function FILE_delete($path)
+ *  889:     function FILE_paste($path,$target,$elInfo)
  *
  *              SECTION: COMMON
- *  915:     function printItems($menuItems,$item)
- *  960:     function printLayerJScode($menuItems)
- *  998:     function wrapColorTableCM($str)
- * 1021:     function menuItemsForTopFrame($menuItems)
- * 1038:     function menuItemsForClickMenu($menuItems)
- * 1073:     function linkItem($str,$icon,$onClick,$onlyCM=0,$dontHide=0)
- * 1097:     function excludeIcon($iconCode)
- * 1107:     function label($label)
- * 1116:     function isCMlayers()
- * 1126:     function frameLocation($str)
+ *  929:     function printItems($menuItems,$item)
+ *  981:     function printLayerJScode($menuItems)
+ * 1019:     function wrapColorTableCM($str)
+ * 1042:     function menuItemsForTopFrame($menuItems)
+ * 1059:     function menuItemsForClickMenu($menuItems)
+ * 1094:     function linkItem($str,$icon,$onClick,$onlyCM=0,$dontHide=0)
+ * 1118:     function excludeIcon($iconCode)
+ * 1128:     function enableDisableItems($menuItems)
+ * 1166:     function cleanUpSpacers($menuItems)
+ * 1208:     function label($label)
+ * 1217:     function isCMlayers()
+ * 1227:     function frameLocation($str)
  *
  *
- * 1151: class SC_alt_clickmenu
- * 1169:     function init()
- * 1260:     function main()
- * 1295:     function printContent()
+ * 1252: class SC_alt_clickmenu
+ * 1271:     function init()
+ * 1369:     function main()
+ * 1403:     function printContent()
  *
- * TOTAL FUNCTIONS: 41
+ * TOTAL FUNCTIONS: 43
  * (This index is automatically created/updated by the extension "extdeveval")
  *
  */
@@ -132,7 +134,7 @@ class clickMenu {
        var $listFrame=0;                       // If set, the calling document should be in the listframe of a frameset.
        var $isDBmenu=0;                        // If set, the menu is about database records, not files. (set if part 2 [1] of the item-var is NOT blank)
        var $alwaysContentFrame=0;      // If true, the "content" frame is always used for reference (when condensed mode is enabled)
-       var $iParts=array();            // Stores the parts of the input $item string, splitted by "|"
+       var $iParts=array();            // Stores the parts of the input $item string, splitted by "|": [0] = table/file, [1] = uid/blank, [2] = flag: If set, listFrame, [3] = ("+" prefix = disable all by default, enable these. Default is to disable) Items key list
        var $disabledItems=array();     // Contains list of keywords of items to disable in the menu
        var $dontDisplayTopFrameCM=0;   // If true, the context sensitive menu will not appear in the top frame, only as a layer.
        var $leftIcons=0;                       // If true, Show icons on the left.
@@ -400,10 +402,15 @@ class clickMenu {
                        $isSel = $this->clipObj->isSelected($table,$uid);
                }
 
+               $addParam = array();
+               if ($this->listFrame)   {
+                       $addParam['reloadListFrame'] = ($this->alwaysContentFrame ? 2 : 1);
+               }
+
                return $this->linkItem(
                        $this->label($type),
                        $this->excludeIcon('<img'.t3lib_iconWorks::skinImg($this->PH_backPath,'gfx/clip_'.$type.($isSel==$type?'_h':'').'.gif','width="12" height="12"').' alt="" />'),
-                       "top.loadTopMenu('".$this->clipObj->selUrlDB($table,$uid,($type=='copy'?1:0),($isSel==$type),array('reloadListFrame'=>$this->listFrame))."');return false;"
+                       "top.loadTopMenu('".$this->clipObj->selUrlDB($table,$uid,($type=='copy'?1:0),($isSel==$type),$addParam)."');return false;"
                );
        }
 
@@ -832,15 +839,21 @@ class clickMenu {
         * @internal
         */
        function FILE_copycut($path,$type)      {
-               $table='_FILE';         // Pseudo table name for use in the clipboard.
+               $table = '_FILE';               // Pseudo table name for use in the clipboard.
                $uid = t3lib_div::shortmd5($path);
                if ($this->clipObj->current=='normal')  {
                        $isSel = $this->clipObj->isSelected($table,$uid);
                }
+
+               $addParam = array();
+               if ($this->listFrame)   {
+                       $addParam['reloadListFrame'] = ($this->alwaysContentFrame ? 2 : 1);
+               }
+
                return $this->linkItem(
                        $this->label($type),
                        $this->excludeIcon('<img'.t3lib_iconWorks::skinImg($this->PH_backPath,'gfx/clip_'.$type.($isSel==$type?'_h':'').'.gif','width="12" height="12"').' alt="" />'),
-                       "top.loadTopMenu('".$this->clipObj->selUrlFile($path,($type=='copy'?1:0),($isSel==$type))."');return false;"
+                       "top.loadTopMenu('".$this->clipObj->selUrlFile($path,($type=='copy'?1:0),($isSel==$type),$addParam)."');return false;"
                );
        }
 
@@ -914,8 +927,15 @@ class clickMenu {
         * @return      string          HTML code
         */
        function printItems($menuItems,$item)   {
+
                $out='';
 
+                       // Enable/Disable items:
+               $menuItems = $this->enableDisableItems($menuItems);
+
+                       // Clean up spacers:
+               $menuItems = $this->cleanUpSpacers($menuItems);
+
                        // Adding topframe part (horizontal clickmenu)
                if ($this->doDisplayTopFrameCM())       {
                        $out.= '
@@ -1099,6 +1119,86 @@ if (top.content && top.content'.$frameName.' && top.content'.$frameName.'.setLay
                return ($GLOBALS['BE_USER']->uc['noMenuMode'] && strcmp($GLOBALS['BE_USER']->uc['noMenuMode'],'icons')) ? '' : ' '.$iconCode;
        }
 
+       /**
+        * Enabling / Disabling items based on list provided from GET var ($this->iParts[3])
+        *
+        * @param       array           Menu items array
+        * @return      array           Menu items array, processed.
+        */
+       function enableDisableItems($menuItems) {
+               if ($this->iParts[3])   {
+
+                               // Detect "only" mode: (only showing listed items)
+                       if (substr($this->iParts[3],0,1)=='+')  {
+                               $this->iParts[3] = substr($this->iParts[3],1);
+                               $only = TRUE;
+                       } else {
+                               $only = FALSE;
+                       }
+
+                               // Do filtering:
+                       if ($only)      {       // Transfer ONLY elements which are mentioned (or are spacers)
+                               $newMenuArray = array();
+                               foreach($menuItems as $key => $value)   {
+                                       if (t3lib_div::inList($this->iParts[3], $key) || (is_string($value) && $value=='spacer'))       {
+                                               $newMenuArray[$key] = $value;
+                                       }
+                               }
+                               $menuItems = $newMenuArray;
+                       } else {        // Traverse all elements except those listed (just unsetting them):
+                               $elements = t3lib_div::trimExplode(',',$this->iParts[3],1);
+                               foreach($elements as $value)    {
+                                       unset($menuItems[$value]);
+                               }
+                       }
+               }
+
+                       // Return processed menu items:
+               return $menuItems;
+       }
+
+       /**
+        * Clean up spacers; Will remove any spacers in the start/end of menu items array plus any duplicates.
+        *
+        * @param       array           Menu items array
+        * @return      array           Menu items array, processed.
+        */
+       function cleanUpSpacers($menuItems)     {
+
+                       // Remove doubles:
+               $prevItemWasSpacer = FALSE;
+               foreach($menuItems as $key => $value)   {
+                       if (is_string($value) && $value=='spacer')      {
+                               if ($prevItemWasSpacer) {
+                                       unset($menuItems[$key]);
+                               }
+                               $prevItemWasSpacer = TRUE;
+                       } else {
+                               $prevItemWasSpacer = FALSE;
+                       }
+               }
+
+                       // Remove first:
+               reset($menuItems);
+               $key = key($menuItems);
+               $value = current($menuItems);
+               if (is_string($value) && $value=='spacer')      {
+                       unset($menuItems[$key]);
+               }
+
+
+                       // Remove last:
+               end($menuItems);
+               $key = key($menuItems);
+               $value = current($menuItems);
+               if (is_string($value) && $value=='spacer')      {
+                       unset($menuItems[$key]);
+               }
+
+                       // Return processed menu items:
+               return $menuItems;
+       }
+
        /**
         * Get label from locallang_core.php:cm.*
         *
@@ -1212,6 +1312,7 @@ class SC_alt_clickmenu {
                $secs = t3lib_div::intInRange($BE_USER->getTSConfigVal('options.contextMenu.options.clickMenuTimeOut'),1,100,5);        // default is 5
 
                        // Setting the JavaScript controlling the timer on the page
+               $listFrameDoc = $this->reloadListFrame!=2 ? 'top.content.list_frame' : 'top.content';
                $this->doc->JScode.=$this->doc->wrapScriptTags('
        var date = new Date();
        var mo_timeout = Math.floor(date.getTime()/1000);
@@ -1255,7 +1356,7 @@ class SC_alt_clickmenu {
 
        '.($this->reloadListFrame ? '
                // Reload list frame:
-       if(top.content.list_frame){top.content.list_frame.document.location=top.content.list_frame.document.location;}' :
+       if('.$listFrameDoc.'){'.$listFrameDoc.'.document.location='.$listFrameDoc.'.document.location;}' :
        '').'
                ');
        }
@@ -1274,7 +1375,6 @@ class SC_alt_clickmenu {
 
                        // Update clipboard if some actions are sent.
                $CB = t3lib_div::_GET('CB');
-
                $clipObj->setCmd($CB);
                $clipObj->cleanCurrent();
                $clipObj->endClipboard();       // Saves
index 5ca1678..3356c89 100755 (executable)
@@ -415,6 +415,12 @@ class SC_alt_doc {
                        }
                '.(isset($HTTP_POST_VARS['_savedokview_x']) && $this->popViewId ? t3lib_BEfunc::viewOnClick($this->popViewId,'',t3lib_BEfunc::BEgetRootLine($this->popViewId),'',$this->viewUrl) : '')
                );
+
+                       // Setting up the context sensitive menu:
+               $CMparts = $this->doc->getContextMenuCode();
+               $this->doc->JScode.= $CMparts[0];
+               $this->doc->bodyTagAdditions = $CMparts[1];
+               $this->doc->postCode.= $CMparts[2];
        }
 
        /**
@@ -439,6 +445,7 @@ class SC_alt_doc {
                        $this->tceforms->returnUrl = $this->R_URI;
                        $this->tceforms->palettesCollapsed = !$this->MOD_SETTINGS['showPalettes'];
                        $this->tceforms->disableRTE = $this->MOD_SETTINGS['disableRTE'];
+                       $this->tceforms->enableClickMenu = TRUE;
 
                                // Clipboard is initialized:
                        $this->tceforms->clipObj = t3lib_div::makeInstance('t3lib_clipboard');          // Start clipboard
index efe9d9b..6178fcb 100755 (executable)
@@ -309,6 +309,7 @@ TABLE.typo3-page-ceHeader IMG { vertical-align: middle; }
 TABLE.typo3-page-columnsMode IMG.c-divider { margin: 10px 0px 5px 0px;}
 TABLE.typo3-page-columnsMode TR TD A { text-decoration: none; }
 TABLE.typo3-page-columnsMode TR TD A B { text-decoration: underline; }
+TABLE.typo3-page-cols TR TD SPAN.exampleContent A { text-decoration: none;}
 
 /* Web > List */
 TABLE.typo3-dblist IMG { vertical-align: middle; }
index a0db1d5..0d9ecb9 100755 (executable)
@@ -1,22 +1,22 @@
 <?php
 /***************************************************************
 *  Copyright notice
-*  
+*
 *  (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)
 *  All rights reserved
 *
-*  This script is part of the TYPO3 project. The TYPO3 project is 
+*  This script is part of the TYPO3 project. The TYPO3 project is
 *  free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
-* 
+*
 *  The GNU General Public License can be found at
 *  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license 
+*  A copy is found in the textfile GPL.txt and important notices to the license
 *  from the author is found in LICENSE.txt distributed with these scripts.
 *
-* 
+*
 *  This script is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -24,7 +24,7 @@
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
-/** 
+/**
  * Include file extending db_list.inc for use with the web_layout module
  *
  * $Id$
  *
  *
  *
- *  111: class tx_cms_layout extends recordList 
+ *  111: class tx_cms_layout extends recordList
  *
  *              SECTION: Renderings
- *  173:     function getTable($table,$id)     
- *  224:     function getTable_pages($id)      
- *  358:     function getTable_tt_content($id) 
- *  646:     function getTable_fe_users($id)   
- *  672:     function getTable_sys_note($id)   
- *  763:     function getTable_tt_board($id)   
- *  843:     function getTable_tt_address($id) 
- *  873:     function getTable_tt_links($id)   
- *  899:     function getTable_tt_guest($id)   
- *  914:     function getTable_tt_news($id)    
- *  935:     function getTable_tt_calender($id)        
- *  985:     function getTable_tt_products($id)        
+ *  173:     function getTable($table,$id)
+ *  224:     function getTable_pages($id)
+ *  358:     function getTable_tt_content($id)
+ *  646:     function getTable_fe_users($id)
+ *  672:     function getTable_sys_note($id)
+ *  763:     function getTable_tt_board($id)
+ *  843:     function getTable_tt_address($id)
+ *  873:     function getTable_tt_links($id)
+ *  899:     function getTable_tt_guest($id)
+ *  914:     function getTable_tt_news($id)
+ *  935:     function getTable_tt_calender($id)
+ *  985:     function getTable_tt_products($id)
  *
  *              SECTION: Generic listing of items
- * 1031:     function makeOrdinaryList($table, $id, $fList, $icon=0, $addWhere='')     
- * 1110:     function dataFields($fieldArr,$table,$row,$out=array())   
- * 1161:     function headerFields($fieldArr,$table,$out=array())      
+ * 1031:     function makeOrdinaryList($table, $id, $fList, $icon=0, $addWhere='')
+ * 1110:     function dataFields($fieldArr,$table,$row,$out=array())
+ * 1161:     function headerFields($fieldArr,$table,$out=array())
  *
  *              SECTION: Additional functions; Pages
- * 1203:     function pages_getTree($theRows,$pid,$qWhere,$treeIcons,$depth) 
- * 1235:     function pages_drawItem($row,$fieldArr)   
+ * 1203:     function pages_getTree($theRows,$pid,$qWhere,$treeIcons,$depth)
+ * 1235:     function pages_drawItem($row,$fieldArr)
  *
  *              SECTION: Additional functions; Content Elements
- * 1345:     function tt_content_drawColHeader($colName,$editParams,$newParams)        
- * 1395:     function tt_content_drawHeader($row,$space=0)     
- * 1521:     function tt_content_drawItem($row)        
- * 1668:     function infoGif($infoArr)        
- * 1684:     function newContentElementOnClick($id,$colPos,$sys_language)      
- * 1703:     function linkEditContent($str,$row,$isRTE=0)      
- * 1736:     function languageSelector($id)    
- * 1771:     function getResult($result)       
+ * 1345:     function tt_content_drawColHeader($colName,$editParams,$newParams)
+ * 1395:     function tt_content_drawHeader($row,$space=0)
+ * 1521:     function tt_content_drawItem($row)
+ * 1668:     function infoGif($infoArr)
+ * 1684:     function newContentElementOnClick($id,$colPos,$sys_language)
+ * 1703:     function linkEditContent($str,$row,$isRTE=0)
+ * 1736:     function languageSelector($id)
+ * 1771:     function getResult($result)
  *
  *              SECTION: Additional functions; Message board items (tt_board)
- * 1840:     function tt_board_getTree($theRows,$parent,$pid,$qWhere,$treeIcons) 
- * 1875:     function tt_board_drawItem($table,$row,$re)       
+ * 1840:     function tt_board_getTree($theRows,$parent,$pid,$qWhere,$treeIcons)
+ * 1875:     function tt_board_drawItem($table,$row,$re)
  *
  *              SECTION: Various helper functions
- * 1922:     function numberOfRecords($table,$pid)     
- * 1941:     function renderText($input)       
- * 1955:     function getIcon($table,$row)     
- * 1978:     function getProcessedValue($table,$fieldList,$row,&$info) 
- * 1998:     function isDisabled($table,$row)  
- * 2016:     function wordWrapper($content,$max=50,$char=' -') 
- * 2033:     function noEditIcon($label='noEditItems') 
- * 2042:     function cleanTableNames()        
+ * 1922:     function numberOfRecords($table,$pid)
+ * 1941:     function renderText($input)
+ * 1955:     function getIcon($table,$row)
+ * 1978:     function getProcessedValue($table,$fieldList,$row,&$info)
+ * 1998:     function isDisabled($table,$row)
+ * 2016:     function wordWrapper($content,$max=50,$char=' -')
+ * 2033:     function noEditIcon($label='noEditItems')
+ * 2042:     function cleanTableNames()
  * 2078:     function isRTEforField($table,$row,$field)
  * 2107:     function getSpecConfForField($table,$row,$field)
  *
  *              SECTION: External renderings
- * 2144:     function getPageInfoBox($rec,$edit=0)     
- * 2313:     function getTableMenu($id)        
+ * 2144:     function getPageInfoBox($rec,$edit=0)
+ * 2313:     function getTableMenu($id)
  *
  * TOTAL FUNCTIONS: 39
  * (This index is automatically created/updated by the extension "extdeveval")
  * @subpackage core
  */
 class tx_cms_layout extends recordList {
-       
+
                // External, static: For page statistics:
        var $stat_select_field='page_id';               // fieldname from sys_stat to select on.
        var $stat_codes=array();                                // eg.  "HITS_days:-1"
@@ -124,11 +124,11 @@ class tx_cms_layout extends recordList {
        var $ext_function=0;                                    // If set to "1", will link a big button to content element wizard.
        var $doEdit=1;                                                  // If true, elements will have edit icons (probably this is whethere the user has permission to edit the page content). Set externally.
        var $agePrefixes = ' min| hrs| days| yrs';      // Age prefixes for displaying times. May be set externally to localized values.
-       
+
                // External, static: Configuration of tt_content element display:
        var $tt_contentConfig = Array (
                'showInfo' => 1,                                        // Boolean: Display info-marks or not
-               'showCommands' => 1,                            // Boolean: Display up/down arrows and edit icons for tt_content records 
+               'showCommands' => 1,                            // Boolean: Display up/down arrows and edit icons for tt_content records
                'showCommands_info' => 1,                       // Boolean: Displays infoGif with the command buttons
                'single' => 1,                                          // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
                'showSingleCol' => 0,                           // The column(s) to show if single mode (under each other)
@@ -150,8 +150,8 @@ class tx_cms_layout extends recordList {
        );
        var $CType_labels=array();                              // Used to store labels for CTypes for tt_content elements
        var $itemLabels=array();                                // Used to store labels for the various fields in tt_content elements
-       
-       
+
+
 
 
 
@@ -174,7 +174,7 @@ class tx_cms_layout extends recordList {
 
                        // Load full table definition:
                t3lib_div::loadTCA($table);
-               
+
                        // Branch out based on table name:
                        // Notice: Most of these tables belongs to other extensions than 'cms'. Each of these tables can be rendered only if the extensions they belong to is loaded.
                switch($table)  {
@@ -227,7 +227,7 @@ class tx_cms_layout extends recordList {
                        // Initializing:
                $out='';
                $delClause = t3lib_BEfunc::deleteClause('pages').' AND '.$GLOBALS['BE_USER']->getPagePermsClause(1);            // Select clause for pages:
-               
+
                        // Select current page:
                if (!$id)       {
                        $row = $GLOBALS['SOBE']->pageinfo;              // The root has a pseudo record in pageinfo...
@@ -235,10 +235,10 @@ class tx_cms_layout extends recordList {
                        $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'uid='.intval($id).$delClause);
                        $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
                }
-               
+
                        // If there was found a page:
                if (is_array($row))     {
-               
+
                                // Select which fields to show:
                        $pKey = $GLOBALS['SOBE']->MOD_SETTINGS['function']=='tx_cms_webinfo_hits' ? 'hits' : $GLOBALS['SOBE']->MOD_SETTINGS['pages'];
                        switch($pKey)   {
@@ -257,10 +257,10 @@ class tx_cms_layout extends recordList {
                                        $this->fieldArray = explode(',','title,uid,alias,starttime,endtime,fe_group,target,url,shortcut');
                                break;
                        }
-                       
+
                                // Getting select-depth:
                        $depth=intval($GLOBALS['SOBE']->MOD_SETTINGS['pages_levels']);
-                       
+
                                // Half line is drawn
                        $theData = Array();
                        $theData['subject'] = $this->widthGif;
@@ -278,7 +278,7 @@ class tx_cms_layout extends recordList {
                        $out.=$code;
                        $editUids=array();
                        if ($flag)      {
-                                       
+
                                        // Getting children:
                                $theRows = Array();
                                $theRows = $this->pages_getTree($theRows,$row['uid'],$delClause,'',$depth);
@@ -290,7 +290,7 @@ class tx_cms_layout extends recordList {
                                        if ($GLOBALS['BE_USER']->doesUserHaveAccess($sRow,2))   $editUids[]=$sRow['uid'];
                                        $out.=$this->pages_drawItem($sRow,$this->fieldArray);
                                }
-                               $this->eCounter++;      
+                               $this->eCounter++;
                        }
 
                                // Header line is drawn
@@ -377,7 +377,7 @@ class tx_cms_layout extends recordList {
 
                        // Select display mode:
                if (!$this->tt_contentConfig['single']) {               // MULTIPLE column display mode, side by side:
-               
+
                                // Setting language list:
                        $langList = $this->tt_contentConfig['sys_language_uid'];
                        if ($this->tt_contentConfig['languageMode'])    {
@@ -389,15 +389,15 @@ class tx_cms_layout extends recordList {
                                $languageColumn=array();
                        }
                        $langListArr = explode(',',$langList);
-                       
-                       
+
+
                                // For EACH languages... :
                        foreach($langListArr as $lP)    {       // If NOT languageMode, then we'll only be through this once.
                                $showLanguage = ' AND sys_language_uid='.$lP;
                                $cList = explode(',',$this->tt_contentConfig['cols']);
                                $content = array();
                                $head = array();
-                               
+
                                        // For EACH column, render the content into a variable:
                                foreach($cList as $key) {
 
@@ -417,18 +417,18 @@ class tx_cms_layout extends recordList {
                                        foreach($rowArr as $row)        {
                                                $editUidList.= $row['uid'].',';
                                                $content[$key].= $this->tt_content_drawHeader($row,$this->tt_contentConfig['showInfo']?15:5);
-                                               
+
                                                $isRTE = $RTE && $this->isRTEforField('tt_content',$row,'bodytext');
-                                               $content[$key].= $this->linkEditContent($this->tt_content_drawItem($row),$row,$isRTE);
+                                               $content[$key].= $this->tt_content_drawItem($row,$isRTE);
                                        }
-                                       
+
                                                // Add new-icon link, header:
                                        $newP = $this->newContentElementOnClick($id,$key,$lP);
                                        $head[$key].= $this->tt_content_drawColHeader(t3lib_BEfunc::getProcessedValue('tt_content','colPos',$key), ($this->doEdit&&count($rowArr)?'&edit[tt_content]['.$editUidList.']=edit'.$pageTitleParamForAltDoc:''), $newP);
                                        $editUidList = '';
                                }
-                               
-                               
+
+
                                        // For EACH column, fit the rendered content into a table cell:
                                $out='';
                                foreach($cList as $k => $key)   {
@@ -456,15 +456,15 @@ class tx_cms_layout extends recordList {
                                                <tr>'.$out.'
                                                </tr>
                                        </table>';
-                       } 
+                       }
 
                                // If language mode, then make another presentation:
                                // Notice that THIS presentation will override the value of $out! But it needs the code above to execute since $languageColumn is filled with content we need!
                        if ($this->tt_contentConfig['languageMode'])    {
-                       
+
                                        // Get language selector:
                                $languageSelector = $this->languageSelector($id);
-                       
+
                                        // Reset out - we will make new content here:
                                $out='';
                                        // Separator between language columns (black thin line)
@@ -477,11 +477,11 @@ class tx_cms_layout extends recordList {
                                $cCont=array();
                                $sCont=array();
                                foreach($langListArr as $lP)    {
-                               
+
                                                // Header:
                                        $cCont[$lP]='
                                                <td valign="top" align="center" class="bgColor6"><strong>'.htmlspecialchars($this->tt_contentConfig['languageCols'][$lP]).'</strong></td>';
-                                       
+
                                                // Language overlay page header:
                                        if ($lP)        {
                                                list($lpRecord) = t3lib_BEfunc::getRecordsByField('pages_language_overlay','pid',$id,'AND sys_language_uid='.intval($lP));
@@ -515,7 +515,7 @@ class tx_cms_layout extends recordList {
                                                <td valign="top">',$cCont).'</td>
                                        </tr>';
                                }
-                               
+
                                        // Finally, wrap it all in a table and add the language selector on top of it:
                                $out = $languageSelector.'
                                        <table border="0" cellpadding="0" cellspacing="0" width="480" class="typo3-page-langMode">
@@ -523,13 +523,13 @@ class tx_cms_layout extends recordList {
                                        </table>';
                        }
                } else {                // SINGLE column mode (columns shown beneath each other):
-               
+
                                // Initialize:
                        $showLanguage = ' AND sys_language_uid='.$this->tt_contentConfig['sys_language_uid'];
                        $cList = explode(',',$this->tt_contentConfig['showSingleCol']);
                        $content=array();
                        $out='';
-                       
+
                                // Expand the table to some preset dimensions:
                        $out.='
                                <tr>
@@ -561,16 +561,16 @@ class tx_cms_layout extends recordList {
                                        $c++;
                                        $editUidList.=$row['uid'].',';
                                        $isRTE=$RTE && $this->isRTEforField('tt_content',$row,'bodytext');
-                                               
+
                                                // Create row output:
                                        $rowOut.='
                                                <tr>
                                                        <td></td>
                                                        <td valign="top">'.$this->tt_content_drawHeader($row).'</td>
                                                        <td></td>
-                                                       <td valign="top">'.$this->linkEditContent($this->tt_content_drawItem($row),$row,$isRTE).'</td>
+                                                       <td valign="top">'.$this->tt_content_drawItem($row,$isRTE).'</td>
                                                </tr>';
-                                               
+
                                                // If the element was not the last element, add a divider line:
                                        if ($c != $GLOBALS['TYPO3_DB']->sql_num_rows($result))  {
                                                $rowOut.='
@@ -580,7 +580,7 @@ class tx_cms_layout extends recordList {
                                                </tr>';
                                        }
                                }
-                                       
+
                                        // Add spacer between sections in the vertical list
                                if ($counter)   {
                                        $out.='
@@ -593,7 +593,7 @@ class tx_cms_layout extends recordList {
                                        // Add section header:
                                $newP = $this->newContentElementOnClick($id,$key,$this->tt_contentConfig['sys_language_uid']);
                                $out.='
-                               
+
                                        <!-- Column header: -->
                                        <tr>
                                                <td></td>
@@ -602,18 +602,18 @@ class tx_cms_layout extends recordList {
                                                        $theNewButton.
                                                        '<br /></td>
                                        </tr>';
-                                       
+
                                        // Finally, add the content from the records in this column:
                                $out.=$rowOut;
                        }
-                       
+
                                // Finally, wrap all table rows in one, big table:
                        $out = '
                                <table border="0" cellpadding="0" cellspacing="0" width="400" class="typo3-page-columnsMode">
                                        '.$out.'
                                </table>';
                }
-               
+
 
                        // Add the big buttons to page:
                if ($this->option_showBigButtons)       {
@@ -632,11 +632,11 @@ class tx_cms_layout extends recordList {
                                <img src="clear.gif" width="1" height="5" alt="" /><br />
                                '.$out;
                }
-               
+
                        // Return content:
                return $out;
        }
-       
+
        /**
         * Renders Frontend Users from the fe_users table from page id
         *
@@ -671,7 +671,7 @@ class tx_cms_layout extends recordList {
         */
        function getTable_sys_note($id) {
                global $TCA;
-               
+
                if (!t3lib_extMgm::isLoaded('sys_note'))        return '';
 
                        // INIT:
@@ -682,14 +682,14 @@ class tx_cms_layout extends recordList {
                foreach($TCA['sys_note']['columns'] as $name => $val)   {
                        $this->itemLabels[$name]=$GLOBALS['LANG']->sL($val['label']);
                }
-               
+
                        // If page ids were found, select all sys_notes from the page ids:
                $out='';
                if (count($tree->ids))          {
                        $delClause = t3lib_BEfunc::deleteClause('sys_note');
                        $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_note', 'pid IN ('.implode($tree->ids,',').') AND (!personal OR cruser='.intval($GLOBALS['BE_USER']->user['uid']).')'.$delClause);
                        $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
-                       
+
                                // If sys_notes were found, render them:
                        if ($dbCount)   {
                                $this->fieldArray = explode(',','__cmds__,info,note');
@@ -705,9 +705,9 @@ class tx_cms_layout extends recordList {
                                $theData = Array();
                                $theData['info'] = $this->widthGif;
                                $out.=$this->addelement(0,'',$theData);
-               
+
                                $this->no_noWrap=1;
-                               
+
                                        // Items
                                $this->eCounter=$this->firstElementNumber;
                                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))   {
@@ -727,11 +727,11 @@ class tx_cms_layout extends recordList {
                                                $this->getProcessedValue('sys_note','subject,category,author,email,personal',$row,$info);
                                                $cont=implode($info,'<br />');
                                                $head = '<b>Page:</b> '.t3lib_BEfunc::getRecordPath($row['pid'],$perms_clause,10).'<br />';
-                                               
+
                                                $theData['__cmds__']= $this->getIcon('sys_note',$row);
                                                $theData['info'] = $head.$cont;
                                                $theData['note'] = nl2br($row['message']);
-                                               
+
                                                $out.=$this->addelement(1,'',$theData,$tdparams,20);
 
 
@@ -773,11 +773,11 @@ class tx_cms_layout extends recordList {
                        $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
                        $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
                }
-               
+
                        // If results came out of that, render the list:
                $out='';
                if ($dbCount)   {
-               
+
                                // Setting fields to display first:
                        if ($GLOBALS['SOBE']->MOD_SETTINGS['tt_board']=='expand')       {
                                $this->fieldArray = explode(',','subject,author,date,age');
@@ -787,7 +787,7 @@ class tx_cms_layout extends recordList {
 
                                // Header line is drawn
                        $theData = Array();
-                       $theData['subject'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_subject',1).'</b>';       
+                       $theData['subject'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_subject',1).'</b>';
                        $theData['author'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_author',1).'</b>';
                        $theData['date'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_date',1).'</b>';
                        $theData['age'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_age',1).'</b>';
@@ -820,14 +820,14 @@ class tx_cms_layout extends recordList {
                                                }
                                        }
                                }
-                               $this->eCounter++;      
+                               $this->eCounter++;
                        }
 
                                // Wrap it all in a table:
                        $out='
                                <table border="0" cellpadding="0" cellspacing="0" class="typo3-page-listTTboard">
                                        '.$out.'
-                               </table>';      
+                               </table>';
                }
 
                return $out;
@@ -857,7 +857,7 @@ class tx_cms_layout extends recordList {
                                $fList = 'name,email,www,phone,fax,mobile';
                        break;
                }
-               
+
                        // Create listing
                $out = $this->makeOrdinaryList('tt_address',$id, $fList, $icon);
                return $out;
@@ -1036,7 +1036,7 @@ class tx_cms_layout extends recordList {
                $queryParts = $this->makeQueryArray($table, $id, $addWhere);
                $this->setTotalItems($queryParts);
                $dbCount = 0;
-               
+
                        // Make query for records if there were any records found in the count operation:
                if ($this->totalItems)  {
                        $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
@@ -1054,7 +1054,7 @@ class tx_cms_layout extends recordList {
                        $theData = array();
                        $theData = $this->headerFields($this->fieldArray,$table,$theData);
                        $out.= $this->addelement(1,'',$theData,' class="c-headLine"',15);
-                       
+
                                // Render Items
                        $this->eCounter = $this->firstElementNumber;
                        while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))   {
@@ -1063,7 +1063,7 @@ class tx_cms_layout extends recordList {
                                if ($flag)      {
                                        $params = '&edit['.$table.']['.$row['uid'].']=edit';
                                        $Nrow = array();
-                                       
+
                                                // Setting icons/edit links:
                                        if ($icon)      {
                                                $Nrow['__cmds__']= $this->getIcon($table,$row);
@@ -1081,18 +1081,18 @@ class tx_cms_layout extends recordList {
                                        $tdparams = $this->eCounter%2 ? ' class="bgColor4"' : ' class="bgColor4-20"';
                                        $out.= $this->addelement(1,'',$Nrow,$tdparams);
                                }
-                               $this->eCounter++;      
+                               $this->eCounter++;
                        }
-                       
+
                                // Wrap it all in a table:
                        $out='
-                       
-                               <!-- 
-                                       STANDARD LIST OF "'.$table.'" 
+
+                               <!--
+                                       STANDARD LIST OF "'.$table.'"
                                -->
                                <table border="0" cellpadding="1" cellspacing="2" width="480" id="typo3-page-stdlist">
                                        '.$out.'
-                               </table>';      
+                               </table>';
                }
                return $out;
        }
@@ -1109,15 +1109,15 @@ class tx_cms_layout extends recordList {
         */
        function dataFields($fieldArr,$table,$row,$out=array()) {
                global $TCA;
-                       
+
                        // Check table validity:
                if ($TCA[$table])       {
                        t3lib_div::loadTCA($table);
                        $thumbsCol = $TCA[$table]['ctrl']['thumbnail'];
 
-                               // Traverse fields:                     
+                               // Traverse fields:
                        foreach($fieldArr as $fieldName)        {
-                       
+
                                if ($TCA[$table]['columns'][$fieldName])        {       // Each field has its own cell (if configured in TCA)
                                        if ($fieldName==$thumbsCol)     {       // If the column is a thumbnail column:
                                                $out[$fieldName] = $this->thumbCode($row,$table,$fieldName);
@@ -1126,7 +1126,7 @@ class tx_cms_layout extends recordList {
                                        }
                                } else {        // Each field is separated by <br /> and shown in the same cell (If not a TCA field, then explode the field name with ";" and check each value there as a TCA configured field)
                                        $theFields = explode(';',$fieldName);
-                                       
+
                                                // Traverse fields, separated by ";" (displayed in a single cell).
                                        foreach($theFields as $fName2)  {
                                                if ($TCA[$table]['columns'][$fName2])   {
@@ -1139,7 +1139,7 @@ class tx_cms_layout extends recordList {
                                }
                                        // If no value, add a nbsp.
                                if (!$out[$fieldName])  $out[$fieldName]='&nbsp;';
-                               
+
                                        // Wrap in dimmed-span tags if record is "disabled"
                                if ($this->isDisabled($table,$row))     {
                                        $out[$fieldName] = $GLOBALS['TBE_TEMPLATE']->dfw($out[$fieldName]);
@@ -1160,9 +1160,9 @@ class tx_cms_layout extends recordList {
         */
        function headerFields($fieldArr,$table,$out=array())    {
                global $TCA;
-               
+
                t3lib_div::loadTCA($table);
-               
+
                foreach($fieldArr as $fieldName)        {
                        $ll = $GLOBALS['LANG']->sL($TCA[$table]['columns'][$fieldName]['label'],1);
                        $out[$fieldName] = '<b>'.($ll?$ll:'&nbsp;').'</b>';
@@ -1170,13 +1170,13 @@ class tx_cms_layout extends recordList {
                return $out;
        }
 
-       
-       
-       
-       
-       
-       
-       
+
+
+
+
+
+
+
 
 
 
@@ -1210,7 +1210,7 @@ class tx_cms_layout extends recordList {
                                $c++;
                                $row['treeIcons'] = $treeIcons.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/join'.($rc==$c?'bottom':'').'.gif','width="18" height="16"').' alt="" />';
                                $theRows[]=$row;
-                               
+
                                        // Get the branch
                                $spaceOutIcons = '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.($rc==$c?'blank.gif':'line.gif'),'width="18" height="16"').' alt="" />';
                                $theRows = $this->pages_getTree($theRows,$row['uid'],$qWhere,$treeIcons.$spaceOutIcons,$row['php_tree_stop']?0:$depth);
@@ -1220,9 +1220,9 @@ class tx_cms_layout extends recordList {
                        $row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
                        if ($row[0])    {
                                $this->plusPages[$pid]=$row[0];
-                       }                       
+                       }
                }
-               return $theRows;        
+               return $theRows;
        }
 
        /**
@@ -1237,7 +1237,7 @@ class tx_cms_layout extends recordList {
 
                        // Initialization
                $theIcon=$this->getIcon('pages',$row);
-               
+
                        //      Preparing and getting the data-array
                $theData = Array();
                foreach($fieldArr as $field)    {
@@ -1278,26 +1278,26 @@ class tx_cms_layout extends recordList {
                                                                        $timespan = mktime (0,0,0)+intval($fParts[1])*3600*24;
                                                                                // Page hits
                                                                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                                                                                                       'count(*)', 
-                                                                                                       'sys_stat', 
-                                                                                                       $this->stat_select_field.'='.intval($row['uid']).' 
-                                                                                                               AND tstamp>='.intval($timespan).' 
+                                                                                                       'count(*)',
+                                                                                                       'sys_stat',
+                                                                                                       $this->stat_select_field.'='.intval($row['uid']).'
+                                                                                                               AND tstamp>='.intval($timespan).'
                                                                                                                AND tstamp<'.intval($timespan+3600*24)
                                                                                                );
                                                                        list($number) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
                                                                        if ($number)    {
                                                                                        // Sessions
                                                                                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                                                                                                               'count(*)', 
-                                                                                                               'sys_stat', 
-                                                                                                               $this->stat_select_field.'='.intval($row['uid']).' 
-                                                                                                                       AND tstamp>='.intval($timespan).' 
+                                                                                                               'count(*)',
+                                                                                                               'sys_stat',
+                                                                                                               $this->stat_select_field.'='.intval($row['uid']).'
+                                                                                                                       AND tstamp>='.intval($timespan).'
                                                                                                                        AND tstamp<'.intval($timespan+3600*24).'
                                                                                                                        AND surecookie!=""',
                                                                                                                'surecookie'
                                                                                                        );
                                                                                $scnumber = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
-                                                                               
+
                                                                                $number.= '/'.$scnumber;
                                                                        } else {
                                                                                $number='';
@@ -1311,7 +1311,7 @@ class tx_cms_layout extends recordList {
                                        } else {
                                                $theData[$field]= '&nbsp;&nbsp;'.htmlspecialchars(t3lib_BEfunc::getProcessedValue('pages',$field,$row[$field]));
                                        }
-                               break;                  
+                               break;
                        }
                }
                return $this->addelement(1,'',$theData);
@@ -1357,7 +1357,7 @@ class tx_cms_layout extends recordList {
                                <tr>
                                        <td class="bgColor5">';
 
-                               // Edit whole of column:                
+                               // Edit whole of column:
                        if ($editParams)        {
                                $out.='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($editParams,$this->backPath)).'">'.
                                                '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL('editColumn',1).'" alt="" />'.
@@ -1374,7 +1374,7 @@ class tx_cms_layout extends recordList {
                                        </td>
                                </tr>';
                }
-               
+
                        // Wrap and return:
                return '
                        <table border="0" cellpadding="0" cellspacing="0" width="100%" class="typo3-page-colHeader">'.($space?'
@@ -1384,7 +1384,7 @@ class tx_cms_layout extends recordList {
                                $out.'
                        </table>';
        }
-                
+
        /**
         * Draw the header for a single tt_content element
         *
@@ -1394,7 +1394,7 @@ class tx_cms_layout extends recordList {
         */
        function tt_content_drawHeader($row,$space=0)   {
                global $TCA;
-               
+
                        // Load full table description:
                t3lib_div::loadTCA('tt_content');
 
@@ -1420,22 +1420,22 @@ class tx_cms_layout extends recordList {
                                // Get processed values:
                        $info = Array();
                        $this->getProcessedValue('tt_content','hidden,starttime,endtime,fe_group,spaceBefore,spaceAfter,section_frame,sectionIndex,linkToTop',$row,$info);
-                       
+
                                // Render control panel for the element:
                        if ($this->tt_contentConfig['showCommands'] && $this->doEdit)   {
-                       
+
                                        // Start control cell:
                                $out.= '
                                        <!-- Control Panel -->
                                        <tr>
                                                <td class="bgColor5">';
-                                       
+
                                        // Edit content element:
                                $params='&edit[tt_content]['.$this->tt_contentData['nextThree'][$row['uid']].']=edit';
                                $out.='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath)).'">'.
                                                '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.htmlspecialchars($this->nextThree>1?sprintf($GLOBALS['LANG']->getLL('nextThree'),$this->nextThree):$GLOBALS['LANG']->getLL('edit')).'" alt="" />'.
                                                '</a>';
-       
+
                                        // New content element:
                                if ($this->option_newWizard)    {
                                        $onClick="document.location='db_new_content_el.php?id=".$row['pid'].'&sys_language_uid='.$row['sys_language_uid'].'&colPos='.$row['colPos'].'&uid_pid='.(-$row['uid']).'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';";
@@ -1446,7 +1446,7 @@ class tx_cms_layout extends recordList {
                                $out.='<a href="#" onclick="'.htmlspecialchars($onClick).'">'.
                                                '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_record.gif','width="16" height="12"').' title="'.$GLOBALS['LANG']->getLL('newAfter',1).'" alt="" />'.
                                                '</a>';
-       
+
                                        // Move element up:
                                if ($this->tt_contentData['prev'][$row['uid']]) {
                                        $params='&cmd[tt_content]['.$row['uid'].'][move]='.$this->tt_contentData['prev'][$row['uid']];
@@ -1487,13 +1487,13 @@ class tx_cms_layout extends recordList {
                                $out.='<a href="'.htmlspecialchars($GLOBALS['SOBE']->doc->issueCommand($params)).'" onclick="'.htmlspecialchars('return confirm('.$GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('deleteWarning')).');').'">'.
                                                '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/garbage.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL('deleteItem',1).'" alt="" />'.
                                                '</a>';
-                       
+
                                        // End cell:
                                $out.= '
                                                </td>
                                        </tr>';
                        }
-                       
+
                                // Display info from records fields:
                        if (count($info))       {
                                $out.= '
@@ -1516,23 +1516,25 @@ class tx_cms_layout extends recordList {
         * Draws the preview content for a content element
         *
         * @param       string          Content element
+        * @param       boolean         Set if the RTE link can be created.
         * @return      string          HTML
         */
-       function tt_content_drawItem($row)      {
+       function tt_content_drawItem($row, $isRTE=FALSE)        {
                global $TCA;
 
                $out='';
+               $outHeader='';
 
                        // Make header:
                if ($row['header'] && $row['header_layout']!=100)       {
                        $infoArr = Array();
                        $this->getProcessedValue('tt_content','header_position,header_layout,header_link',$row,$infoArr);
 
-                       $out.=  ($row['date'] ? htmlspecialchars($this->itemLabels['date'].' '.t3lib_BEfunc::date($row['date'])).'<br />':''). 
+                       $outHeader=  ($row['date'] ? htmlspecialchars($this->itemLabels['date'].' '.t3lib_BEfunc::date($row['date'])).'<br />':'').
                                        $this->infoGif($infoArr).
-                                       '<b>'.$this->renderText($row['header']).'</b><br />';
+                                       '<b>'.$this->linkEditContent($this->renderText($row['header']),$row).'</b><br />';
                }
-               
+
                        // Make content:
                $infoArr=Array();
                switch($row['CType'])   {
@@ -1540,7 +1542,7 @@ class tx_cms_layout extends recordList {
                                if ($row['subheader'])  {
                                        $this->getProcessedValue('tt_content','layout',$row,$infoArr);
                                        $out.=  $this->infoGif($infoArr).
-                                                       $this->renderText($row['subheader']).'<br />';
+                                                       $this->linkEditContent($this->renderText($row['subheader']),$row).'<br />';
                                }
                        break;
                        case 'text':
@@ -1550,21 +1552,21 @@ class tx_cms_layout extends recordList {
                                        if ($row['bodytext'])   {
                                                $this->getProcessedValue('tt_content','text_align,text_face,text_size,text_color,text_properties',$row,$infoArr);
                                                $out.=  $this->infoGif($infoArr).
-                                                               $this->renderText($row['bodytext']).'<br />';
+                                                               $this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
                                        }
                                }
-                               if ($row['CType']=='textpic' || $row['CType']=='image') {       
+                               if ($row['CType']=='textpic' || $row['CType']=='image') {
                                        if ($row['image'])      {
                                                $infoArr=Array();
                                                $this->getProcessedValue('tt_content','imageorient,imagecols,image_noRows,imageborder,imageheight,image_link,image_zoom,image_compression,image_effects,image_frames',$row,$infoArr);
                                                $out.=  $this->infoGif($infoArr).
                                                                $this->thumbCode($row,'tt_content','image').'<br />';
-                                                               
+
                                                if ($row['imagecaption'])       {
                                                        $infoArr=Array();
                                                        $this->getProcessedValue('tt_content','imagecaption_position',$row,$infoArr);
                                                        $out.=  $this->infoGif($infoArr).
-                                                                       $this->renderText($row['imagecaption']).'<br />';
+                                                                       $this->linkEditContent($this->renderText($row['imagecaption']),$row).'<br />';
                                                }
                                        }
                                }
@@ -1573,21 +1575,21 @@ class tx_cms_layout extends recordList {
                                if ($row['bodytext'])   {
                                        $this->getProcessedValue('tt_content','layout,text_align,text_face,text_size,text_color,text_properties',$row,$infoArr);
                                        $out.=  $this->infoGif($infoArr).
-                                                       $this->renderText($row['bodytext']).'<br />';
+                                                       $this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
                                }
                        break;
                        case 'table':
                                if ($row['bodytext'])   {
                                        $this->getProcessedValue('tt_content','table_bgColor,table_border,table_cellspacing,cols,layout,text_align,text_face,text_size,text_color,text_properties',$row,$infoArr);
                                        $out.=  $this->infoGif($infoArr).
-                                                       $this->renderText($row['bodytext']).'<br />';
+                                                       $this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
                                }
                        break;
                        case 'uploads':
                                if ($row['media'])      {
                                        $this->getProcessedValue('tt_content','media,select_key,layout,filelink_size,table_bgColor,table_border,table_cellspacing',$row,$infoArr);
                                        $out.=  $this->infoGif($infoArr).
-                                                       $this->renderText($row['bodytext']).'<br />';
+                                                       $this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
                                }
                        break;
                        case 'multimedia':
@@ -1600,12 +1602,12 @@ class tx_cms_layout extends recordList {
                                if ($row['bodytext'])   {
                                        $this->getProcessedValue('tt_content','pages,subheader',$row,$infoArr);
                                        $out.=  $this->infoGif($infoArr).
-                                                       $this->renderText($row['bodytext']).'<br />';
+                                                       $this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
                                }
                        break;
                        case 'splash':
                                if ($row['bodytext'])   {
-                                       $out.=  $this->renderText($row['bodytext']).'<br />';
+                                       $out.=  $this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
                                }
                                if ($row['image'])      {
                                        $infoArr=Array();
@@ -1618,14 +1620,14 @@ class tx_cms_layout extends recordList {
                                if ($row['pages'])      {
                                        $this->getProcessedValue('tt_content','menu_type',$row,$infoArr);
                                        $out.=  $this->infoGif($infoArr).
-                                                       $row['pages'].'<br />';
+                                                       $this->linkEditContent($row['pages'],$row).'<br />';
                                }
                        break;
                        case 'shortcut':
                                if ($row['records'])    {
                                        $this->getProcessedValue('tt_content','layout',$row,$infoArr);
                                        $out.=  $this->infoGif($infoArr).
-                                                       $row['shortcut'].'<br />';
+                                                       $this->linkEditContent($row['shortcut'],$row).'<br />';
                                }
                        break;
                        case 'list':
@@ -1643,15 +1645,27 @@ class tx_cms_layout extends recordList {
                        break;
                        case 'script':
                                $out.=  $GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('tt_content','select_key'),1).' '.$row['select_key'].'<br />';
-                               $out.=  '<br />'.$this->renderText($row['bodytext']).'<br />';
-                               $out.=  '<br />'.$this->renderText($row['imagecaption']).'<br />';
+                               $out.=  '<br />'.$this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
+                               $out.=  '<br />'.$this->linkEditContent($this->renderText($row['imagecaption']),$row).'<br />';
                        break;
                        default:
                                if ($row['bodytext'])   {
-                                       $out.=$this->renderText($row['bodytext']).'<br />';
+                                       $out.=$this->linkEditContent($this->renderText($row['bodytext']),$row).'<br />';
                                }
                        break;
                }
+
+                       // Wrap span-tags:
+               $out = '
+                       <span class="exampleContent">'.$out.'</span>';
+                       // Add header:
+               $out = $outHeader.$out;
+                       // Add RTE button:
+               if ($isRTE) {
+                       $out.= $this->linkRTEbutton($row);
+               }
+
+                       // Return values:
                if ($this->isDisabled('tt_content',$row))       {
                        return $GLOBALS['TBE_TEMPLATE']->dfw($out);
                } else {
@@ -1671,7 +1685,7 @@ class tx_cms_layout extends recordList {
                        return $out;
                }
        }
-               
+
        /**
         * Creates onclick-attribute content for a new content element
         *
@@ -1696,35 +1710,40 @@ class tx_cms_layout extends recordList {
         *
         * @param       string          String to link. Must be prepared for HTML output.
         * @param       array           The row.
-        * @param       boolean         If true, the RTE link will be made
         * @return      string          If the whole thing was editable ($this->doEdit) $str is return with link around. Otherwise just $str.
         * @see getTable_tt_content()
         */
-       function linkEditContent($str,$row,$isRTE=0)    {
+       function linkEditContent($str,$row    {
                $addButton='';
                $onClick = '';
 
                if ($this->doEdit)      {
-
-                               // If RTE is enabled, make a button which links to RTE for the element:
-                       if ($isRTE)     {
-                               $params = array();
-                               $params['table'] = 'tt_content';
-                               $params['uid'] = $row['uid'];
-                               $params['pid'] = $row['pid'];
-                               $params['field'] = 'bodytext';
-                               $params['returnUrl'] = t3lib_div::linkThisScript();
-                               $RTEonClick="document.location='".$this->backPath."wizard_rte.php?".t3lib_div::implodeArrayForUrl('',array('P'=>$params))."';return false;";
-                               $addButton=$this->option_showBigButtons?$GLOBALS['SOBE']->doc->t3Button($RTEonClick,$GLOBALS['LANG']->getLL('editInRTE')):'';
-                       }
-
-                               // Setting onclick action for content link:                     
+                               // Setting onclick action for content link:
                        $onClick=t3lib_BEfunc::editOnClick('&edit[tt_content]['.$row['uid'].']=edit',$this->backPath);
                }
                        // Return link
                return $onClick ? '<a href="#" onclick="'.htmlspecialchars($onClick).'" title="'.$GLOBALS['LANG']->getLL('edit',1).'">'.$str.'</a>'.$addButton : $str;
        }
 
+       /**
+        * Adds a button to edit the row in RTE wizard
+        *
+        * @param       array   The row of tt_content element
+        * @return      string  Button to click if you want to edit in RTE wizard.
+        */
+       function linkRTEbutton($row)    {
+               $params = array();
+               $params['table'] = 'tt_content';
+               $params['uid'] = $row['uid'];
+               $params['pid'] = $row['pid'];
+               $params['field'] = 'bodytext';
+               $params['returnUrl'] = t3lib_div::linkThisScript();
+               $RTEonClick = "document.location='".$this->backPath."wizard_rte.php?".t3lib_div::implodeArrayForUrl('',array('P'=>$params))."';return false;";
+               $addButton = $this->option_showBigButtons ? $GLOBALS['SOBE']->doc->t3Button($RTEonClick,$GLOBALS['LANG']->getLL('editInRTE')) : '';
+
+               return $addButton;
+       }
+
        /**
         * Make selector box for creating new translation in a language
         * Displays only languages which are not yet present for the current page.
@@ -1745,13 +1764,13 @@ class tx_cms_layout extends recordList {
                                $langSelItems[$row['uid']]='
                                                <option value="'.$row['uid'].'">'.htmlspecialchars($row['title']).'</option>';
                        }
-                       
+
                                // Then, subtract the languages which are already on the page:
                        $res = $GLOBALS['SOBE']->exec_languageQuery($id);
                        while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))       {
                                unset($langSelItems[$row['uid']]);
                        }
-                       
+
                                // If any languages are left, make selector:
                        if (count($langSelItems)>1)             {
                                $onChangeContent = 'document.location=\''.$this->backPath.'alt_doc.php?&edit[pages_language_overlay]['.$id.']=new&overrideVals[pages_language_overlay][sys_language_uid]=\'+this.options[this.selectedIndex].value+\'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')).'\'';
@@ -1769,30 +1788,30 @@ class tx_cms_layout extends recordList {
         * @return      array           The selected rows returned in this array.
         */
        function getResult($result)     {
-       
+
                        // Initialize:
                $editUidList='';
                $recs=Array();
                $nextTree = $this->nextThree;
                $c=0;
                $output=Array();
-               
+
                        // Traverse the result:
                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))   {
 
                                // Add the row to the array:
                        $output[]=$row;
-                       
+
                                // Set an internal register:
                        $recs[$c]=$row['uid'];
-                       
+
                                // Create the list of the next three ids (for editing links...)
                        for($a=0;$a<$nextTree;$a++)     {
                                if(isset($recs[$c-$a])) {
                                        $this->tt_contentData['nextThree'][$recs[$c-$a]].=$row['uid'].',';
                                }
                        }
-                       
+
                                // Set next/previous ids:
                        if (isset($recs[$c-1])) {
                                if (isset($recs[$c-2])) {
@@ -1804,7 +1823,7 @@ class tx_cms_layout extends recordList {
                        }
                        $c++;
                }
-               
+
                        // Return selected records
                return $output;
        }
@@ -1826,7 +1845,7 @@ class tx_cms_layout extends recordList {
         * Additional functions; Message board items (tt_board)
         *
         **********************************/
-        
+
        /**
         * Traverses recursively a branch in a message board.
         *
@@ -1838,10 +1857,10 @@ class tx_cms_layout extends recordList {
         * @return      array           $theRows, but with added content
         */
        function tt_board_getTree($theRows,$parent,$pid,$qWhere,$treeIcons) {
-       
+
                        // Select tt_board elements:
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_board', 'pid='.intval($pid).' AND parent='.intval($parent).$qWhere, '', 'crdate');
-               
+
                        // Traverse the results:
                $c=0;
                $rc = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
@@ -1849,7 +1868,7 @@ class tx_cms_layout extends recordList {
                        $c++;
                        $row['treeIcons'] = $treeIcons.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.($rc==$c ? 'joinbottom.gif' : 'join.gif'),'width="18" height="16"').' alt="" />';
                        $theRows[]=$row;
-                               
+
                                // Get the branch
                        $theRows = $this->tt_board_getTree(
                                                $theRows,
@@ -1859,9 +1878,9 @@ class tx_cms_layout extends recordList {
                                                $treeIcons.'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.($rc==$c ? 'blank.gif' : 'line.gif'),'width="18" height="16"').' alt="" />'
                                        );
                }
-               
+
                        // Return modified rows:
-               return $theRows;        
+               return $theRows;
        }
 
        /**
@@ -1873,7 +1892,7 @@ class tx_cms_layout extends recordList {
         * @return      string          Return content of element (table row)
         */
        function tt_board_drawItem($table,$row,$re)     {
-       
+
                        // Building data-arary with content:
                $theData = Array();
                $theData['subject'] = t3lib_div::fixed_lgd(htmlspecialchars($row['subject']),25).'&nbsp; &nbsp;';
@@ -1883,29 +1902,29 @@ class tx_cms_layout extends recordList {
                if ($re)        {
                        $theData['replys'] = $re;
                }
-                       
+
                        // Subject is built:
-               $theData['subject']     = 
+               $theData['subject']     =
                                        $row['treeIcons'].
                                        $this->getIcon($table,$row).
                                        $theData['subject'];
-                                       
+
                        // Adding element:
                return $this->addelement(1,'',$theData);
        }
 
 
-       
-       
-       
-       
-       
-       
-       
-       
-       
-       
-       
+
+
+
+
+
+
+
+
+
+
+
        /********************************
         *
         * Various helper functions
@@ -1931,7 +1950,7 @@ class tx_cms_layout extends recordList {
                }
                return $c;
        }
-       
+
        /**
         * Processing of larger amounts of text (usually from RTE/bodytext fields) with word wrapping etc.
         *
@@ -1959,12 +1978,12 @@ class tx_cms_layout extends recordList {
                $iconImg = t3lib_iconWorks::getIconImage($table,$row,$this->backPath,'title="'.$alttext.'"');
                $this->counter++;
 
-                       // The icon with link   
+                       // The icon with link
                $theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg,$table,$row['uid']);
 
                return $theIcon;
        }
-        
+
        /**
         * Creates processed values for all fieldnames in $fieldList based on values from $row array.
         * The result is 'returned' through $info which is passed as a reference
@@ -1976,11 +1995,11 @@ class tx_cms_layout extends recordList {
         * @return      void
         */
        function getProcessedValue($table,$fieldList,$row,&$info)       {
-       
+
                        // Splitting values from $fieldList:
                $fieldArr = explode(',',$fieldList);
 
-                       // Traverse fields from $fieldList:             
+                       // Traverse fields from $fieldList:
                foreach($fieldArr as $field)    {
                        if ($row[$field])       {
                                $info[]= htmlspecialchars($this->itemLabels[$field]).' '.htmlspecialchars(t3lib_BEfunc::getProcessedValue($table,$field,$row[$field]));
@@ -2015,7 +2034,7 @@ class tx_cms_layout extends recordList {
         */
        function wordWrapper($content,$max=50,$char=' -')       {
                $array = split(' |'.chr(10),$content);
-               foreach($array as $val) {       
+               foreach($array as $val) {
                        if (strlen($val)>$max)  {
                                $content=str_replace($val,substr(chunk_split($val,$max,$char),0,-1),$content);
                        }
@@ -2041,10 +2060,10 @@ class tx_cms_layout extends recordList {
         */
        function cleanTableNames()      {
                global $TCA;
-               
+
                        // Get all table names:
                $tableNames=array_flip(array_keys($TCA));
-               
+
                        // Unset common names:
                unset($tableNames['pages']);
                unset($tableNames['static_template']);
@@ -2053,9 +2072,9 @@ class tx_cms_layout extends recordList {
                unset($tableNames['sys_workflows']);
                unset($tableNames['be_users']);
                unset($tableNames['be_groups']);
-       
+
                $this->allowedTableNames=array();
-               
+
                        // Traverse table names and set them in allowedTableNames array IF they can be read-accessed by the user.
                if (is_array($tableNames))      {
                        foreach($tableNames as $k => $v)        {
@@ -2089,7 +2108,7 @@ class tx_cms_layout extends recordList {
                                }
                        }
                }
-               
+
                return FALSE;
        }
 
@@ -2127,7 +2146,7 @@ class tx_cms_layout extends recordList {
 
 
 
-       
+
        /*****************************************
         *
         * External renderings
@@ -2143,7 +2162,7 @@ class tx_cms_layout extends recordList {
         */
        function getPageInfoBox($rec,$edit=0)   {
                global $LANG;
-               
+
                        // If editing of the page header is allowed:
                if ($edit)      {
                        $params='&edit[pages]['.$rec['uid'].']=edit';
@@ -2153,13 +2172,13 @@ class tx_cms_layout extends recordList {
                } else {
                        $editIcon=$this->noEditIcon('noEditPage');
                }
-                       
-                       // Setting page icon, link, title:      
+
+                       // Setting page icon, link, title:
                $outPutContent = t3lib_iconWorks::getIconImage('pages',$rec,$this->backPath,'title="'.htmlspecialchars(t3lib_BEfunc::titleAttribForPages($rec)).'"').
                                $editIcon.
                                '&nbsp;'.
                                htmlspecialchars($rec['title']);
-               
+
 
                        // Init array where infomation is accumulated as label/value pairs.
                $lines=array();
@@ -2176,17 +2195,17 @@ class tx_cms_layout extends recordList {
                        // Created:
                $lines[]=array($LANG->getLL('pI_crDate').':', t3lib_BEfunc::datetime($rec['crdate']).' ('.t3lib_BEfunc::calcAge(time()-$rec['crdate'],$this->agePrefixes).')');
 
-                       // Last change:         
+                       // Last change:
                $lines[]=array($LANG->getLL('pI_lastChange').':', t3lib_BEfunc::datetime($rec['tstamp']).' ('.t3lib_BEfunc::calcAge(time()-$rec['tstamp'],$this->agePrefixes).')');
 
-                       // Last change of content:              
+                       // Last change of content:
                if ($rec['SYS_LASTCHANGED'])    {
                        $lines[]=array($LANG->getLL('pI_lastChangeContent').':', t3lib_BEfunc::datetime($rec['SYS_LASTCHANGED']).' ('.t3lib_BEfunc::calcAge(time()-$rec['SYS_LASTCHANGED'],$this->agePrefixes).')');
                }
-       
+
                        // Spacer:
                $lines[]='';
-               
+
                        // Display contents of certain page fields, if any value:
                $dfields = explode(',','alias,target,hidden,starttime,endtime,fe_group,no_cache,cache_timeout,newUntil,lastUpdated,subtitle,keywords,description,abstract,author,author_email');
                foreach($dfields as $fV)        {
@@ -2194,23 +2213,23 @@ class tx_cms_layout extends recordList {
                                $lines[]=array($GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('pages',$fV)), t3lib_BEfunc::getProcessedValue('pages',$fV,$rec[$fV]));
                        }
                }
-               
+
                        // Page hits (depends on "sys_stat" extension)
                if ($this->pI_showStat && t3lib_extMgm::isLoaded('sys_stat'))   {
-                               
+
                                // Counting total hits:
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'sys_stat', 'page_id='.intval($rec['uid']));
                        $rrow = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
                        if ($rrow[0])   {
-                       
+
                                        // Get min/max
                                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('min(tstamp) AS min,max(tstamp) AS max', 'sys_stat', 'page_id='.intval($rec['uid']));
                                $rrow2 = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
-       
+
                                $lines[]='';
                                $lines[]=array($LANG->getLL('pI_hitsPeriod').':',t3lib_BEfunc::date($rrow2[0]).' - '.t3lib_BEfunc::date($rrow2[1]).' ('.t3lib_BEfunc::calcAge($rrow2[1]-$rrow2[0],$this->agePrefixes).')');
                                $lines[]=array($LANG->getLL('pI_hitsTotal').':',$rrow[0]);
-       
+
 
                                        // Last 10 days
                                $nextMidNight = mktime (0,0,0)+1*3600*24;
@@ -2220,7 +2239,7 @@ class tx_cms_layout extends recordList {
                                while($rrow = $GLOBALS['TYPO3_DB']->sql_fetch_row($res))        {
                                        $days[$rrow[1]] = $rrow[0];
                                }
-                               
+
                                $headerH=array();
                                $contentH=array();
                                for($a=9;$a>=0;$a--)    {
@@ -2229,7 +2248,7 @@ class tx_cms_layout extends recordList {
                                        $contentH[]='
                                                        <td align="center">'.($days[$a] ? intval($days[$a]) : '-').'</td>';
                                }
-                                       
+
                                        // Compile first hit-table (last 10 days)
                                $hitTable='
                                        <table border="0" cellpadding="0" cellspacing="1" class="typo3-page-hits">
@@ -2237,8 +2256,8 @@ class tx_cms_layout extends recordList {
                                                <tr>'.implode('',$contentH).'</tr>
                                        </table>';
                                $lines[]=array($LANG->getLL('pI_hits10days').':',$hitTable,1);
-       
-       
+
+
                                        // Last 24 hours
                                $nextHour = mktime (date('H'),0,0)+3600;
                                $hours=16;
@@ -2248,7 +2267,7 @@ class tx_cms_layout extends recordList {
                                while($rrow = $GLOBALS['TYPO3_DB']->sql_fetch_row($res))        {
                                        $days[$rrow[1]]=$rrow[0];
                                }
-                               
+
                                $headerH=array();
                                $contentH=array();
                                for($a=($hours-1);$a>=0;$a--)   {
@@ -2257,7 +2276,7 @@ class tx_cms_layout extends recordList {
                                        $contentH[]='
                                                        <td align="center">'.($days[$a] ? intval($days[$a]) : '-').'</td>';
                                }
-                                       
+
                                        // Compile second hit-table (last 24 hours)
                                $hitTable='
                                        <table border="0" cellpadding="0" cellspacing="1" class="typo3-page-stat">
@@ -2266,8 +2285,8 @@ class tx_cms_layout extends recordList {
                                        </table>';
                                $lines[]=array($LANG->getLL('pI_hits24hours').':',$hitTable,1);
                        }
-               }               
-               
+               }
+
 
                        // Finally, wrap the elements in the $lines array in table cells/rows
                foreach($lines as $fV)  {
@@ -2285,19 +2304,19 @@ class tx_cms_layout extends recordList {
                                </tr>';
                        }
                }
-               
+
                        // Wrap table tags around...
                $outPutContent.='
 
 
-               
+
                        <!--
                                Page info box:
                        -->
                        <table border="0" cellpadding="0" cellspacing="1" id="typo3-page-info">
                                '.$out.'
                        </table>';
-                       
+
                        // ... and return it.
                return $outPutContent;
        }
@@ -2319,17 +2338,17 @@ class tx_cms_layout extends recordList {
 
                        // Traverse tables to check:
                foreach($theTables as $tName)   {
-                       
+
                                // Check access and whether the proper extensions are loaded:
                        if ($GLOBALS['BE_USER']->check('tables_select',$tName) && (t3lib_extMgm::isLoaded($tName)||t3lib_div::inList('fe_users,tt_content',$tName)))    {
-                       
+
                                        // Make query to count records from page:
                                $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', $tName, 'pid='.intval($id).t3lib_BEfunc::deleteClause($tName));
                                list($c) = $GLOBALS['TYPO3_DB']->sql_fetch_row($result);
-                               
+
                                        // If records were found (or if "tt_content" is the table...):
                                if ($c || t3lib_div::inList('tt_content',$tName))       {
-                               
+
                                                // Add row to menu:
                                        $out.='
                                        <td><a href="#'.$tName.'"></a>'.
@@ -2344,12 +2363,12 @@ class tx_cms_layout extends recordList {
                                }
                        }
                }
-               
+
                        // Wrap cells in table tags:
                $out = '
 
 
-               
+
                        <!--
                                Menu of tables on the page (table menu)
                        -->
@@ -2357,7 +2376,7 @@ class tx_cms_layout extends recordList {
                                <tr>'.$out.'
                                </tr>
                        </table>';
-                       
+
                        // Return the content:
                return $out;
        }
index c6a0b57..3525b44 100755 (executable)
@@ -1,22 +1,22 @@
 <?php
 /***************************************************************
 *  Copyright notice
-*  
+*
 *  (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)
 *  All rights reserved
 *
-*  This script is part of the TYPO3 project. The TYPO3 project is 
+*  This script is part of the TYPO3 project. The TYPO3 project is
 *  free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
-* 
+*
 *  The GNU General Public License can be found at
 *  http://www.gnu.org/copyleft/gpl.html.
-*  A copy is found in the textfile GPL.txt and important notices to the license 
+*  A copy is found in the textfile GPL.txt and important notices to the license
 *  from the author is found in LICENSE.txt distributed with these scripts.
 *
-* 
+*
 *  This script is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -24,9 +24,9 @@
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
-/** 
+/**
  * Module: Web>Page
- * 
+ *
  * This module lets you view a page in a more Content Management like style than the ordinary record-list
  *
  * $Id$
  *
  *
  *
- *  106: class ext_posMap extends t3lib_positionMap 
- *  117:     function wrapRecordTitle($str,$row)       
- *  130:     function wrapColumnHeader($str,$vv)       
- *  144:     function onClickInsertRecord($row,$vv,$moveUid,$pid) 
- *  161:     function wrapRecordHeader($str,$row)      
+ *  106: class ext_posMap extends t3lib_positionMap
+ *  117:     function wrapRecordTitle($str,$row)
+ *  130:     function wrapColumnHeader($str,$vv)
+ *  144:     function onClickInsertRecord($row,$vv,$moveUid,$pid)
+ *  161:     function wrapRecordHeader($str,$row)
  *
  *
- *  182: class SC_db_layout 
- *  231:     function init()   
- *  286:     function menuConfig()     
- *  362:     function clearCache()     
- *  377:     function main()   
- *  475:     function renderQuickEdit()        
+ *  182: class SC_db_layout
+ *  231:     function init()
+ *  286:     function menuConfig()
+ *  362:     function clearCache()
+ *  377:     function main()
+ *  475:     function renderQuickEdit()
  *  839:     function renderListContent()
- * 1104:     function printContent()   
+ * 1104:     function printContent()
  *
  *              SECTION: Other functions
- * 1131:     function getNumberOfHiddenElements()      
- * 1144:     function local_linkThisScript($params)    
- * 1156:     function exec_languageQuery($id)  
+ * 1131:     function getNumberOfHiddenElements()
+ * 1144:     function local_linkThisScript($params)
+ * 1156:     function exec_languageQuery($id)
  *
  * TOTAL FUNCTIONS: 14
  * (This index is automatically created/updated by the extension "extdeveval")
@@ -106,7 +106,7 @@ t3lib_extMgm::isLoaded('cms',1);
 class ext_posMap extends t3lib_positionMap {
        var $dontPrintPageInsertIcons = 1;
        var $l_insertNewRecordHere='newContentElement';
-       
+
        /**
         * Wrapping the title of the record.
         *
@@ -219,9 +219,9 @@ class SC_db_layout {
        var $topFuncMenu;                       // Function menu temporary storage
        var $editIcon;                          // Temporary storage for page edit icon
 
-       
-       
-               
+
+
+
 
        /**
         * Initializing the module
@@ -230,7 +230,7 @@ class SC_db_layout {
         */
        function init() {
                global $BE_USER,$LANG;
-               
+
                        // Setting module configuration / page select clause
                $this->MCONF = $GLOBALS['MCONF'];
                $this->perms_clause = $BE_USER->getPagePermsClause(1);
@@ -252,13 +252,13 @@ class SC_db_layout {
 
                        // Load page info array:
                $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
-               
+
                        // Initialize menu
                $this->menuConfig();
 
                        // Setting sys language from session var:
                $this->current_sys_language=intval($this->MOD_SETTINGS['language']);
-               
+
                        // Include scripts: QuickEdit
                if ($this->MOD_SETTINGS['function']==0) {
                        $this->include_once[]=PATH_t3lib.'class.t3lib_tceforms.php';
@@ -328,29 +328,29 @@ class SC_db_layout {
                                0 => $LANG->getLL('m_default')
                        )
                );
-               
+
                         // First, select all pages_language_overlay records on the current page. Each represents a possibility for a language on the page. Add these to language selector.
                $res = $this->exec_languageQuery($this->id);
                while($lrow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))      {
                        $this->MOD_MENU['language'][$lrow['uid']]=($lrow['hidden']?'('.$lrow['title'].')':$lrow['title']);
                }
-               
+
                        // Find if there are ANY languages at all (and if not, remove the language option from function menu).
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'sys_language', ($BE_USER->isAdmin()?'':'hidden=0'));
                if (!$GLOBALS['TYPO3_DB']->sql_num_rows($res))  {
                        unset($this->MOD_MENU['function']['2']);
                }
-               
+
                        // page/be_user TSconfig settings and blinding of menu-items
                $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,'mod.'.$this->MCONF['name']);
                if ($this->modTSconfig['properties']['QEisDefault'])    ksort($this->MOD_MENU['function']);
                $this->MOD_MENU['function'] = t3lib_BEfunc::unsetMenuItems($this->modTSconfig['properties'],$this->MOD_MENU['function'],'menu.function');
-               
+
                        // Remove QuickEdit as option if page type is not...
                if (!t3lib_div::inList($TYPO3_CONF_VARS['FE']['content_doktypes'].',6',$this->pageinfo['doktype']))     {
                        unset($this->MOD_MENU['function'][0]);
                }
-               
+
                        // Clean up settings
                $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
        }
@@ -382,16 +382,16 @@ class SC_db_layout {
                // The page will show only if there is a valid page and if this page may be viewed by the user
                $access = is_array($this->pageinfo) ? 1 : 0;
                if ($this->id && $access)       {
-               
+
                                // Initialize permission settings:
                        $this->CALC_PERMS = $BE_USER->calcPerms($this->pageinfo);
                        $this->EDIT_CONTENT = ($this->CALC_PERMS&16) ? 1 : 0;
-               
+
                                // Start document template object:
                        $this->doc = t3lib_div::makeInstance('mediumDoc');
                        $this->doc->backPath = $BACK_PATH;
                        $this->doc->docType='xhtml_trans';
-               
+
                                // JavaScript:
                        $this->doc->JScode = '<script type="text/javascript" src="'.$BACK_PATH.'t3lib/jsfunc.updateform.js"></script>';
                        $this->doc->JScode.= $this->doc->wrapScriptTags('
@@ -406,22 +406,22 @@ class SC_db_layout {
                                        } else document.location = URL;
                                }
                        '.($this->popView ? t3lib_BEfunc::viewOnClick($this->id,$BACK_PATH,t3lib_BEfunc::BEgetRootLine($this->id)) : '').'
-                       
+
                                function deleteRecord(table,id,url)     {       //
-                                       if (confirm('.$LANG->JScharCode($LANG->getLL('deleteWarning')).'))      {       
+                                       if (confirm('.$LANG->JScharCode($LANG->getLL('deleteWarning')).'))      {
                                                document.location = "'.$BACK_PATH.'tce_db.php?cmd["+table+"]["+id+"][delete]=1&redirect="+escape(url)+"&vC='.$BE_USER->veriCode().'&prErr=1&uPT=1";
                                        }
                                        return false;
                                }
                        ');
-               
+
                                // Setting doc-header
                        $this->doc->form='<form action="'.htmlspecialchars('db_layout.php?id='.$this->id.'&imagemode='.$this->imagemode).'" method="post">';
-               
+
                                // Creating the top function menu:
                        $this->topFuncMenu = t3lib_BEfunc::getFuncMenu($this->id,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function'],'db_layout.php','').
-                                               (count($this->MOD_MENU['language'])>1 ? '<br />'.t3lib_BEfunc::getFuncMenu($this->id,'SET[language]',$this->current_sys_language,$this->MOD_MENU['language'],'db_layout.php','') : ''); 
-                       
+                                               (count($this->MOD_MENU['language'])>1 ? '<br />'.t3lib_BEfunc::getFuncMenu($this->id,'SET[language]',$this->current_sys_language,$this->MOD_MENU['language'],'db_layout.php','') : '');
+
                                // Creating the top edit page icon:
                        if ($this->CALC_PERMS&2)        {
                                $params='&edit[pages]['.$this->id.']=edit';
@@ -429,32 +429,32 @@ class SC_db_layout {
                        } else {
                                $this->editIcon='';
                        }
-                       
+
                                // Find columns
                        $modTSconfig_SHARED = t3lib_BEfunc::getModTSconfig($this->id,'mod.SHARED');             // SHARED page-TSconfig settings.
                        $this->colPosList = strcmp(trim($this->modTSconfig['properties']['tt_content.']['colPos_list']),'') ? trim($this->modTSconfig['properties']['tt_content.']['colPos_list']) : $modTSconfig_SHARED['properties']['colPos_list'];
                        $this->colPosList = strcmp($this->colPosList,'')?$this->colPosList:'1,0,2,3';
                        $this->colPosList = implode(',',array_unique(t3lib_div::intExplode(',',$this->colPosList)));            // Removing duplicates, if any
-                       
-               
+
+
                                // Render the primary module content:
                        if ($this->MOD_SETTINGS['function']==0) {
                                $this->renderQuickEdit();       // QuickEdit
                        } else {
                                $this->renderListContent();     // All other listings
                        }
-               
-               
+
+
                                // ShortCut
                        if ($BE_USER->mayMakeShortcut())        {
                                $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('id,edit_record,pointer,new_unique_uid,search_field,search_levels,showLimit',implode(',',array_keys($this->MOD_MENU)),$this->MCONF['name']));
                        }
-               
+
                                // Ending page:
                        $this->content.=$this->doc->spacer(10);
                        $this->content.=$this->doc->endPage();
                } else {
-                               
+
                                // If no access or id value, create empty document:
                        $this->doc = t3lib_div::makeInstance('mediumDoc');
                        $this->doc->docType='xhtml_trans';
@@ -467,7 +467,7 @@ class SC_db_layout {
                        $this->content.=$this->doc->endPage();
                }
        }
-       
+
        /**
         * Rendering the quick-edit view.
         *
@@ -479,14 +479,20 @@ class SC_db_layout {
                        // Alternative form tag; Quick Edit submits its content to tce_db.php.
                $this->doc->form='<form action="'.htmlspecialchars($BACK_PATH.'tce_db.php?&prErr=1&uPT=1').'" method="post" enctype="'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'].'" name="editform" onsubmit="return TBE_EDITOR_checkSubmit(1);">';
 
+                       // Setting up the context sensitive menu:
+               $CMparts = $this->doc->getContextMenuCode();
+               $this->doc->JScode.= $CMparts[0];
+               $this->doc->bodyTagAdditions = $CMparts[1];
+               $this->doc->postCode.= $CMparts[2];
+
                        // Set the edit_record value for internal use in this function:
                $edit_record = $this->edit_record;
-               
+
                        // If a command to edit all records in a column is issue, then select all those elements, and redirect to alt_doc.php:
                if (substr($edit_record,0,9)=='_EDIT_COL')      {
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                                               '*', 
-                                               'tt_content', 
+                                               '*',
+                                               'tt_content',
                                                'pid='.intval($this->id).' AND colPos='.intval(substr($edit_record,10)).' AND sys_language_uid='.intval($this->current_sys_language).
                                                                ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : t3lib_BEfunc::BEenableFields('tt_content')).
                                                                t3lib_BEfunc::deleteClause('tt_content'),
@@ -502,7 +508,7 @@ class SC_db_layout {
                        header('Location: '.t3lib_div::locationHeaderUrl($jumpUrl));
                        exit;
                }
-               
+
                        // If the former record edited was the creation of a NEW record, this will look up the created records uid:
                if ($this->new_unique_uid)      {
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_log', 'userid='.intval($BE_USER->user['uid']).' AND NEWid="'.$GLOBALS['TYPO3_DB']->quoteStr($this->new_unique_uid, 'sys_log').'"');
@@ -511,7 +517,7 @@ class SC_db_layout {
                                $edit_record=$sys_log_row['tablename'].':'.$sys_log_row['recuid'];
                        }
                }
-               
+
 
                        // Creating the selector box, allowing the user to select which element to edit:
                $opt=array();
@@ -530,10 +536,10 @@ class SC_db_layout {
                        $opt[]='<option value="'.$inValue.'"'.($edit_record==$inValue?' selected="selected"':'').'>[ '.$LANG->getLL('editPageHeader',1).' ]</option>';
                }
 
-                       // Selecting all content elements from this language:   
+                       // Selecting all content elements from this language:
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                                       '*', 
-                                       'tt_content', 
+                                       '*',
+                                       'tt_content',
                                        'pid='.intval($this->id).' AND sys_language_uid='.intval($this->current_sys_language).
                                                        ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : t3lib_BEfunc::BEenableFields('tt_content')).
                                                        t3lib_Befunc::deleteClause('tt_content'),
@@ -560,40 +566,40 @@ class SC_db_layout {
                        $opt[]='<option value="'.$inValue.'"'.($edit_record==$inValue?' selected="selected"':'').'>'.htmlspecialchars(t3lib_div::fixed_lgd($cRow['header']?$cRow['header']:'['.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.no_title').'] '.strip_tags($cRow['bodytext']),$BE_USER->uc['titleLen'])).'</option>';
                        $prev=-$cRow['uid'];
                }
-       
+
                        // If edit_record is not set (meaning, no content elements was found for this language) we simply set it to create a new element:
                if (!$edit_record)      {
                        $edit_record='tt_content:new/'.$prev.'/'.$colPos;
-       
+
                        $inValue = 'tt_content:new/'.$prev.'/'.$colPos;
                        $is_selected+=intval($edit_record==$inValue);
                        $opt[]='<option value="'.$inValue.'"'.($edit_record==$inValue?' selected="selected"':'').'>[ '.$LANG->getLL('newLabel',1).' ]</option>';
                }
-       
+
                        // If none is yet selected...
-               if (!$is_selected)      {       
+               if (!$is_selected)      {
                        $opt[]='<option value=""></option>';
                        $opt[]='<option value="'.$edit_record.'"  selected="selected">[ '.$LANG->getLL('newLabel',1).' ]</option>';
                }
-               
-               
+
+
                        // Splitting the edit-record cmd value into table/uid:
                $eRParts = explode(':',$edit_record);
-               
+
                        // Delete-button flag?
                $deleteButton = (t3lib_div::testInt($eRParts[1]) && $edit_record && (($eRParts[0]!='pages'&&$this->EDIT_CONTENT) || ($eRParts[0]=='pages'&&($this->CALC_PERMS&4))));
-       
+
                        // If undo-button should be rendered (depends on available items in sys_history)
                $undoButton=0;
                $undoRes = $GLOBALS['TYPO3_DB']->exec_SELECTquery('tstamp', 'sys_history', 'tablename="'.$GLOBALS['TYPO3_DB']->quoteStr($eRParts[0], 'sys_history').'" AND recuid="'.$GLOBALS['TYPO3_DB']->quoteStr($eRParts[1], 'sys_history').'"', '', 'tstamp DESC', '1');
                if ($undoButtonR = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($undoRes))     {
                        $undoButton=1;
                }
-       
-                       // Setting up the Return URL for coming back to THIS script (if links take the user to another script)  
+
+                       // Setting up the Return URL for coming back to THIS script (if links take the user to another script)
                $R_URL_parts = parse_url(t3lib_div::getIndpEnv('REQUEST_URI'));
                $R_URL_getvars = t3lib_div::_GET();
-       
+
                unset($R_URL_getvars['popView']);
                unset($R_URL_getvars['new_unique_uid']);
                $R_URL_getvars['edit_record']=$edit_record;
@@ -601,7 +607,7 @@ class SC_db_layout {
 
                        // Setting close url/return url for exiting this script:
                $closeUrl = $this->local_linkThisScript(array('SET'=>array('function'=>1)));    // Goes to 'Columns' view if close is pressed (default)
-               
+
                if ($BE_USER->uc['condensedMode'])      {
                        $uParts = parse_url(t3lib_div::getIndpEnv('REQUEST_URI'));
                        $closeUrl=$BACK_PATH.'alt_db_navframe.php';
@@ -611,10 +617,10 @@ class SC_db_layout {
                }
                        // Return-url for JavaScript:
                $retUrlStr = $this->returnUrl?"+'&returnUrl='+'".rawurlencode($this->returnUrl)."'":'';
-               
+
                        // Drawing tool bar:
                $toolBar=
-                       '<select name="edit_record" onchange="'.htmlspecialchars('jumpToUrl(\'db_layout.php?id='.$this->id.'&edit_record=\'+escape(this.options[this.selectedIndex].value,this)'.$retUrlStr.');').'">'.implode('',$opt).'</select>'.
+                       '<select name="edit_record" onchange="'.htmlspecialchars('jumpToUrl(\'db_layout.php?id='.$this->id.'&edit_record=\'+escape(this.options[this.selectedIndex].value)'.$retUrlStr.',this);').'">'.implode('',$opt).'</select>'.
 
                        '<input class="c-inputButton" type="image" name="savedok"'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/savedok.gif','').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc',1).'" alt="" />'.
 
@@ -649,13 +655,13 @@ class SC_db_layout {
                $toolBar.='<a href="#" onclick="'.htmlspecialchars('jumpToUrl(\''.$BACK_PATH.'db_new.php?id='.$this->id.'&pagesOnly=1&returnUrl='.rawurlencode($R_URI).'\');return false;').'">'.
                                '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/new_page.gif','width="13" height="12"').' class="c-inputButton" title="'.$LANG->getLL('newPage',1).'" alt="" />'.
                                '</a>';
-       
+
                $toolBar.='<a href="'.htmlspecialchars($this->local_linkThisScript(array('edit_record'=>'pages:'.$this->id))).'">'.
                                '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/edit2.gif','width="11" height="12"').' class="c-inputButton" title="'.$LANG->getLL('editPageHeader',1).'" alt="" />'.
                                '</a>';
                $toolBar.='<img src="clear.gif" width="15" height="1" align="top" alt="" />';
                $toolBar.=t3lib_BEfunc::helpTextIcon($this->descrTable,'quickEdit',$BACK_PATH);
-               
+
                        // Setting page header:
                $hS2='
                        <table border="0" cellpadding="0" cellspacing="0" width="460">
@@ -673,18 +679,18 @@ class SC_db_layout {
                                        <td colspan="3" class="bgColor4">'.t3lib_BEfunc::helpText($this->descrTable,'quickEdit',$BACK_PATH).$toolBar.'</td>
                                </tr>
                        </table>';
-       
+
                $content.=$this->doc->startPage($LANG->getLL('title'));
                $content.=$this->doc->section('',$hS2);
                $content.=$this->doc->spacer(7);
-       
-       
+
+
                        // Creating editing form:
                if ($BE_USER->check('tables_modify',$eRParts[0]) && $edit_record && (($eRParts[0]!='pages'&&$this->EDIT_CONTENT) || ($eRParts[0]=='pages'&&($this->CALC_PERMS&1))))     {
-               
+
                                // Splitting uid parts for special features, if new:
                        list($uidVal,$ex_pid,$ex_colPos) = explode('/',$eRParts[1]);
-                       
+
                                // Initializing transfer-data object:
                        $trData = t3lib_div::makeInstance('t3lib_transferData');
                        $trData->defVals[$eRParts[0]] = array (
@@ -705,10 +711,10 @@ class SC_db_layout {
                        } else {
                                $rec['uid'] = $uidVal;
                        }
-                       
+
                                // If the record is an array (which it will always be... :-)
                        if (is_array($rec))     {
-                       
+
                                        // Create instance of TCEforms, setting defaults:
                                $tceforms = t3lib_div::makeInstance('t3lib_TCEforms');
                                $tceforms->backPath = $BACK_PATH;
@@ -716,6 +722,7 @@ class SC_db_layout {
                                $tceforms->fieldOrder = $this->modTSconfig['properties']['tt_content.']['fieldOrder'];
                                $tceforms->palettesCollapsed = !$this->MOD_SETTINGS['showPalettes'];
                                $tceforms->disableRTE = $this->MOD_SETTINGS['disableRTE'];
+                               $tceforms->enableClickMenu = TRUE;
 
                                        // Clipboard is initialized:
                                $tceforms->clipObj = t3lib_div::makeInstance('t3lib_clipboard');                // Start clipboard
@@ -740,10 +747,10 @@ class SC_db_layout {
                                        <input type="hidden" name="edit_record" value="'.$edit_record.'" />
                                        <input type="hidden" name="redirect" value="'.htmlspecialchars($uidVal=='new' ? t3lib_extMgm::extRelPath('cms').'layout/db_layout.php?id='.$this->id.'&new_unique_uid='.$new_unique_uid.'&returnUrl='.rawurlencode($this->returnUrl) : $R_URI ).'" />
                                        ';
-                                       
+
                                        // Add JavaScript as needed around the form:
                                $theCode=$tceforms->printNeededJSFunctions_top().$theCode.$tceforms->printNeededJSFunctions();
-                               
+
                                        // Add warning sign if record was "locked":
                                if ($lockInfo=t3lib_BEfunc::isRecordLocked($eRParts[0],$rec['uid']))    {
                                        $lockIcon='
@@ -759,7 +766,7 @@ class SC_db_layout {
                                                </table>
                                                ';
                                } else $lockIcon='';
-                               
+
                                        // Add whole form as a document section:
                                $content.=$this->doc->section('',$lockIcon.$theCode);
                        }
@@ -767,7 +774,7 @@ class SC_db_layout {
                                // If no edit access, print error message:
                        $content.=$this->doc->section($LANG->getLL('noAccess'),$LANG->getLL('noAccess_msg').'<br /><br />',0,1);
                }
-               
+
 
                        // Bottom controls (function menus):
                $q_count = $this->getNumberOfHiddenElements();
@@ -783,7 +790,7 @@ class SC_db_layout {
                                                t3lib_BEfunc::getFuncCheck($this->id,'SET[showDescriptions]',$this->MOD_SETTINGS['showDescriptions'],'db_layout.php','').
                                                $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showDescriptions',1);
                }
-               
+
                if ($BE_USER->isRTE())  {
                        $h_func_b.= '<br />'.
                                                t3lib_BEfunc::getFuncCheck($this->id,'SET[disableRTE]',$this->MOD_SETTINGS['disableRTE'],'db_layout.php','').
@@ -793,19 +800,19 @@ class SC_db_layout {
                        // Add the function menus to bottom:
                $content.=$this->doc->section('',$h_func_b,0,0);
                $content.=$this->doc->spacer(10);
-       
+
 
                        // Select element matrix:
                if ($eRParts[0]=='tt_content' && t3lib_div::testInt($eRParts[1]))       {
                        $posMap = t3lib_div::makeInstance('ext_posMap');
                        $posMap->backPath = $BACK_PATH;
                        $posMap->cur_sys_language=$this->current_sys_language;
-                       
+
                        $HTMLcode='';
                        $HTMLcode.=t3lib_BEfunc::helpTextIcon($this->descrTable,'quickEdit_selElement',$BACK_PATH).
                                                        t3lib_BEfunc::helpText($this->descrTable,'quickEdit_selElement',$BACK_PATH).
                                                        '<br />';
-               
+
                        $HTMLcode.=$posMap->printContentElementColumns($this->id,$eRParts[1],$this->colPosList,$this->MOD_SETTINGS['tt_content_showHidden'],$R_URI);
 
                        $HTMLcode.='<br /><br />'.
@@ -819,13 +826,13 @@ class SC_db_layout {
                                                '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/new_record.gif','width="16" height="12"').' vspace="0" hspace="2" align="top" title="'.$LANG->getLL('newContentElement',1).'" alt="" />'.
                                                $LANG->getLL('newContentElement',1).
                                                '</a>';
-       
+
                        $content.=$this->doc->spacer(20);
                        $content.=$this->doc->section($LANG->getLL('CEonThisPage'),$HTMLcode,0,1);
                        $content.=$this->doc->spacer(20);
                }
 
-                       // Finally, if comments were generated in TCEforms object, print these as a HTML comment:       
+                       // Finally, if comments were generated in TCEforms object, print these as a HTML comment:
                if (count($tceforms->commentMessages))  {
                        $content.='
        <!-- TCEFORM messages
@@ -833,11 +840,11 @@ class SC_db_layout {
        -->
        ';
                }
-               
+
                        // Adding content to internal accumulation variable:
                $this->content.=$content;
-       }       
-       
+       }
+
        /**
         * Rendering all other listings than QuickEdit
         *
@@ -845,13 +852,13 @@ class SC_db_layout {
         */
        function renderListContent()    {
                global $LANG,$BACK_PATH,$TCA;
-       
+
                        // Initialize list object (see "class.db_layout.inc"):
                $dblist = t3lib_div::makeInstance('tx_cms_layout');
                $dblist->backPath = $BACK_PATH;
                $dblist->thumbs = $this->imagemode;
                $dblist->no_noWrap = 1;
-               
+
                $this->pointer = t3lib_div::intInRange($this->pointer,0,100000);
                $dblist->script = 'db_layout.php';
                $dblist->showIcon = 0;
@@ -863,11 +870,11 @@ class SC_db_layout {
                $dblist->option_showBigButtons = $this->modTSconfig['properties']['disableBigButtons'] ? 0 : 1;
                $dblist->option_newWizard = $this->modTSconfig['properties']['disableNewContentElementWizard'] ? 0 : 1;
                if (!$dblist->nextThree)        $dblist->nextThree = 1;
-               
+
 
                        // Create menu for selecting a table to jump to (this is, if more than just pages/tt_content elements are found on the page!)
                $h_menu=$dblist->getTableMenu($this->id);
-               
+
                        // Initialize other variables:
                $h_func='';
                $optionArr=array();
@@ -878,11 +885,11 @@ class SC_db_layout {
                        // Traverse the list of table names which has records on this page (that array is populated by the $dblist object during the function getTableMenu()):
                reset($dblist->activeTables);
                while(list($table)=each($dblist->activeTables)) {
-               
+
                                // Load full table definitions:
                        t3lib_div::loadTCA($table);
-                       
-                               // Creating special conditions for each table:  
+
+                               // Creating special conditions for each table:
                        switch($table)  {
                                case 'tt_board':
                                        $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_board]',$this->MOD_SETTINGS['tt_board'],$this->MOD_MENU['tt_board'],'db_layout.php','');
@@ -907,11 +914,11 @@ class SC_db_layout {
                                case 'tt_content':
                                        $q_count = $this->getNumberOfHiddenElements();
                                        $h_func_b= t3lib_BEfunc::getFuncCheck($this->id,'SET[tt_content_showHidden]',$this->MOD_SETTINGS['tt_content_showHidden'],'db_layout.php','').(!$q_count?$GLOBALS['TBE_TEMPLATE']->dfw($LANG->getLL('hiddenCE')):$LANG->getLL('hiddenCE').' ('.$q_count.')');
-       
-                                       $dblist->tt_contentConfig['showCommands'] = 1;  // Boolean: Display up/down arrows and edit icons for tt_content records 
+
+                                       $dblist->tt_contentConfig['showCommands'] = 1;  // Boolean: Display up/down arrows and edit icons for tt_content records
                                        $dblist->tt_contentConfig['showInfo'] = 1;              // Boolean: Display info-marks or not
                                        $dblist->tt_contentConfig['single'] =0;                 // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
-       
+
                                                // Setting up the tt_content columns to show:
                                        if (is_array($TCA['tt_content']['columns']['colPos']['config']['items']))       {
                                                $colList=array();
@@ -933,7 +940,7 @@ class SC_db_layout {
                                        $dblist->tt_contentConfig['cols'] = implode(',',$colList);              // The order of the rows: Default is left(1), Normal(0), right(2), margin(3)
                                        $dblist->tt_contentConfig['showHidden'] = $this->MOD_SETTINGS['tt_content_showHidden'];
                                        $dblist->tt_contentConfig['sys_language_uid'] = intval($this->current_sys_language);
-                                       
+
                                                // If the function menu is set to "Language":
                                        if ($this->MOD_SETTINGS['function']==2) {
                                                $dblist->tt_contentConfig['single'] = 0;
@@ -943,27 +950,27 @@ class SC_db_layout {
                                        }
                                break;
                        }
-       
+
                                // Start the dblist object:
                        $dblist->start($this->id,$table,$this->pointer,$this->search_field,$this->search_levels,$this->showLimit);
                        $dblist->counter = $CMcounter;
                        $dblist->ext_function = $this->MOD_SETTINGS['function'];
-                       
+
                                // Generate the list of elements here:
                        $dblist->generateList();
-       
+
                                // Adding the list content to the tableOutput variable:
                        $tableOutput[$table]=
                                                        ($h_func?$h_func.'<br /><img src="clear.gif" width="1" height="4" alt="" /><br />':'').
                                                        $dblist->HTMLcode.
                                                        ($h_func_b?'<img src="clear.gif" width="1" height="10" alt="" /><br />'.$h_func_b:'');
-                                                       
+
                                // ... and any accumulated JavaScript goes the same way!
                        $tableJSOutput[$table] = $dblist->JScode;
 
                                // Increase global counter:
                        $CMcounter+= $dblist->counter;
-                                                                                       
+
                                // Reset variables after operation:
                        $dblist->HTMLcode='';
                        $dblist->JScode='';
@@ -977,7 +984,7 @@ class SC_db_layout {
                $this->doc->bodyTagAdditions = $CMparts[1];
                $this->doc->JScode.= $CMparts[0];
                $this->doc->postCode.= $CMparts[2];
-       
+
 
                        // Draw the page header.
                $headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath']).'<br />'.
@@ -1011,7 +1018,7 @@ class SC_db_layout {
                        // Add CSH (Context Sensitive Help) icon to tool bar:
                $hT = trim(t3lib_BEfunc::helpText($this->descrTable,'columns',$BACK_PATH));
                $toolBar.=$hT?$hT.'<br />':t3lib_BEfunc::helpTextIcon($this->descrTable,'columns',$BACK_PATH);
-               
+
                        // Wrap the toolbar into a table:
                $headerSection.='
                        <table border="0" cellpadding="0" cellspacing="0" class="bgColor4">
@@ -1019,7 +1026,7 @@ class SC_db_layout {
                                        <td>'.$toolBar.'</td>
                                </tr>
                        </table>';
-       
+
 
                        // Create menu of table-icons for jumping to table-listing anchor points:
                if ($this->MOD_SETTINGS['function']!=3 && count($tableOutput)>1)        {
@@ -1027,7 +1034,7 @@ class SC_db_layout {
                } else {
                        $goToTable_menu = '';
                }
-               
+
                        // Compile the whole header section into a table: Toolbar, Table selector, Function menu(s), Page-edit icon:
                $hS2='
                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
@@ -1038,14 +1045,14 @@ class SC_db_layout {
                                        <td valign="top" align="right" width="1%"><img src="clear.gif" width="1" height="3" alt="" /><br />'.$this->editIcon.'</td>
                                </tr>
                        </table>';
-       
+
                        // Create page header:
                $this->content.=$this->doc->startPage($LANG->getLL('title'));
                $this->content.=$this->doc->section('',$hS2);
-               
+
 
                        // Now, create listing based on which element is selected in the function menu:
-               
+
                if ($this->MOD_SETTINGS['function']==3) {
 
                                // Making page info:
@@ -1059,12 +1066,12 @@ class SC_db_layout {
                                $this->content.=$this->doc->spacer(15);
                                $this->content.=$this->doc->sectionEnd();
                        }
-               
+
                                // Making search form:
-                       if (!$this->modTSconfig['properties']['disableSearchBox'] && count($tableOutput))       {       
+                       if (!$this->modTSconfig['properties']['disableSearchBox'] && count($tableOutput))       {
                                $this->content.=$this->doc->section($LANG->sL('LLL:EXT:lang/locallang_core.php:labels.search'),$dblist->getSearchBox(),0,1);
                        }
-                       
+
                                // Making display of Sys-notes (from extension "sys_note")
                        $dblist->id=$this->id;
                        $sysNotes = $dblist->showSysNotesForPage();
@@ -1075,14 +1082,14 @@ class SC_db_layout {
 
                                // Display advanced options: Clear cache, new record link etc:
                        if (!$this->modTSconfig['properties']['disableAdvanced'])       {
-                       
+
                                        // Clear cache links:
                                $af_content = $this->doc->clearCacheMenu($this->id);
-       
+
                                        // "Create new record" link:
                                if (!$this->modTSconfig['properties']['noCreateRecordsLink']) {
                                        $af_content.='
-                                       
+
                                        <!--
                                                Link for creating a new record:
                                        -->
@@ -1093,12 +1100,12 @@ class SC_db_layout {
                                                '</a>
                                        </div>';
                                }
-       
+
                                        // Add content of the advanced-options section:
                                $this->content.=$this->doc->spacer(10);
                                $this->content.=$this->doc->section($LANG->getLL('advancedFunctions'),$af_content,0,1);
                        }
-                       
+
                                // Add spacer in bottom of page:
                        $this->content.=$this->doc->spacer(10);
                }
@@ -1165,18 +1172,18 @@ class SC_db_layout {
                $exQ = $GLOBALS['BE_USER']->isAdmin() ? '' : ' AND sys_language.hidden=0';
                if ($id)        {
                        return $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                                                       'sys_language.*', 
-                                                       'pages_language_overlay,sys_language', 
+                                                       'sys_language.*',
+                                                       'pages_language_overlay,sys_language',
                                                        'pages_language_overlay.sys_language_uid=sys_language.uid AND pages_language_overlay.pid='.intval($id).$exQ,
-                                                       'pages_language_overlay.sys_language_uid', 
+                                                       'pages_language_overlay.sys_language_uid',
                                                        'sys_language.title'
                                                );
                } else {
                        return $GLOBALS['TYPO3_DB']->exec_SELECTquery(
-                                                       'sys_language.*', 
-                                                       'sys_language', 
-                                                       'sys_language.hidden=0', 
-                                                       '', 
+                                                       'sys_language.*',
+                                                       'sys_language',
+                                                       'sys_language.hidden=0',
+                                                       '',
                                                        'sys_language.title'
                                                );
                }
index d86e27d..d9ba0cf 100755 (executable)
@@ -4636,8 +4636,11 @@ class tslib_cObj {
                        $target = isset($conf['target']) ? $conf['target'] : $GLOBALS['TSFE']->intTarget;
                        if ($conf['target.'])   {$target=$this->stdWrap($target, $conf['target.']);}
 
+                               // Parse URL:
+                       $pU = parse_url($link_param);
+
                                // Detecting kind of link:
-                       if(strstr($link_param,'@'))     {               // If it's a mail address:
+                       if(strstr($link_param,'@') && !$pU['scheme'])   {               // If it's a mail address:
                                $link_param = eregi_replace('^mailto:','',$link_param);
                                if ($linktxt=='') $linktxt = $link_param;
                                if (!$GLOBALS['TSFE']->config['config']['jumpurl_enable'] || $GLOBALS['TSFE']->config['config']['jumpurl_mailto_disable'])      {
@@ -4664,12 +4667,12 @@ class tslib_cObj {
                                        $isLocalFile=1;
                                }
 
-                               if(!$isLocalFile && $urlChar && (strstr($link_param,'//') || !$fileChar || $urlChar<$fileChar)) {       // url (external): If doubleSlash or if a '.' comes before a '/'.
+                               if($pU['scheme'] || (!$isLocalFile && $urlChar && (!$fileChar || $urlChar<$fileChar)))  {       // url (external): If doubleSlash or if a '.' comes before a '/'.
                                        $target = isset($conf['extTarget']) ? $conf['extTarget'] : $GLOBALS['TSFE']->extTarget;
                                        if ($conf['extTarget.'])        {$target = $this->stdWrap($target, $conf['extTarget.']);}
                                        if ($forceTarget)       {$target=$forceTarget;}
                                        if ($linktxt=='') $linktxt = $link_param;
-                                       if (!ereg('^[a-z]*://',trim(strtolower($link_param))))  {$scheme='http://';} else {$scheme='';}
+                                       if (!$pU['scheme'])     {$scheme='http://';} else {$scheme='';}
                                        if ($GLOBALS['TSFE']->config['config']['jumpurl_enable'])       {
                                                $this->lastTypoLinkUrl = $GLOBALS['TSFE']->absRefPrefix.$GLOBALS['TSFE']->config['mainScript'].$initP.'&jumpurl='.rawurlencode($scheme.$link_param).$GLOBALS['TSFE']->getMethodUrlIdToken;
                                        } else {
@@ -4680,7 +4683,7 @@ class tslib_cObj {
                                        $finalTagParts['targetParams'] = $target ? ' target="'.$target.'"' : '';
                                        $finalTagParts['TYPE']='url';
                                } elseif ($fileChar || $isLocalFile)    {       // file (internal)
-                                       $splitLinkParam = explode('?',$link_param);
+                                       $splitLinkParam = explode('?', $link_param);
                                        if (@file_exists(rawurldecode($splitLinkParam[0])) || $isLocalFile)     {
                                                if ($linktxt=='') $linktxt = rawurldecode($link_param);
                                                if ($GLOBALS['TSFE']->config['config']['jumpurl_enable'])       {
index afdaa58..8189519 100755 (executable)
@@ -509,7 +509,10 @@ class tslib_pibase {
                        <'.trim('table '.$tableParams).'>
                                <tr>
                                        <td><input type="text" name="'.$this->prefixId.'[sword]" value="'.htmlspecialchars($this->piVars['sword']).'"'.$this->pi_classParam('searchbox-sword').' /></td>
-                                       <td><input type="submit" value="'.$this->pi_getLL('pi_list_searchBox_search','Search',TRUE).'"'.$this->pi_classParam('searchbox-button').' /><input type="hidden" name="no_cache" value="1" /></td>
+                                       <td><input type="submit" value="'.$this->pi_getLL('pi_list_searchBox_search','Search',TRUE).'"'.$this->pi_classParam('searchbox-button').' />'.
+                                               '<input type="hidden" name="no_cache" value="1" />'.
+                                               '<input type="hidden" name="'.$this->prefixId.'[pointer]" value="" />'.
+                                               '</td>
                                </tr>
                        </table>
                        </form>
index c36d043..0f9038d 100755 (executable)
@@ -279,12 +279,14 @@ class template {
         * @param       integer         If icon is for database record this is the UID for the record from $table
         * @param       boolean         Tells the top frame script that the link is coming from a "list" frame which means a frame from within the backend content frame.
         * @param       string          Additional GET parameters for the link to alt_clickmenu.php
+        * @param       string          Enable / Disable click menu items. Example: "+new,view" will display ONLY these two items (and any spacers in between), "new,view" will display all BUT these two items.
+        * @param       boolean         If set, will return only the onclick JavaScript, not the whole link.
         * @return      string          The link-wrapped input string.
         */
-       function wrapClickMenuOnIcon($str,$table,$uid='',$listFr=1,$addParams='')       {
+       function wrapClickMenuOnIcon($str,$table,$uid='',$listFr=1,$addParams='',$enDisItems='', $returnOnClick=FALSE)  {
                $backPath = '&backPath='.rawurlencode($this->backPath).'|'.t3lib_div::shortMD5($this->backPath.'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']);
-               $onClick = 'top.loadTopMenu(\''.$this->backPath.'alt_clickmenu.php?item='.rawurlencode($table.'|'.$uid.'|'.$listFr).$backPath.$addParams.'\');'.$this->thisBlur().'return false;';
-               return '<a href="#" onclick="'.htmlspecialchars($onClick).'">'.$str.'</a>';
+               $onClick = 'top.loadTopMenu(\''.$this->backPath.'alt_clickmenu.php?item='.rawurlencode($table.'|'.$uid.'|'.$listFr.'|'.$enDisItems).$backPath.$addParams.'\');'.$this->thisBlur().'return false;';
+               return $returnOnClick ? $onClick : '<a href="#" onclick="'.htmlspecialchars($onClick).'">'.$str.'</a>';
        }
 
        /**