00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00063 $BACK_PATH='';
00064 require('init.php');
00065 require('template.php');
00066 require_once(PATH_t3lib.'class.t3lib_browsetree.php');
00067
00068
00069
00078 class localPageTree extends t3lib_browseTree {
00079
00080 var $ext_showPageId;
00081 var $ext_IconMode;
00082
00088 function localPageTree() {
00089 $this->init();
00090 }
00091
00099 function wrapIcon($icon,&$row) {
00100
00101 if ($lockInfo=t3lib_BEfunc::isRecordLocked('pages',$row['uid'])) {
00102 $aOnClick = 'alert('.$GLOBALS['LANG']->JScharCode($lockInfo['msg']).');return false;';
00103 $lockIcon='<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
00104 '<img'.t3lib_iconWorks::skinImg('','gfx/recordlock_warning3.gif','width="17" height="12"').' title="'.htmlspecialchars($lockInfo['msg']).'" alt="" />'.
00105 '</a>';
00106 } else $lockIcon = '';
00107
00108
00109 $thePageIcon = $this->addTagAttributes($icon, $this->titleAttrib.'="'.$this->getTitleAttrib($row).'"');
00110
00111
00112 if (!$this->ext_IconMode) {
00113 $thePageIcon = $GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon($thePageIcon,'pages',$row['uid'],0,'&bank='.$this->bank);
00114 } elseif (!strcmp($this->ext_IconMode,'titlelink')) {
00115 $aOnClick = 'return jumpTo(\''.$this->getJumpToParam($row).'\',this,\''.$this->treeName.'\');';
00116 $thePageIcon='<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$thePageIcon.'</a>';
00117 }
00118
00119
00120 $spanOnDrag = htmlspecialchars('return dragElement("'.$row['uid'].'")');
00121 $spanOnDrop = htmlspecialchars('return dropElement("'.$row['uid'].'")');
00122 $dragDropIcon = '<span id="dragIconID_'.$row['uid'].'" ondragstart="'.$spanOnDrag.'" onmousedown="'.$spanOnDrag.'" onmouseup="'.$spanOnDrop.'">'.$thePageIcon.'</span>';
00123
00124
00125 if ($this->ext_showPageId) {
00126 $pageIdStr = '['.$row['uid'].'] ';
00127 } else {
00128 $pageIdStr = '';
00129 }
00130
00131 return $dragDropIcon.$lockIcon.$pageIdStr;
00132 }
00133
00142 function wrapStop($str,$row) {
00143 if ($row['php_tree_stop']) {
00144 $str.='<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => $row['uid']))).'" class="typo3-red">+</a> ';
00145 }
00146 return $str;
00147 }
00148
00158 function wrapTitle($title,$row,$bank=0) {
00159 $aOnClick = 'return jumpTo(\''.$this->getJumpToParam($row).'\',this,\''.$this->domIdPrefix.$this->getId($row).'\','.$bank.');';
00160 $CSM = '';
00161 if ($GLOBALS['TYPO3_CONF_VARS']['BE']['useOnContextMenuHandler']) {
00162 $CSM = ' oncontextmenu="'.htmlspecialchars($GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon('','pages',$row['uid'],0,'&bank='.$this->bank,'',TRUE)).'"';
00163 }
00164 $thePageTitle='<a href="#" onclick="'.htmlspecialchars($aOnClick).'"'.$CSM.'>'.$title.'</a>';
00165
00166
00167 $spanOnDrag = htmlspecialchars('return dragElement("'.$row['uid'].'")');
00168 $spanOnDrop = htmlspecialchars('return dropElement("'.$row['uid'].'")');
00169 $dragDropTitle = '<span id="dragTitleID_'.$row['uid'].'" ondragstart="'.$spanOnDrag.'" onmousedown="'.$spanOnDrag.'" onmouseup="'.$spanOnDrop.'">'.$thePageTitle.'</span>';
00170 return $dragDropTitle;
00171 }
00172 }
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00192 class SC_alt_db_navframe {
00193
00194
00195 var $content;
00196 var $pagetree;
00197 var $doc;
00198 var $active_tempMountPoint = 0;
00199
00200
00201 var $currentSubScript;
00202 var $cMR;
00203 var $setTempDBmount;
00204
00210 function init() {
00211 global $BE_USER,$BACK_PATH;
00212
00213
00214 $this->currentSubScript = t3lib_div::_GP('currentSubScript');
00215 $this->cMR = t3lib_div::_GP('cMR');
00216 $this->setTempDBmount = t3lib_div::_GP('setTempDBmount');
00217
00218
00219 $this->pagetree = t3lib_div::makeInstance('localPageTree');
00220 $this->pagetree->ext_IconMode = $BE_USER->getTSConfigVal('options.pageTree.disableIconLinkToContextmenu');
00221 $this->pagetree->ext_showPageId = $BE_USER->getTSConfigVal('options.pageTree.showPageIdWithTitle');
00222 $this->pagetree->thisScript = 'alt_db_navframe.php';
00223 $this->pagetree->addField('alias');
00224 $this->pagetree->addField('shortcut');
00225 $this->pagetree->addField('shortcut_mode');
00226 $this->pagetree->addField('mount_pid');
00227 $this->pagetree->addField('mount_pid_ol');
00228 $this->pagetree->addField('nav_hide');
00229 $this->pagetree->addField('url');
00230
00231 # $this->settingTemporaryMountPoint(11);
00232
00233 $this->initializeTemporaryDBmount();
00234
00235
00236 $this->doHighlight = !$BE_USER->getTSConfigVal('options.pageTree.disableTitleHighlight') && $BE_USER->workspace===0;
00237
00238
00239 $this->doc = t3lib_div::makeInstance('template');
00240 $this->doc->docType='xhtml_trans';
00241
00242
00243 $this->doc->backPath = $BACK_PATH;
00244
00245
00246 $this->doc->JScode=$this->doc->wrapScriptTags(
00247 ($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
00248
00249
00250 function jumpTo(id,linkObj,highLightID,bank) {
00251 var theUrl = top.TS.PATH_typo3+top.currentSubScript+"?id="+id;
00252 top.fsMod.currentBank = bank;
00253
00254 if (top.condensedMode) {
00255 top.content.location.href=theUrl;
00256 } else {
00257 parent.list_frame.location.href=theUrl;
00258 }
00259
00260 '.($this->doHighlight?'hilight_row("web",highLightID+"_"+bank);':'').'
00261
00262 '.(!$GLOBALS['CLIENT']['FORMSTYLE'] ? '' : 'if (linkObj) {linkObj.blur();}').'
00263 return false;
00264 }
00265
00266
00267
00268 function refresh_nav() {
00269 window.setTimeout("_refresh_nav();",0);
00270 }
00271 function _refresh_nav() {
00272 window.location.href="'.$this->pagetree->thisScript.'?unique='.time().'";
00273 }
00274
00275
00276 function hilight_row(frameSetModule,highLightID) {
00277
00278
00279 theObj = document.getElementById(top.fsMod.navFrameHighlightedID[frameSetModule]);
00280 if (theObj) {
00281 theObj.setAttribute("class", "");
00282 }
00283
00284
00285 top.fsMod.navFrameHighlightedID[frameSetModule] = highLightID;
00286 theObj = document.getElementById(highLightID);
00287 if (theObj) {
00288 theObj.setAttribute("class", "navFrameHL");
00289 }
00290 }
00291
00292 '.($this->cMR?"jumpTo(top.fsMod.recentIds['web'],'');":'').';
00293 ');
00294
00295
00296 $CMparts=$this->doc->getContextMenuCode();
00297 $this->doc->bodyTagAdditions = $CMparts[1];
00298 $this->doc->JScode.= $CMparts[0];
00299 $this->doc->postCode.= $CMparts[2];
00300
00301
00302 $DDparts=$this->doc->getDragDropCode('pages');
00303
00304 $this->doc->JScode.= $DDparts[0];
00305 $this->doc->postCode.= $DDparts[2];
00306 }
00307
00313 function main() {
00314 global $LANG,$CLIENT;
00315
00316
00317 $tree = $this->pagetree->getBrowsableTree();
00318
00319
00320 $this->content = '';
00321 $this->content.= $this->doc->startPage('Page tree');
00322
00323
00324 if ($GLOBALS['BE_USER']->workspace!==0 || $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.onlineWorkspaceInfo')) {
00325 switch($GLOBALS['BE_USER']->workspace) {
00326 case 0:
00327 $wsTitle = ' '.$this->doc->icons(2).'['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:shortcut_onlineWS',1).']';
00328 break;
00329 case -1:
00330 $wsTitle = '['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:shortcut_offlineWS',1).']';
00331 break;
00332 default:
00333 $wsTitle = '['.$GLOBALS['BE_USER']->workspace.'] '.htmlspecialchars($GLOBALS['BE_USER']->workspaceRec['title']);
00334 break;
00335 }
00336
00337 $this->content.= '
00338 <div class="bgColor4 workspace-info">'.
00339 '<a href="'.htmlspecialchars('mod/user/ws/index.php').'" target="content">'.
00340 '<img'.t3lib_iconWorks::skinImg('','gfx/i/sys_workspace.png','width="18" height="16"').' align="top" alt="" />'.
00341 '</a>'.$wsTitle.'
00342 </div>
00343 ';
00344 }
00345
00346
00347 if ($this->active_tempMountPoint) {
00348 $this->content.= '
00349 <div class="bgColor4 c-notice">
00350 <img'.t3lib_iconWorks::skinImg('','gfx/icon_note.gif','width="18" height="16"').' align="top" alt="" />'.
00351 '<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => 0))).'">'.
00352 $LANG->sl('LLL:EXT:lang/locallang_core.php:labels.temporaryDBmount',1).
00353 '</a><br/>
00354 '.$LANG->sl('LLL:EXT:lang/locallang_core.php:labels.path',1).': <span title="'.htmlspecialchars($this->active_tempMountPoint['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($this->active_tempMountPoint['_thePath'],-50)).'</span>
00355 </div>
00356 ';
00357 }
00358
00359
00360 $this->content.= $tree;
00361
00362
00363 $refreshUrl = t3lib_div::getIndpEnv('REQUEST_URI');
00364 $this->content.= '
00365 <p class="c-refresh">
00366 <a href="'.htmlspecialchars($refreshUrl).'">'.
00367 '<img'.t3lib_iconWorks::skinImg('','gfx/refresh_n.gif','width="14" height="14"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.refresh',1).'" alt="" />'.
00368 '</a><a href="'.htmlspecialchars($refreshUrl).'">'.
00369 $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.refresh',1).'</a>
00370 </p>
00371 <br />';
00372
00373
00374 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'pagetree', $GLOBALS['BACK_PATH']);
00375
00376
00377 if ($this->doHighlight) $this->content .=$this->doc->wrapScriptTags('
00378 hilight_row("",top.fsMod.navFrameHighlightedID["web"]);
00379 ');
00380 }
00381
00387 function printContent() {
00388 $this->content.= $this->doc->endPage();
00389 $this->content = $this->doc->insertStylesAndJS($this->content);
00390 echo $this->content;
00391 }
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00415 function initializeTemporaryDBmount(){
00416 global $BE_USER;
00417
00418
00419 if (strlen($this->setTempDBmount)) {
00420 $set = t3lib_div::intInRange($this->setTempDBmount,0);
00421 if ($set>0 && $BE_USER->isInWebMount($set)) {
00422 $this->settingTemporaryMountPoint($set);
00423 } else {
00424 $this->settingTemporaryMountPoint(0);
00425 }
00426 }
00427
00428
00429 $temporaryMountPoint = intval($BE_USER->getSessionData('pageTree_temporaryMountPoint'));
00430
00431
00432 if ($temporaryMountPoint > 0 && $BE_USER->isInWebMount($temporaryMountPoint)) {
00433 if ($this->active_tempMountPoint = t3lib_BEfunc::readPageAccess($temporaryMountPoint, $BE_USER->getPagePermsClause(1))) {
00434 $this->pagetree->MOUNTS = array($temporaryMountPoint);
00435 }
00436 else {
00437
00438 $this->settingTemporaryMountPoint(0);
00439 }
00440 }
00441 }
00442
00449 function settingTemporaryMountPoint($pageId) {
00450 global $BE_USER;
00451
00452
00453 $BE_USER->setAndSaveSessionData('pageTree_temporaryMountPoint',intval($pageId));
00454 }
00455 }
00456
00457
00458 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_db_navframe.php']) {
00459 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_db_navframe.php']);
00460 }
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474 $SOBE = t3lib_div::makeInstance('SC_alt_db_navframe');
00475 $SOBE->init();
00476 $SOBE->main();
00477 $SOBE->printContent();
00478
00479 ?>