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
00055 $BACK_PATH = '';
00056 require('init.php');
00057 require('template.php');
00058 require_once('class.webpagetree.php');
00059
00060
00068 class SC_alt_db_navframe {
00069
00070
00071 var $content;
00072 var $pagetree;
00073 var $doc;
00074 var $active_tempMountPoint = 0;
00075 var $backPath;
00076
00077
00078 var $ajax;
00079 var $currentSubScript;
00080 var $cMR;
00081 var $setTempDBmount;
00082
00088 function init() {
00089 global $BE_USER,$BACK_PATH;
00090
00091
00092 $this->backPath = $BACK_PATH;
00093 $this->doc->backPath = $BACK_PATH;
00094
00095
00096 $this->ajax = t3lib_div::_GP('ajax');
00097 $this->cMR = t3lib_div::_GP('cMR');
00098 $this->currentSubScript = t3lib_div::_GP('currentSubScript');
00099 $this->setTempDBmount = t3lib_div::_GP('setTempDBmount');
00100
00101
00102 $this->pagetree = t3lib_div::makeInstance('webPageTree');
00103 $this->pagetree->ext_IconMode = $BE_USER->getTSConfigVal('options.pageTree.disableIconLinkToContextmenu');
00104 $this->pagetree->ext_showPageId = $BE_USER->getTSConfigVal('options.pageTree.showPageIdWithTitle');
00105 $this->pagetree->thisScript = 'alt_db_navframe.php';
00106 $this->pagetree->addField('alias');
00107 $this->pagetree->addField('shortcut');
00108 $this->pagetree->addField('shortcut_mode');
00109 $this->pagetree->addField('mount_pid');
00110 $this->pagetree->addField('mount_pid_ol');
00111 $this->pagetree->addField('nav_hide');
00112 $this->pagetree->addField('url');
00113
00114
00115 $this->initializeTemporaryDBmount();
00116
00117
00118 if (!$this->ajax) {
00119
00120 $this->doHighlight = !$BE_USER->getTSConfigVal('options.pageTree.disableTitleHighlight');
00121
00122
00123 if ($this->doHighlight) {
00124 if ($BE_USER->workspace === 0) $hlClass = 'active';
00125 else $hlClass = 'active active-ws wsver'.$BE_USER->workspace;
00126 }
00127
00128
00129 $this->doc = t3lib_div::makeInstance('template');
00130 $this->doc->docType = 'xhtml_trans';
00131
00132
00133 $this->doc->JScode = '
00134 <script type="text/javascript" src="'.$this->backPath.'contrib/prototype/prototype.js"></script>
00135 <script type="text/javascript" src="'.$this->backPath.'tree.js"></script>'."\n";
00136
00137 $this->doc->JScode .= $this->doc->wrapScriptTags(
00138 ($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
00139
00140 Tree.thisScript = "'.$this->pagetree->thisScript.'";
00141 '.($this->doHighlight ? 'Tree.highlightClass = "'.$hlClass.'";' : '').'
00142
00143 DragDrop.changeURL = "'.$this->backPath.'alt_clickmenu.php";
00144 DragDrop.backPath = "'.t3lib_div::shortMD5(''.'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']).'";
00145 DragDrop.table = "pages";
00146
00147
00148 function jumpTo(id, linkObj, highlightID, bank) {
00149 var theUrl = top.TS.PATH_typo3 + top.currentSubScript + "?id=" + id;
00150 top.fsMod.currentBank = bank;
00151
00152 if (top.condensedMode) top.content.location.href = theUrl;
00153 else parent.list_frame.location.href=theUrl;
00154
00155 '.($this->doHighlight ? 'Tree.highlightActiveItem("web", highlightID + "_" + bank);' : '').'
00156 '.(!$GLOBALS['CLIENT']['FORMSTYLE'] ? '' : 'if (linkObj) linkObj.blur(); ').'
00157 return false;
00158 }
00159 '.($this->cMR?"jumpTo(top.fsMod.recentIds['web'],'');":'').'
00160 ');
00161
00162
00163 $CMparts=$this->doc->getContextMenuCode();
00164 $this->doc->bodyTagAdditions = $CMparts[1];
00165 $this->doc->JScode.= $CMparts[0];
00166 $this->doc->postCode.= $CMparts[2];
00167 }
00168 }
00169
00170
00176 function main() {
00177 global $LANG,$CLIENT;
00178
00179
00180 $tree = $this->pagetree->getBrowsableTree();
00181
00182
00183 if ($this->ajax) {
00184 $this->content = $LANG->csConvObj->utf8_encode($tree, $LANG->charSet);
00185 return;
00186 }
00187
00188
00189 $this->content = $this->doc->startPage('TYPO3 Page Tree');
00190
00191
00192 if ($GLOBALS['BE_USER']->workspace!==0 || $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.onlineWorkspaceInfo')) {
00193 switch($GLOBALS['BE_USER']->workspace) {
00194 case 0:
00195 $wsTitle = ' '.$this->doc->icons(2).'['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:shortcut_onlineWS',1).']';
00196 break;
00197 case -1:
00198 $wsTitle = '['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:shortcut_offlineWS',1).']';
00199 break;
00200 default:
00201 $wsTitle = '['.$GLOBALS['BE_USER']->workspace.'] '.htmlspecialchars($GLOBALS['BE_USER']->workspaceRec['title']);
00202 break;
00203 }
00204
00205 $this->content.= '
00206 <div class="bgColor4 workspace-info">'.
00207 '<a href="'.htmlspecialchars('mod/user/ws/index.php').'" target="content">'.
00208 '<img'.t3lib_iconWorks::skinImg('','gfx/i/sys_workspace.png','width="18" height="16"').' align="top" alt="" />'.
00209 '</a>'.$wsTitle.'
00210 </div>
00211 ';
00212 }
00213
00214
00215 if ($this->active_tempMountPoint) {
00216 $this->content.= '
00217 <div class="bgColor4 c-notice">
00218 <img'.t3lib_iconWorks::skinImg('','gfx/icon_note.gif','width="18" height="16"').' align="top" alt="" />'.
00219 '<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => 0))).'">'.
00220 $LANG->sl('LLL:EXT:lang/locallang_core.php:labels.temporaryDBmount',1).
00221 '</a><br/>
00222 '.$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>
00223 </div>
00224 ';
00225 }
00226
00227
00228 $this->content.= $tree;
00229
00230
00231 $this->content.= '
00232 <p class="c-refresh">
00233 <a href="'.htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')).'">'.
00234 '<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="" />'.
00235 $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.refresh',1).'</a>
00236 </p>
00237 <br />';
00238
00239
00240 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'pagetree', $GLOBALS['BACK_PATH']);
00241
00242
00243 $this->content .=$this->doc->wrapScriptTags('
00244 '.($this->doHighlight ? 'Tree.highlightActiveItem("",top.fsMod.navFrameHighlightedID["web"]);' : '').'
00245 '.(!$this->doc->isCMlayers() ? 'Tree.activateDragDrop = false;' : 'Tree.registerDragDropHandlers();')
00246 );
00247 }
00248
00254 function printContent() {
00255
00256 if ($this->ajax) {
00257 header('X-JSON: ('.($this->pagetree->ajaxStatus?'true':'false').')');
00258 header('Content-type: text/html; charset=utf-8');
00259
00260 } else {
00261 $this->content.= $this->doc->endPage();
00262 $this->content = $this->doc->insertStylesAndJS($this->content);
00263 }
00264 echo $this->content;
00265 }
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00282 function initializeTemporaryDBmount(){
00283 global $BE_USER;
00284
00285
00286 if (strlen($this->setTempDBmount)) {
00287 $set = t3lib_div::intInRange($this->setTempDBmount,0);
00288 if ($set>0 && $BE_USER->isInWebMount($set)) {
00289 $this->settingTemporaryMountPoint($set);
00290 } else {
00291 $this->settingTemporaryMountPoint(0);
00292 }
00293 }
00294
00295
00296 $temporaryMountPoint = intval($BE_USER->getSessionData('pageTree_temporaryMountPoint'));
00297
00298
00299 if ($temporaryMountPoint > 0 && $BE_USER->isInWebMount($temporaryMountPoint)) {
00300 if ($this->active_tempMountPoint = t3lib_BEfunc::readPageAccess($temporaryMountPoint, $BE_USER->getPagePermsClause(1))) {
00301 $this->pagetree->MOUNTS = array($temporaryMountPoint);
00302 }
00303 else {
00304
00305 $this->settingTemporaryMountPoint(0);
00306 }
00307 }
00308 }
00309
00310
00317 function settingTemporaryMountPoint($pageId) {
00318 global $BE_USER;
00319
00320
00321 $BE_USER->setAndSaveSessionData('pageTree_temporaryMountPoint',intval($pageId));
00322 }
00323 }
00324
00325
00326
00327 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_db_navframe.php']) {
00328 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_db_navframe.php']);
00329 }
00330
00331
00332
00333
00334
00335
00336 $SOBE = t3lib_div::makeInstance('SC_alt_db_navframe');
00337 $SOBE->init();
00338 $SOBE->main();
00339 $SOBE->printContent();
00340
00341 ?>