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
00057 $BACK_PATH = '';
00058 require('init.php');
00059 require('template.php');
00060 require_once('class.filelistfoldertree.php');
00061
00062
00070 class SC_alt_file_navframe {
00071
00072
00073 var $content;
00074 var $foldertree;
00075 var $doc;
00076 var $backPath;
00077
00078
00079 var $ajax;
00080 var $currentSubScript;
00081 var $cMR;
00082
00083
00089 function init() {
00090 global $BE_USER,$BACK_PATH,$CLIENT;
00091
00092
00093 $this->backPath = $BACK_PATH;
00094 $this->doc->backPath = $BACK_PATH;
00095
00096
00097 $this->ajax = t3lib_div::_GP('ajax');
00098 $this->currentSubScript = t3lib_div::_GP('currentSubScript');
00099 $this->cMR = t3lib_div::_GP('cMR');
00100
00101
00102 $this->foldertree = t3lib_div::makeInstance('filelistFolderTree');
00103 $this->foldertree->ext_IconMode = $BE_USER->getTSConfigVal('options.folderTree.disableIconLinkToContextmenu');
00104 $this->foldertree->thisScript = 'alt_file_navframe.php';
00105
00106
00107 if (!$this->ajax) {
00108
00109 $this->doHighlight = !$BE_USER->getTSConfigVal('options.pageTree.disableTitleHighlight');
00110
00111
00112 $this->doc = t3lib_div::makeInstance('template');
00113 $this->doc->docType = 'xhtml_trans';
00114
00115
00116 $this->doc->JScode = '
00117 <script type="text/javascript" src="'.$this->backPath.'contrib/prototype/prototype.js"></script>
00118 <script type="text/javascript" src="'.$this->backPath.'tree.js"></script>'."\n";
00119
00120
00121 $this->doc->JScode .= $this->doc->wrapScriptTags(
00122 ($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
00123
00124
00125 Tree.thisScript = "'.$this->foldertree->thisScript.'";
00126 DragDrop.changeURL = "'.$this->backPath.'alt_clickmenu.php";
00127 DragDrop.backPath = "'.t3lib_div::shortMD5(''.'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']).'";
00128 DragDrop.table = "folders";
00129
00130
00131 function jumpTo(id, linkObj, highlightID, bank) {
00132 var theUrl = top.TS.PATH_typo3 + top.currentSubScript + "?id=" + id;
00133 top.fsMod.currentBank = bank;
00134
00135 if (top.condensedMode) top.content.location.href = theUrl;
00136 else parent.list_frame.location.href = theUrl;
00137
00138 '.($this->doHighlight ? 'Tree.highlightActiveItem("file", highlightID + "_" + bank);' : '').'
00139 '.(!$GLOBALS['CLIENT']['FORMSTYLE'] ? '' : 'if (linkObj) linkObj.blur(); ').'
00140 return false;
00141 }
00142 '.($this->cMR ? " jumpTo(top.fsMod.recentIds['file'],'');" : '')
00143 );
00144
00145
00146 $CMparts=$this->doc->getContextMenuCode();
00147 $this->doc->bodyTagAdditions = $CMparts[1];
00148 $this->doc->JScode.= $CMparts[0];
00149 $this->doc->postCode.= $CMparts[2];
00150 }
00151 }
00152
00158 function main() {
00159 global $LANG,$CLIENT;
00160
00161
00162 $tree = $this->foldertree->getBrowsableTree();
00163
00164
00165 if ($this->ajax) {
00166 $this->content = $LANG->csConvObj->utf8_encode($tree, $LANG->charSet);
00167 return;
00168 }
00169
00170 $this->content = $this->doc->startPage('TYPO3 Folder Tree');
00171
00172
00173 $this->content.= $tree;
00174
00175
00176 $this->content.= '
00177 <p class="c-refresh">
00178 <a href="'.htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')).'">'.
00179 '<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="" />'.
00180 $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.refresh',1).'</a>
00181 </p>
00182 <br />';
00183
00184
00185 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filetree', $GLOBALS['BACK_PATH']);
00186
00187
00188 $this->content .=$this->doc->wrapScriptTags('
00189 '.($this->doHighlight ? 'Tree.highlightActiveItem("", top.fsMod.navFrameHighlightedID["file"]);' : '').'
00190 '.(!$this->doc->isCMlayers() ? 'Tree.activateDragDrop = false;' : 'Tree.registerDragDropHandlers();')
00191 );
00192
00193 }
00194
00200 function printContent() {
00201
00202 if ($this->ajax) {
00203 header('X-JSON: ('.($this->foldertree->ajaxStatus?'true':'false').')');
00204 header('Content-type: text/html; charset=utf-8');
00205
00206 } else {
00207 $this->content.= $this->doc->endPage();
00208 $this->content = $this->doc->insertStylesAndJS($this->content);
00209 }
00210 echo $this->content;
00211 }
00212 }
00213
00214
00215 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_file_navframe.php']) {
00216 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_file_navframe.php']);
00217 }
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231 $SOBE = t3lib_div::makeInstance('SC_alt_file_navframe');
00232 $SOBE->init();
00233 $SOBE->main();
00234 $SOBE->printContent();
00235 ?>