This commit was manufactured by cvs2svn to create branch 'Kasper'.
[Packages/TYPO3.CMS.git] / typo3 / db_layout.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2003 Kasper Skårhøj (kasper@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: Web>Page
29 *
30 * This module lets you view a page in a more Content Management like style than the ordinary record-list
31 * This module is in fact a part of the "cms" extension found in sysext/cms/
32 *
33 * Notice: This module and Web>List (db_list.php) module has a special status since they
34 * are NOT located in their actual module directories (fx. sysext/cms/layout/) but in the
35 * backend root directory. This has some historical and practical causes.
36 *
37 * @author Kasper Skårhøj <kasper@typo3.com>
38 * @package TYPO3
39 * @subpackage core
40 *
41 */
42
43
44 unset($MCONF);
45 require ("sysext/cms/layout/conf.php");
46 require ("init.php");
47 require ("template.php");
48 include (TYPO3_MOD_PATH."locallang.php");
49 require_once (PATH_t3lib."class.t3lib_pagetree.php");
50 require_once (PATH_t3lib."class.t3lib_page.php");
51 require_once (PATH_t3lib."class.t3lib_recordlist.php");
52 require_once ("class.db_list.inc");
53 require_once ("class.db_layout.inc");
54 require_once (PATH_t3lib."class.t3lib_positionmap.php");
55 $BE_USER->modAccess($MCONF,1);
56
57 // Will open up records locked by current user. It's assumed that the locking should end if this script is hit.
58 t3lib_BEfunc::lockRecords();
59
60 // Exits if "cms" extension is not loaded:
61 t3lib_extMgm::isLoaded("cms",1);
62
63
64 // ***************************
65 // Script Classes
66 // ***************************
67 class ext_posMap extends t3lib_positionMap {
68 var $dontPrintPageInsertIcons = 1;
69 var $l_insertNewRecordHere="newContentElement";
70
71 function wrapRecordTitle($str,$row) {
72 return '<a href="#" onClick="jumpToUrl(\''.$GLOBALS["SOBE"]->local_linkThisScript(array("edit_record"=>"tt_content:".$row["uid"])).'\');return false;">'.$str.'</a>';
73 }
74 function wrapColumnHeader($str,$vv) {
75 return '<a href="#" onClick="jumpToUrl(\''.$GLOBALS["SOBE"]->local_linkThisScript(array("edit_record"=>"_EDIT_COL:".$vv)).'\');return false;">'.$str.'</a>';
76 }
77 function onClickInsertRecord($row,$vv,$moveUid,$pid) {
78 $table="tt_content";
79 if (is_array($row)) {
80 $location=$GLOBALS["SOBE"]->local_linkThisScript(array("edit_record"=>"tt_content:new/-".$row["uid"]."/".$row["colPos"]));
81 } else {
82 $location=$GLOBALS["SOBE"]->local_linkThisScript(array("edit_record"=>"tt_content:new/".$pid."/".$vv));
83 }
84 return 'jumpToUrl(\''.$location.'\');return false;';
85 }
86 function wrapRecordHeader($str,$row) {
87 if ($row["uid"]==$this->moveUid) {
88 // return '<table border=0 cellpadding=0 cellspacing=0 width="100%"><tr bgColor="'.$GLOBALS["SOBE"]->doc->bgColor2.'"><td>'.$str.'</td></tr></table>';
89 return '<img src="gfx/content_client.gif" width="7" height="10" vspace=2 border="0" alt="" align=top>'.$str;
90 } else return $str;
91 }
92 }
93 class SC_db_layout {
94 var $MCONF=array();
95 var $MOD_MENU=array();
96 var $MOD_SETTINGS=array();
97
98 var $include_once=array();
99
100 var $content;
101 var $perms_clause;
102 var $pageinfo;
103 var $descrTable;
104 var $modTSconfig;
105 var $topFuncMenu;
106 var $editIcon;
107 var $colPosList;
108 var $EDIT_CONTENT;
109 var $CALC_PERMS;
110 var $pointer;
111 var $imagemode;
112 var $id;
113 var $doc;
114 var $current_sys_language;
115
116 function init() {
117 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
118 $this->MCONF = $GLOBALS["MCONF"];
119
120 // Init:
121 $this->imagemode = t3lib_div::GPvar("imagemode");
122 $this->pointer = t3lib_div::GPvar("pointer");
123 $this->id = intval(t3lib_div::GPvar("id"));
124
125 $this->perms_clause = $BE_USER->getPagePermsClause(1);
126 $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause);
127
128 // Menu Configuration
129 $this->menuConfig();
130
131 $this->current_sys_language=intval($this->MOD_SETTINGS["language"]);
132
133 // Include scripts:
134 if ($this->MOD_SETTINGS["function"]==0) { // QuickEdit
135 $this->include_once[]=PATH_t3lib."class.t3lib_tceforms.php";
136 $this->include_once[]=PATH_t3lib."class.t3lib_loaddbgroup.php";
137 $this->include_once[]=PATH_t3lib."class.t3lib_transferdata.php";
138 }
139 if (t3lib_div::GPvar("clear_cache")) {
140 $this->include_once[]=PATH_t3lib."class.t3lib_tcemain.php";
141 }
142
143 // Descriptions:
144 $this->descrTable = "_MOD_".$this->MCONF["name"];
145 if ($BE_USER->uc["edit_showFieldHelp"]) {
146 $LANG->loadSingleTableDescription($this->descrTable);
147 }
148 }
149 function menuConfig() {
150 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
151 // MENU-ITEMS:
152 // If array, then it's a selector box menu
153 // If empty string it's just a variable, that'll be saved.
154 // Values NOT in this array will not be saved in the settings-array for the module.
155 $this->MOD_MENU = array(
156 "tt_board" => array(
157 0 => $LANG->getLL("m_tt_board_0"),
158 "expand" => $LANG->getLL("m_tt_board_expand")
159 ),
160 "tt_address" => array(
161 0 => $LANG->getLL("m_tt_address_0"),
162 1 => $LANG->getLL("m_tt_address_1"),
163 2 => $LANG->getLL("m_tt_address_2")
164 ),
165 "tt_links" => array(
166 0 => $LANG->getLL("m_default"),
167 1 => $LANG->getLL("m_tt_links_1"),
168 2 => $LANG->getLL("m_tt_links_2")
169 ),
170 "tt_calender" => array (
171 0 => $LANG->getLL("m_default"),
172 "date" => $LANG->getLL("m_tt_calender_date"),
173 "date_ext" => $LANG->getLL("m_tt_calender_date_ext"),
174 "todo" => $LANG->getLL("m_tt_calender_todo"),
175 "todo_ext" => $LANG->getLL("m_tt_calender_todo_ext")
176 ),
177 "tt_products" => array (
178 0 => $LANG->getLL("m_default"),
179 "ext" => $LANG->getLL("m_tt_products_ext")
180 ),
181 "tt_content_showHidden" => "",
182 "showPalettes" => "",
183 "showDescriptions" => "",
184 "disableRTE" => "",
185 "function" => array(
186 1 => $LANG->getLL("m_function_1"),
187 0 => $LANG->getLL("m_function_0"),
188 2 => $LANG->getLL("m_function_2"),
189 3 => $LANG->getLL("pageInformation")
190 ),
191 "language" => array(
192 0 => $LANG->getLL("m_default")
193 )
194 );
195
196
197 // First, select all pages_language_overlay records on the current page. Each represents a possibility for a language on the page.
198 $query = $this->languageQuery($this->id);
199 $res = mysql(TYPO3_db,$query);
200 echo mysql_error();
201 while($lrow=mysql_fetch_assoc($res)) {
202 $this->MOD_MENU["language"][$lrow["uid"]]=($lrow["hidden"]?"(".$lrow["title"].")":$lrow["title"]);
203 }
204
205 // Find if there are ANY languages at all.
206 $query = "SELECT uid FROM sys_language".($BE_USER->isAdmin()?"":" WHERE hidden=0");
207 $res = mysql(TYPO3_db,$query);
208 if (!mysql_num_rows($res)) {
209 unset($this->MOD_MENU["function"]["2"]);
210 }
211
212 // page/be_user TSconfig settings and blinding of menu-items
213 $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,"mod.".$this->MCONF["name"]);
214 if ($this->modTSconfig["properties"]["QEisDefault"]) ksort($this->MOD_MENU["function"]);
215 $this->MOD_MENU["function"] = t3lib_BEfunc::unsetMenuItems($this->modTSconfig["properties"],$this->MOD_MENU["function"],"menu.function");
216
217 // Remove QuickEdit as option if page type is not...
218 if (!t3lib_div::inList($GLOBALS["TYPO3_CONF_VARS"]["FE"]["content_doktypes"].",6",$this->pageinfo["doktype"])) {
219 unset($this->MOD_MENU["function"][0]);
220 }
221
222 // CLEANSE SETTINGS
223 $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::GPvar("SET"), $this->MCONF["name"]);
224 }
225 function clearCache() {
226 if (t3lib_div::GPvar("clear_cache")) {
227 $tce = t3lib_div::makeInstance("t3lib_TCEmain");
228 $tce->start(Array(),Array());
229 $tce->clear_cacheCmd($this->id);
230 }
231 }
232 function main() {
233 global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$HTTP_GET_VARS,$HTTP_POST_VARS,$CLIENT,$TYPO3_CONF_VARS;
234
235 // Access check...
236 // The page will show only if there is a valid page and if this page may be viewed by the user
237 $access = is_array($this->pageinfo) ? 1 : 0;
238 if ($this->id && $access) {
239 $this->CALC_PERMS = $BE_USER->calcPerms($this->pageinfo);
240 $this->EDIT_CONTENT = ($this->CALC_PERMS&16) ? 1 : 0;
241
242
243 $this->doc = t3lib_div::makeInstance("mediumDoc");
244 $this->doc->backPath = $BACK_PATH;
245
246 // JavaScript
247 $this->doc->JScode = '
248 <script language="javascript" type="text/javascript" src="'.$BACK_PATH.'t3lib/jsfunc.updateform.js"></script>
249 <script language="javascript" type="text/javascript">
250 if (top.fsMod) top.fsMod.recentIds["web"] = '.intval($this->id).';
251 function jumpToUrl(URL,formEl) {
252 if (document.editform && document.TBE_EDITOR_isFormChanged) { // Check if the function exists... (works in all browsers?)
253 if (!TBE_EDITOR_isFormChanged()) {
254 document.location = URL;
255 } else if (formEl) {
256 if (formEl.type=="checkbox") formEl.checked = formEl.checked ? 0 : 1;
257 }
258 } else document.location = URL;
259 }
260 '.(t3lib_div::GPVar("popView") ? t3lib_BEfunc::viewOnClick($this->id,"",t3lib_BEfunc::BEgetRootLine($this->id)) : '').'
261
262 function deleteRecord(table,id,url) {
263 if (confirm('.$GLOBALS['LANG']->JScharCode($LANG->getLL("deleteWarning")).')) {
264 document.location = "'.$BACK_PATH.'tce_db.php?cmd["+table+"]["+id+"][delete]=1&redirect="+escape(url)+"&vC='.$BE_USER->veriCode().'&prErr=1&uPT=1";
265 }
266 return false;
267 }
268 </script>
269 ';
270
271 // Setting doc-header
272 $this->doc->form='<form action="db_layout.php?id='.$this->id.'&imagemode='.$this->imagemode.'" method="POST">';
273
274 $this->topFuncMenu = t3lib_BEfunc::getFuncMenu($this->id,"SET[function]",$this->MOD_SETTINGS["function"],$this->MOD_MENU["function"],"db_layout.php","").
275 (count($this->MOD_MENU["language"])>1 ? "<BR>".t3lib_BEfunc::getFuncMenu($this->id,"SET[language]",$this->current_sys_language,$this->MOD_MENU["language"],"db_layout.php","") : "");
276
277
278
279
280
281
282 if ($this->CALC_PERMS&2) {
283 $params="&edit[pages][".$this->id."]=edit";
284 $this->editIcon='<A HREF="#" onClick="'.t3lib_BEfunc::editOnClick($params).'"><img src="'.$BACK_PATH.'gfx/edit2.gif" width=11 height=12 vspace=2 border=0'.t3lib_BEfunc::titleAttrib($GLOBALS["LANG"]->getLL("edit"),1).' align="top"></a>';
285 } else {
286 // $this->editIcon=$dblist->noEditIcon("noEditPage");
287 $this->editIcon="";
288 }
289
290
291 // Find columns
292 $modTSconfig_SHARED = t3lib_BEfunc::getModTSconfig($this->id,"mod.SHARED"); // SHARED page-TSconfig settings.
293 $this->colPosList = strcmp(trim($this->modTSconfig["properties"]["tt_content."]["colPos_list"]),"") ? trim($this->modTSconfig["properties"]["tt_content."]["colPos_list"]) : $modTSconfig_SHARED["properties"]["colPos_list"];
294 $this->colPosList = strcmp($this->colPosList,"")?$this->colPosList:"1,0,2,3";
295
296 if ($this->MOD_SETTINGS["function"]==0) { // QuickEdit
297 $this->content.=$this->quickEdit();
298 } else {
299 // *******************
300 // Make DB list
301 // *******************
302 // $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,"mod.".$this->MCONF["name"]); // page-TSconfig setting for this module.
303
304 $dblist = t3lib_div::makeInstance("recordList_layout");
305 $dblist->backPath = $BACK_PATH;
306 $dblist->thumbs = $this->imagemode;
307 $dblist->no_noWrap=1;
308
309 $this->pointer = t3lib_div::intInRange($this->pointer,0,100000);
310 $dblist->headLineCol = $this->doc->bgColor2;
311 $dblist->script = "db_layout.php";
312 $dblist->showIcon = 0;
313 $dblist->setLMargin=0;
314 $dblist->doEdit = $this->CALC_PERMS&16 ? 1 : 0;
315 $dblist->agePrefixes=$GLOBALS["LANG"]->sL("LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears");
316 $dblist->id=$this->id;
317 $dblist->nextThree = t3lib_div::intInRange($this->modTSconfig["properties"]["editFieldsAtATime"],0,10);
318 $dblist->option_showBigButtons = $this->modTSconfig["properties"]["disableBigButtons"] ? 0 : 1;
319 $dblist->option_newWizard = $this->modTSconfig["properties"]["disableNewContentElementWizard"] ? 0 : 1;
320 if (!$dblist->nextThree) $dblist->nextThree= 1;
321
322
323 // Preparing
324 $h_menu=$dblist->getTableMenu($this->id);
325 $h_func="";
326 $optionArr=array();
327
328 $tableOutput=array();
329 $tableJSOutput=array();
330 $CMcounter = 0;
331 reset($dblist->activeTables);
332 while(list($table)=each($dblist->activeTables)) {
333 t3lib_div::loadTCA($table);
334 // Creating special conditions for each table:
335 switch($table) {
336 case "tt_board":
337 $h_func = t3lib_BEfunc::getFuncMenu($this->id,"SET[tt_board]",$this->MOD_SETTINGS["tt_board"],$this->MOD_MENU["tt_board"],"db_layout.php","");
338 break;
339 case "tt_address":
340 $h_func = t3lib_BEfunc::getFuncMenu($this->id,"SET[tt_address]",$this->MOD_SETTINGS["tt_address"],$this->MOD_MENU["tt_address"],"db_layout.php","");
341 break;
342 case "tt_links":
343 $h_func = t3lib_BEfunc::getFuncMenu($this->id,"SET[tt_links]",$this->MOD_SETTINGS["tt_links"],$this->MOD_MENU["tt_links"],"db_layout.php","");
344 break;
345 case "tt_calender":
346 $h_func = t3lib_BEfunc::getFuncMenu($this->id,"SET[tt_calender]",$this->MOD_SETTINGS["tt_calender"],$this->MOD_MENU["tt_calender"],"db_layout.php","");
347 break;
348 case "tt_products":
349 $h_func = t3lib_BEfunc::getFuncMenu($this->id,"SET[tt_products]",$this->MOD_SETTINGS["tt_products"],$this->MOD_MENU["tt_products"],"db_layout.php","");
350 break;
351 case "tt_guest":
352 case "tt_news":
353 case "fe_users":
354 // Nothing
355 break;
356 case "tt_content":
357 $q_count = $this->getNumberOfHiddenElements();
358 $h_func_b= t3lib_BEfunc::getFuncCheck($this->id,"SET[tt_content_showHidden]",$this->MOD_SETTINGS["tt_content_showHidden"],"db_layout.php","").(!$q_count?$GLOBALS["TBE_TEMPLATE"]->dfw($LANG->getLL("hiddenCE")):$LANG->getLL("hiddenCE")." (".$q_count.")");
359
360 $dblist->tt_contentConfig["showCommands"] = 1; // Boolean: Display up/down arrows and edit icons for tt_content records
361 $dblist->tt_contentConfig["showInfo"] = 1; // Boolean: Display info-marks or not
362 $dblist->tt_contentConfig["single"] =0; // Boolean: If set, the content of column(s) $this->tt_contentConfig["showSingleCol"] is shown in the total width of the page
363
364 if (is_array($TCA["tt_content"]["columns"]["colPos"]["config"]["items"])) {
365 $colList=array();
366 reset($TCA["tt_content"]["columns"]["colPos"]["config"]["items"]);
367 while(list(,$temp)=each($TCA["tt_content"]["columns"]["colPos"]["config"]["items"])) {
368 $colList[]=$temp[1];
369 }
370 } else { // ... should be impossible that colPos has no array. But this is the fallback should it make any sense:
371 $colList=array("1","0","2","3");
372 }
373 if (strcmp($this->colPosList,"")) {
374 $colList=array_intersect(t3lib_div::intExplode(",",$this->colPosList),$colList);
375 }
376 // If only one column found, display the single-column view.
377 if (count($colList)==1) {
378 $dblist->tt_contentConfig["single"] =1; // Boolean: If set, the content of column(s) $this->tt_contentConfig["showSingleCol"] is shown in the total width of the page
379 $dblist->tt_contentConfig["showSingleCol"]=current($colList); // The column(s) to show if single mode (under each other)
380 }
381 $dblist->tt_contentConfig["cols"]= implode(",",$colList); // The order of the rows: Default is left(1), Normal(0), right(2), margin(3)
382 $dblist->tt_contentConfig["showHidden"]=$this->MOD_SETTINGS["tt_content_showHidden"];
383 $dblist->tt_contentConfig["sys_language_uid"] = intval($this->current_sys_language);
384
385 if ($this->MOD_SETTINGS["function"]==2) { // LANGUAGE
386 $dblist->tt_contentConfig["single"]=0;
387 $dblist->tt_contentConfig["languageMode"]=1;
388 $dblist->tt_contentConfig["languageCols"] = $this->MOD_MENU["language"];
389 $dblist->tt_contentConfig["languageColsPointer"] = $this->current_sys_language;
390 }
391 break;
392 }
393
394 $dblist->start($this->id,$table,$this->pointer,t3lib_div::GPvar("search_field"),t3lib_div::GPvar("search_levels"),t3lib_div::GPvar("showLimit"));
395 $dblist->counter=$CMcounter;
396 $dblist->ext_function = $this->MOD_SETTINGS["function"];
397 $dblist->generateList();
398
399 $tableOutput[$table]=($h_func?$h_func."<BR><img src=clear.gif width=1 height=4><BR>":"").$dblist->HTMLcode.($h_func_b?"<img src=clear.gif width=1 height=10><BR>".$h_func_b:""); //."<HR>".
400 $tableJSOutput[$table]=$dblist->JScode;
401 $CMcounter+=$dblist->counter;
402
403 $dblist->HTMLcode="";
404 $dblist->JScode="";
405 $h_func="";
406 $h_func_b="";
407 }
408
409
410
411 $CMparts=$this->doc->getContextMenuCode();
412 $this->doc->bodyTagAdditions = $CMparts[1];
413 $this->doc->JScode.=$CMparts[0];
414 $this->doc->postCode.= $CMparts[2];
415
416 // ******************
417 // Draw the header.
418 // ******************
419 $headerSection = $this->doc->getHeader("pages",$this->pageinfo,$this->pageinfo["_thePath"]).'<br>'.$LANG->sL("LLL:EXT:lang/locallang_core.php:labels.path").': '.t3lib_div::fixed_lgd_pre($this->pageinfo["_thePath"],50);
420
421 $toolBar='';
422 $toolBar.='<a href="#" onClick="jumpToUrl(\'show_rechis.php?element='.rawurlencode('pages:'.$this->id).'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI")).'#latest\');return false;"><img src="gfx/history2.gif" width="13" height="12" vspace=2 hspace=2 border="0"'.t3lib_BEfunc::titleAttrib($LANG->getLL("recordHistory"),1).' align=top></a>';
423 $toolBar.='<A HREF="db_new_content_el.php?id='.$this->id.'&sys_language_uid='.$this->current_sys_language.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI")).'"><img src="'.$BACK_PATH.'gfx/new_record.gif" vspace=2 hspace=1 width=16 height=12 border=0 align=top align="top"'.t3lib_BEfunc::titleAttrib($LANG->getLL("newContentElement")).'></a>';
424 $toolBar.='<A HREF="move_el.php?table=pages&uid='.$this->id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI")).'"><img src="'.$BACK_PATH.'gfx/move_page.gif" vspace=2 hspace=2 width=11 height=12 border=0 align=top align="top"'.t3lib_BEfunc::titleAttrib($LANG->getLL("move_page")).'></a>';
425 $toolBar.='<a href="#" onClick="jumpToUrl(\'db_new.php?id='.$this->id.'&pagesOnly=1&returnUrl='.rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI")).'\');return false;"><img src="gfx/new_page.gif" width="13" height="12" hspace=0 vspace=2 border="0"'.t3lib_BEfunc::titleAttrib($LANG->getLL("newPage"),1).' align=top></a>';
426
427 $params="&edit[pages][".$this->id."]=edit";
428 $toolBar.='<a href="#" onClick="'.t3lib_BEfunc::editOnClick($params).'"><img src="gfx/edit2.gif" width="11" height="12" hspace=2 vspace=2 border="0"'.t3lib_BEfunc::titleAttrib($LANG->getLL("editPageHeader"),1).' align=top></a>';
429
430 $hT = trim(t3lib_BEfunc::helpText($this->descrTable,"columns",$GLOBALS["BACK_PATH"]));
431 $toolBar.=$hT?$hT."<BR>":t3lib_BEfunc::helpTextIcon($this->descrTable,"columns",$GLOBALS["BACK_PATH"]);
432 $headerSection.='<table border=0 cellpadding=0 cellspacing=0 bgColor="'.$this->doc->bgColor4.'"><tr><td>'.$toolBar.'</TD></tr></table>';
433
434 // ******************
435 // Link menu, if more than one table.
436 // ******************
437 if ($this->MOD_SETTINGS["function"]!=3 && count($tableOutput)>1) {
438 $goToTable_menu = '<td valign=top width=1% nowrap>'.$h_menu.'</td>';
439 } else {
440 $goToTable_menu = '';
441 }
442 $hS2='<table border=0 cellpadding=0 cellspacing=0 width=100%>
443 <tr>
444 <td valign=top width=99%>'.$headerSection.'</td>
445 '.$goToTable_menu.'
446 <td valign=top width=1% valign=top>'.$this->topFuncMenu.'</td>
447 <td valign=top align=right width=1%><img src=clear.gif width=1 height=3><BR>'.$this->editIcon.'</td>
448 </tr>
449 </table>';
450
451 $this->content.=$this->doc->startPage($LANG->getLL("title"));
452 $this->content.=$this->doc->section('',$hS2);
453
454
455 if ($this->MOD_SETTINGS["function"]==3) {
456
457 // ********************
458 // Making page info:
459 // ********************
460 $this->content.=$this->doc->spacer(10);
461 $this->content.=$this->doc->section($GLOBALS["LANG"]->getLL("pageInformation"),$dblist->getPageInfoBox($this->pageinfo,$this->CALC_PERMS&2),0,1);
462 } else {
463
464 // ******************
465 // Draw Content
466 // ******************
467 reset($tableOutput);
468 while(list($table,$output)=each($tableOutput)) {
469 $this->content.=$this->doc->section('<a name="'.$table.'"></a>'.$dblist->activeTables[$table],$output,1,1);
470 $this->content.=$this->doc->spacer(15);
471 $this->content.=$this->doc->sectionEnd();
472 }
473
474 // ********************
475 // Making search form:
476 // ********************
477 if (!$this->modTSconfig["properties"]["disableSearchBox"] && count($tableOutput)) {
478 // debug(array($dblist->getSearchBox(0)));
479 $this->content.=$this->doc->section($GLOBALS["LANG"]->sL("LLL:EXT:lang/locallang_core.php:labels.search"),$dblist->getSearchBox(),0,1);
480 }
481
482 // ********************
483 // Sys notes:
484 // ********************
485 $dblist->id=$this->id;
486 $sysNotes = $dblist->showSysNotesForPage();
487 if ($sysNotes) {
488 $this->content.=$this->doc->spacer(10);
489 $this->content.=$this->doc->section($LANG->getLL("internalNotes"),$sysNotes,0,1);
490 }
491
492
493 // Advanced.
494 if (!$this->modTSconfig["properties"]["disableAdvanced"]) {
495 $af_content = $this->doc->clearCacheMenu($this->id);
496
497 if (!$this->modTSconfig["properties"]["noCreateRecordsLink"]) {
498 $af_content.='<BR><BR><a href="db_new.php?id='.$this->id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI")).'"><img src="gfx/new_el.gif" width="11" height="12" hspace=4 border="0" align=top><strong>'.$LANG->getLL("newRecordGeneral").'</strong></a><BR><BR>';
499 }
500
501 $this->content.=$this->doc->spacer(10);
502 $this->content.=$this->doc->section($LANG->getLL("advancedFunctions"),$af_content,0,1);
503 }
504 $this->content.=$this->doc->spacer(10);
505 }
506 }
507
508
509 // ShortCut
510 if ($BE_USER->mayMakeShortcut()) {
511 $this->content.=$this->doc->spacer(20).$this->doc->section('',$this->doc->makeShortcutIcon("id,edit_record,pointer,new_unique_uid,search_field,search_levels,showLimit",implode(",",array_keys($this->MOD_MENU)),$this->MCONF["name"]));
512 }
513
514 $this->content.=$this->doc->spacer(10);
515 $this->content.=$this->doc->endPage();
516 } else {
517 $this->doc = t3lib_div::makeInstance("mediumDoc");
518 $this->doc->backPath = $BACK_PATH;
519 $this->doc->JScode = '
520 <script language="javascript" type="text/javascript">
521 if (top.fsMod) top.fsMod.recentIds["web"] = '.intval($this->id).';
522 </script>
523 ';
524 $this->content=$this->doc->startPage($LANG->getLL("title"));
525 $this->content.=$this->doc->section($LANG->getLL("clickAPage_header"),$LANG->getLL("clickAPage_content"),0,1);
526 $this->content.=$this->doc->endPage();
527 }
528 }
529 function printContent() {
530 echo $this->content;
531 }
532
533
534 function getNumberOfHiddenElements() {
535 $q_hidden = "SELECT count(*) FROM tt_content WHERE pid=".intval($this->id)." AND sys_language_uid=".intval($this->current_sys_language).t3lib_BEfunc::BEenableFields("tt_content",1).t3lib_BEfunc::deleteClause("tt_content");
536 $q_res = mysql(TYPO3_db,$q_hidden);
537 list($q_count) = mysql_fetch_row($q_res);
538 return $q_count;
539 }
540 function local_linkThisScript ($params) {
541 $params["popView"]="";
542 $params["new_unique_uid"]="";
543 return t3lib_div::linkThisScript($params);
544 }
545 function languageQuery($id) {
546 $exQ = $GLOBALS["BE_USER"]->isAdmin() ? '' : 'AND sys_language.hidden=0';
547 if ($id) {
548 $query = "SELECT sys_language.* FROM pages_language_overlay,sys_language
549 WHERE pages_language_overlay.sys_language_uid=sys_language.uid
550 AND pages_language_overlay.pid=".intval($id)."
551 ".$exQ."
552 GROUP BY pages_language_overlay.sys_language_uid
553 ORDER BY sys_language.title";
554 } else {
555 $query = "SELECT sys_language.* FROM sys_language
556 WHERE sys_language.hidden=0
557 ORDER BY sys_language.title";
558 }
559 return $query;
560 }
561 function quickEdit() {
562 global $SOBE,$LANG,$BE_USER;
563
564 $this->doc->form='<form action="tce_db.php?&prErr=1&uPT=1" method="POST" enctype="'.$GLOBALS["TYPO3_CONF_VARS"]["SYS"]["form_enctype"].'" name="editform" onSubmit="return TBE_EDITOR_checkSubmit(1);">';
565 $edit_record = t3lib_div::GPvar("edit_record");
566
567 if (substr($edit_record,0,9)=="_EDIT_COL") {
568 $query = "SELECT * FROM tt_content WHERE pid=".intval($this->id).
569 " AND colPos=".intval(substr($edit_record,10)).
570 " AND sys_language_uid=".intval($this->current_sys_language).
571 ($this->MOD_SETTINGS["tt_content_showHidden"] ? "" : t3lib_BEfunc::BEenableFields("tt_content")).
572 t3lib_Befunc::deleteClause("tt_content").
573 " ORDER BY sorting";
574 $res = mysql(TYPO3_db,$query);
575 $idListA=array();
576 while($cRow=mysql_fetch_assoc($res)) {
577 $idListA[]=$cRow["uid"];
578 }
579 // debug($idListA);
580 $jumpUrl = 'alt_doc.php?edit[tt_content]['.implode(",",$idListA).']=edit&returnUrl='.rawurlencode($this->local_linkThisScript(array("edit_record"=>"")));
581 header("Location: ".t3lib_div::locationHeaderUrl($jumpUrl));
582 exit;
583 }
584
585 if (t3lib_div::GPvar("new_unique_uid")) {
586 $query = "SELECT * FROM sys_log WHERE userid='".$BE_USER->user["uid"]."' AND NEWid='".t3lib_div::GPvar("new_unique_uid")."'";
587 $res = mysql(TYPO3_db,$query);
588 $sys_log_row = mysql_fetch_assoc($res);
589 if (is_array($sys_log_row)) {
590 $edit_record=$sys_log_row["tablename"].":".$sys_log_row["recuid"];
591 }
592 unset($HTTP_GET_VARS["new_unique_uid"]); // removing this for certain so
593 }
594
595 // Creating tool bar
596 $opt=array();
597 $is_selected=0;
598 $languageOverlayRecord="";
599 if ($this->current_sys_language) {
600 list($languageOverlayRecord) = t3lib_BEfunc::getRecordsByField("pages_language_overlay","pid",$this->id,"AND sys_language_uid=".intval($this->current_sys_language));
601 }
602 if (is_array($languageOverlayRecord)) {
603 $inValue = 'pages_language_overlay:'.$languageOverlayRecord["uid"];
604 $is_selected+=intval($edit_record==$inValue);
605 $opt[]='<option value="'.$inValue.'"'.($edit_record==$inValue?" selected":"").'>[ '.$LANG->getLL("editLanguageHeader").' ]</option>';
606 } else {
607 $inValue = 'pages:'.$this->id;
608 $is_selected+=intval($edit_record==$inValue);
609 $opt[]='<option value="'.$inValue.'"'.($edit_record==$inValue?" selected":"").'>[ '.$LANG->getLL("editPageHeader").' ]</option>';
610 }
611
612 // $andH=" AND hidden=0";
613 $andH="";
614 $query = "SELECT * FROM tt_content WHERE pid=".intval($this->id).
615 $andH.
616 " AND sys_language_uid=".intval($this->current_sys_language).
617 ($this->MOD_SETTINGS["tt_content_showHidden"] ? "" : t3lib_BEfunc::BEenableFields("tt_content")).
618 t3lib_Befunc::deleteClause("tt_content").
619 " ORDER BY colPos,sorting";
620 $res = mysql(TYPO3_db,$query);
621 $colPos="";
622 $first=1;
623 $prev=$this->id; // Page is the pid if no record to put this after.
624 while($cRow=mysql_fetch_assoc($res)) {
625 if ($first) {
626 if (!$edit_record) {
627 $edit_record="tt_content:".$cRow["uid"];
628 }
629 $first = 0;
630 }
631 if (strcmp($cRow["colPos"],$colPos)) {
632 if (strcmp($colPos,"")) {
633 // $inValue = 'tt_content:new/'.$prev."/".$colPos;
634 // $is_selected+=intval($edit_record==$inValue);
635 // $opt[]='<option value="'.$inValue.'"'.($edit_record==$inValue?" selected":"").'>[ '.$LANG->getLL("newLabel").' ]</option>';
636 }
637 $colPos=$cRow["colPos"];
638 $opt[]='<option value=""></option>';
639 $opt[]='<option value="_EDIT_COL:'.$colPos.'">__'.$LANG->sL(t3lib_BEfunc::getLabelFromItemlist("tt_content","colPos",$colPos)).':__</option>';
640 }
641 $inValue = 'tt_content:'.$cRow["uid"];
642 $is_selected+=intval($edit_record==$inValue);
643 $opt[]='<option value="'.$inValue.'"'.($edit_record==$inValue?" selected":"").'>'.htmlspecialchars(t3lib_div::fixed_lgd($cRow["header"]?$cRow["header"]:"[".$GLOBALS["LANG"]->sL("LLL:EXT:lang/locallang_core.php:labels.no_title")."] ".strip_tags($cRow["bodytext"]),$GLOBALS["BE_USER"]->uc["titleLen"])).'</option>';
644 $prev=-$cRow["uid"];
645 }
646
647 if (!$edit_record) {
648 $edit_record="tt_content:new/".$prev."/".$colPos;
649
650 // Formerly outside this condition...
651 $inValue = 'tt_content:new/'.$prev."/".$colPos;
652 $is_selected+=intval($edit_record==$inValue);
653 $opt[]='<option value="'.$inValue.'"'.($edit_record==$inValue?" selected":"").'>[ '.$LANG->getLL("newLabel").' ]</option>';
654 }
655
656 if (!$is_selected) { // If none is yet selected...
657 $opt[]='<option value=""></option>';
658 $opt[]='<option value="'.$edit_record.'" SELECTED>[ '.$LANG->getLL("newLabel").' ]</option>';
659 }
660
661
662 $eRParts = explode(":",$edit_record);
663 // debug($eRParts);
664 $deleteButton = (t3lib_div::testInt($eRParts[1]) && $edit_record && (($eRParts[0]!="pages"&&$this->EDIT_CONTENT) || ($eRParts[0]=="pages"&&($this->CALC_PERMS&4))));
665
666 $undoButton=0;
667 $undoQuery="SELECT tstamp FROM sys_history WHERE tablename='".$eRParts[0]."' AND recuid='".$eRParts[1]."' ORDER BY tstamp DESC LIMIT 1";
668 $undoRes = mysql(TYPO3_db,$undoQuery);
669 if ($undoButtonR = mysql_fetch_assoc($undoRes)) {
670 $undoButton=1;
671 }
672
673 $elementName="edit_record";
674 $addparams="";
675
676
677 $R_URL_parts = parse_url(t3lib_div::getIndpEnv("REQUEST_URI"));
678 $R_URL_getvars = $GLOBALS["HTTP_GET_VARS"];
679
680 unset($R_URL_getvars["popView"]);
681 unset($R_URL_getvars["new_unique_uid"]);
682 $R_URL_getvars["edit_record"]=$edit_record;
683 $R_URI = $R_URL_parts["path"]."?".t3lib_div::implodeArrayForUrl("",$R_URL_getvars);
684
685
686 $closeUrl = $this->local_linkThisScript(array("SET"=>array("function"=>1))); // Goes to "Columns" view if close is pressed (default)
687
688 if ($BE_USER->uc["condensedMode"]) {
689 $uParts = parse_url(t3lib_div::getIndpEnv("REQUEST_URI"));
690 $closeUrl="alt_db_navframe.php";
691 }
692 if (t3lib_div::GPvar("returnUrl")) {
693 $closeUrl = t3lib_div::GPvar("returnUrl");
694 }
695
696 $retUrlStr = t3lib_div::GPvar("returnUrl")?"+'&returnUrl='+'".rawurlencode(t3lib_div::GPvar("returnUrl"))."'":"";
697 $toolBar='<select name="edit_record" onChange="jumpToUrl(\'db_layout.php?id='.$this->id.$addparams.'&'.$elementName.'=\'+escape(this.options[this.selectedIndex].value,this)'.$retUrlStr.');">'.implode("",$opt).'</select>'.
698 '<input type="image" border=0 name="savedok" src="gfx/savedok.gif" hspace=2 width="21" height="16"'.t3lib_BEfunc::titleAttrib($LANG->sL("LLL:EXT:lang/locallang_core.php:rm.saveDoc"),1).' align=top>'.
699 '<a href="#" onClick="document.editform.redirect.value+=\'&popView=1\'; TBE_EDITOR_checkAndDoSubmit(1); return false;"><img border=0 src="gfx/savedokshow.gif" hspace=2 width="21" height="16"'.t3lib_BEfunc::titleAttrib($LANG->sL("LLL:EXT:lang/locallang_core.php:rm.saveDocShow"),1).' align=top></a>'.
700 '<a href="#" onClick="jumpToUrl(unescape(\''.rawurlencode($closeUrl).'\')); return false;"><img border=0 src="gfx/closedok.gif" hspace=2 width="21" height="16"'.t3lib_BEfunc::titleAttrib($LANG->sL("LLL:EXT:lang/locallang_core.php:rm.closeDoc"),1).' align=top></a>'.
701 ($deleteButton ? '<a href="#" onClick="return deleteRecord(\''.$eRParts[0].'\',\''.$eRParts[1].'\',\'db_layout.php?id='.$this->id.'\');"><img border=0 src="gfx/deletedok.gif" hspace=2 width="21" height="16"'.t3lib_BEfunc::titleAttrib($LANG->getLL("deleteItem"),1).' align=top></a>' : '').
702 ($undoButton ? '<a href="#" onClick="document.location=\'show_rechis.php?element='.rawurlencode($eRParts[0].':'.$eRParts[1]).'&revert=ALL_FIELDS&sumUp=-1&returnUrl='.rawurlencode($R_URI).'\'; return false;"><img border=0 src="gfx/undo.gif" hspace=2 width="21" height="16"'.t3lib_BEfunc::titleAttrib(sprintf($LANG->getLL("undoLastChange"),t3lib_BEfunc::calcAge(time()-$undoButtonR["tstamp"],$LANG->sL("LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears"))),1).'" align=top></a>' : '').
703 '';
704 $toolBar.='<img src=clear.gif width=15 height=1 align=top>';
705 $toolBar.=$undoButton?'<a href="#" onClick="jumpToUrl(\'show_rechis.php?element='.rawurlencode($eRParts[0].':'.$eRParts[1]).'&returnUrl='.rawurlencode($R_URI).'#latest\');return false;"><img src="gfx/history2.gif" width="13" height="12" vspace=2 hspace=2 border="0"'.t3lib_BEfunc::titleAttrib($LANG->getLL("recordHistory"),1).' align=top></a>':'';
706 $toolBar.='<A HREF="db_new_content_el.php?id='.$this->id.'&sys_language_uid='.$this->current_sys_language.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI")).'"><img src="'.$BACK_PATH.'gfx/new_record.gif" vspace=2 hspace=1 width=16 height=12 border=0 align=top align="top"'.t3lib_BEfunc::titleAttrib($LANG->getLL("newContentElement")).'></a>';
707 if (t3lib_div::testInt($eRParts[1])) $toolBar.='<A HREF="move_el.php?table='.$eRParts[0].'&uid='.$eRParts[1].'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI")).'"><img src="'.$BACK_PATH.'gfx/move_'.($eRParts[0]=="tt_content"?"record":"page").'.gif" vspace=2 hspace=2 width=11 height=12 border=0 align=top align="top"'.t3lib_BEfunc::titleAttrib($LANG->getLL("move_".($eRParts[0]=="tt_content"?"record":"page"))).'></a>';
708 $toolBar.='<a href="#" onClick="jumpToUrl(\'db_new.php?id='.$this->id.'&pagesOnly=1&returnUrl='.rawurlencode($R_URI).'\');return false;"><img src="gfx/new_page.gif" width="13" height="12" hspace=0 vspace=2 border="0"'.t3lib_BEfunc::titleAttrib($LANG->getLL("newPage"),1).' align=top></a>';
709
710 // $params="&edit[pages][".$this->id."]=edit";
711 // $toolBar.='<a href="#" onClick="'.t3lib_BEfunc::editOnClick($params).'"><img src="gfx/edit_page.gif" width="12" height="12" hspace=2 vspace=2 border="0"'.t3lib_BEfunc::titleAttrib($LANG->getLL("editPageHeader"),1).' align=top></a>';
712 $toolBar.='<a href="'.$this->local_linkThisScript(array("edit_record"=>"pages:".$this->id)).'"><img src="gfx/edit2.gif" width="11" height="12" hspace=2 vspace=2 border="0"'.t3lib_BEfunc::titleAttrib($LANG->getLL("editPageHeader"),1).' align=top></a>';
713 $toolBar.='<img src=clear.gif width=15 height=1 align=top>';
714 $toolBar.=t3lib_BEfunc::helpTextIcon($this->descrTable,"quickEdit",$GLOBALS["BACK_PATH"]);
715
716 // Setting page header
717 $hS2='<table border=0 cellpadding=0 cellspacing=0 width=460>
718 <tr>
719 <td valign=top width=99%>'.$this->doc->getHeader("pages",$this->pageinfo,$this->pageinfo["_thePath"],0,explode("|",'<a href="'.$this->local_linkThisScript(array("edit_record"=>"pages:".$this->id)).'">|</a>')).'</td>
720 <td valign=top width=1% valign=top>'.$this->topFuncMenu.'</td>
721 <td valign=top width=1%><img src=clear.gif width=1 height=3><BR>'.$this->editIcon.'</td>
722 </tr>
723 <tr>
724 <td><img src=clear.gif width=300 height=1></td>
725 <td></td>
726 <td></td>
727 </tr>
728 <tr>
729 <td colspan=3 bgColor="'.$this->doc->bgColor4.'">'.t3lib_BEfunc::helpText($this->descrTable,"quickEdit",$GLOBALS["BACK_PATH"]).$toolBar.'</td>
730 </tr>
731 </table>';
732
733 $content.=$this->doc->startPage($LANG->getLL("title"));
734 $content.=$this->doc->section('',$hS2);
735 $content.=$this->doc->spacer(7);
736
737
738 // EDIT FORM:
739 if ($GLOBALS["BE_USER"]->check("tables_modify",$eRParts[0]) && $edit_record && (($eRParts[0]!="pages"&&$this->EDIT_CONTENT) || ($eRParts[0]=="pages"&&($this->CALC_PERMS&1)))) {
740
741 list($uidVal,$ex_pid,$ex_colPos) = explode("/",$eRParts[1]);
742
743 $trData = t3lib_div::makeInstance("t3lib_transferData");
744 $trData->defVals[$eRParts[0]] = array(
745 'colPos' => intval($ex_colPos),
746 'sys_language_uid' => intval($this->current_sys_language)
747 );
748 $trData->disableRTE = $this->MOD_SETTINGS["disableRTE"];
749 $trData->lockRecords=1;
750 $trData->fetchRecord($eRParts[0],($uidVal=="new"?$this->id:$uidVal),$uidVal); // "new"
751 // $rec = $trData->regTableItems_data[$eRParts[0]."_".$uidVal];
752 reset($trData->regTableItems_data);
753 $rec = current($trData->regTableItems_data);
754 if ($uidVal=="new") {
755 $new_unique_uid = uniqid("NEW");
756 $rec["uid"] = $new_unique_uid;
757 $rec["pid"] = intval($ex_pid)?intval($ex_pid):$this->id;
758 } else {
759 $rec["uid"] = $uidVal;
760 }
761
762 if (is_array($rec)) {
763 $tceforms = t3lib_div::makeInstance("t3lib_TCEforms");
764 $tceforms->initDefaultBEMode();
765 $tceforms->fieldOrder = $this->modTSconfig["properties"]["tt_content."]["fieldOrder"];
766 $tceforms->palettesCollapsed = !$this->MOD_SETTINGS["showPalettes"];
767 $tceforms->disableRTE = $this->MOD_SETTINGS["disableRTE"];
768 if ($BE_USER->uc["edit_showFieldHelp"]!="text" && $this->MOD_SETTINGS["showDescriptions"]) $tceforms->edit_showFieldHelp="text";
769
770 $theCode="";
771 $panel="";
772 $panel.=$tceforms->getMainFields($eRParts[0],$rec);
773 $panel=$tceforms->wrapTotal($panel,$rec,$eRParts[0]);
774
775 $theCode.=$panel;
776 if ($uidVal=="new") {
777 $theCode.='<input type="hidden" name="data['.$eRParts[0].']['.$rec["uid"].'][pid]" value="'.$rec["pid"].'">';
778 }
779 $theCode.='
780 <input type="hidden" name="_serialNumber" value="'.md5(microtime()).'">
781 <input type="hidden" name="_disableRTE" value="'.$tceforms->disableRTE.'">
782 <input type="hidden" name="edit_record" value="'.$edit_record.'">
783 <input type="hidden" name="redirect" value="'.htmlspecialchars($uidVal=="new" ? "db_layout.php?id=".$this->id."&new_unique_uid=".$new_unique_uid."&returnUrl=".rawurlencode(t3lib_div::GPvar("returnUrl")) : $R_URI ).'">
784 ';
785 $theCode=$tceforms->printNeededJSFunctions_top().$theCode.$tceforms->printNeededJSFunctions();
786
787 if ($lockInfo=t3lib_BEfunc::isRecordLocked($eRParts[0],$rec["uid"])) {
788 $lockIcon='<BR><table align="center" border=0 cellpadding=4 cellspacing=0 bgcolor="yellow" style="border:solid 2px black;"><tr><td>
789 <img src="gfx/recordlock_warning3.gif" width="17" height="12" vspace=2 hspace=10 border="0" align=top></td><td><strong>'.htmlspecialchars($lockInfo["msg"]).'</strong>
790 </td></tr></table><BR><BR>
791 ';
792 } else $lockIcon="";
793
794 $content.=$this->doc->section('',$lockIcon.$theCode);
795 }
796 } else {
797 $content.=$this->doc->section($LANG->getLL("noAccess"),$LANG->getLL("noAccess_msg")."<BR><BR>",0,1);
798 }
799
800
801 // Bottom controls:
802 $q_count = $this->getNumberOfHiddenElements();
803 $h_func_b= t3lib_BEfunc::getFuncCheck($this->id,"SET[tt_content_showHidden]",$this->MOD_SETTINGS["tt_content_showHidden"],"db_layout.php","").(!$q_count?$GLOBALS["TBE_TEMPLATE"]->dfw($LANG->getLL("hiddenCE")):$LANG->getLL("hiddenCE")." (".$q_count.")");
804 $h_func_b.= "<BR>".t3lib_BEfunc::getFuncCheck($this->id,"SET[showPalettes]",$this->MOD_SETTINGS["showPalettes"],"db_layout.php","").$LANG->sL("LLL:EXT:lang/locallang_core.php:labels.showPalettes");
805 if (t3lib_extMgm::isLoaded("context_help") && $BE_USER->uc["edit_showFieldHelp"]!="text") $h_func_b.= "<BR>".t3lib_BEfunc::getFuncCheck($this->id,"SET[showDescriptions]",$this->MOD_SETTINGS["showDescriptions"],"db_layout.php","").$LANG->sL("LLL:EXT:lang/locallang_core.php:labels.showDescriptions");
806 if ($BE_USER->isRTE()) $h_func_b.= "<BR>".t3lib_BEfunc::getFuncCheck($this->id,"SET[disableRTE]",$this->MOD_SETTINGS["disableRTE"],"db_layout.php","").$LANG->sL("LLL:EXT:lang/locallang_core.php:labels.disableRTE");
807 $content.=$this->doc->section("",$h_func_b,0,0);
808
809 $content.=$this->doc->spacer(10);
810
811 // Select element:
812 if ($eRParts[0]=="tt_content" && t3lib_div::testInt($eRParts[1])) {
813 $posMap = t3lib_div::makeInstance("ext_posMap");
814 $posMap->cur_sys_language=$this->current_sys_language;
815 $HTMLcode="";
816 $HTMLcode.=t3lib_BEfunc::helpTextIcon($this->descrTable,"quickEdit_selElement",$GLOBALS["BACK_PATH"]).
817 t3lib_BEfunc::helpText($this->descrTable,"quickEdit_selElement",$GLOBALS["BACK_PATH"]).
818 "<BR>";
819
820 $HTMLcode.=$posMap->printContentElementColumns($this->id,$eRParts[1],$this->colPosList,$this->MOD_SETTINGS["tt_content_showHidden"],$R_URI);
821 $HTMLcode.='<BR><BR><A HREF="move_el.php?table=tt_content&uid='.$eRParts[1].'&sys_language_uid='.$this->current_sys_language.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI")).'"><img src="'.$BACK_PATH.'gfx/move_record.gif" vspace=0 hspace=5 width=11 height=12 border=0 align=top align="top"'.t3lib_BEfunc::titleAttrib($LANG->getLL("move_record")).'>'.htmlspecialchars($LANG->getLL("move_record")).'</a>';
822 $HTMLcode.='<BR><img src=clear.gif width=1 height=5>';
823 $HTMLcode.='<BR><A HREF="db_new_content_el.php?id='.$this->id.'&sys_language_uid='.$this->current_sys_language.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv("REQUEST_URI")).'"><img src="'.$BACK_PATH.'gfx/new_record.gif" vspace=0 hspace=2 width=16 height=12 border=0 align=top align="top"'.t3lib_BEfunc::titleAttrib($LANG->getLL("newContentElement")).'>'.htmlspecialchars($LANG->getLL("newContentElement")).'</a>';
824
825 $content.=$this->doc->spacer(20);
826 $content.=$this->doc->section($LANG->getLL("CEonThisPage"),$HTMLcode,0,1);
827 $content.=$this->doc->spacer(20);
828 }
829
830 //debug($tceforms->commentMessages);
831 if (count($tceforms->commentMessages)) {
832 $content.='
833 <!-- TCEFORM messages
834 '.implode(chr(10),$tceforms->commentMessages).'
835 -->
836 ';
837 }
838
839 return $content;
840 }
841 }
842
843 // Include extension?
844 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/db_layout.php"]) {
845 include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["typo3/db_layout.php"]);
846 }
847
848
849
850
851
852
853
854
855
856
857
858
859 // Make instance:
860 $SOBE = t3lib_div::makeInstance("SC_db_layout");
861 $SOBE->init();
862
863 // Include files?
864 reset($SOBE->include_once);
865 while(list(,$INC_FILE)=each($SOBE->include_once)) {include_once($INC_FILE);}
866
867 $SOBE->clearCache();
868 $SOBE->main();
869 $SOBE->printContent();
870 ?>