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
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 $BACK_PATH = '';
00056 require_once('init.php');
00057 require('template.php');
00058 require_once('class.webpagetree.php');
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 class SC_alt_db_navframe {
00069
00070
00071 var $content;
00072 var $pagetree;
00073
00074
00075
00076
00077
00078
00079 var $doc;
00080 var $active_tempMountPoint = 0;
00081 var $backPath;
00082
00083
00084 var $currentSubScript;
00085 var $cMR;
00086 var $setTempDBmount;
00087
00088 var $template;
00089 var $hasFilterBox;
00090
00091
00092
00093
00094
00095
00096 function init() {
00097 global $BE_USER,$BACK_PATH;
00098
00099
00100 $this->backPath = $BACK_PATH;
00101
00102
00103 $this->cMR = t3lib_div::_GP('cMR');
00104 $this->currentSubScript = t3lib_div::_GP('currentSubScript');
00105 $this->setTempDBmount = t3lib_div::_GP('setTempDBmount');
00106
00107
00108 $this->hasFilterBox = !$BE_USER->getTSConfigVal('options.pageTree.hideFilter');
00109
00110
00111 $this->pagetree = t3lib_div::makeInstance('webPageTree');
00112 $this->pagetree->ext_IconMode = $BE_USER->getTSConfigVal('options.pageTree.disableIconLinkToContextmenu');
00113 $this->pagetree->ext_showPageId = $BE_USER->getTSConfigVal('options.pageTree.showPageIdWithTitle');
00114 $this->pagetree->ext_showNavTitle = $BE_USER->getTSConfigVal('options.pageTree.showNavTitle');
00115 $this->pagetree->ext_separateNotinmenuPages = $BE_USER->getTSConfigVal('options.pageTree.separateNotinmenuPages');
00116 $this->pagetree->ext_alphasortNotinmenuPages = $BE_USER->getTSConfigVal('options.pageTree.alphasortNotinmenuPages');
00117 $this->pagetree->thisScript = 'alt_db_navframe.php';
00118 $this->pagetree->addField('alias');
00119 $this->pagetree->addField('shortcut');
00120 $this->pagetree->addField('shortcut_mode');
00121 $this->pagetree->addField('mount_pid');
00122 $this->pagetree->addField('mount_pid_ol');
00123 $this->pagetree->addField('nav_hide');
00124 $this->pagetree->addField('nav_title');
00125 $this->pagetree->addField('url');
00126
00127
00128 $this->initializeTemporaryDBmount();
00129 }
00130
00131
00132
00133
00134
00135
00136
00137
00138 public function initPage() {
00139 global $BE_USER;
00140
00141
00142 $this->doHighlight = !$BE_USER->getTSConfigVal('options.pageTree.disableTitleHighlight');
00143
00144
00145 if ($this->doHighlight) {
00146 $hlClass = ($BE_USER->workspace === 0 ? 'active' : 'active active-ws wsver'.$BE_USER->workspace);
00147 }
00148
00149
00150 $this->doc = t3lib_div::makeInstance('template');
00151 $this->doc->backPath = $BACK_PATH;
00152 $this->doc->setModuleTemplate('templates/alt_db_navframe.html');
00153 $this->doc->showFlashMessages = FALSE;
00154
00155
00156
00157
00158
00159 $this->doc->getDragDropCode('pages');
00160 $this->doc->getContextMenuCode();
00161 $this->doc->getPageRenderer()->loadScriptaculous('effects');
00162 $this->doc->getPageRenderer()->loadExtJS();
00163
00164 $this->doc->getPageRenderer()->addJsFile('js/pagetreefiltermenu.js');
00165
00166 $this->doc->JScode .= $this->doc->wrapScriptTags(
00167 ($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
00168
00169 '.($this->doHighlight ? 'Tree.highlightClass = "'.$hlClass.'";' : '').'
00170
00171
00172 function jumpTo(id, linkObj, highlightID, bank) {
00173 var theUrl = top.TS.PATH_typo3 + top.currentSubScript ;
00174 if (theUrl.indexOf("?") != -1) {
00175 theUrl += "&id=" + id
00176 } else {
00177 theUrl += "?id=" + id
00178 }
00179 top.fsMod.currentBank = bank;
00180
00181 if (top.TYPO3.configuration.condensedMode) {
00182 top.content.location.href = theUrl;
00183 } else {
00184 parent.list_frame.location.href=theUrl;
00185 }
00186
00187 '.($this->doHighlight ? 'Tree.highlightActiveItem("web", highlightID + "_" + bank);' : '').'
00188 '.(!$GLOBALS['CLIENT']['FORMSTYLE'] ? '' : 'if (linkObj) linkObj.blur(); ').'
00189 return false;
00190 }
00191 '.($this->cMR?"jumpTo(top.fsMod.recentIds['web'],'');":'').
00192
00193 ($this->hasFilterBox ? 'var TYPO3PageTreeFilter = new PageTreeFilter();' : '') . '
00194
00195 ');
00196
00197 $this->doc->bodyTagId = 'typo3-pagetree';
00198 }
00199
00200
00201
00202
00203
00204
00205
00206 function main() {
00207 global $LANG,$CLIENT;
00208
00209
00210 $tree = $this->pagetree->getBrowsableTree();
00211
00212
00213
00214 if ($this->active_tempMountPoint) {
00215 $flashText = '
00216 <a href="' . htmlspecialchars(t3lib_div::linkThisScript(array('setTempDBmount' => 0))) . '">' .
00217 $LANG->sl('LLL:EXT:lang/locallang_core.xml:labels.temporaryDBmount',1) .
00218 '</a> <br />' .
00219 $LANG->sl('LLL:EXT:lang/locallang_core.xml:labels.path',1) . ': <span title="' .
00220 htmlspecialchars($this->active_tempMountPoint['_thePathFull']) . '">' .
00221 htmlspecialchars(t3lib_div::fixed_lgd_cs($this->active_tempMountPoint['_thePath'],-50)).
00222 '</span>
00223 ';
00224
00225 $flashMessage = t3lib_div::makeInstance(
00226 't3lib_FlashMessage',
00227 $flashText,
00228 '',
00229 t3lib_FlashMessage::INFO
00230 );
00231
00232
00233 $this->content.= $flashMessage->render();
00234 }
00235
00236
00237 $this->content .= '<div id="PageTreeDiv">'.$tree.'</div>';
00238
00239
00240 $this->content .= $this->doc->wrapScriptTags('
00241 '.($this->doHighlight ? 'Tree.highlightActiveItem("",top.fsMod.navFrameHighlightedID["web"]);' : '').'
00242 '.(!$this->doc->isCMlayers() ? 'Tree.activateDragDrop = false;' : 'Tree.registerDragDropHandlers();')
00243 );
00244
00245
00246 $docHeaderButtons = $this->getButtons();
00247 $markers = array(
00248 'IMG_RESET' => t3lib_iconWorks::getSpriteIcon('actions-document-close', array(
00249 'id' =>'treeFilterReset',
00250 'alt'=> $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter'),
00251 'title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter')
00252 )),
00253 'WORKSPACEINFO' => $this->getWorkspaceInfo(),
00254 'CONTENT' => $this->content
00255 );
00256 $subparts = array();
00257
00258 if (!$this->hasFilterBox) {
00259 $subparts['###SECOND_ROW###'] = '';
00260 }
00261
00262 $this->content = $this->doc->startPage('TYPO3 Page Tree');
00263 $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers, $subparts);
00264 $this->content.= $this->doc->endPage();
00265
00266 $this->content = $this->doc->insertStylesAndJS($this->content);
00267 }
00268
00269
00270
00271
00272
00273
00274 function printContent() {
00275 echo $this->content;
00276 }
00277
00278
00279
00280
00281
00282
00283 protected function getButtons() {
00284 global $LANG;
00285
00286 $buttons = array(
00287 'csh' => '',
00288 'new_page' => '',
00289 'refresh' => '',
00290 'filter' => '',
00291 );
00292
00293
00294 $onclickNewPageWizard = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'db_new.php?pagesOnly=1&id=\'+Tree.pageID;';
00295 $buttons['new_page'] = '<a href="#" onclick="' . $onclickNewPageWizard . '" title="' . $LANG->sL('LLL:EXT:cms/layout/locallang.xml:newPage', TRUE) . '">' .
00296 t3lib_iconWorks::getSpriteIcon('actions-page-new') .
00297 '</a>';
00298
00299
00300 $buttons['refresh'] = '<a href="' . htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')) . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.refresh', TRUE) . '">' .
00301 t3lib_iconWorks::getSpriteIcon('actions-system-refresh') .
00302 '</a>';
00303
00304
00305 $buttons['csh'] = str_replace('typo3-csh-inline','typo3-csh-inline show-right',t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'pagetree', $GLOBALS['BACK_PATH'], '', TRUE));
00306
00307
00308 if ($this->hasFilterBox) {
00309 $buttons['filter'] = '<a href="#" id="tree-toolbar-filter-item">' . t3lib_iconWorks::getSpriteIcon('actions-system-tree-search-open', array('title'=> $LANG->sL('LLL:EXT:cms/layout/locallang.xml:labels.filter', 1))) . '</a>';
00310 }
00311
00312 return $buttons;
00313 }
00314
00315
00316
00317
00318
00319
00320 protected function getWorkspaceInfo() {
00321 global $LANG;
00322
00323 if ($GLOBALS['BE_USER']->workspace!==0 || $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.onlineWorkspaceInfo')) {
00324 switch($GLOBALS['BE_USER']->workspace) {
00325 case 0:
00326 $wsTitle = ' '.$this->doc->icons(2).'['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:shortcut_onlineWS',1).']';
00327 break;
00328 case -1:
00329 $wsTitle = '['.$LANG->sL('LLL:EXT:lang/locallang_misc.xml:shortcut_offlineWS',1).']';
00330 break;
00331 default:
00332 $wsTitle = '['.$GLOBALS['BE_USER']->workspace.'] '.htmlspecialchars($GLOBALS['BE_USER']->workspaceRec['title']);
00333 break;
00334 }
00335
00336 $workspaceInfo = '
00337 <div class="bgColor4 workspace-info">
00338 <a href="'.htmlspecialchars('mod/user/ws/index.php').'" target="content">'.
00339 t3lib_iconWorks::getSpriteIcon('apps-toolbar-menu-workspace') .
00340 '</a>'.$wsTitle.'
00341 </div>
00342 ';
00343 }
00344
00345 return $workspaceInfo;
00346 }
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360 function initializeTemporaryDBmount(){
00361 global $BE_USER;
00362
00363
00364 if (strlen($this->setTempDBmount)) {
00365 $set = t3lib_div::intInRange($this->setTempDBmount,0);
00366 if ($set>0 && $BE_USER->isInWebMount($set)) {
00367 $this->settingTemporaryMountPoint($set);
00368 } else {
00369 $this->settingTemporaryMountPoint(0);
00370 }
00371 }
00372
00373
00374 $temporaryMountPoint = intval($BE_USER->getSessionData('pageTree_temporaryMountPoint'));
00375
00376
00377 if ($temporaryMountPoint > 0 && $BE_USER->isInWebMount($temporaryMountPoint)) {
00378 if ($this->active_tempMountPoint = t3lib_BEfunc::readPageAccess($temporaryMountPoint, $BE_USER->getPagePermsClause(1))) {
00379 $this->pagetree->MOUNTS = array($temporaryMountPoint);
00380 }
00381 else {
00382
00383 $this->settingTemporaryMountPoint(0);
00384 }
00385 }
00386 }
00387
00388
00389
00390
00391
00392
00393
00394
00395 function settingTemporaryMountPoint($pageId) {
00396 $GLOBALS['BE_USER']->setAndSaveSessionData('pageTree_temporaryMountPoint',intval($pageId));
00397 }
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414 public function ajaxExpandCollapse($params, $ajaxObj) {
00415 global $LANG;
00416
00417 $this->init();
00418 $tree = $this->pagetree->getBrowsableTree();
00419 if (!$this->pagetree->ajaxStatus) {
00420 $ajaxObj->setError($tree);
00421 } else {
00422 $ajaxObj->addContent('tree', $tree);
00423 }
00424 }
00425 }
00426
00427
00428
00429 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_db_navframe.php']) {
00430 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_db_navframe.php']);
00431 }
00432
00433
00434
00435 if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX)) {
00436 $SOBE = t3lib_div::makeInstance('SC_alt_db_navframe');
00437 $SOBE->init();
00438 $SOBE->initPage();
00439 $SOBE->main();
00440 $SOBE->printContent();
00441 }
00442
00443 ?>