TYPO3 API  SVNRelease
class.t3lib_positionmap.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003  *  Copyright notice
00004  *
00005  *  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
00006  *  All rights reserved
00007  *
00008  *  This script is part of the TYPO3 project. The TYPO3 project is
00009  *  free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  The GNU General Public License can be found at
00015  *  http://www.gnu.org/copyleft/gpl.html.
00016  *  A copy is found in the textfile GPL.txt and important notices to the license
00017  *  from the author is found in LICENSE.txt distributed with these scripts.
00018  *
00019  *
00020  *  This script is distributed in the hope that it will be useful,
00021  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  *  GNU General Public License for more details.
00024  *
00025  *  This copyright notice MUST APPEAR in all copies of the script!
00026  ***************************************************************/
00027 /**
00028  * Contains class for creating a position map.
00029  *
00030  * $Id: class.t3lib_positionmap.php 10161 2011-01-20 14:54:34Z baschny $
00031  * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
00032  * XHTML compliant (should be)
00033  *
00034  * @author  Kasper Skårhøj <kasperYYYY@typo3.com>
00035  */
00036 /**
00037  * [CLASS/FUNCTION INDEX of SCRIPT]
00038  *
00039  *
00040  *
00041  *   85: class t3lib_positionMap
00042  *
00043  *            SECTION: Page position map:
00044  *  132:     function positionTree($id,$pageinfo,$perms_clause,$R_URI)
00045  *  246:     function JSimgFunc($prefix='')
00046  *  276:     function boldTitle($t_code,$dat,$id)
00047  *  293:     function onClickEvent($pid,$newPagePID)
00048  *  312:     function insertlabel()
00049  *  324:     function linkPageTitle($str,$rec)
00050  *  335:     function checkNewPageInPid($pid)
00051  *  351:     function getModConfig($pid)
00052  *  366:     function insertQuadLines($codes,$allBlank=0)
00053  *
00054  *            SECTION: Content element positioning:
00055  *  404:     function printContentElementColumns($pid,$moveUid,$colPosList,$showHidden,$R_URI)
00056  *  442:     function printRecordMap($lines,$colPosArray)
00057  *  480:     function wrapColumnHeader($str,$vv)
00058  *  494:     function insertPositionIcon($row,$vv,$kk,$moveUid,$pid)
00059  *  511:     function onClickInsertRecord($row,$vv,$moveUid,$pid,$sys_lang=0)
00060  *  531:     function wrapRecordHeader($str,$row)
00061  *  541:     function getRecordHeader($row)
00062  *  554:     function wrapRecordTitle($str,$row)
00063  *
00064  * TOTAL FUNCTIONS: 17
00065  * (This index is automatically created/updated by the extension "extdeveval")
00066  *
00067  */
00068 
00069 
00070 /**
00071  * Position map class - generating a page tree / content element list which links for inserting (copy/move) of records.
00072  * Used for pages / tt_content element wizards of various kinds.
00073  *
00074  * @author  Kasper Skårhøj <kasperYYYY@typo3.com>
00075  * @package TYPO3
00076  * @subpackage t3lib
00077  */
00078 class t3lib_positionMap {
00079 
00080         // EXTERNAL, static:
00081     var $moveOrCopy = 'move';
00082     var $dontPrintPageInsertIcons = 0;
00083     var $backPath = '';
00084     var $depth = 2; // How deep the position page tree will go.
00085     var $cur_sys_language; // Can be set to the sys_language uid to select content elements for.
00086 
00087 
00088         // INTERNAL, dynamic:
00089     var $R_URI = ''; // Request uri
00090     var $elUid = ''; // Element id.
00091     var $moveUid = ''; // tt_content element uid to move.
00092 
00093         // Caching arrays:
00094     var $getModConfigCache = array();
00095     var $checkNewPageCache = Array();
00096 
00097         // Label keys:
00098     var $l_insertNewPageHere = 'insertNewPageHere';
00099     var $l_insertNewRecordHere = 'insertNewRecordHere';
00100 
00101     var $modConfigStr = 'mod.web_list.newPageWiz';
00102 
00103 
00104     /*************************************
00105      *
00106      * Page position map:
00107      *
00108      **************************************/
00109 
00110     /**
00111      * Creates a "position tree" based on the page tree.
00112      * Notice: A class, "localPageTree" must exist and probably it is an extension class of the t3lib_pageTree class. See "db_new.php" in the core for an example.
00113      *
00114      * @param   integer     Current page id
00115      * @param   array       Current page record.
00116      * @param   string      Page selection permission clause.
00117      * @param   string      Current REQUEST_URI
00118      * @return  string      HTML code for the tree.
00119      */
00120     function positionTree($id, $pageinfo, $perms_clause, $R_URI) {
00121         global $LANG, $BE_USER;
00122 
00123             // Make page tree object:
00124         $t3lib_pageTree = t3lib_div::makeInstance('localPageTree');
00125         $t3lib_pageTree->init(' AND ' . $perms_clause);
00126         $t3lib_pageTree->addField('pid');
00127 
00128             // Initialize variables:
00129         $this->R_URI = $R_URI;
00130         $this->elUid = $id;
00131 
00132             // Create page tree, in $this->depth levels.
00133         $t3lib_pageTree->getTree($pageinfo['pid'], $this->depth);
00134         if (!$this->dontPrintPageInsertIcons) {
00135             $code .= $this->JSimgFunc();
00136         }
00137 
00138             // Initialize variables:
00139         $saveBlankLineState = array();
00140         $saveLatestUid = array();
00141         $latestInvDepth = $this->depth;
00142 
00143             // Traverse the tree:
00144         foreach ($t3lib_pageTree->tree as $cc => $dat) {
00145 
00146                 // Make link + parameters.
00147             $latestInvDepth = $dat['invertedDepth'];
00148             $saveLatestUid[$latestInvDepth] = $dat;
00149             if (isset($t3lib_pageTree->tree[$cc - 1])) {
00150                 $prev_dat = $t3lib_pageTree->tree[$cc - 1];
00151 
00152                     // If current page, subpage?
00153                 if ($prev_dat['row']['uid'] == $id) {
00154                     if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($id) && !($prev_dat['invertedDepth'] > $t3lib_pageTree->tree[$cc]['invertedDepth'])) { // 1) It must be allowed to create a new page and 2) If there are subpages there is no need to render a subpage icon here - it'll be done over the subpages...
00155                         $code .= '<span class="nobr">' .
00156                                  $this->insertQuadLines($dat['blankLineCode']) .
00157                                  '<img src="clear.gif" width="18" height="8" align="top" alt="" />' .
00158                                  '<a href="#" onclick="' . htmlspecialchars($this->onClickEvent($id, $id, 1)) . '" onmouseover="' . htmlspecialchars('changeImg(\'mImgSubpage' . $cc . '\',0);') . '" onmouseout="' . htmlspecialchars('changeImg(\'mImgSubpage' . $cc . '\',1);') . '">' .
00159                                  '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' name="mImgSubpage' . $cc . '" border="0" align="top" title="' . $this->insertlabel() . '" alt="" />' .
00160                                  '</a></span><br />';
00161                     }
00162                 }
00163 
00164                 if ($prev_dat['invertedDepth'] > $t3lib_pageTree->tree[$cc]['invertedDepth']) { // If going down
00165                     $prevPid = $t3lib_pageTree->tree[$cc]['row']['pid'];
00166                 } elseif ($prev_dat['invertedDepth'] < $t3lib_pageTree->tree[$cc]['invertedDepth']) { // If going up
00167                     // First of all the previous level should have an icon:
00168                     if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($prev_dat['row']['pid'])) {
00169                         $prevPid = (-$prev_dat['row']['uid']);
00170                         $code .= '<span class="nobr">' .
00171                                  $this->insertQuadLines($dat['blankLineCode']) .
00172                                  '<img src="clear.gif" width="18" height="1" align="top" alt="" />' .
00173                                  '<a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $prev_dat['row']['pid'], 2)) . '" onmouseover="' . htmlspecialchars('changeImg(\'mImgAfter' . $cc . '\',0);') . '" onmouseout="' . htmlspecialchars('changeImg(\'mImgAfter' . $cc . '\',1);') . '">' .
00174                                  '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' name="mImgAfter' . $cc . '" border="0" align="top" title="' . $this->insertlabel() . '" alt="" />' .
00175                                  '</a></span><br />';
00176                     }
00177 
00178                         // Then set the current prevPid
00179                     $prevPid = -$prev_dat['row']['pid'];
00180                 } else {
00181                     $prevPid = -$prev_dat['row']['uid']; // In on the same level
00182                 }
00183             } else {
00184                 $prevPid = $dat['row']['pid']; // First in the tree
00185             }
00186             if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) {
00187                 $code .= '<span class="nobr">' .
00188                          $this->insertQuadLines($dat['blankLineCode']) .
00189                          '<a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $dat['row']['pid'], 3)) . '" onmouseover="' . htmlspecialchars('changeImg(\'mImg' . $cc . '\',0);') . '" onmouseout="' . htmlspecialchars('changeImg(\'mImg' . $cc . '\',1);') . '">' .
00190                          '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' name="mImg' . $cc . '" border="0" align="top" title="' . $this->insertlabel() . '" alt="" />' .
00191                          '</a></span><br />';
00192             }
00193 
00194                 // The line with the icon and title:
00195             $t_code = '<span class="nobr">' .
00196                       $dat['HTML'] .
00197                       $this->linkPageTitle($this->boldTitle(htmlspecialchars(t3lib_div::fixed_lgd_cs($dat['row']['title'], $BE_USER->uc['titleLen'])), $dat, $id), $dat['row']) .
00198                       '</span><br />';
00199             $code .= $t_code;
00200         }
00201 
00202             // If the current page was the last in the tree:
00203         $prev_dat = end($t3lib_pageTree->tree);
00204         if ($prev_dat['row']['uid'] == $id) {
00205             if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($id)) {
00206                 $code .= '<span class="nobr">' .
00207                          $this->insertQuadLines($saveLatestUid[$latestInvDepth]['blankLineCode'], 1) .
00208                          '<img src="clear.gif" width="18" height="8" align="top" alt="" />' .
00209                          '<a href="#" onclick="' . $this->onClickEvent($id, $id, 4) . '" onmouseover="' . htmlspecialchars('changeImg(\'mImgSubpage' . $cc . '\',0);') . '" onmouseout="' . htmlspecialchars('changeImg(\'mImgSubpage' . $cc . '\',1);') . '">' .
00210                          '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' name="mImgSubpage' . $cc . '" border="0" align="top" title="' . $this->insertlabel() . '" alt="" />' .
00211                          '</a></span><br />';
00212             }
00213         }
00214 
00215         for ($a = $latestInvDepth; $a <= $this->depth; $a++) {
00216             $dat = $saveLatestUid[$a];
00217             $prevPid = (-$dat['row']['uid']);
00218             if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) {
00219                 $code .= '<span class="nobr">' .
00220                          $this->insertQuadLines($dat['blankLineCode'], 1) .
00221                          '<a href="#" onclick="' . htmlspecialchars($this->onClickEvent($prevPid, $dat['row']['pid'], 5)) . '" onmouseover="' . htmlspecialchars('changeImg(\'mImgEnd' . $a . '\',0);') . '" onmouseout="' . htmlspecialchars('changeImg(\'mImgEnd' . $a . '\',1);') . '">' .
00222                          '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' name="mImgEnd' . $a . '" border="0" align="top" title="' . $this->insertlabel() . '" alt="" />' .
00223                          '</a></span><br />';
00224             }
00225         }
00226 
00227         return $code;
00228     }
00229 
00230     /**
00231      * Creates the JavaScritp for insert new-record rollover image
00232      *
00233      * @param   string      Insert record image prefix.
00234      * @return  string      <script> section
00235      */
00236     function JSimgFunc($prefix = '') {
00237         $code .= $GLOBALS['TBE_TEMPLATE']->wrapScriptTags('
00238 
00239             var img_newrecord_marker=new Image();
00240             img_newrecord_marker.src = "' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/newrecord' . $prefix . '_marker.gif', '', 1) . '";
00241 
00242             var img_newrecord_marker_d=new Image();
00243             img_newrecord_marker_d.src = "' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/newrecord' . $prefix . '_marker_d.gif', '', 1) . '";
00244 
00245             function changeImg(name,d)  {   //
00246                 if (document[name]) {
00247                     if (d)  {
00248                         document[name].src = img_newrecord_marker_d.src;
00249                     } else {
00250                         document[name].src = img_newrecord_marker.src;
00251                     }
00252                 }
00253             }
00254         ');
00255         return $code;
00256     }
00257 
00258     /**
00259      * Wrap $t_code in bold IF the $dat uid matches $id
00260      *
00261      * @param   string      Title string
00262      * @param   array       Infomation array with record array inside.
00263      * @param   integer     The current id.
00264      * @return  string      The title string.
00265      */
00266     function boldTitle($t_code, $dat, $id) {
00267         if ($dat['row']['uid'] == $id) {
00268             $t_code = '<strong>' . $t_code . '</strong>';
00269         }
00270         return $t_code;
00271     }
00272 
00273     /**
00274      * Creates the onclick event for the insert-icons.
00275      *
00276      * TSconfig mod.web_list.newPageWiz.overrideWithExtension may contain an extension which provides a module
00277      * to be used instead of the normal create new page wizard.
00278      *
00279      * @param   integer     The pid.
00280      * @param   integer     New page id.
00281      * @return  string      Onclick attribute content
00282      */
00283     function onClickEvent($pid, $newPagePID) {
00284         $TSconfigProp = $this->getModConfig($newPagePID);
00285 
00286         if ($TSconfigProp['overrideWithExtension']) {
00287             if (t3lib_extMgm::isLoaded($TSconfigProp['overrideWithExtension'])) {
00288                 $onclick = "window.location.href='" . t3lib_extMgm::extRelPath($TSconfigProp['overrideWithExtension']) . 'mod1/index.php?cmd=crPage&positionPid=' . $pid . "';";
00289                 return $onclick;
00290             }
00291         }
00292 
00293         $params = '&edit[pages][' . $pid . ']=new&returnNewPageId=1';
00294         return t3lib_BEfunc::editOnClick($params, '', $this->R_URI);
00295     }
00296 
00297     /**
00298      * Get label, htmlspecialchars()'ed
00299      *
00300      * @return  string      The localized label for "insert new page here"
00301      */
00302     function insertlabel() {
00303         global $LANG;
00304         return $LANG->getLL($this->l_insertNewPageHere, 1);
00305     }
00306 
00307     /**
00308      * Wrapping page title.
00309      *
00310      * @param   string      Page title.
00311      * @param   array       Page record (?)
00312      * @return  string      Wrapped title.
00313      */
00314     function linkPageTitle($str, $rec) {
00315         return $str;
00316     }
00317 
00318     /**
00319      * Checks if the user has permission to created pages inside of the $pid page.
00320      * Uses caching so only one regular lookup is made - hence you can call the function multiple times without worrying about performance.
00321      *
00322      * @param   integer     Page id for which to test.
00323      * @return  boolean
00324      */
00325     function checkNewPageInPid($pid) {
00326         global $BE_USER;
00327         if (!isset($this->checkNewPageCache[$pid])) {
00328             $pidInfo = t3lib_BEfunc::getRecord('pages', $pid);
00329             $this->checkNewPageCache[$pid] = ($BE_USER->isAdmin() || $BE_USER->doesUserHaveAccess($pidInfo, 8));
00330         }
00331         return $this->checkNewPageCache[$pid];
00332     }
00333 
00334     /**
00335      * Returns module configuration for a pid.
00336      *
00337      * @param   integer     Page id for which to get the module configuration.
00338      * @return  array       The properties of teh module configuration for the page id.
00339      * @see onClickEvent()
00340      */
00341     function getModConfig($pid) {
00342         if (!isset($this->getModConfigCache[$pid])) {
00343                 // Acquiring TSconfig for this PID:
00344             $this->getModConfigCache[$pid] = t3lib_BEfunc::getModTSconfig($pid, $this->modConfigStr);
00345         }
00346         return $this->getModConfigCache[$pid]['properties'];
00347     }
00348 
00349     /**
00350      * Insert half/quad lines.
00351      *
00352      * @param   string      keywords for which lines to insert.
00353      * @param   boolean     If true all lines are just blank clear.gifs
00354      * @return  string      HTML content.
00355      */
00356     function insertQuadLines($codes, $allBlank = 0) {
00357         $codeA = t3lib_div::trimExplode(',', $codes . ",line", 1);
00358 
00359         $lines = array();
00360         foreach ($codeA as $code) {
00361             if ($code == "blank" || $allBlank) {
00362                 $lines[] = '<img src="clear.gif" width="18" height="8" align="top" alt="" />';
00363             } else {
00364                 $lines[] = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/ol/halfline.gif', 'width="18" height="8"') . ' align="top" alt="" />';
00365             }
00366         }
00367         return implode('', $lines);
00368     }
00369 
00370 
00371     /*************************************
00372      *
00373      * Content element positioning:
00374      *
00375      **************************************/
00376 
00377     /**
00378      * Creates HTML for inserting/moving content elements.
00379      *
00380      * @param   integer     page id onto which to insert content element.
00381      * @param   integer     Move-uid (tt_content element uid?)
00382      * @param   string      List of columns to show
00383      * @param   boolean     If not set, then hidden/starttime/endtime records are filtered out.
00384      * @param   string      Request URI
00385      * @return  string      HTML
00386      */
00387     function printContentElementColumns($pid, $moveUid, $colPosList, $showHidden, $R_URI) {
00388         $this->R_URI = $R_URI;
00389         $this->moveUid = $moveUid;
00390         $colPosArray = t3lib_div::trimExplode(',', $colPosList, 1);
00391 
00392         $lines = array();
00393         foreach ($colPosArray as $kk => $vv) {
00394             $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
00395                 '*',
00396                 'tt_content',
00397                 'pid=' . intval($pid) .
00398                 ($showHidden ? '' : t3lib_BEfunc::BEenableFields('tt_content')) .
00399                 ' AND colPos=' . intval($vv) .
00400                 (strcmp($this->cur_sys_language, '') ? ' AND sys_language_uid=' . intval($this->cur_sys_language) : '') .
00401                 t3lib_BEfunc::deleteClause('tt_content') .
00402                 t3lib_BEfunc::versioningPlaceholderClause('tt_content'),
00403                 '',
00404                 'sorting'
00405             );
00406             $lines[$kk] = array();
00407             $lines[$kk][] = $this->insertPositionIcon('', $vv, $kk, $moveUid, $pid);
00408             while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
00409                 t3lib_BEfunc::workspaceOL('tt_content', $row);
00410                 if (is_array($row)) {
00411                     $lines[$kk][] = $this->wrapRecordHeader($this->getRecordHeader($row), $row);
00412                     $lines[$kk][] = $this->insertPositionIcon($row, $vv, $kk, $moveUid, $pid);
00413                 }
00414             }
00415             $GLOBALS['TYPO3_DB']->sql_free_result($res);
00416         }
00417         return $this->printRecordMap($lines, $colPosArray);
00418     }
00419 
00420     /**
00421      * Creates the table with the content columns
00422      *
00423      * @param   array       Array with arrays of lines for each column
00424      * @param   array       Column position array
00425      * @return  string      HTML
00426      */
00427     function printRecordMap($lines, $colPosArray) {
00428         $row1 = '';
00429         $row2 = '';
00430         $count = t3lib_div::intInRange(count($colPosArray), 1);
00431 
00432             // Traverse the columns here:
00433         foreach ($colPosArray as $kk => $vv) {
00434             $row1 .= '<td align="center" width="' . round(100 / $count) . '%"><span class="uppercase"><strong>' .
00435                      $this->wrapColumnHeader($GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content', 'colPos', $vv), 1), $vv) .
00436                      '</strong></span></td>';
00437             $row2 .= '<td valign="top" nowrap="nowrap">' .
00438                      implode('<br />', $lines[$kk]) .
00439                      '</td>';
00440         }
00441 
00442         $table = '
00443 
00444         <!--
00445             Map of records in columns:
00446         -->
00447         <table border="0" cellpadding="0" cellspacing="1" id="typo3-ttContentList">
00448             <tr class="bgColor5">' . $row1 . '</tr>
00449             <tr>' . $row2 . '</tr>
00450         </table>
00451 
00452         ';
00453 
00454         return $this->JSimgFunc('2') . $table;
00455     }
00456 
00457     /**
00458      * Wrapping the column header
00459      *
00460      * @param   string      Header value
00461      * @param   string      Column info.
00462      * @return  string
00463      * @see printRecordMap()
00464      */
00465     function wrapColumnHeader($str, $vv) {
00466         return $str;
00467     }
00468 
00469     /**
00470      * Creates a linked position icon.
00471      *
00472      * @param   array       Element row.
00473      * @param   string      Column position value.
00474      * @param   integer     Column key.
00475      * @param   integer     Move uid
00476      * @param   integer     PID value.
00477      * @return  string
00478      */
00479     function insertPositionIcon($row, $vv, $kk, $moveUid, $pid) {
00480         $cc = hexdec(substr(md5($row['uid'] . '-' . $vv . '-' . $kk), 0, 4));
00481         return '<a href="#" onclick="' . htmlspecialchars($this->onClickInsertRecord($row, $vv, $moveUid, $pid, $this->cur_sys_language)) . '" onmouseover="' . htmlspecialchars('changeImg(\'mImg' . $cc . '\',0);') . '" onmouseout="' . htmlspecialchars('changeImg(\'mImg' . $cc . '\',1);') . '">' .
00482                '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/newrecord2_marker_d.gif', 'width="100" height="8"') . ' name="mImg' . $cc . '" border="0" align="top" title="' . $GLOBALS['LANG']->getLL($this->l_insertNewRecordHere, 1) . '" alt="" />' .
00483                '</a>';
00484     }
00485 
00486     /**
00487      * Create on-click event value.
00488      *
00489      * @param   array       The record.
00490      * @param   string      Column position value.
00491      * @param   integer     Move uid
00492      * @param   integer     PID value.
00493      * @param   integer     System language (not used currently)
00494      * @return  string
00495      */
00496     function onClickInsertRecord($row, $vv, $moveUid, $pid, $sys_lang = 0) {
00497         $table = 'tt_content';
00498         if (is_array($row)) {
00499             $location = 'tce_db.php?cmd[' . $table . '][' . $moveUid . '][' . $this->moveOrCopy . ']=-' . $row['uid'] . '&prErr=1&uPT=1&vC=' . $GLOBALS['BE_USER']->veriCode() . t3lib_BEfunc::getUrlToken('tceAction');
00500         } else {
00501             $location = 'tce_db.php?cmd[' . $table . '][' . $moveUid . '][' . $this->moveOrCopy . ']=' . $pid . '&data[' . $table . '][' . $moveUid . '][colPos]=' . $vv . '&prErr=1&vC=' . $GLOBALS['BE_USER']->veriCode() . t3lib_BEfunc::getUrlToken('tceAction');
00502         }
00503             //      $location.='&redirect='.rawurlencode($this->R_URI);     // returns to prev. page
00504         $location .= '&uPT=1&redirect=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')); // This redraws screen
00505 
00506         return 'window.location.href=\'' . $location . '\';return false;';
00507     }
00508 
00509     /**
00510      * Wrapping the record header  (from getRecordHeader())
00511      *
00512      * @param   string      HTML content
00513      * @param   array       Record array.
00514      * @return  string      HTML content
00515      */
00516     function wrapRecordHeader($str, $row) {
00517         return $str;
00518     }
00519 
00520     /**
00521      * Create record header (includes teh record icon, record title etc.)
00522      *
00523      * @param   array       Record row.
00524      * @return  string      HTML
00525      */
00526     function getRecordHeader($row) {
00527         $line = t3lib_iconWorks::getSpriteIconForRecord('tt_content', $row, array('title' => htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($row, 'tt_content'))));
00528         $line .= t3lib_BEfunc::getRecordTitle('tt_content', $row, TRUE);
00529         return $this->wrapRecordTitle($line, $row);
00530     }
00531 
00532     /**
00533      * Wrapping the title of the record.
00534      *
00535      * @param   string      The title value.
00536      * @param   array       The record row.
00537      * @return  string      Wrapped title string.
00538      */
00539     function wrapRecordTitle($str, $row) {
00540         return '<a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('uid' => intval($row['uid']), 'moveUid' => ''))) . '">' . $str . '</a>';
00541     }
00542 }
00543 
00544 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_positionmap.php'])) {
00545     include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_positionmap.php']);
00546 }
00547 ?>