* Added two hooks for tx_timtaw, written by Sebastian Kurfuerst
[Packages/TYPO3.CMS.git] / typo3 / sysext / lowlevel / config / index.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2004 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: Log-viewing
29 *
30 * This module lets you view the changelog.
31 *
32 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
33 */
34
35
36 unset($MCONF);
37 require ("conf.php");
38 require ($BACK_PATH."init.php");
39 require ($BACK_PATH."template.php");
40 require_once (PATH_t3lib."class.t3lib_arraybrowser.php");
41
42 $BE_USER->modAccess($MCONF,1);
43
44
45
46
47
48
49
50 // ***************************
51 // Script Classes
52 // ***************************
53 class SC_mod_tools_config_index {
54 var $MCONF=array();
55 var $MOD_MENU=array();
56 var $MOD_SETTINGS=array();
57 var $doc;
58
59 var $include_once=array();
60 var $content;
61
62 function init() {
63 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
64 $this->MCONF = $GLOBALS["MCONF"];
65
66 $this->menuConfig();
67
68 $this->doc = t3lib_div::makeInstance("noDoc");
69 $this->doc->backPath = $BACK_PATH;
70 // JavaScript
71 $this->doc->JScode = '
72 <script language="javascript" type="text/javascript">
73 script_ended = 0;
74 function jumpToUrl(URL) {
75 document.location = URL;
76 }
77 </script>
78 ';
79
80 $this->doc->form = '<form action="" method="POST">';
81 }
82 function menuConfig() {
83 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
84
85 // MENU-ITEMS:
86 // If array, then it's a selector box menu
87 // If empty string it's just a variable, that'll be saved.
88 // Values NOT in this array will not be saved in the settings-array for the module.
89 $this->MOD_MENU = array(
90 "function" => array(
91 0 => '$TYPO3_CONF_VARS',
92 1 => '$TCA (tables.php)',
93 3 => '$TYPO3_LOADED_EXT',
94 4 => '$TBE_STYLES',
95
96 // 2 => '$PAGES_TYPES (tables.php)'
97 ),
98 "regexsearch" => "",
99 "fixedLgd" => ""
100 );
101
102 // CLEANSE SETTINGS
103 $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP("SET"), $this->MCONF["name"]);
104 }
105 function main() {
106 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
107
108 $this->content.=$this->doc->startPage("Configuration");
109 $this->content.=$this->doc->header("Configuration");
110 $this->content.=$this->doc->spacer(5);
111
112 $arrayBrowser = t3lib_div::makeInstance("t3lib_arrayBrowser");
113
114 $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"]).
115 fw("&nbsp;&nbsp;Crop lines:&nbsp;&nbsp;").t3lib_BEfunc::getFuncCheck(0,"SET[fixedLgd]",$this->MOD_SETTINGS["fixedLgd"]);
116 $this->content.=$this->doc->section("",'<NOBR>'.$menu.'</NOBR>');
117
118 switch($this->MOD_SETTINGS["function"]) {
119 case 0:
120 $theVar = $TYPO3_CONF_VARS;
121 $arrayBrowser->varName = '$TYPO3_CONF_VARS';
122 break;
123 case 1:
124 reset($TCA);
125 while(list($ttable)=each($TCA)) {
126 t3lib_div::loadTCA($ttable);
127 }
128 $theVar = $TCA;
129 $arrayBrowser->varName = '$TCA';
130 break;
131 case 3:
132 $theVar = $GLOBALS['TYPO3_LOADED_EXT'];
133 $arrayBrowser->varName = '$TYPO3_LOADED_EXT';
134 break;
135 case 4:
136 $theVar = $GLOBALS['TBE_STYLES'];
137 $arrayBrowser->varName = '$TBE_STYLES';
138 break;
139 case 2:
140 // $theVar = $PAGES_TYPES;
141 break;
142 default:
143 $theVar = array();
144 break;
145 }
146
147
148 // Update node:
149 $update = 0;
150 $node = t3lib_div::_GET('node');
151 if (is_array($node)) { // If any plus-signs were clicked, it's registred.
152 $this->MOD_SETTINGS["node_".$this->MOD_SETTINGS["function"]] = $arrayBrowser->depthKeys($node, $this->MOD_SETTINGS["node_".$this->MOD_SETTINGS["function"]]);
153 $update=1;
154 }
155 if ($update){ $GLOBALS["BE_USER"]->pushModuleData($this->MCONF["name"],$this->MOD_SETTINGS);}
156
157 $arrayBrowser->depthKeys = $this->MOD_SETTINGS["node_".$this->MOD_SETTINGS["function"]];
158 $arrayBrowser->regexMode = $this->MOD_SETTINGS["regexsearch"];
159 $arrayBrowser->fixedLgd = $this->MOD_SETTINGS["fixedLgd"];
160
161
162 $search_field = t3lib_div::_GP("search_field");
163 if (t3lib_div::_POST("search") && trim($search_field)) { // If any POST-vars are send, update the condition array
164 $arrayBrowser->depthKeys=$arrayBrowser->getSearchKeys($theVar, "", $search_field, array());
165 // debug($arrayBrowser->depthKeys);
166 // debug($arrayBrowser->searchKeys);
167 }
168
169 $tree = $arrayBrowser->tree($theVar, "", "");
170
171 $label = $this->MOD_MENU["function"][$this->MOD_SETTINGS["function"]];
172 $this->content.= $this->doc->sectionEnd();
173
174 // Variable name:
175 if (t3lib_div::_GP('varname')) {
176 $this->content.= '<div style="margin: 10px 10px 10px 10px; padding: 10px 10px 10px 10px; background-color: #eeeeee; border: 1px solid black;">Variable: <br/>
177 <input type="text" name="_" value="'.trim(htmlspecialchars(t3lib_div::_GP('varname'))).'" size="80" /><br/>
178 (Now, copy/paste this value into the configuration file where you can set it. This is all you can do from here...)
179 </div>
180 ';
181 }
182
183 $this->content.= '<BR><table border=0 cellpadding=1 cellspacing=0>';
184 $this->content.= '<tr>
185 <td><img src=clear.gif width=1 height=1></td>
186 <td class="bgColor2">
187 <table border=0 cellpadding=0 cellspacing=0 class="bgColor5" width="100%"><tr><td nowrap><b>'.fw($label).'</b></td></tr></table>
188 </td>
189 </tr>';
190 $this->content.='<tr>
191 <td></td>
192 <td class="bgColor2">
193 <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>
194 </tr>
195 </table>
196 ';
197
198
199 // Search:
200 $this->content.='<br>
201 <table border=0 cellpadding=1 cellspacing=0>
202 <tr>
203 <td><img src=clear.gif width=1 height=1></td>
204 <td class="bgColor2">
205 <table border=0 cellpadding=0 cellspacing=0 bgcolor="#D9D5C9">
206 <tr>
207 <td>'.fw("&nbsp;Enter search phrase:&nbsp;&nbsp;").'<input type="Text" name="search_field" value="'.htmlspecialchars($search_field).'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(20).'></td>
208 <td><input type="Submit" name="search" value="Search"></td>
209 </tr>
210 <tr>
211 <td>'.fw("&nbsp;Use ereg(), not stristr():&nbsp;&nbsp;").t3lib_BEfunc::getFuncCheck(0,"SET[regexsearch]",$this->MOD_SETTINGS["regexsearch"]).'</td>
212 <td>&nbsp;</td>
213 </tr>
214 </table>
215 </td>
216 </tr>
217 </table>
218 <br>
219 ';
220
221 if ($BE_USER->mayMakeShortcut()) {
222 $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon("","function",$this->MCONF["name"]));
223 }
224 }
225 function printContent() {
226
227 $this->content.=$this->doc->endPage();
228 echo $this->content;
229 }
230 }
231
232 // Include extension?
233 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/lowlevel/config/index.php"]) {
234 include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/lowlevel/config/index.php"]);
235 }
236
237
238
239
240
241
242
243
244
245
246
247
248 // Make instance:
249 $SOBE = t3lib_div::makeInstance("SC_mod_tools_config_index");
250 $SOBE->init();
251 $SOBE->main();
252 $SOBE->printContent();
253 ?>