Public Member Functions | |
positionTree ($id, $pageinfo, $perms_clause, $R_URI) | |
Creates a "position tree" based on the page tree. | |
JSimgFunc ($prefix='') | |
Creates the JavaScritp for insert new-record rollover image. | |
boldTitle ($t_code, $dat, $id) | |
Wrap $t_code in bold IF the $dat uid matches $id. | |
onClickEvent ($pid, $newPagePID) | |
Creates the onclick event for the insert-icons. | |
insertlabel () | |
Get label, htmlspecialchars()'ed. | |
linkPageTitle ($str, $rec) | |
Wrapping page title. | |
checkNewPageInPid ($pid) | |
Checks if the user has permission to created pages inside of the $pid page. | |
getModConfig ($pid) | |
Returns module configuration for a pid. | |
insertQuadLines ($codes, $allBlank=0) | |
Insert half/quad lines. | |
printContentElementColumns ($pid, $moveUid, $colPosList, $showHidden, $R_URI) | |
Creates HTML for inserting/moving content elements. | |
printRecordMap ($lines, $colPosArray) | |
Creates the table with the content columns. | |
wrapColumnHeader ($str, $vv) | |
Wrapping the column header. | |
insertPositionIcon ($row, $vv, $kk, $moveUid, $pid) | |
Creates a linked position icon. | |
onClickInsertRecord ($row, $vv, $moveUid, $pid, $sys_lang=0) | |
Create on-click event value. | |
wrapRecordHeader ($str, $row) | |
Wrapping the record header (from getRecordHeader()). | |
getRecordHeader ($row) | |
Create record header (includes teh record icon, record title etc.). | |
wrapRecordTitle ($str, $row) | |
Wrapping the title of the record. | |
Public Attributes | |
$moveOrCopy = 'move' | |
$dontPrintPageInsertIcons = 0 | |
$backPath = '' | |
$depth = 2 | |
$cur_sys_language | |
$R_URI = '' | |
$elUid = '' | |
$moveUid = '' | |
$getModConfigCache = array() | |
$checkNewPageCache = Array() | |
$l_insertNewPageHere = 'insertNewPageHere' | |
$l_insertNewRecordHere = 'insertNewRecordHere' | |
$modConfigStr = 'mod.web_list.newPageWiz' |
|
Wrap $t_code in bold IF the $dat uid matches $id.
Reimplemented in ext_posMap_pages. Definition at line 276 of file class.t3lib_positionmap.php. 00276 { 00277 if ($dat['row']['uid']==$id) { 00278 $t_code='<strong>'.$t_code.'</strong>'; 00279 } 00280 return $t_code; 00281 }
|
|
Checks if the user has permission to created pages inside of the $pid page. Uses caching so only one regular lookup is made - hence you can call the function multiple times without worrying about performance.
Definition at line 335 of file class.t3lib_positionmap.php. References t3lib_BEfunc::getRecord(). Referenced by positionTree(). 00335 { 00336 global $BE_USER; 00337 if (!isset($this->checkNewPageCache[$pid])) { 00338 $pidInfo = t3lib_BEfunc::getRecord('pages',$pid); 00339 $this->checkNewPageCache[$pid] = ($BE_USER->isAdmin() || $BE_USER->doesUserHaveAccess($pidInfo,8)); 00340 } 00341 return $this->checkNewPageCache[$pid]; 00342 }
|
|
Returns module configuration for a pid.
Definition at line 351 of file class.t3lib_positionmap.php. References t3lib_BEfunc::getModTSconfig(). 00351 { 00352 if (!isset($this->getModConfigCache[$pid])) { 00353 // Acquiring TSconfig for this PID: 00354 $this->getModConfigCache[$pid] = t3lib_BEfunc::getModTSconfig($pid,$this->modConfigStr); 00355 } 00356 return $this->getModConfigCache[$pid]['properties']; 00357 }
|
|
Create record header (includes teh record icon, record title etc.).
Definition at line 539 of file class.t3lib_positionmap.php. References t3lib_iconWorks::getIconImage(), and t3lib_BEfunc::getRecordTitle(). 00539 { 00540 $line = t3lib_iconWorks::getIconImage('tt_content',$row,$this->backPath,' align="top" title="'.htmlspecialchars(t3lib_BEfunc::getRecordIconAltText($row,'tt_content')).'"'); 00541 $line.= t3lib_BEfunc::getRecordTitle('tt_content',$row,1); 00542 return $this->wrapRecordTitle($line,$row); 00543 }
|
|
Get label, htmlspecialchars()'ed.
Definition at line 312 of file class.t3lib_positionmap.php. References $LANG. 00312 { 00313 global $LANG; 00314 return $LANG->getLL($this->l_insertNewPageHere,1); 00315 }
|
|
Creates a linked position icon.
Definition at line 492 of file class.t3lib_positionmap.php. 00492 { 00493 $cc = hexdec(substr(md5($row['uid'].'-'.$vv.'-'.$kk),0,4)); 00494 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);').'">'. 00495 '<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="" />'. 00496 '</a>'; 00497 }
|
|
Insert half/quad lines.
Definition at line 366 of file class.t3lib_positionmap.php. Referenced by positionTree(). 00366 { 00367 $codeA = t3lib_div::trimExplode(',',$codes.",line",1); 00368 00369 $lines=array(); 00370 while(list(,$code)=each($codeA)) { 00371 if ($code=="blank" || $allBlank) { 00372 $lines[]='<img src="clear.gif" width="18" height="8" align="top" alt="" />'; 00373 } else { 00374 $lines[]='<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/halfline.gif','width="18" height="8"').' align="top" alt="" />'; 00375 } 00376 } 00377 return implode('',$lines); 00378 }
|
|
Creates the JavaScritp for insert new-record rollover image.
Definition at line 246 of file class.t3lib_positionmap.php. Referenced by positionTree(). 00246 { 00247 $code.=$GLOBALS['TBE_TEMPLATE']->wrapScriptTags(' 00248 00249 var img_newrecord_marker=new Image(); 00250 img_newrecord_marker.src = "'.t3lib_iconWorks::skinImg($this->backPath,'gfx/newrecord'.$prefix.'_marker.gif','',1).'"; 00251 00252 var img_newrecord_marker_d=new Image(); 00253 img_newrecord_marker_d.src = "'.t3lib_iconWorks::skinImg($this->backPath,'gfx/newrecord'.$prefix.'_marker_d.gif','',1).'"; 00254 00255 function changeImg(name,d) { // 00256 if (document[name]) { 00257 if (d) { 00258 document[name].src = img_newrecord_marker_d.src; 00259 } else { 00260 document[name].src = img_newrecord_marker.src; 00261 } 00262 } 00263 } 00264 '); 00265 return $code; 00266 }
|
|
Wrapping page title.
Reimplemented in ext_posMap_pages, and ext_posMap_tt_content. Definition at line 324 of file class.t3lib_positionmap.php. Referenced by positionTree(). 00324 {
00325 return $str;
00326 }
|
|
Creates the onclick event for the insert-icons. TSconfig mod.web_list.newPageWiz.overrideWithExtension may contain an extension which provides a module to be used instead of the normal create new page wizard.
Reimplemented in ext_posMap_pages. Definition at line 293 of file class.t3lib_positionmap.php. References t3lib_BEfunc::editOnClick(), and t3lib_extMgm::isLoaded(). 00293 { 00294 $TSconfigProp = $this->getModConfig($newPagePID); 00295 00296 if ($TSconfigProp['overrideWithExtension']) { 00297 if (t3lib_extMgm::isLoaded($TSconfigProp['overrideWithExtension'])) { 00298 $onclick = "document.location='".t3lib_extMgm::extRelPath($TSconfigProp['overrideWithExtension']).'mod1/index.php?cmd=crPage&positionPid='.$pid."';"; 00299 return $onclick; 00300 } 00301 } 00302 00303 $params='&edit[pages]['.$pid.']=new&returnNewPageId=1'; 00304 return t3lib_BEfunc::editOnClick($params,'',$this->R_URI); 00305 }
|
|
Create on-click event value.
Reimplemented in ext_posMap. Definition at line 509 of file class.t3lib_positionmap.php. 00509 { 00510 $table='tt_content'; 00511 if (is_array($row)) { 00512 $location='tce_db.php?cmd['.$table.']['.$moveUid.']['.$this->moveOrCopy.']=-'.$row['uid'].'&prErr=1&uPT=1&vC='.$GLOBALS['BE_USER']->veriCode(); 00513 } else { 00514 $location='tce_db.php?cmd['.$table.']['.$moveUid.']['.$this->moveOrCopy.']='.$pid.'&data['.$table.']['.$moveUid.'][colPos]='.$vv.'&prErr=1&vC='.$GLOBALS['BE_USER']->veriCode(); 00515 } 00516 // $location.='&redirect='.rawurlencode($this->R_URI); // returns to prev. page 00517 $location.='&uPT=1&redirect='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')); // This redraws screen 00518 00519 return 'document.location=\''.$location.'\';return false;'; 00520 }
|
|
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.
Definition at line 132 of file class.t3lib_positionmap.php. References $a, checkNewPageInPid(), insertQuadLines(), JSimgFunc(), and linkPageTitle(). 00132 { 00133 global $LANG, $BE_USER; 00134 00135 // Make page tree object: 00136 $t3lib_pageTree = t3lib_div::makeInstance('localPageTree'); 00137 $t3lib_pageTree->init(' AND '.$perms_clause); 00138 $t3lib_pageTree->addField('pid'); 00139 00140 // Initialize variables: 00141 $this->R_URI = $R_URI; 00142 $this->elUid = $id; 00143 00144 // Create page tree, in $this->depth levels. 00145 $t3lib_pageTree->getTree($pageinfo['pid'], $this->depth); 00146 if (!$this->dontPrintPageInsertIcons) $code.=$this->JSimgFunc(); 00147 00148 // Initialize variables: 00149 $saveBlankLineState=array(); 00150 $saveLatestUid=array(); 00151 $latestInvDepth=$this->depth; 00152 00153 // Traverse the tree: 00154 foreach($t3lib_pageTree->tree as $cc => $dat) { 00155 00156 // Make link + parameters. 00157 $latestInvDepth=$dat['invertedDepth']; 00158 $saveLatestUid[$latestInvDepth]=$dat; 00159 if (isset($t3lib_pageTree->tree[$cc-1])) { 00160 $prev_dat = $t3lib_pageTree->tree[$cc-1]; 00161 00162 // If current page, subpage? 00163 if ($prev_dat['row']['uid']==$id) { 00164 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... 00165 $code.='<span class="nobr">'. 00166 $this->insertQuadLines($dat['blankLineCode']). 00167 '<img src="clear.gif" width="18" height="8" align="top" alt="" />'. 00168 '<a href="#" onclick="'.htmlspecialchars($this->onClickEvent($id,$id,1)).'" onmouseover="'.htmlspecialchars('changeImg(\'mImgSubpage'.$cc.'\',0);').'" onmouseout="'.htmlspecialchars('changeImg(\'mImgSubpage'.$cc.'\',1);').'">'. 00169 '<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="" />'. 00170 '</a></span><br />'; 00171 } 00172 } 00173 00174 if ($prev_dat['invertedDepth']>$t3lib_pageTree->tree[$cc]['invertedDepth']) { // If going down 00175 $prevPid = $t3lib_pageTree->tree[$cc]['row']['pid']; 00176 } elseif ($prev_dat['invertedDepth']<$t3lib_pageTree->tree[$cc]['invertedDepth']) { // If going up 00177 // First of all the previous level should have an icon: 00178 if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($prev_dat['row']['pid'])) { 00179 $prevPid = (-$prev_dat['row']['uid']); 00180 $code.='<span class="nobr">'. 00181 $this->insertQuadLines($dat['blankLineCode']). 00182 '<img src="clear.gif" width="18" height="1" align="top" alt="" />'. 00183 '<a href="#" onclick="'.htmlspecialchars($this->onClickEvent($prevPid,$prev_dat['row']['pid'],2)).'" onmouseover="'.htmlspecialchars('changeImg(\'mImgAfter'.$cc.'\',0);').'" onmouseout="'.htmlspecialchars('changeImg(\'mImgAfter'.$cc.'\',1);').'">'. 00184 '<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="" />'. 00185 '</a></span><br />'; 00186 } 00187 00188 // Then set the current prevPid 00189 $prevPid = -$prev_dat['row']['pid']; 00190 } else { 00191 $prevPid = -$prev_dat['row']['uid']; // In on the same level 00192 } 00193 } else { 00194 $prevPid = $dat['row']['pid']; // First in the tree 00195 } 00196 if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) { 00197 $code.='<span class="nobr">'. 00198 $this->insertQuadLines($dat['blankLineCode']). 00199 '<a href="#" onclick="'.htmlspecialchars($this->onClickEvent($prevPid,$dat['row']['pid'],3)).'" onmouseover="'.htmlspecialchars('changeImg(\'mImg'.$cc.'\',0);').'" onmouseout="'.htmlspecialchars('changeImg(\'mImg'.$cc.'\',1);').'">'. 00200 '<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="" />'. 00201 '</a></span><br />'; 00202 } 00203 00204 // The line with the icon and title: 00205 $t_code='<span class="nobr">'. 00206 $dat['HTML']. 00207 $this->linkPageTitle($this->boldTitle(htmlspecialchars(t3lib_div::fixed_lgd_cs($dat['row']['title'],$BE_USER->uc['titleLen'])),$dat,$id),$dat['row']). 00208 '</span><br />'; 00209 $code.=$t_code; 00210 } 00211 00212 // If the current page was the last in the tree: 00213 $prev_dat = end($t3lib_pageTree->tree); 00214 if ($prev_dat['row']['uid']==$id) { 00215 if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($id)) { 00216 $code.='<span class="nobr">'. 00217 $this->insertQuadLines($saveLatestUid[$latestInvDepth]['blankLineCode'],1). 00218 '<img src="clear.gif" width="18" height="8" align="top" alt="" />'. 00219 '<a href="#" onclick="'.$this->onClickEvent($id,$id,4).'" onmouseover="'.htmlspecialchars('changeImg(\'mImgSubpage'.$cc.'\',0);').'" onmouseout="'.htmlspecialchars('changeImg(\'mImgSubpage'.$cc.'\',1);').'">'. 00220 '<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="" />'. 00221 '</a></span><br />'; 00222 } 00223 } 00224 00225 for ($a=$latestInvDepth;$a<=$this->depth;$a++) { 00226 $dat = $saveLatestUid[$a]; 00227 $prevPid = (-$dat['row']['uid']); 00228 if (!$this->dontPrintPageInsertIcons && $this->checkNewPageInPid($dat['row']['pid'])) { 00229 $code.='<span class="nobr">'. 00230 $this->insertQuadLines($dat['blankLineCode'],1). 00231 '<a href="#" onclick="'.htmlspecialchars($this->onClickEvent($prevPid,$dat['row']['pid'],5)).'" onmouseover="'.htmlspecialchars('changeImg(\'mImgEnd'.$a.'\',0);').'" onmouseout="'.htmlspecialchars('changeImg(\'mImgEnd'.$a.'\',1);').'">'. 00232 '<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="" />'. 00233 '</a></span><br />'; 00234 } 00235 } 00236 00237 return $code; 00238 }
|
|
Creates HTML for inserting/moving content elements.
Definition at line 404 of file class.t3lib_positionmap.php. References t3lib_BEfunc::deleteClause(). 00404 { 00405 $this->R_URI = $R_URI; 00406 $this->moveUid = $moveUid; 00407 $colPosArray = t3lib_div::trimExplode(',',$colPosList,1); 00408 00409 $lines=array(); 00410 while(list($kk,$vv)=each($colPosArray)) { 00411 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery( 00412 '*', 00413 'tt_content', 00414 'pid='.intval($pid). 00415 ($showHidden ? '' : t3lib_BEfunc::BEenableFields('tt_content')). 00416 ' AND colPos='.intval($vv). 00417 (strcmp($this->cur_sys_language,'') ? ' AND sys_language_uid='.intval($this->cur_sys_language) : ''). 00418 t3lib_BEfunc::deleteClause('tt_content'), 00419 '', 00420 'sorting' 00421 ); 00422 $lines[$kk]=array(); 00423 $lines[$kk][]=$this->insertPositionIcon('',$vv,$kk,$moveUid,$pid); 00424 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) { 00425 $lines[$kk][]=$this->wrapRecordHeader($this->getRecordHeader($row),$row); 00426 $lines[$kk][]=$this->insertPositionIcon($row,$vv,$kk,$moveUid,$pid); 00427 } 00428 $GLOBALS['TYPO3_DB']->sql_free_result($res); 00429 } 00430 return $this->printRecordMap($lines,$colPosArray); 00431 }
|
|
Creates the table with the content columns.
Definition at line 440 of file class.t3lib_positionmap.php. References table(). 00440 { 00441 $row1=''; 00442 $row2=''; 00443 $count = t3lib_div::intInRange(count($colPosArray),1); 00444 00445 // Traverse the columns here: 00446 foreach($colPosArray as $kk => $vv) { 00447 $row1.='<td align="center" width="'.round(100/$count).'%"><span class="uppercase"><strong>'. 00448 $this->wrapColumnHeader($GLOBALS['LANG']->sL(t3lib_BEfunc::getLabelFromItemlist('tt_content','colPos',$vv),1),$vv). 00449 '</strong></span></td>'; 00450 $row2.='<td valign="top" nowrap="nowrap">'. 00451 implode('<br />',$lines[$kk]). 00452 '</td>'; 00453 } 00454 00455 $table = ' 00456 00457 <!-- 00458 Map of records in columns: 00459 --> 00460 <table border="0" cellpadding="0" cellspacing="1" id="typo3-ttContentList"> 00461 <tr class="bgColor5">'.$row1.'</tr> 00462 <tr>'.$row2.'</tr> 00463 </table> 00464 00465 '; 00466 00467 return $this->JSimgFunc('2').$table; 00468 }
|
|
Wrapping the column header.
Reimplemented in ext_posMap. Definition at line 478 of file class.t3lib_positionmap.php. 00478 {
00479 return $str;
00480 }
|
|
Wrapping the record header (from getRecordHeader()).
Reimplemented in ext_posMap. Definition at line 529 of file class.t3lib_positionmap.php. 00529 {
00530 return $str;
00531 }
|
|
Wrapping the title of the record.
Reimplemented in ext_posMap_tt_content, ext_posMap, and ext_posMap. Definition at line 552 of file class.t3lib_positionmap.php. 00552 { 00553 return '<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('uid'=>intval($row['uid']),'moveUid'=>''))).'">'.$str.'</a>'; 00554 }
|
|
Definition at line 90 of file class.t3lib_positionmap.php. |
|
Definition at line 102 of file class.t3lib_positionmap.php. |
|
Definition at line 92 of file class.t3lib_positionmap.php. |
|
Definition at line 91 of file class.t3lib_positionmap.php. |
|
Reimplemented in ext_posMap_tt_content, and ext_posMap. Definition at line 89 of file class.t3lib_positionmap.php. |
|
Definition at line 97 of file class.t3lib_positionmap.php. |
|
Definition at line 101 of file class.t3lib_positionmap.php. |
|
Reimplemented in ext_posMap_pages. Definition at line 105 of file class.t3lib_positionmap.php. |
|
Reimplemented in ext_posMap. Definition at line 106 of file class.t3lib_positionmap.php. |
|
Definition at line 108 of file class.t3lib_positionmap.php. |
|
Definition at line 88 of file class.t3lib_positionmap.php. |
|
Definition at line 98 of file class.t3lib_positionmap.php. |
|
Definition at line 96 of file class.t3lib_positionmap.php. |