Documentation TYPO3 par Ameos

alt_file_navframe.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00052 $BACK_PATH='';
00053 require ('init.php');
00054 require ('template.php');
00055 require_once (PATH_t3lib.'class.t3lib_foldertree.php');
00056 
00057 
00058 
00059 
00060 
00068 class SC_alt_file_navframe {
00069 
00070                 // Internal, dynamic:
00071         var $content;           // Content accumulates in this variable.
00072         var $foldertree;        // Folder tree object.
00073         var $doc;                       // Template object.
00074 
00075                 // Internal, static: GPvar:
00076         var $currentSubScript;
00077         var $cMR;
00078 
00079 
00085         function init() {
00086                 global $BE_USER,$BACK_PATH,$CLIENT;
00087 
00088                         // Setting GPvars:
00089                 $this->currentSubScript = t3lib_div::_GP('currentSubScript');
00090                 $this->cMR = t3lib_div::_GP('cMR');
00091 
00092                         // Create folder tree object:
00093                 $this->foldertree = t3lib_div::makeInstance('t3lib_folderTree');
00094                 $this->foldertree->ext_IconMode = $BE_USER->getTSConfigVal('options.folderTree.disableIconLinkToContextmenu');
00095                 $this->foldertree->thisScript = 'alt_file_navframe.php';
00096 
00097                         // Setting highlight mode:
00098                 $this->doHighlight = !$BE_USER->getTSConfigVal('options.pageTree.disableTitleHighlight');
00099 
00100                         // Create template object:
00101                 $this->doc = t3lib_div::makeInstance('template');
00102                 $this->doc->docType='xhtml_trans';
00103 
00104                         // Setting backPath
00105                 $this->doc->backPath = $BACK_PATH;
00106 
00107                         // Setting JavaScript for menu.
00108                 $this->doc->JScode=$this->doc->wrapScriptTags(
00109         ($this->currentSubScript?'top.currentSubScript=unescape("'.rawurlencode($this->currentSubScript).'");':'').'
00110 
00111                 // Function, loading the list frame from navigation tree:
00112         function jumpTo(id,linkObj,highLightID) {       //
00113                 var theUrl = top.TS.PATH_typo3+top.currentSubScript+"?id="+id;
00114 
00115                 if (top.condensedMode)  {
00116                         top.content.document.location=theUrl;
00117                 } else {
00118                         parent.list_frame.document.location=theUrl;
00119                 }
00120 
00121         '.($this->doHighlight?'hilight_row("file",highLightID);':'').'
00122                 '.(!$CLIENT['FORMSTYLE'] ? '' : 'if (linkObj) {linkObj.blur();}').'
00123                 return false;
00124         }
00125 
00126 
00127                 // Call this function, refresh_nav(), from another script in the backend if you want to refresh the navigation frame (eg. after having changed a page title or moved pages etc.)
00128                 // See t3lib_BEfunc::getSetUpdateSignal()
00129         function refresh_nav()  {       //
00130                 window.setTimeout("_refresh_nav();",0);
00131         }
00132         function _refresh_nav() {       //
00133                 document.location="'.$this->pagetree->thisScript.'?unique='.time().'";
00134         }
00135 
00136                 // Highlighting rows in the folder tree:
00137         function hilight_row(frameSetModule,highLightID) {      //
00138 
00139                         // Remove old:
00140                 theObj = document.getElementById(top.fsMod.navFrameHighlightedID[frameSetModule]);
00141                 if (theObj)     {
00142                         theObj.style.backgroundColor="";
00143                 }
00144 
00145                         // Set new:
00146                 top.fsMod.navFrameHighlightedID[frameSetModule] = highLightID;
00147                 theObj = document.getElementById(highLightID);
00148                 if (theObj)     {
00149                         theObj.style.backgroundColor="'.t3lib_div::modifyHTMLColorAll($this->doc->bgColor,-20).'";
00150                 }
00151         }
00152 
00153         '.($this->cMR?"jumpTo(top.fsMod.recentIds['file'],'');":'').';
00154                 ');
00155 
00156                         // Click menu code is added:
00157                 $CMparts=$this->doc->getContextMenuCode();
00158                 $this->doc->bodyTagAdditions = $CMparts[1];
00159                 $this->doc->JScode.=$CMparts[0];
00160                 $this->doc->postCode.= $CMparts[2];
00161         }
00162 
00168         function main() {
00169                 global $LANG,$CLIENT;
00170 
00171                         // Produce browse-tree:
00172                 $tree = $this->foldertree->getBrowsableTree();
00173 
00174                 $this->content = '';
00175                 $this->content.= $this->doc->startPage('Folder tree');
00176                 $this->content.= $tree;
00177                 $refreshUrl = t3lib_div::getIndpEnv('REQUEST_URI');
00178                 $this->content.= '
00179                         <p class="c-refresh">
00180                                 <a href="'.htmlspecialchars($refreshUrl).'">'.
00181                                 '<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="" />'.
00182                                 '</a><a href="'.htmlspecialchars($refreshUrl).'">'.
00183                                 $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.refresh',1).'</a>
00184                         </p>
00185                         <br />';
00186                 $this->content.= t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'filetree', $GLOBALS['BACK_PATH']);
00187 
00188                         // Adding highlight - JavaScript
00189                 if ($this->doHighlight) $this->content .=$this->doc->wrapScriptTags('
00190                         hilight_row("",top.fsMod.navFrameHighlightedID["file"]);
00191                 ');
00192         }
00193 
00199         function printContent() {
00200                 $this->content.= $this->doc->endPage();
00201                 echo $this->content;
00202         }
00203 }
00204 
00205 // Include extension?
00206 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_file_navframe.php'])     {
00207         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_file_navframe.php']);
00208 }
00209 
00210 
00211 
00212 
00213 
00214 
00215 
00216 
00217 
00218 
00219 
00220 
00221 // Make instance:
00222 $SOBE = t3lib_div::makeInstance('SC_alt_file_navframe');
00223 $SOBE->init();
00224 $SOBE->main();
00225 $SOBE->printContent();
00226 ?>


Généré par Le spécialiste TYPO3 avec  doxygen 1.4.6