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
00058 $BACK_PATH='';
00059 require ('init.php');
00060 require ('template.php');
00061 require_once (PATH_t3lib.'class.t3lib_foldertree.php');
00062
00063
00072 class localFolderTree extends t3lib_folderTree {
00073
00074 var $ext_IconMode;
00075
00081 function localFolderTree() {
00082 parent::t3lib_folderTree();
00083 }
00084
00092 function wrapIcon($icon,&$row) {
00093
00094
00095 $theFolderIcon = $this->addTagAttributes($icon,($this->titleAttrib ? $this->titleAttrib.'="'.$this->getTitleAttrib($row).'"' : ''));
00096
00097
00098 if (!$this->ext_IconMode) {
00099 $theFolderIcon = $GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon($theFolderIcon,$row['path'],'',0);
00100 } elseif (!strcmp($this->ext_IconMode,'titlelink')) {
00101 $aOnClick = 'return jumpTo(\''.$this->getJumpToParam($row).'\',this,\''.$this->domIdPrefix.$this->getId($row).'\','.$this->bank.');';
00102 $theFolderIcon='<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$theFolderIcon.'</a>';
00103 }
00104
00105 $spanOnDrag = htmlspecialchars('return dragElement("'.$this->getJumpToParam($row).'", "'.$row['uid'].'")');
00106 $spanOnDrop = htmlspecialchars('return dropElement("'.$this->getJumpToParam($row).'")');
00107 $dragDropIcon = '<span id="dragIconID_'.$row['uid'].'" ondragstart="'.$spanOnDrag.'" onmousedown="'.$spanOnDrag.'" onmouseup="'.$spanOnDrop.'">'.$theFolderIcon.'</span>';
00108
00109 return $dragDropIcon;
00110 }
00111
00121 function wrapTitle($title,$row,$bank=0) {
00122 $aOnClick = 'return jumpTo(\''.$this->getJumpToParam($row).'\',this,\''.$this->domIdPrefix.$this->getId($row).'\','.$bank.');';
00123 $CSM = '';
00124 if ($GLOBALS['TYPO3_CONF_VARS']['BE']['useOnContextMenuHandler']) {
00125 $CSM = ' oncontextmenu="'.htmlspecialchars($GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon('',$row['path'],'',0,'&bank='.$this->bank,'',TRUE)).'"';
00126 }
00127 $theFolderTitle='<a href="#" onclick="'.htmlspecialchars($aOnClick).'"'.$CSM.'>'.$title.'</a>';
00128
00129
00130 $spanOnDrag = htmlspecialchars('return dragElement("'.$this->getJumpToParam($row).'","'.$row['uid'].'")');
00131 $spanOnDrop = htmlspecialchars('return dropElement("'.$this->getJumpToParam($row).'")');
00132 $dragDropTitle = '<span id="dragTitleID_'.$row['uid'].'" ondragstart="'.$spanOnDrag.'" onmousedown="'.$spanOnDrag.'" onmouseup="'.$spanOnDrop.'">'.$theFolderTitle.'</span>';
00133 return $dragDropTitle;
00134 }
00135 }
00136
00137
00138
00146 class SC_alt_file_navframe {
00147
00148
00149 var $content;
00150 var $foldertree;
00151 var $doc;
00152
00153
00154 var $currentSubScript;
00155 var $cMR;
00156
00157
00163 function init() {
00164 global $BE_USER,$BACK_PATH,$CLIENT;
00165
00166
00167 $this->currentSubScript = t3lib_div::_GP('currentSubScript');
00168 $this->cMR = t3lib_div::_GP('cMR');
00169
00170
00171 $this->foldertree = t3lib_div::makeInstance('localFolderTree');
00172 $this->foldertree->ext_IconMode = $BE_USER->getTSConfigVal('options.folderTree.disableIconLinkToContextmenu');
00173 $this->foldertree->thisScript = 'alt_file_navframe.php';
00174
00175
00176 $this->doHighlight = !$BE_USER->getTSConfigVal('options.pageTree.disableTitleHighlight');
00177
00178
00179 $this->doc = t3lib_div::makeInstance('template');
00180 $this->doc->docType='xhtml_trans';
00181
00182
00183 $this->doc->backPath = $BACK_PATH;
00184
00185
00186 $this->doc->JScode=$this->doc->wrapScriptTags(
00187 ($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
00188
00189
00190 function jumpTo(id,linkObj,highLightID,bank) {
00191 var theUrl = top.TS.PATH_typo3+top.currentSubScript+"?id="+id;
00192 top.fsMod.currentBank = bank;
00193
00194 if (top.condensedMode) {
00195 top.content.location.href=theUrl;
00196 } else {
00197 parent.list_frame.location.href=theUrl;
00198 }
00199
00200 '.($this->doHighlight?'hilight_row("file",highLightID+"_"+bank);':'').'
00201 '.(!$CLIENT['FORMSTYLE'] ? '' : 'if (linkObj) {linkObj.blur();}').'
00202 return false;
00203 }
00204
00205
00206
00207
00208 function refresh_nav() {
00209 window.setTimeout("_refresh_nav();",0);
00210 }
00211 function _refresh_nav() {
00212 window.location.href="'.$this->pagetree->thisScript.'?unique='.time().'";
00213 }
00214
00215
00216 function hilight_row(frameSetModule,highLightID) {
00217
00218
00219 theObj = document.getElementById(top.fsMod.navFrameHighlightedID[frameSetModule]);
00220 if (theObj) {
00221 theObj.style.backgroundColor="";
00222 }
00223
00224
00225 top.fsMod.navFrameHighlightedID[frameSetModule] = highLightID;
00226 theObj = document.getElementById(highLightID);
00227 if (theObj) {
00228 theObj.style.backgroundColor="'.t3lib_div::modifyHTMLColorAll($this->doc->bgColor,-20).'";
00229 }
00230 }
00231
00232 '.($this->cMR?"jumpTo(top.fsMod.recentIds['file'],'');":'').';
00233 ');
00234
00235
00236 $CMparts=$this->doc->getContextMenuCode();
00237 $this->doc->bodyTagAdditions = $CMparts[1];
00238 $this->doc->JScode.=$CMparts[0];
00239 $this->doc->postCode.= $CMparts[2];
00240
00241
00242 $DDparts=$this->doc->getDragDropCode('folders');
00243
00244 $this->doc->JScode.= $DDparts[0];
00245 $this->doc->postCode.= $DDparts[2];
00246 }
00247
00253 function main() {
00254 global $LANG,$CLIENT;
00255
00256
00257 $tree = $this->foldertree->getBrowsableTree();
00258
00259 $this->content = '';
00260 $this->content.= $this->doc->startPage('Folder tree');
00261 $this->content.= $tree;
00262 $refreshUrl = t3lib_div::getIndpEnv('REQUEST_URI');
00263 $this->content.= '
00264 <p class="c-refresh">
00265 <a href="'.htmlspecialchars($refreshUrl).'">'.
00266 '<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="" />'.
00267 '</a><a href="'.htmlspecialchars($refreshUrl).'">'.
00268 $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.refresh',1).'</a>
00269 </p>
00270 <br />';
00271 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filetree', $GLOBALS['BACK_PATH']);
00272
00273
00274 if ($this->doHighlight) $this->content .=$this->doc->wrapScriptTags('
00275 hilight_row("",top.fsMod.navFrameHighlightedID["file"]);
00276 ');
00277 }
00278
00284 function printContent() {
00285 $this->content.= $this->doc->endPage();
00286 $this->content = $this->doc->insertStylesAndJS($this->content);
00287 echo $this->content;
00288 }
00289 }
00290
00291
00292 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_file_navframe.php']) {
00293 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_file_navframe.php']);
00294 }
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308 $SOBE = t3lib_div::makeInstance('SC_alt_file_navframe');
00309 $SOBE->init();
00310 $SOBE->main();
00311 $SOBE->printContent();
00312 ?>