Index: t3lib/class.t3lib_positionmap.php
===================================================================
--- t3lib/class.t3lib_positionmap.php (revision 8742)
+++ t3lib/class.t3lib_positionmap.php (revision )
@@ -1,29 +1,29 @@
init(' AND '.$perms_clause);
+ $t3lib_pageTree->init(' AND ' . $perms_clause);
$t3lib_pageTree->addField('pid');
// Initialize variables:
@@ -143,94 +131,96 @@
// Create page tree, in $this->depth levels.
$t3lib_pageTree->getTree($pageinfo['pid'], $this->depth);
- if (!$this->dontPrintPageInsertIcons) $code.=$this->JSimgFunc();
+ if (!$this->dontPrintPageInsertIcons) {
+ $code .= $this->JSimgFunc();
+ }
// Initialize variables:
- $saveBlankLineState=array();
+ $saveBlankLineState = array();
- $saveLatestUid=array();
+ $saveLatestUid = array();
- $latestInvDepth=$this->depth;
+ $latestInvDepth = $this->depth;
// Traverse the tree:
- foreach($t3lib_pageTree->tree as $cc => $dat) {
+ foreach ($t3lib_pageTree->tree as $cc => $dat) {
// Make link + parameters.
- $latestInvDepth=$dat['invertedDepth'];
+ $latestInvDepth = $dat['invertedDepth'];
- $saveLatestUid[$latestInvDepth]=$dat;
+ $saveLatestUid[$latestInvDepth] = $dat;
- if (isset($t3lib_pageTree->tree[$cc-1])) {
+ if (isset($t3lib_pageTree->tree[$cc - 1])) {
- $prev_dat = $t3lib_pageTree->tree[$cc-1];
+ $prev_dat = $t3lib_pageTree->tree[$cc - 1];
// If current page, subpage?
- if ($prev_dat['row']['uid']==$id) {
+ 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...
+ 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.=''.
+ $code .= '' .
- $this->insertQuadLines($dat['blankLineCode']).
+ $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="" />'.
+ '
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
+ 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
+ } 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'])) {
+ if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($prev_dat['row']['pid'])) {
$prevPid = (-$prev_dat['row']['uid']);
- $code.=''.
+ $code .= '' .
- $this->insertQuadLines($dat['blankLineCode']).
+ $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="" />'.
+ '
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
+ // Then set the current prevPid
$prevPid = -$prev_dat['row']['pid'];
} else {
- $prevPid = -$prev_dat['row']['uid']; // In on the same level
+ $prevPid = -$prev_dat['row']['uid']; // In on the same level
}
} else {
- $prevPid = $dat['row']['pid']; // First in the tree
+ $prevPid = $dat['row']['pid']; // First in the tree
}
- if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) {
+ if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) {
- $code.=''.
+ $code .= '' .
- $this->insertQuadLines($dat['blankLineCode']).
+ $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="" />'.
+ '
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=''.
+ $t_code = '' .
- $dat['HTML'].
+ $dat['HTML'] .
- $this->linkPageTitle($this->boldTitle(htmlspecialchars(t3lib_div::fixed_lgd_cs($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']) .
- '
';
+ '
';
- $code.=$t_code;
+ $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 ($prev_dat['row']['uid'] == $id) {
- if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($id)) {
+ if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($id)) {
- $code.=''.
+ $code .= '' .
- $this->insertQuadLines($saveLatestUid[$latestInvDepth]['blankLineCode'],1).
+ $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="" />'.
+ '
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++) {
+ for ($a = $latestInvDepth; $a <= $this->depth; $a++) {
$dat = $saveLatestUid[$a];
$prevPid = (-$dat['row']['uid']);
- if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) {
+ if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) {
- $code.=''.
+ $code .= '' .
- $this->insertQuadLines($dat['blankLineCode'],1).
+ $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="" />'.
+ '
backPath, 'gfx/newrecord_marker_d.gif', 'width="281" height="8"') . ' name="mImgEnd' . $a . '" border="0" align="top" title="' . $this->insertlabel() . '" alt="" />' .
- '
';
+ '
';
}
}
@@ -243,14 +233,14 @@
* @param string Insert record image prefix.
* @return string