Added feature #13953: Hookrequest - t3lib_page::getRecordOverlay (thanks to Tolleiv...
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_positionmap.php
old mode 100755 (executable)
new mode 100644 (file)
index 53ac51c..f47e19b
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
+*  (c) 1999-2009 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
  *
  *              SECTION: Content element positioning:
  *  404:     function printContentElementColumns($pid,$moveUid,$colPosList,$showHidden,$R_URI)
- *  440:     function printRecordMap($lines,$colPosArray)
- *  478:     function wrapColumnHeader($str,$vv)
- *  492:     function insertPositionIcon($row,$vv,$kk,$moveUid,$pid)
- *  509:     function onClickInsertRecord($row,$vv,$moveUid,$pid,$sys_lang=0)
- *  529:     function wrapRecordHeader($str,$row)
- *  539:     function getRecordHeader($row)
- *  552:     function wrapRecordTitle($str,$row)
+ *  442:     function printRecordMap($lines,$colPosArray)
+ *  480:     function wrapColumnHeader($str,$vv)
+ *  494:     function insertPositionIcon($row,$vv,$kk,$moveUid,$pid)
+ *  511:     function onClickInsertRecord($row,$vv,$moveUid,$pid,$sys_lang=0)
+ *  531:     function wrapRecordHeader($str,$row)
+ *  541:     function getRecordHeader($row)
+ *  554:     function wrapRecordTitle($str,$row)
  *
  * TOTAL FUNCTIONS: 17
  * (This index is automatically created/updated by the extension "extdeveval")
@@ -295,7 +295,7 @@ class t3lib_positionMap {
 
                if ($TSconfigProp['overrideWithExtension'])     {
                        if (t3lib_extMgm::isLoaded($TSconfigProp['overrideWithExtension']))     {
-                               $onclick = "document.location='".t3lib_extMgm::extRelPath($TSconfigProp['overrideWithExtension']).'mod1/index.php?cmd=crPage&positionPid='.$pid."';";
+                               $onclick = "window.location.href='".t3lib_extMgm::extRelPath($TSconfigProp['overrideWithExtension']).'mod1/index.php?cmd=crPage&positionPid='.$pid."';";
                                return $onclick;
                        }
                }
@@ -424,8 +424,10 @@ class t3lib_positionMap {
                        $lines[$kk][]=$this->insertPositionIcon('',$vv,$kk,$moveUid,$pid);
                        while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))               {
                                t3lib_BEfunc::workspaceOL('tt_content',$row);
-                               $lines[$kk][]=$this->wrapRecordHeader($this->getRecordHeader($row),$row);
-                               $lines[$kk][]=$this->insertPositionIcon($row,$vv,$kk,$moveUid,$pid);
+                               if (is_array($row))     {
+                                       $lines[$kk][]=$this->wrapRecordHeader($this->getRecordHeader($row),$row);
+                                       $lines[$kk][]=$this->insertPositionIcon($row,$vv,$kk,$moveUid,$pid);
+                               }
                        }
                        $GLOBALS['TYPO3_DB']->sql_free_result($res);
                }
@@ -518,7 +520,7 @@ class t3lib_positionMap {
 //             $location.='&redirect='.rawurlencode($this->R_URI);             // returns to prev. page
                $location.='&uPT=1&redirect='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));               // This redraws screen
 
-               return 'document.location=\''.$location.'\';return false;';
+               return 'window.location.href=\''.$location.'\';return false;';
        }
 
        /**
@@ -540,7 +542,7 @@ class t3lib_positionMap {
         */
        function getRecordHeader($row)  {
                $line = t3lib_iconWorks::getIconImage('tt_content',$row,$this->backPath,' align="top" title="'.htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($row,'tt_content')).'"');
-               $line.= t3lib_BEfunc::getRecordTitle('tt_content',$row,1);
+               $line.= t3lib_BEfunc::getRecordTitle('tt_content',$row,TRUE);
                return $this->wrapRecordTitle($line,$row);
        }