Tiny bug with date function in t3lib_befunc. Casted timestamp to integer.
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_positionmap.php
old mode 100755 (executable)
new mode 100644 (file)
index 6a49c2a..f47e19b
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2004 Kasper Skaarhoj (kasper@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
@@ -31,7 +31,7 @@
  * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
  * XHTML compliant (should be)
  *
- * @author     Kasper Skaarhoj <kasper@typo3.com>
+ * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
  */
 /**
  * [CLASS/FUNCTION INDEX of SCRIPT]
  *
  *              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")
@@ -78,7 +78,7 @@
  * Position map class - generating a page tree / content element list which links for inserting (copy/move) of records.
  * Used for pages / tt_content element wizards of various kinds.
  *
- * @author     Kasper Skaarhoj <kasper@typo3.com>
+ * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage t3lib
  */
@@ -130,7 +130,7 @@ class t3lib_positionMap {
         * @return      string          HTML code for the tree.
         */
        function positionTree($id,$pageinfo,$perms_clause,$R_URI)       {
-               global $LANG;
+               global $LANG, $BE_USER;
 
                        // Make page tree object:
                $t3lib_pageTree = t3lib_div::makeInstance('localPageTree');
@@ -204,7 +204,7 @@ class t3lib_positionMap {
                                // The line with the icon and title:
                        $t_code='<span class="nobr">'.
                                $dat['HTML'].
-                               $this->linkPageTitle($this->boldTitle(htmlspecialchars(t3lib_div::fixed_lgd($dat['row']['title'],$BE_USER->uc['titleLen'])),$dat,$id),$dat['row']).
+                               $this->linkPageTitle($this->boldTitle(htmlspecialchars(t3lib_div::fixed_lgd_cs($dat['row']['title'],$BE_USER->uc['titleLen'])),$dat,$id),$dat['row']).
                                '</span><br />';
                        $code.=$t_code;
                }
@@ -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;
                        }
                }
@@ -415,15 +415,19 @@ class t3lib_positionMap {
                                                                ($showHidden ? '' : t3lib_BEfunc::BEenableFields('tt_content')).
                                                                ' AND colPos='.intval($vv).
                                                                (strcmp($this->cur_sys_language,'') ? ' AND sys_language_uid='.intval($this->cur_sys_language) : '').
-                                                               t3lib_BEfunc::deleteClause('tt_content'),
+                                                               t3lib_BEfunc::deleteClause('tt_content').
+                                                               t3lib_BEfunc::versioningPlaceholderClause('tt_content'),
                                                        '',
                                                        'sorting'
                                                );
                        $lines[$kk]=array();
                        $lines[$kk][]=$this->insertPositionIcon('',$vv,$kk,$moveUid,$pid);
                        while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))               {
-                               $lines[$kk][]=$this->wrapRecordHeader($this->getRecordHeader($row),$row);
-                               $lines[$kk][]=$this->insertPositionIcon($row,$vv,$kk,$moveUid,$pid);
+                               t3lib_BEfunc::workspaceOL('tt_content',$row);
+                               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);
                }
@@ -516,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;';
        }
 
        /**
@@ -538,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);
        }