Documentation TYPO3 par Ameos |
00001 <?php 00002 /*************************************************************** 00003 * Copyright notice 00004 * 00005 * (c) 1999-2004 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 ***************************************************************/ 00036 unset($MCONF); 00037 require ("conf.php"); 00038 require ($BACK_PATH."init.php"); 00039 require ($BACK_PATH."template.php"); 00040 require_once (PATH_t3lib."class.t3lib_arraybrowser.php"); 00041 00042 $BE_USER->modAccess($MCONF,1); 00043 00044 00045 00046 00047 00048 00049 00050 // *************************** 00051 // Script Classes 00052 // *************************** 00053 class SC_mod_tools_config_index { 00054 var $MCONF=array(); 00055 var $MOD_MENU=array(); 00056 var $MOD_SETTINGS=array(); 00057 var $doc; 00058 00059 var $include_once=array(); 00060 var $content; 00061 00062 function init() { 00063 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS; 00064 $this->MCONF = $GLOBALS["MCONF"]; 00065 00066 $this->menuConfig(); 00067 00068 $this->doc = t3lib_div::makeInstance("noDoc"); 00069 $this->doc->backPath = $BACK_PATH; 00070 // JavaScript 00071 $this->doc->JScode = ' 00072 <script language="javascript" type="text/javascript"> 00073 script_ended = 0; 00074 function jumpToUrl(URL) { 00075 document.location = URL; 00076 } 00077 </script> 00078 '; 00079 00080 $this->doc->form = '<form action="" method="POST">'; 00081 } 00082 function menuConfig() { 00083 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS; 00084 00085 // MENU-ITEMS: 00086 // If array, then it's a selector box menu 00087 // If empty string it's just a variable, that'll be saved. 00088 // Values NOT in this array will not be saved in the settings-array for the module. 00089 $this->MOD_MENU = array( 00090 "function" => array( 00091 0 => '$TYPO3_CONF_VARS', 00092 1 => '$TCA (tables.php)', 00093 3 => '$TYPO3_LOADED_EXT', 00094 4 => '$TBE_STYLES', 00095 00096 // 2 => '$PAGES_TYPES (tables.php)' 00097 ), 00098 "regexsearch" => "", 00099 "fixedLgd" => "" 00100 ); 00101 00102 // CLEANSE SETTINGS 00103 $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP("SET"), $this->MCONF["name"]); 00104 } 00105 function main() { 00106 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS; 00107 00108 $this->content.=$this->doc->startPage("Configuration"); 00109 $this->content.=$this->doc->header("Configuration"); 00110 $this->content.=$this->doc->spacer(5); 00111 00112 $arrayBrowser = t3lib_div::makeInstance("t3lib_arrayBrowser"); 00113 00114 $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"]). 00115 fw(" Crop lines: ").t3lib_BEfunc::getFuncCheck(0,"SET[fixedLgd]",$this->MOD_SETTINGS["fixedLgd"]); 00116 $this->content.=$this->doc->section("",'<NOBR>'.$menu.'</NOBR>'); 00117 00118 switch($this->MOD_SETTINGS["function"]) { 00119 case 0: 00120 $theVar = $TYPO3_CONF_VARS; 00121 $arrayBrowser->varName = '$TYPO3_CONF_VARS'; 00122 break; 00123 case 1: 00124 reset($TCA); 00125 while(list($ttable)=each($TCA)) { 00126 t3lib_div::loadTCA($ttable); 00127 } 00128 $theVar = $TCA; 00129 $arrayBrowser->varName = '$TCA'; 00130 break; 00131 case 3: 00132 $theVar = $GLOBALS['TYPO3_LOADED_EXT']; 00133 $arrayBrowser->varName = '$TYPO3_LOADED_EXT'; 00134 break; 00135 case 4: 00136 $theVar = $GLOBALS['TBE_STYLES']; 00137 $arrayBrowser->varName = '$TBE_STYLES'; 00138 break; 00139 case 2: 00140 // $theVar = $PAGES_TYPES; 00141 break; 00142 default: 00143 $theVar = array(); 00144 break; 00145 } 00146 00147 00148 // Update node: 00149 $update = 0; 00150 $node = t3lib_div::_GET('node'); 00151 if (is_array($node)) { // If any plus-signs were clicked, it's registred. 00152 $this->MOD_SETTINGS["node_".$this->MOD_SETTINGS["function"]] = $arrayBrowser->depthKeys($node, $this->MOD_SETTINGS["node_".$this->MOD_SETTINGS["function"]]); 00153 $update=1; 00154 } 00155 if ($update){ $GLOBALS["BE_USER"]->pushModuleData($this->MCONF["name"],$this->MOD_SETTINGS);} 00156 00157 $arrayBrowser->depthKeys = $this->MOD_SETTINGS["node_".$this->MOD_SETTINGS["function"]]; 00158 $arrayBrowser->regexMode = $this->MOD_SETTINGS["regexsearch"]; 00159 $arrayBrowser->fixedLgd = $this->MOD_SETTINGS["fixedLgd"]; 00160 00161 00162 $search_field = t3lib_div::_GP("search_field"); 00163 if (t3lib_div::_POST("search") && trim($search_field)) { // If any POST-vars are send, update the condition array 00164 $arrayBrowser->depthKeys=$arrayBrowser->getSearchKeys($theVar, "", $search_field, array()); 00165 // debug($arrayBrowser->depthKeys); 00166 // debug($arrayBrowser->searchKeys); 00167 } 00168 00169 $tree = $arrayBrowser->tree($theVar, "", ""); 00170 00171 $label = $this->MOD_MENU["function"][$this->MOD_SETTINGS["function"]]; 00172 $this->content.= $this->doc->sectionEnd(); 00173 00174 // Variable name: 00175 if (t3lib_div::_GP('varname')) { 00176 $this->content.= '<div style="margin: 10px 10px 10px 10px; padding: 10px 10px 10px 10px; background-color: #eeeeee; border: 1px solid black;">Variable: <br/> 00177 <input type="text" name="_" value="'.htmlspecialchars(t3lib_div::_GP('varname')).'" size="80" /><br/> 00178 (Now, copy/paste this value into the configuration file where you can set it. This is all you can do from here...) 00179 </div> 00180 '; 00181 } 00182 00183 $this->content.= '<BR><table border=0 cellpadding=1 cellspacing=0>'; 00184 $this->content.= '<tr> 00185 <td><img src=clear.gif width=1 height=1></td> 00186 <td class="bgColor2"> 00187 <table border=0 cellpadding=0 cellspacing=0 class="bgColor5" width="100%"><tr><td nowrap><b>'.fw($label).'</b></td></tr></table> 00188 </td> 00189 </tr>'; 00190 $this->content.='<tr> 00191 <td></td> 00192 <td class="bgColor2"> 00193 <table border=0 cellpadding=0 cellspacing=0 bgcolor="#D9D5C9" width="100%"><tr><td nowrap>'.$tree.'</td></tr></table><img src=clear.gif width=465 height=1></td> 00194 </tr> 00195 </table> 00196 '; 00197 00198 00199 // Search: 00200 $this->content.='<br> 00201 <table border=0 cellpadding=1 cellspacing=0> 00202 <tr> 00203 <td><img src=clear.gif width=1 height=1></td> 00204 <td class="bgColor2"> 00205 <table border=0 cellpadding=0 cellspacing=0 bgcolor="#D9D5C9"> 00206 <tr> 00207 <td>'.fw(" Enter search phrase: ").'<input type="Text" name="search_field" value="'.htmlspecialchars($search_field).'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(20).'></td> 00208 <td><input type="Submit" name="search" value="Search"></td> 00209 </tr> 00210 <tr> 00211 <td>'.fw(" Use ereg(), not stristr(): ").t3lib_BEfunc::getFuncCheck(0,"SET[regexsearch]",$this->MOD_SETTINGS["regexsearch"]).'</td> 00212 <td> </td> 00213 </tr> 00214 </table> 00215 </td> 00216 </tr> 00217 </table> 00218 <br> 00219 '; 00220 00221 if ($BE_USER->mayMakeShortcut()) { 00222 $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon("","function",$this->MCONF["name"])); 00223 } 00224 } 00225 function printContent() { 00226 00227 $this->content.=$this->doc->endPage(); 00228 echo $this->content; 00229 } 00230 } 00231 00232 // Include extension? 00233 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/lowlevel/config/index.php"]) { 00234 include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/lowlevel/config/index.php"]); 00235 } 00236 00237 00238 00239 00240 00241 00242 00243 00244 00245 00246 00247 00248 // Make instance: 00249 $SOBE = t3lib_div::makeInstance("SC_mod_tools_config_index"); 00250 $SOBE->init(); 00251 $SOBE->main(); 00252 $SOBE->printContent(); 00253 ?>