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 if ($this->ext_showPageId) {
00121 $pageIdStr = '['.$row['uid'].'] ';
00122 } else {
00123 $pageIdStr = '';
00124 }
00125
00126 return $thePageIcon.$lockIcon.$pageIdStr;
00127 }
00128
00137 function wrapStop($str,$row) {
00138 if ($row['php_tree_stop']) {
00139 $str.='<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => $row['uid']))).'" class="typo3-red">+</a> ';
00140 }
00141 return $str;
00142 }
00143
00153 function wrapTitle($title,$row,$bank=0) {
00154 $aOnClick = 'return jumpTo(\''.$this->getJumpToParam($row).'\',this,\''.$this->domIdPrefix.$this->getId($row).'_'.$bank.'\');';
00155 $CSM = '';
00156 if ($GLOBALS['TYPO3_CONF_VARS']['BE']['useOnContextMenuHandler']) {
00157 $CSM = ' oncontextmenu="'.htmlspecialchars($GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon('','pages',$row['uid'],0,'&bank='.$this->bank,'',TRUE)).'"';
00158 }
00159 return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'"'.$CSM.'>'.$title.'</a>';
00160 }
00161 }
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00181 class SC_alt_db_navframe {
00182
00183
00184 var $content;
00185 var $pagetree;
00186 var $doc;
00187 var $active_tempMountPoint = 0;
00188
00189
00190 var $currentSubScript;
00191 var $cMR;
00192 var $setTempDBmount;
00193
00199 function init() {
00200 global $BE_USER,$BACK_PATH;
00201
00202
00203 $this->currentSubScript = t3lib_div::_GP('currentSubScript');
00204 $this->cMR = t3lib_div::_GP('cMR');
00205 $this->setTempDBmount = t3lib_div::_GP('setTempDBmount');
00206
00207
00208 $this->pagetree = t3lib_div::makeInstance('localPageTree');
00209 $this->pagetree->ext_IconMode = $BE_USER->getTSConfigVal('options.pageTree.disableIconLinkToContextmenu');
00210 $this->pagetree->ext_showPageId = $BE_USER->getTSConfigVal('options.pageTree.showPageIdWithTitle');
00211 $this->pagetree->thisScript = 'alt_db_navframe.php';
00212 $this->pagetree->addField('alias');
00213 $this->pagetree->addField('shortcut');
00214 $this->pagetree->addField('shortcut_mode');
00215 $this->pagetree->addField('mount_pid');
00216 $this->pagetree->addField('mount_pid_ol');
00217 $this->pagetree->addField('nav_hide');
00218 $this->pagetree->addField('url');
00219
00220 # $this->settingTemporaryMountPoint(11);
00221
00222 $this->initializeTemporaryDBmount();
00223
00224
00225 $this->doHighlight = !$BE_USER->getTSConfigVal('options.pageTree.disableTitleHighlight');
00226
00227
00228 $this->doc = t3lib_div::makeInstance('template');
00229 $this->doc->docType='xhtml_trans';
00230
00231
00232 $this->doc->backPath = $BACK_PATH;
00233
00234
00235 $this->doc->JScode=$this->doc->wrapScriptTags(
00236 ($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
00237
00238
00239 function jumpTo(id,linkObj,highLightID) {
00240 var theUrl = top.TS.PATH_typo3+top.currentSubScript+"?id="+id;
00241
00242 if (top.condensedMode) {
00243 top.content.document.location=theUrl;
00244 } else {
00245 parent.list_frame.document.location=theUrl;
00246 }
00247
00248 '.($this->doHighlight?'hilight_row("web",highLightID);':'').'
00249
00250 '.(!$GLOBALS['CLIENT']['FORMSTYLE'] ? '' : 'if (linkObj) {linkObj.blur();}').'
00251 return false;
00252 }
00253
00254
00255
00256 function refresh_nav() {
00257 window.setTimeout("_refresh_nav();",0);
00258 }
00259 function _refresh_nav() {
00260 document.location="'.$this->pagetree->thisScript.'?unique='.time().'";
00261 }
00262
00263
00264 function hilight_row(frameSetModule,highLightID) {
00265
00266
00267 theObj = document.getElementById(top.fsMod.navFrameHighlightedID[frameSetModule]);
00268 if (theObj) {
00269 theObj.style.backgroundColor="";
00270 }
00271
00272
00273 top.fsMod.navFrameHighlightedID[frameSetModule] = highLightID;
00274 theObj = document.getElementById(highLightID);
00275 if (theObj) {
00276 theObj.style.backgroundColor="'.t3lib_div::modifyHTMLColorAll($this->doc->bgColor,-20).'";
00277 }
00278 }
00279
00280 '.($this->cMR?"jumpTo(top.fsMod.recentIds['web'],'');":'').';
00281 ');
00282
00283
00284 $CMparts=$this->doc->getContextMenuCode();
00285 $this->doc->bodyTagAdditions = $CMparts[1];
00286 $this->doc->JScode.= $CMparts[0];
00287 $this->doc->postCode.= $CMparts[2];
00288 }
00289
00295 function main() {
00296 global $LANG,$CLIENT;
00297
00298
00299 $tree = $this->pagetree->getBrowsableTree();
00300
00301
00302 $this->content = '';
00303 $this->content.= $this->doc->startPage('Page tree');
00304
00305
00306 if ($this->active_tempMountPoint) {
00307 $this->content.= '
00308 <div class="bgColor4 c-notice">
00309 <img'.t3lib_iconWorks::skinImg('','gfx/icon_note.gif','width="18" height="16"').' align="top" alt="" />'.
00310 '<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => 0))).'">'.
00311 $LANG->sl('LLL:EXT:lang/locallang_core.php:labels.temporaryDBmount',1).
00312 '</a><br/>
00313 '.$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>
00314 </div>
00315 ';
00316 }
00317
00318
00319 $this->content.= $tree;
00320
00321
00322 $refreshUrl = t3lib_div::getIndpEnv('REQUEST_URI');
00323 $this->content.= '
00324 <p class="c-refresh">
00325 <a href="'.htmlspecialchars($refreshUrl).'">'.
00326 '<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="" />'.
00327 '</a><a href="'.htmlspecialchars($refreshUrl).'">'.
00328 $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.refresh',1).'</a>
00329 </p>
00330 <br />';
00331
00332
00333 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'pagetree', $GLOBALS['BACK_PATH']);
00334
00335
00336 if ($this->doHighlight) $this->content .=$this->doc->wrapScriptTags('
00337 hilight_row("",top.fsMod.navFrameHighlightedID["web"]);
00338 ');
00339 }
00340
00346 function printContent() {
00347 $this->content.= $this->doc->endPage();
00348 echo $this->content;
00349 }
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00373 function initializeTemporaryDBmount(){
00374 global $BE_USER;
00375
00376
00377 if (strlen($this->setTempDBmount)) {
00378 $set = t3lib_div::intInRange($this->setTempDBmount,0);
00379 if ($set>0 && $BE_USER->isInWebMount($set)) {
00380 $this->settingTemporaryMountPoint($set);
00381 } else {
00382 $this->settingTemporaryMountPoint(0);
00383 }
00384 }
00385
00386
00387 $temporaryMountPoint = intval($BE_USER->getSessionData('pageTree_temporaryMountPoint'));
00388
00389
00390 if ($temporaryMountPoint > 0 && $BE_USER->isInWebMount($temporaryMountPoint)) {
00391 $this->pagetree->MOUNTS = array($temporaryMountPoint);
00392 $this->active_tempMountPoint = t3lib_BEfunc::readPageAccess($temporaryMountPoint, $BE_USER->getPagePermsClause(1));
00393 }
00394 }
00395
00402 function settingTemporaryMountPoint($pageId) {
00403 global $BE_USER;
00404
00405
00406 $BE_USER->setAndSaveSessionData('pageTree_temporaryMountPoint',intval($pageId));
00407 }
00408 }
00409
00410
00411 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_db_navframe.php']) {
00412 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_db_navframe.php']);
00413 }
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427 $SOBE = t3lib_div::makeInstance('SC_alt_db_navframe');
00428 $SOBE->init();
00429 $SOBE->main();
00430 $SOBE->printContent();
00431
00432 ?>