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
00056
00057 $BACK_PATH = '';
00058 require_once('init.php');
00059 require('template.php');
00060 require_once('class.filelistfoldertree.php');
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 class SC_alt_file_navframe {
00071
00072
00073 var $content;
00074 var $foldertree;
00075
00076
00077
00078
00079
00080
00081 var $doc;
00082 var $backPath;
00083
00084
00085 var $currentSubScript;
00086 var $cMR;
00087
00088
00089
00090
00091
00092
00093
00094 function init() {
00095 global $BE_USER, $BACK_PATH;
00096
00097
00098 $this->backPath = $BACK_PATH;
00099
00100
00101 $this->currentSubScript = t3lib_div::_GP('currentSubScript');
00102 $this->cMR = t3lib_div::_GP('cMR');
00103
00104
00105 $this->foldertree = t3lib_div::makeInstance('filelistFolderTree');
00106 $this->foldertree->ext_IconMode = $BE_USER->getTSConfigVal('options.folderTree.disableIconLinkToContextmenu');
00107 $this->foldertree->thisScript = 'alt_file_navframe.php';
00108 }
00109
00110
00111
00112
00113
00114
00115
00116
00117 public function initPage() {
00118 global $BE_USER, $BACK_PATH, $CLIENT;
00119
00120
00121 $this->doHighlight = !$BE_USER->getTSConfigVal('options.pageTree.disableTitleHighlight');
00122
00123
00124 $this->doc = t3lib_div::makeInstance('template');
00125 $this->doc->backPath = $BACK_PATH;
00126 $this->doc->setModuleTemplate('templates/alt_file_navframe.html');
00127 $this->doc->showFlashMessages = FALSE;
00128
00129
00130 $this->doc->getDragDropCode('folders');
00131 $this->doc->getContextMenuCode();
00132
00133
00134 $this->doc->JScode .= $this->doc->wrapScriptTags(
00135
00136 ($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
00137
00138 function initFlashUploader(path) {
00139 path = decodeURIComponent(path);
00140 var flashUploadOptions = {
00141 uploadURL: top.TS.PATH_typo3 + "ajax.php",
00142 uploadFileSizeLimit: "' . t3lib_div::getMaxUploadFileSize() . '",
00143 uploadFileTypes: {
00144 allow: "' . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']['webspace']['allow'] . '",
00145 deny: "' . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']['webspace']['deny'] . '"
00146 },
00147 uploadFilePostName: "upload_1",
00148 uploadPostParams: {
00149 "file[upload][1][target]": path,
00150 "file[upload][1][data]": 1,
00151 "file[upload][1][charset]": "utf-8",
00152 "ajaxID": "TYPO3_tcefile::process"
00153 }
00154 };
00155
00156
00157 var flashUploader = top.TYPO3.FileUploadWindow.getInstance(flashUploadOptions);
00158
00159 var infoComponent = new top.Ext.Panel({
00160 autoEl: { tag: "div" },
00161 height: "auto",
00162 bodyBorder: false,
00163 border: false,
00164 hideBorders: true,
00165 cls: "t3-upload-window-infopanel",
00166 id: "t3-upload-window-infopanel-addition",
00167 html: \'<label for="overrideExistingFilesCheckbox"><input id="overrideExistingFilesCheckbox" type="checkbox" onclick="setFlashPostOptionOverwriteExistingFiles(this);" />\' + top.String.format(top.TYPO3.LLL.fileUpload.infoComponentOverrideFiles) + \'</label>\'
00168 });
00169 flashUploader.add(infoComponent);
00170
00171
00172 flashUploader.on("totalcomplete", function() {
00173 jumpTo (top.rawurlencode(path), "", "", "");
00174 });
00175
00176
00177 top.setFlashPostOptionOverwriteExistingFiles = function(checkbox) {
00178 var uploader = top.TYPO3.getInstance("FileUploadWindow");
00179 if (uploader.isVisible()) {
00180 uploader.swf.addPostParam("overwriteExistingFiles", (checkbox.checked == true ? 1 : 0));
00181 }
00182 };
00183 }
00184
00185
00186
00187 Tree.ajaxID = "SC_alt_file_navframe::expandCollapse";
00188
00189
00190 function jumpTo(id, linkObj, highlightID, bank) {
00191 var theUrl = top.TS.PATH_typo3 + top.currentSubScript ;
00192 if (theUrl.indexOf("?") != -1) {
00193 theUrl += "&id=" + id
00194 } else {
00195 theUrl += "?id=" + id
00196 }
00197 top.fsMod.currentBank = bank;
00198
00199 if (top.TYPO3.configuration.condensedMode) {
00200 top.content.location.href = theUrl;
00201 } else {
00202 parent.list_frame.location.href=theUrl;
00203 }
00204
00205 '.($this->doHighlight ? 'Tree.highlightActiveItem("file", highlightID + "_" + bank);' : '').'
00206 '.(!$CLIENT['FORMSTYLE'] ? '' : 'if (linkObj) linkObj.blur(); ').'
00207 return false;
00208 }
00209 '.($this->cMR ? " jumpTo(top.fsMod.recentIds['file'],'');" : '')
00210 );
00211 }
00212
00213
00214
00215
00216
00217
00218
00219 function main() {
00220 global $LANG,$CLIENT;
00221
00222
00223 $tree = $this->foldertree->getBrowsableTree();
00224
00225
00226 $this->content.= $tree;
00227
00228
00229 $this->content .=$this->doc->wrapScriptTags('
00230 '.($this->doHighlight ? 'Tree.highlightActiveItem("", top.fsMod.navFrameHighlightedID["file"]);' : '').'
00231 '.(!$this->doc->isCMlayers() ? 'Tree.activateDragDrop = false;' : 'Tree.registerDragDropHandlers();')
00232 );
00233
00234
00235 $docHeaderButtons = $this->getButtons();
00236 $markers = array(
00237 'IMG_RESET' => '<img' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/close_gray.gif', ' width="16" height="16"') .
00238 ' id="treeFilterReset" alt="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter') . '" ' .
00239 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.resetFilter') . '" />',
00240 'CONTENT' => $this->content
00241 );
00242
00243 $subparts = array();
00244
00245
00246 $subparts['###SECOND_ROW###'] = '';
00247
00248
00249 $this->content = $this->doc->startPage('TYPO3 Folder Tree');
00250 $this->content.= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers, $subparts);
00251 $this->content.= $this->doc->endPage();
00252 $this->content = $this->doc->insertStylesAndJS($this->content);
00253 }
00254
00255
00256
00257
00258
00259
00260 function printContent() {
00261 echo $this->content;
00262 }
00263
00264
00265
00266
00267
00268
00269 protected function getButtons() {
00270 $buttons = array(
00271 'csh' => '',
00272 'refresh' => '',
00273 );
00274
00275
00276 $buttons['refresh'] = '<a href="' . htmlspecialchars(t3lib_div::getIndpEnv('REQUEST_URI')) . '">' .
00277 t3lib_iconWorks::getSpriteIcon('actions-system-refresh') .
00278 '</a>';
00279
00280
00281 $buttons['csh'] = str_replace('typo3-csh-inline','typo3-csh-inline show-right',t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filetree', $GLOBALS['BACK_PATH']));
00282
00283 return $buttons;
00284 }
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300 public function ajaxExpandCollapse($params, $ajaxObj) {
00301 global $LANG;
00302
00303 $this->init();
00304 $tree = $this->foldertree->getBrowsableTree();
00305 if (!$this->foldertree->ajaxStatus) {
00306 $ajaxObj->setError($tree);
00307 } else {
00308 $ajaxObj->addContent('tree', $tree);
00309 }
00310 }
00311 }
00312
00313
00314 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_file_navframe.php']) {
00315 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_file_navframe.php']);
00316 }
00317
00318
00319
00320 if (!(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX)) {
00321 $SOBE = t3lib_div::makeInstance('SC_alt_file_navframe');
00322 $SOBE->init();
00323 $SOBE->initPage();
00324 $SOBE->main();
00325 $SOBE->printContent();
00326 }
00327
00328 ?>