*/ /** * [CLASS/FUNCTION INDEX of SCRIPT] * * * * 85: class t3lib_positionMap * * SECTION: Page position map: * 132: function positionTree($id,$pageinfo,$perms_clause,$R_URI) * 246: function JSimgFunc($prefix='') * 276: function boldTitle($t_code,$dat,$id) * 293: function onClickEvent($pid,$newPagePID) * 312: function insertlabel() * 324: function linkPageTitle($str,$rec) * 335: function checkNewPageInPid($pid) * 351: function getModConfig($pid) * 366: function insertQuadLines($codes,$allBlank=0) * * SECTION: Content element positioning: * 404: function printContentElementColumns($pid,$moveUid,$colPosList,$showHidden,$R_URI) * 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") * */ /** * 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 Skårhøj * @package TYPO3 * @subpackage t3lib */ class t3lib_positionMap { // EXTERNAL, static: var $moveOrCopy = 'move'; var $dontPrintPageInsertIcons = 0; var $backPath = ''; var $depth = 2; // How deep the position page tree will go. var $cur_sys_language; // Can be set to the sys_language uid to select content elements for. // INTERNAL, dynamic: var $R_URI = ''; // Request uri var $elUid = ''; // Element id. var $moveUid = ''; // tt_content element uid to move. // Caching arrays: var $getModConfigCache = array(); var $checkNewPageCache = Array(); // Label keys: var $l_insertNewPageHere = 'insertNewPageHere'; var $l_insertNewRecordHere = 'insertNewRecordHere'; var $modConfigStr = 'mod.web_list.newPageWiz'; /************************************* * * Page position map: * **************************************/ /** * Creates a "position tree" based on the page tree. * 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. * * @param integer Current page id * @param array Current page record. * @param string Page selection permission clause. * @param string Current REQUEST_URI * @return string HTML code for the tree. */ function positionTree($id, $pageinfo, $perms_clause, $R_URI) { global $LANG, $BE_USER; $code = ''; // Make page tree object: $t3lib_pageTree = t3lib_div::makeInstance('localPageTree'); $t3lib_pageTree->init(' AND ' . $perms_clause); $t3lib_pageTree->addField('pid'); // Initialize variables: $this->R_URI = $R_URI; $this->elUid = $id; // Create page tree, in $this->depth levels. $t3lib_pageTree->getTree($pageinfo['pid'], $this->depth); if (!$this->dontPrintPageInsertIcons) { $code .= $this->JSimgFunc(); } // Initialize variables: $saveBlankLineState = array(); $saveLatestUid = array(); $latestInvDepth = $this->depth; // Traverse the tree: foreach ($t3lib_pageTree->tree as $cc => $dat) { // Make link + parameters. $latestInvDepth = $dat['invertedDepth']; $saveLatestUid[$latestInvDepth] = $dat; if (isset($t3lib_pageTree->tree[$cc - 1])) { $prev_dat = $t3lib_pageTree->tree[$cc - 1]; // If current page, subpage? if ($prev_dat['row']['uid'] == $id) { 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... $code .= '' . $this->insertQuadLines($dat['blankLineCode']) . '' . '' . 'backPath, 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' name="mImgSubpage' . $cc . '" border="0" align="top" title="' . $this->insertlabel() . '" alt="" />' . '
'; } } if ($prev_dat['invertedDepth'] > $t3lib_pageTree->tree[$cc]['invertedDepth']) { // If going down $prevPid = $t3lib_pageTree->tree[$cc]['row']['pid']; } elseif ($prev_dat['invertedDepth'] < $t3lib_pageTree->tree[$cc]['invertedDepth']) { // If going up // First of all the previous level should have an icon: if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($prev_dat['row']['pid'])) { $prevPid = (-$prev_dat['row']['uid']); $code .= '' . $this->insertQuadLines($dat['blankLineCode']) . '' . '' . 'backPath, 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' name="mImgAfter' . $cc . '" border="0" align="top" title="' . $this->insertlabel() . '" alt="" />' . '
'; } // Then set the current prevPid $prevPid = -$prev_dat['row']['pid']; } else { $prevPid = -$prev_dat['row']['uid']; // In on the same level } } else { $prevPid = $dat['row']['pid']; // First in the tree } if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) { $code .= '' . $this->insertQuadLines($dat['blankLineCode']) . '' . 'backPath, 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' name="mImg' . $cc . '" border="0" align="top" title="' . $this->insertlabel() . '" alt="" />' . '
'; } // The line with the icon and title: $t_code = '' . $dat['HTML'] . $this->linkPageTitle($this->boldTitle(htmlspecialchars(t3lib_div::fixed_lgd_cs($dat['row']['title'], $BE_USER->uc['titleLen'])), $dat, $id), $dat['row']) . '
'; $code .= $t_code; } // If the current page was the last in the tree: $prev_dat = end($t3lib_pageTree->tree); if ($prev_dat['row']['uid'] == $id) { if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($id)) { $code .= '' . $this->insertQuadLines($saveLatestUid[$latestInvDepth]['blankLineCode'], 1) . '' . '' . 'backPath, 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' name="mImgSubpage' . $cc . '" border="0" align="top" title="' . $this->insertlabel() . '" alt="" />' . '
'; } } for ($a = $latestInvDepth; $a <= $this->depth; $a++) { $dat = $saveLatestUid[$a]; $prevPid = (-$dat['row']['uid']); if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) { $code .= '' . $this->insertQuadLines($dat['blankLineCode'], 1) . '' . 'backPath, 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' name="mImgEnd' . $a . '" border="0" align="top" title="' . $this->insertlabel() . '" alt="" />' . '
'; } } return $code; } /** * Creates the JavaScritp for insert new-record rollover image * * @param string Insert record image prefix. * @return string