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
00062 $BACK_PATH='';
00063 require('init.php');
00064 require('template.php');
00065 require_once(PATH_t3lib.'class.t3lib_browsetree.php');
00066
00067
00068
00077 class localPageTree extends t3lib_browseTree {
00078
00079 var $ext_showPageId;
00080 var $ext_IconMode;
00081
00087 function localPageTree() {
00088 $this->init();
00089 }
00090
00098 function wrapIcon($icon,&$row) {
00099
00100 if ($lockInfo=t3lib_BEfunc::isRecordLocked('pages',$row['uid'])) {
00101 $aOnClick = 'alert('.$GLOBALS['LANG']->JScharCode($lockInfo['msg']).');return false;';
00102 $lockIcon='<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
00103 '<img'.t3lib_iconWorks::skinImg('','gfx/recordlock_warning3.gif','width="17" height="12"').' title="'.htmlspecialchars($lockInfo['msg']).'" alt="" />'.
00104 '</a>';
00105 } else $lockIcon = '';
00106
00107
00108 $thePageIcon = $this->addTagAttributes($icon, $this->titleAttrib.'="'.$this->getTitleAttrib($row).'"');
00109
00110
00111 if (!$this->ext_IconMode) {
00112 $thePageIcon = $GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon($thePageIcon,'pages',$row['uid'],0,'&bank='.$this->bank);
00113 } elseif (!strcmp($this->ext_IconMode,'titlelink')) {
00114 $aOnClick = 'return jumpTo(\''.$this->getJumpToParam($row).'\',this,\''.$this->treeName.'\');';
00115 $thePageIcon='<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$thePageIcon.'</a>';
00116 }
00117
00118
00119 if ($this->ext_showPageId) {
00120 $pageIdStr = '['.$row['uid'].'] ';
00121 } else {
00122 $pageIdStr = '';
00123 }
00124
00125 return $thePageIcon.$lockIcon.$pageIdStr;
00126 }
00127
00136 function wrapStop($str,$row) {
00137 if ($row['php_tree_stop']) {
00138 $str.='<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => $row['uid']))).'" class="typo3-red">+</a> ';
00139 }
00140 return $str;
00141 }
00142 }
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00162 class SC_alt_db_navframe {
00163
00164
00165 var $content;
00166 var $pagetree;
00167 var $doc;
00168 var $active_tempMountPoint = 0;
00169
00170
00171 var $currentSubScript;
00172 var $cMR;
00173 var $setTempDBmount;
00174
00180 function init() {
00181 global $BE_USER,$BACK_PATH;
00182
00183
00184 $this->currentSubScript = t3lib_div::_GP('currentSubScript');
00185 $this->cMR = t3lib_div::_GP('cMR');
00186 $this->setTempDBmount = t3lib_div::_GP('setTempDBmount');
00187
00188
00189 $this->pagetree = t3lib_div::makeInstance('localPageTree');
00190 $this->pagetree->ext_IconMode = $BE_USER->getTSConfigVal('options.pageTree.disableIconLinkToContextmenu');
00191 $this->pagetree->ext_showPageId = $BE_USER->getTSConfigVal('options.pageTree.showPageIdWithTitle');
00192 $this->pagetree->thisScript = 'alt_db_navframe.php';
00193 $this->pagetree->addField('alias');
00194 $this->pagetree->addField('shortcut');
00195 $this->pagetree->addField('shortcut_mode');
00196 $this->pagetree->addField('mount_pid');
00197 $this->pagetree->addField('mount_pid_ol');
00198 $this->pagetree->addField('nav_hide');
00199 $this->pagetree->addField('url');
00200
00201 # $this->settingTemporaryMountPoint(11);
00202
00203 $this->initializeTemporaryDBmount();
00204
00205
00206 $this->doHighlight = !$BE_USER->getTSConfigVal('options.pageTree.disableTitleHighlight');
00207
00208
00209 $this->doc = t3lib_div::makeInstance('template');
00210 $this->doc->docType='xhtml_trans';
00211
00212
00213 $this->doc->backPath = $BACK_PATH;
00214
00215
00216 $this->doc->JScode=$this->doc->wrapScriptTags(
00217 ($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
00218
00219
00220 function jumpTo(id,linkObj,highLightID) {
00221 var theUrl = top.TS.PATH_typo3+top.currentSubScript+"?id="+id;
00222
00223 if (top.condensedMode) {
00224 top.content.document.location=theUrl;
00225 } else {
00226 parent.list_frame.document.location=theUrl;
00227 }
00228
00229 '.($this->doHighlight?'hilight_row("web",highLightID);':'').'
00230
00231 '.(!$GLOBALS['CLIENT']['FORMSTYLE'] ? '' : 'if (linkObj) {linkObj.blur();}').'
00232 return false;
00233 }
00234
00235
00236
00237 function refresh_nav() {
00238 window.setTimeout("_refresh_nav();",0);
00239 }
00240 function _refresh_nav() {
00241 document.location="'.$this->pagetree->thisScript.'?unique='.time().'";
00242 }
00243
00244
00245 function hilight_row(frameSetModule,highLightID) {
00246
00247
00248 theObj = document.getElementById(top.fsMod.navFrameHighlightedID[frameSetModule]);
00249 if (theObj) {
00250 theObj.style.backgroundColor="";
00251 }
00252
00253
00254 top.fsMod.navFrameHighlightedID[frameSetModule] = highLightID;
00255 theObj = document.getElementById(highLightID);
00256 if (theObj) {
00257 theObj.style.backgroundColor="'.t3lib_div::modifyHTMLColorAll($this->doc->bgColor,-20).'";
00258 }
00259 }
00260
00261 '.($this->cMR?"jumpTo(top.fsMod.recentIds['web'],'');":'').';
00262 ');
00263
00264
00265 $CMparts=$this->doc->getContextMenuCode();
00266 $this->doc->bodyTagAdditions = $CMparts[1];
00267 $this->doc->JScode.= $CMparts[0];
00268 $this->doc->postCode.= $CMparts[2];
00269 }
00270
00276 function main() {
00277 global $LANG,$CLIENT;
00278
00279
00280 $tree = $this->pagetree->getBrowsableTree();
00281
00282
00283 $this->content = '';
00284 $this->content.= $this->doc->startPage('Page tree');
00285
00286
00287 if ($this->active_tempMountPoint) {
00288 $this->content.= '
00289 <div class="bgColor4 c-notice">
00290 <img'.t3lib_iconWorks::skinImg('','gfx/icon_note.gif','width="18" height="16"').' align="top" alt="" />'.
00291 '<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => 0))).'">'.
00292 $LANG->sl('LLL:EXT:lang/locallang_core.php:labels.temporaryDBmount',1).
00293 '</a><br/>
00294 '.$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>
00295 </div>
00296 ';
00297 }
00298
00299
00300 $this->content.= $tree;
00301
00302
00303 $refreshUrl = t3lib_div::getIndpEnv('REQUEST_URI');
00304 $this->content.= '
00305 <p class="c-refresh">
00306 <a href="'.htmlspecialchars($refreshUrl).'">'.
00307 '<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="" />'.
00308 '</a><a href="'.htmlspecialchars($refreshUrl).'">'.
00309 $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.refresh',1).'</a>
00310 </p>
00311 <br />';
00312
00313
00314 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'pagetree', $GLOBALS['BACK_PATH']);
00315
00316
00317 if ($this->doHighlight) $this->content .=$this->doc->wrapScriptTags('
00318 hilight_row("",top.fsMod.navFrameHighlightedID["web"]);
00319 ');
00320 }
00321
00327 function printContent() {
00328 $this->content.= $this->doc->endPage();
00329 echo $this->content;
00330 }
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00354 function initializeTemporaryDBmount(){
00355 global $BE_USER;
00356
00357
00358 if (strlen($this->setTempDBmount)) {
00359 $set = t3lib_div::intInRange($this->setTempDBmount,0);
00360 if ($set>0 && $BE_USER->isInWebMount($set)) {
00361 $this->settingTemporaryMountPoint($set);
00362 } else {
00363 $this->settingTemporaryMountPoint(0);
00364 }
00365 }
00366
00367
00368 $temporaryMountPoint = intval($BE_USER->getSessionData('pageTree_temporaryMountPoint'));
00369
00370
00371 if ($temporaryMountPoint > 0 && $BE_USER->isInWebMount($temporaryMountPoint)) {
00372 $this->pagetree->MOUNTS = array($temporaryMountPoint);
00373 $this->active_tempMountPoint = t3lib_BEfunc::readPageAccess($temporaryMountPoint, $BE_USER->getPagePermsClause(1));
00374 }
00375 }
00376
00383 function settingTemporaryMountPoint($pageId) {
00384 global $BE_USER;
00385
00386
00387 $BE_USER->setAndSaveSessionData('pageTree_temporaryMountPoint',intval($pageId));
00388 }
00389 }
00390
00391
00392 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_db_navframe.php']) {
00393 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_db_navframe.php']);
00394 }
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408 $SOBE = t3lib_div::makeInstance('SC_alt_db_navframe');
00409 $SOBE->init();
00410 $SOBE->main();
00411 $SOBE->printContent();
00412
00413 ?>