Documentation TYPO3 par Ameos |
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 ***************************************************************/ 00051 unset($MCONF); 00052 require ('conf.php'); 00053 require ($BACK_PATH.'init.php'); 00054 require ($BACK_PATH.'template.php'); 00055 require_once (PATH_t3lib.'class.t3lib_arraybrowser.php'); 00056 00057 $BE_USER->modAccess($MCONF,1); 00058 00059 00060 00061 00062 00063 00064 00072 class SC_mod_tools_config_index { 00073 00074 var $MCONF = array(); 00075 var $MOD_MENU = array(); 00076 var $MOD_SETTINGS = array(); 00077 var $doc; 00078 00079 var $include_once = array(); 00080 var $content; 00081 00082 00083 00089 function init() { 00090 global $BACK_PATH; 00091 00092 $this->MCONF = $GLOBALS['MCONF']; 00093 00094 $this->menuConfig(); 00095 00096 $this->doc = t3lib_div::makeInstance('noDoc'); 00097 $this->doc->backPath = $BACK_PATH; 00098 00099 // JavaScript 00100 $this->doc->JScode = ' 00101 <script language="javascript" type="text/javascript"> 00102 script_ended = 0; 00103 function jumpToUrl(URL) { 00104 window.location.href = URL; 00105 } 00106 </script> 00107 '; 00108 00109 $this->doc->form = '<form action="" method="post">'; 00110 } 00111 00117 function menuConfig() { 00118 global $TYPO3_CONF_VARS; 00119 00120 // MENU-ITEMS: 00121 // If array, then it's a selector box menu 00122 // If empty string it's just a variable, that'll be saved. 00123 // Values NOT in this array will not be saved in the settings-array for the module. 00124 $this->MOD_MENU = array( 00125 'function' => array( 00126 0 => '$TYPO3_CONF_VARS', 00127 1 => '$TCA (tables.php)', 00128 3 => '$TYPO3_LOADED_EXT', 00129 4 => '$TBE_STYLES', 00130 ), 00131 'regexsearch' => '', 00132 'fixedLgd' => '' 00133 ); 00134 00135 // CLEANSE SETTINGS 00136 $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']); 00137 } 00138 00144 function main() { 00145 global $BE_USER,$LANG,$TCA,$TYPO3_CONF_VARS; 00146 00147 $this->content.= $this->doc->startPage('Configuration'); 00148 $this->content.= $this->doc->header('Configuration'); 00149 $this->content.= $this->doc->spacer(5); 00150 00151 $arrayBrowser = t3lib_div::makeInstance('t3lib_arrayBrowser'); 00152 00153 $menu = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.menu').' '.t3lib_BEfunc::getFuncMenu(0,'SET[function]',$this->MOD_SETTINGS['function'],$this->MOD_MENU['function']). 00154 ' Crop lines: '.t3lib_BEfunc::getFuncCheck(0,'SET[fixedLgd]',$this->MOD_SETTINGS['fixedLgd']); 00155 $this->content.=$this->doc->section('','<nobr>'.$menu.'</nobr>'); 00156 00157 switch($this->MOD_SETTINGS['function']) { 00158 case 0: 00159 $theVar = $TYPO3_CONF_VARS; 00160 $arrayBrowser->varName = '$TYPO3_CONF_VARS'; 00161 break; 00162 case 1: 00163 reset($TCA); 00164 while(list($ttable) =each($TCA)) { 00165 t3lib_div::loadTCA($ttable); 00166 } 00167 $theVar = $TCA; 00168 $arrayBrowser->varName = '$TCA'; 00169 break; 00170 case 3: 00171 $theVar = $GLOBALS['TYPO3_LOADED_EXT']; 00172 $arrayBrowser->varName = '$TYPO3_LOADED_EXT'; 00173 break; 00174 case 4: 00175 $theVar = $GLOBALS['TBE_STYLES']; 00176 $arrayBrowser->varName = '$TBE_STYLES'; 00177 break; 00178 default: 00179 $theVar = array(); 00180 break; 00181 } 00182 00183 00184 // Update node: 00185 $update = 0; 00186 $node = t3lib_div::_GET('node'); 00187 if (is_array($node)) { // If any plus-signs were clicked, it's registred. 00188 $this->MOD_SETTINGS['node_'.$this->MOD_SETTINGS['function']] = $arrayBrowser->depthKeys($node, $this->MOD_SETTINGS['node_'.$this->MOD_SETTINGS['function']]); 00189 $update = 1; 00190 } 00191 if ($update) { 00192 $GLOBALS['BE_USER']->pushModuleData($this->MCONF['name'],$this->MOD_SETTINGS); 00193 } 00194 00195 $arrayBrowser->depthKeys = $this->MOD_SETTINGS['node_'.$this->MOD_SETTINGS['function']]; 00196 $arrayBrowser->regexMode = $this->MOD_SETTINGS['regexsearch']; 00197 $arrayBrowser->fixedLgd = $this->MOD_SETTINGS['fixedLgd']; 00198 00199 00200 $search_field = t3lib_div::_GP('search_field'); 00201 if (t3lib_div::_POST('search') && trim($search_field)) { // If any POST-vars are send, update the condition array 00202 $arrayBrowser->depthKeys=$arrayBrowser->getSearchKeys($theVar, '', $search_field, array()); 00203 } 00204 00205 $tree = $arrayBrowser->tree($theVar, '', ''); 00206 00207 $label = $this->MOD_MENU['function'][$this->MOD_SETTINGS['function']]; 00208 $this->content.= $this->doc->sectionEnd(); 00209 00210 // Variable name: 00211 if (t3lib_div::_GP('varname')) { 00212 $this->content.= '<div style="margin: 10px 10px 10px 10px; padding: 10px 10px 10px 10px; background-color: #eeeeee; border: 1px solid black;">Variable: <br/> 00213 <input type="text" name="_" value="'.trim(htmlspecialchars(t3lib_div::_GP('varname'))).'" size="80" /><br/> 00214 (Now, copy/paste this value into the configuration file where you can set it. This is all you can do from here...) 00215 </div> 00216 '; 00217 } 00218 00219 $this->content.= '<br/><table border="0" cellpadding="1" cellspacing="0"">'; 00220 $this->content.= '<tr> 00221 <td><img src="clear.gif" width="1" height="1" alt="" /></td> 00222 <td class="bgColor2"> 00223 <table border="0" cellpadding="0" cellspacing="0" class="bgColor5" width="100%"><tr><td nowrap="nowrap"><b>'.$label.'</b></td></tr></table> 00224 </td> 00225 </tr>'; 00226 $this->content.='<tr> 00227 <td></td> 00228 <td class="bgColor2"> 00229 <table border="0" cellpadding="0" cellspacing="0" bgcolor="#D9D5C9" width="100%"><tr><td nowrap="nowrap">'.$tree.'</td></tr></table>' . 00230 '<img src="clear.gif" width="465" height="1" alt="" /></td> 00231 </tr> 00232 </table> 00233 '; 00234 00235 00236 // Search: 00237 $this->content.='<br> 00238 <table border="0" cellpadding="1" cellspacing="0""> 00239 <tr> 00240 <td><img src="clear.gif" width="1" height="1" alt="" /></td> 00241 <td class="bgColor2"> 00242 <table border="0" cellpadding="0" cellspacing="0" bgcolor="#D9D5C9"> 00243 <tr> 00244 <td> Enter search phrase: <input type="text" name="search_field" value="'.htmlspecialchars($search_field).'"'.$GLOBALS['TBE_TEMPLATE']->formWidth(20).'></td> 00245 <td><input type="submit" name="search" value="Search" /></td> 00246 </tr> 00247 <tr> 00248 <td> Use ereg(), not stristr(): '.t3lib_BEfunc::getFuncCheck(0,'SET[regexsearch]',$this->MOD_SETTINGS['regexsearch']).'</td> 00249 <td> </td> 00250 </tr> 00251 </table> 00252 </td> 00253 </tr> 00254 </table> 00255 <br/> 00256 '; 00257 00258 if ($BE_USER->mayMakeShortcut()) { 00259 $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('','function',$this->MCONF['name'])); 00260 } 00261 } 00262 00268 function printContent() { 00269 00270 $this->content.= $this->doc->endPage(); 00271 echo $this->content; 00272 } 00273 } 00274 00275 // Include extension? 00276 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/lowlevel/config/index.php']) { 00277 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/lowlevel/config/index.php']); 00278 } 00279 00280 00281 00282 00283 00284 00285 00286 00287 00288 00289 00290 00291 // Make instance: 00292 $SOBE = t3lib_div::makeInstance('SC_mod_tools_config_index'); 00293 $SOBE->init(); 00294 $SOBE->main(); 00295 $SOBE->printContent(); 00296 ?>