| [ Index ] |
|
Code source de Typo3 4.1.3 |
1 <?php 2 /*************************************************************** 3 * Copyright notice 4 * 5 * (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com) 6 * All rights reserved 7 * 8 * This script is part of the TYPO3 project. The TYPO3 project is 9 * free software; you can redistribute it and/or modify 10 * it under the terms of the GNU General Public License as published by 11 * the Free Software Foundation; either version 2 of the License, or 12 * (at your option) any later version. 13 * 14 * The GNU General Public License can be found at 15 * http://www.gnu.org/copyleft/gpl.html. 16 * A copy is found in the textfile GPL.txt and important notices to the license 17 * from the author is found in LICENSE.txt distributed with these scripts. 18 * 19 * 20 * This script is distributed in the hope that it will be useful, 21 * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 * GNU General Public License for more details. 24 * 25 * This copyright notice MUST APPEAR in all copies of the script! 26 ***************************************************************/ 27 /** 28 * Module: Config 29 * 30 * This module lets you view the config variables around TYPO3. 31 * 32 * @author Kasper Skaarhoj <kasperYYYY@typo3.com> 33 */ 34 /** 35 * [CLASS/FUNCTION INDEX of SCRIPT] 36 * 37 * 38 * 39 * 72: class SC_mod_tools_config_index 40 * 89: function init() 41 * 103: function jumpToUrl(URL) 42 * 117: function menuConfig() 43 * 144: function main() 44 * 268: function printContent() 45 * 46 * TOTAL FUNCTIONS: 5 47 * (This index is automatically created/updated by the extension "extdeveval") 48 * 49 */ 50 51 unset($MCONF); 52 require ('conf.php'); 53 require ($BACK_PATH.'init.php'); 54 require ($BACK_PATH.'template.php'); 55 require_once (PATH_t3lib.'class.t3lib_arraybrowser.php'); 56 57 $BE_USER->modAccess($MCONF,1); 58 59 60 61 62 63 64 65 /** 66 * Script class for the Config module 67 * 68 * @author Kasper Skaarhoj <kasperYYYY@typo3.com> 69 * @package TYPO3 70 * @subpackage tx_lowlevel 71 */ 72 class SC_mod_tools_config_index { 73 74 var $MCONF = array(); 75 var $MOD_MENU = array(); 76 var $MOD_SETTINGS = array(); 77 var $doc; 78 79 var $include_once = array(); 80 var $content; 81 82 83 84 /** 85 * Initialization 86 * 87 * @return void 88 */ 89 function init() { 90 global $BACK_PATH; 91 92 $this->MCONF = $GLOBALS['MCONF']; 93 94 $this->menuConfig(); 95 96 $this->doc = t3lib_div::makeInstance('noDoc'); 97 $this->doc->backPath = $BACK_PATH; 98 99 // JavaScript 100 $this->doc->JScode = ' 101 <script language="javascript" type="text/javascript"> 102 script_ended = 0; 103 function jumpToUrl(URL) { 104 window.location.href = URL; 105 } 106 </script> 107 '; 108 109 $this->doc->form = '<form action="" method="post">'; 110 } 111 112 /** 113 * Menu Configuration 114 * 115 * @return void 116 */ 117 function menuConfig() { 118 global $TYPO3_CONF_VARS; 119 120 // MENU-ITEMS: 121 // If array, then it's a selector box menu 122 // If empty string it's just a variable, that'll be saved. 123 // Values NOT in this array will not be saved in the settings-array for the module. 124 $this->MOD_MENU = array( 125 'function' => array( 126 0 => '$TYPO3_CONF_VARS', 127 1 => '$TCA (tables.php)', 128 3 => '$TYPO3_LOADED_EXT', 129 4 => '$TBE_STYLES', 130 ), 131 'regexsearch' => '', 132 'fixedLgd' => '' 133 ); 134 135 // CLEANSE SETTINGS 136 $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']); 137 } 138 139 /** 140 * [Describe function...] 141 * 142 * @return [type] ... 143 */ 144 function main() { 145 global $BE_USER,$LANG,$TCA,$TYPO3_CONF_VARS; 146 147 $this->content.= $this->doc->startPage('Configuration'); 148 $this->content.= $this->doc->header('Configuration'); 149 $this->content.= $this->doc->spacer(5); 150 151 $arrayBrowser = t3lib_div::makeInstance('t3lib_arrayBrowser'); 152 153 $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']). 154 ' <label for="checkFixedLgd">Crop lines:</label> '.t3lib_BEfunc::getFuncCheck(0,'SET[fixedLgd]',$this->MOD_SETTINGS['fixedLgd'],'','','id="checkFixedLgd"'); 155 $this->content.=$this->doc->section('','<nobr>'.$menu.'</nobr>'); 156 157 switch($this->MOD_SETTINGS['function']) { 158 case 0: 159 $theVar = $TYPO3_CONF_VARS; 160 $arrayBrowser->varName = '$TYPO3_CONF_VARS'; 161 break; 162 case 1: 163 reset($TCA); 164 while(list($ttable) =each($TCA)) { 165 t3lib_div::loadTCA($ttable); 166 } 167 $theVar = $TCA; 168 $arrayBrowser->varName = '$TCA'; 169 break; 170 case 3: 171 $theVar = $GLOBALS['TYPO3_LOADED_EXT']; 172 $arrayBrowser->varName = '$TYPO3_LOADED_EXT'; 173 break; 174 case 4: 175 $theVar = $GLOBALS['TBE_STYLES']; 176 $arrayBrowser->varName = '$TBE_STYLES'; 177 break; 178 default: 179 $theVar = array(); 180 break; 181 } 182 183 184 // Update node: 185 $update = 0; 186 $node = t3lib_div::_GET('node'); 187 if (is_array($node)) { // If any plus-signs were clicked, it's registred. 188 $this->MOD_SETTINGS['node_'.$this->MOD_SETTINGS['function']] = $arrayBrowser->depthKeys($node, $this->MOD_SETTINGS['node_'.$this->MOD_SETTINGS['function']]); 189 $update = 1; 190 } 191 if ($update) { 192 $GLOBALS['BE_USER']->pushModuleData($this->MCONF['name'],$this->MOD_SETTINGS); 193 } 194 195 $arrayBrowser->depthKeys = $this->MOD_SETTINGS['node_'.$this->MOD_SETTINGS['function']]; 196 $arrayBrowser->regexMode = $this->MOD_SETTINGS['regexsearch']; 197 $arrayBrowser->fixedLgd = $this->MOD_SETTINGS['fixedLgd']; 198 199 200 $search_field = t3lib_div::_GP('search_field'); 201 if (t3lib_div::_POST('search') && trim($search_field)) { // If any POST-vars are send, update the condition array 202 $arrayBrowser->depthKeys=$arrayBrowser->getSearchKeys($theVar, '', $search_field, array()); 203 } 204 205 $tree = $arrayBrowser->tree($theVar, '', ''); 206 207 $label = $this->MOD_MENU['function'][$this->MOD_SETTINGS['function']]; 208 $this->content.= $this->doc->sectionEnd(); 209 210 // Variable name: 211 if (t3lib_div::_GP('varname')) { 212 $this->content.= '<div style="margin: 10px 10px 10px 10px; padding: 10px 10px 10px 10px; background-color: #eeeeee; border: 1px solid black;">Variable: <br/> 213 <input type="text" name="_" value="'.trim(htmlspecialchars(t3lib_div::_GP('varname'))).'" size="80" /><br/> 214 (Now, copy/paste this value into the configuration file where you can set it. This is all you can do from here...) 215 </div> 216 '; 217 } 218 219 $this->content.= '<br/><table border="0" cellpadding="1" cellspacing="0"">'; 220 $this->content.= '<tr> 221 <td><img src="clear.gif" width="1" height="1" alt="" /></td> 222 <td class="bgColor2"> 223 <table border="0" cellpadding="0" cellspacing="0" class="bgColor5" width="100%"><tr><td nowrap="nowrap"><b>'.$label.'</b></td></tr></table> 224 </td> 225 </tr>'; 226 $this->content.='<tr> 227 <td></td> 228 <td class="bgColor2"> 229 <table border="0" cellpadding="0" cellspacing="0" bgcolor="#D9D5C9" width="100%"><tr><td nowrap="nowrap">'.$tree.'</td></tr></table>' . 230 '<img src="clear.gif" width="465" height="1" alt="" /></td> 231 </tr> 232 </table> 233 '; 234 235 236 // Search: 237 $this->content.='<br> 238 <table border="0" cellpadding="1" cellspacing="0""> 239 <tr> 240 <td><img src="clear.gif" width="1" height="1" alt="" /></td> 241 <td class="bgColor2"> 242 <table border="0" cellpadding="0" cellspacing="0" bgcolor="#D9D5C9"> 243 <tr> 244 <td> Enter search phrase: <input type="text" name="search_field" value="'.htmlspecialchars($search_field).'"'.$GLOBALS['TBE_TEMPLATE']->formWidth(20).'></td> 245 <td><input type="submit" name="search" value="Search" /></td> 246 </tr> 247 <tr> 248 <td> <label for="checkRegexsearch">Use ereg(), not stristr():</label> '.t3lib_BEfunc::getFuncCheck(0,'SET[regexsearch]',$this->MOD_SETTINGS['regexsearch'],'','','id="checkRegexsearch"').'</td> 249 <td> </td> 250 </tr> 251 </table> 252 </td> 253 </tr> 254 </table> 255 <br/> 256 '; 257 258 if ($BE_USER->mayMakeShortcut()) { 259 $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon('','function',$this->MCONF['name'])); 260 } 261 } 262 263 /** 264 * Print output to browser 265 * 266 * @return void 267 */ 268 function printContent() { 269 270 $this->content.= $this->doc->endPage(); 271 echo $this->content; 272 } 273 } 274 275 // Include extension? 276 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/lowlevel/config/index.php']) { 277 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/lowlevel/config/index.php']); 278 } 279 280 281 282 283 284 285 286 287 288 289 290 291 // Make instance: 292 $SOBE = t3lib_div::makeInstance('SC_mod_tools_config_index'); 293 $SOBE->init(); 294 $SOBE->main(); 295 $SOBE->printContent(); 296 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Sun Nov 25 17:13:16 2007 | par Balluche grâce à PHPXref 0.7 |
|