📄 db_layout.php
字号:
// Return-url for JavaScript: $retUrlStr = $this->returnUrl?"+'&returnUrl='+'".rawurlencode($this->returnUrl)."'":''; // Drawing tool bar: $toolBar= '<select name="edit_record" onchange="'.htmlspecialchars('jumpToUrl(\'db_layout.php?id='.$this->id.'&edit_record=\'+escape(this.options[this.selectedIndex].value)'.$retUrlStr.',this);').'">'.implode('',$opt).'</select>'. '<input class="c-inputButton" type="image" name="savedok"'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/savedok.gif','').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc',1).'" alt="" />'. '<a href="#" onclick="'.htmlspecialchars('document.editform.redirect.value+=\'&popView=1\'; TBE_EDITOR.checkAndDoSubmit(1); return false;').'">'. '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/savedokshow.gif','width="21" height="16"').' class="c-inputButton" title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.saveDocShow',1).'" alt="" />'. '</a>'. '<a href="#" onclick="'.htmlspecialchars('jumpToUrl(unescape(\''.rawurlencode($closeUrl).'\')); return false;').'">'. '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/closedok.gif','width="21" height="16"').' class="c-inputButton" title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc',1).'" alt="" />'. '</a>'. ($deleteButton ? '<a href="#" onclick="'.htmlspecialchars('return deleteRecord(\''.$eRParts[0].'\',\''.$eRParts[1].'\',\''.t3lib_div::getIndpEnv('SCRIPT_NAME').'?id='.$this->id.'\');').'">'. '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/deletedok.gif','width="21" height="16"').' class="c-inputButton" title="'.$LANG->getLL('deleteItem',1).'" alt="" />'. '</a>' : ''). ($undoButton ? '<a href="#" onclick="'.htmlspecialchars('window.location.href=\''.$BACK_PATH.'show_rechis.php?element='.rawurlencode($eRParts[0].':'.$eRParts[1]).'&revert=ALL_FIELDS&sumUp=-1&returnUrl='.rawurlencode($R_URI).'\'; return false;').'">'. '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/undo.gif','width="21" height="16"').' class="c-inputButton" title="'.htmlspecialchars(sprintf($LANG->getLL('undoLastChange'),t3lib_BEfunc::calcAge(time()-$undoButtonR['tstamp'],$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears')))).'" alt="" />'. '</a>' : ''); $toolBar.='<img src="clear.gif" width="15" height="1" align="top" alt="" />'; $toolBar.=$undoButton?'<a href="#" onclick="'.htmlspecialchars('jumpToUrl(\''.$BACK_PATH.'show_rechis.php?element='.rawurlencode($eRParts[0].':'.$eRParts[1]).'&returnUrl='.rawurlencode($R_URI).'#latest\');return false;').'">'. '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/history2.gif','width="13" height="12"').' class="c-inputButton" title="'.$LANG->getLL('recordHistory',1).'" alt="" />'. '</a>':''; $toolBar.='<a href="'.htmlspecialchars('db_new_content_el.php?id='.$this->id.'&sys_language_uid='.$this->current_sys_language.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'. '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/new_record.gif','width="16" height="12"').' class="c-inputButton" title="'.$LANG->getLL('newContentElement',1).'" alt="" />'. '</a>'; if (t3lib_div::testInt($eRParts[1])) $toolBar.='<a href="'.htmlspecialchars($BACK_PATH.'move_el.php?table='.$eRParts[0].'&uid='.$eRParts[1].'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/move_'.($eRParts[0]=='tt_content'?'record':'page').'.gif','width="11" height="12"').' class="c-inputButton" title="'.$LANG->getLL('move_'.($eRParts[0]=='tt_content'?'record':'page'),1).'" alt="" /></a>'; $toolBar.='<a href="#" onclick="'.htmlspecialchars('jumpToUrl(\''.$BACK_PATH.'db_new.php?id='.$this->id.'&pagesOnly=1&returnUrl='.rawurlencode($R_URI).'\');return false;').'">'. '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/new_page.gif','width="13" height="12"').' class="c-inputButton" title="'.$LANG->getLL('newPage',1).'" alt="" />'. '</a>'; $toolBar.='<a href="'.htmlspecialchars($this->local_linkThisScript(array('edit_record'=>'pages:'.$this->id))).'">'. '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/edit2.gif','width="11" height="12"').' class="c-inputButton" title="'.$LANG->getLL('editPageProperties',1).'" alt="" />'. '</a>'; $toolBar.='<img src="clear.gif" width="15" height="1" align="top" alt="" />'; // CSH: $toolBar.= t3lib_BEfunc::cshItem($this->descrTable,'quickEdit',$BACK_PATH,'',FALSE,'margin-top: 0px; margin-bottom: 0px;'); // Setting page properties: $hS2 = ' <table border="0" cellpadding="0" cellspacing="0" width="460"> <tr> <td valign="top" width="99%">'.$this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath'],0,explode('|','<a href="'.htmlspecialchars($this->local_linkThisScript(array('edit_record'=>'pages:'.$this->id))).'">|</a>')).'</td> <td valign="top" width="1%">'.$this->topFuncMenu.'</td> <td valign="top" width="1%"><img src="clear.gif" width="1" height="3" alt="" /><br />'.$this->editIcon.'</td> </tr> <tr> <td><img src="clear.gif" width="300" height="1" alt="" /></td> <td></td> <td></td> </tr> <tr> <td colspan="3" class="bgColor4">'.$toolBar.'</td> </tr> </table>'; $content.=$this->doc->startPage($LANG->getLL('title')); $content.=$this->doc->section('',$hS2); $content.=$this->doc->spacer(7); // Creating editing form: if ($BE_USER->check('tables_modify',$eRParts[0]) && $edit_record && (($eRParts[0]!='pages'&&$this->EDIT_CONTENT) || ($eRParts[0]=='pages'&&($this->CALC_PERMS&1)))) { // Splitting uid parts for special features, if new: list($uidVal,$ex_pid,$ex_colPos) = explode('/',$eRParts[1]); // Convert $uidVal to workspace version if any: if ($uidVal!='new') { if ($draftRecord = t3lib_BEfunc::getWorkspaceVersionOfRecord($GLOBALS['BE_USER']->workspace, $eRParts[0], $uidVal, 'uid')) { $uidVal = $draftRecord['uid']; } } // Initializing transfer-data object: $trData = t3lib_div::makeInstance('t3lib_transferData'); $trData->addRawData = TRUE; $trData->defVals[$eRParts[0]] = array ( 'colPos' => intval($ex_colPos), 'sys_language_uid' => intval($this->current_sys_language) ); $trData->disableRTE = $this->MOD_SETTINGS['disableRTE']; $trData->lockRecords=1; $trData->fetchRecord($eRParts[0],($uidVal=='new'?$this->id:$uidVal),$uidVal); // 'new' // Getting/Making the record: reset($trData->regTableItems_data); $rec = current($trData->regTableItems_data); if ($uidVal=='new') { $new_unique_uid = uniqid('NEW'); $rec['uid'] = $new_unique_uid; $rec['pid'] = intval($ex_pid)?intval($ex_pid):$this->id; $recordAccess = TRUE; } else { $rec['uid'] = $uidVal; // Checking internals access: $recordAccess = $BE_USER->recordEditAccessInternals($eRParts[0],$uidVal); } if (!$recordAccess) { // If no edit access, print error message: $content.=$this->doc->section($LANG->getLL('noAccess'),$LANG->getLL('noAccess_msg').'<br /><br />'. ($BE_USER->errorMsg ? 'Reason: '.$BE_USER->errorMsg.'<br/><br/>' : ''),0,1); } elseif (is_array($rec)) { // If the record is an array (which it will always be... :-) // Create instance of TCEforms, setting defaults: $tceforms = t3lib_div::makeInstance('t3lib_TCEforms'); $tceforms->backPath = $BACK_PATH; $tceforms->initDefaultBEMode(); $tceforms->fieldOrder = $this->modTSconfig['properties']['tt_content.']['fieldOrder']; $tceforms->palettesCollapsed = !$this->MOD_SETTINGS['showPalettes']; $tceforms->disableRTE = $this->MOD_SETTINGS['disableRTE']; $tceforms->enableClickMenu = TRUE; // Clipboard is initialized: $tceforms->clipObj = t3lib_div::makeInstance('t3lib_clipboard'); // Start clipboard $tceforms->clipObj->initializeClipboard(); // Initialize - reads the clipboard content from the user session if ($BE_USER->uc['edit_showFieldHelp']!='text' && $this->MOD_SETTINGS['showDescriptions']) $tceforms->edit_showFieldHelp='text'; // Render form, wrap it: $panel=''; $panel.=$tceforms->getMainFields($eRParts[0],$rec); $panel=$tceforms->wrapTotal($panel,$rec,$eRParts[0]); // Add hidden fields: $theCode=$panel; if ($uidVal=='new') { $theCode.='<input type="hidden" name="data['.$eRParts[0].']['.$rec['uid'].'][pid]" value="'.$rec['pid'].'" />'; } $theCode.=' <input type="hidden" name="_serialNumber" value="'.md5(microtime()).'" /> <input type="hidden" name="_disableRTE" value="'.$tceforms->disableRTE.'" /> <input type="hidden" name="edit_record" value="'.$edit_record.'" /> <input type="hidden" name="redirect" value="'.htmlspecialchars($uidVal=='new' ? t3lib_extMgm::extRelPath('cms').'layout/db_layout.php?id='.$this->id.'&new_unique_uid='.$new_unique_uid.'&returnUrl='.rawurlencode($this->returnUrl) : $R_URI ).'" /> '; // Add JavaScript as needed around the form: $theCode=$tceforms->printNeededJSFunctions_top().$theCode.$tceforms->printNeededJSFunctions(); // Add warning sign if record was "locked": if ($lockInfo=t3lib_BEfunc::isRecordLocked($eRParts[0],$rec['uid'])) { $lockIcon=' <!-- Warning box: --> <table border="0" cellpadding="0" cellspacing="0" class="warningbox"> <tr> <td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/recordlock_warning3.gif','width="17" height="12"').' alt="" /></td> <td>'.htmlspecialchars($lockInfo['msg']).'</td> </tr> </table> '; } else $lockIcon=''; // Add whole form as a document section: $content.=$this->doc->section('',$lockIcon.$theCode); } } else { // If no edit access, print error message: $content.=$this->doc->section($LANG->getLL('noAccess'),$LANG->getLL('noAccess_msg').'<br /><br />',0,1); } // Bottom controls (function menus): $q_count = $this->getNumberOfHiddenElements(); $h_func_b= t3lib_BEfunc::getFuncCheck($this->id,'SET[tt_content_showHidden]',$this->MOD_SETTINGS['tt_content_showHidden'],'db_layout.php','','id="checkTt_content_showHidden"'). '<label for="checkTt_content_showHidden">'.(!$q_count?$GLOBALS['TBE_TEMPLATE']->dfw($LANG->getLL('hiddenCE',1)):$LANG->getLL('hiddenCE',1).' ('.$q_count.')').'</label>'; $h_func_b.= '<br />'. t3lib_BEfunc::getFuncCheck($this->id,'SET[showPalettes]',$this->MOD_SETTINGS['showPalettes'],'db_layout.php','','id="checkShowPalettes"'). '<label for="checkShowPalettes">'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPalettes',1).'</label>'; 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','','id="checkShowDescriptions"'). '<label for="checkShowDescriptions">'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showDescriptions',1).'</label>'; } if ($BE_USER->isRTE()) { $h_func_b.= '<br />'. t3lib_BEfunc::getFuncCheck($this->id,'SET[disableRTE]',$this->MOD_SETTINGS['disableRTE'],'db_layout.php','','id="checkDisableRTE"'). '<label for="checkDisableRTE">'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.disableRTE',1).'</label>'; } // Add the function menus to bottom: $content.=$this->doc->section('',$h_func_b,0,0); $content.=$this->doc->spacer(10); // Select element matrix: if ($eRParts[0]=='tt_content' && t3lib_div::testInt($eRParts[1])) { $posMap = t3lib_div::makeInstance('ext_posMap'); $posMap->backPath = $BACK_PATH; $posMap->cur_sys_language=$this->current_sys_language; $HTMLcode = ''; // CSH: $HTMLcode.= t3lib_BEfunc::cshItem($this->descrTable,'quickEdit_selElement',$BACK_PATH,'|<br/>'); $HTMLcode.=$posMap->printContentElementColumns($this->id,$eRParts[1],$this->colPosList,$this->MOD_SETTINGS['tt_content_showHidden'],$R_URI); $HTMLcode.='<br /><br />'. '<a href="'.htmlspecialchars($BACK_PATH.'move_el.php?table=tt_content&uid='.$eRParts[1].'&sys_language_uid='.$this->current_sys_language.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/move_record.gif','width="11" height="12"').' vspace="0" hspace="5" align="top" title="'.$LANG->getLL('move_record',1).'" alt="" />'. $LANG->getLL('move_record',1). '</a>'; $HTMLcode.='<br /><img src="clear.gif" width="1" height="5" alt="" />'; $HTMLcode.='<br />'. '<a href="'.htmlspecialchars('db_new_content_el.php?id='.$this->id.'&sys_language_uid='.$this->current_sys_language.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'. '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/new_record.gif','width="16" height="12"').' vspace="0" hspace="2" align="top" title="'.$LANG->getLL('newContentElement',1).'" alt="" />'. $LANG->getLL('newContentElement',1). '</a>'; $content.=$this->doc->spacer(20); $content.=$this->doc->section($LANG->getLL('CEonThisPage'),$HTMLcode,0,1); $content.=$this->doc->spacer(20); } // Finally, if comments were generated in TCEforms object, print these as a HTML comment: if (count($tceforms->commentMessages)) { $content.=' <!-- TCEFORM messages '.htmlspecialchars(implode(chr(10),$tceforms->commentMessages)).' --> '; } // Adding content to internal accumulation variable: $this->content.=$content; } /** * Rendering all other listings than QuickEdit * * @return void */ function renderListContent() { global $LANG,$BACK_PATH,$TCA; // Initialize list object (see "class.db_layout.inc"): $dblist = t3lib_div::makeInstance('tx_cms_layout'); $dblist->backPath = $BACK_PATH; $dblist->thumbs = $this->imagemode; $dblist->no_noWrap = 1; $dblist->descrTable = $this->descrTable; $this->pointer = t3lib_div::intInRange($this->pointer,0,100000); $dblist->script = 'db_layout.php'; $dblist->showIcon = 0; $dblist->setLMargin=0; $dblist->doEdit = $this->EDIT_CONTENT; $dblist->ext_CALC_PERMS = $this->CALC_PERMS; $dblist->agePrefixes = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.minutesHoursDaysYears'); $dblist->id = $this->id; $dblist->nextThree = t3lib_div::intInRange($this->modTSconfig['properties']['editFieldsAtATime'],0,10); $dblist->option_showBigButtons = $this->modTSconfig['properties']['disableBigButtons'] ? 0 : 1; $dblist->option_newWizard = $this->modTSconfig['properties']['disableNewContentElementWizard'] ? 0 : 1; $dblist->defLangBinding = $this->modTSconfig['properties']['defLangBinding'] ? 1 : 0; if (!$dblist->nextThree) $dblist->nextThree = 1; $dblist->externalTables = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['cms']['db_layout']['addTables']; // Create menu for selecting a table to jump to (this is, if more than just pages/tt_content elements are found on the page!) $h_menu = $dblist->getTableMenu($this->id); // Initialize other variables: $h_func=''; $tableOutput=array(); $tableJSOutput=array(); $CMcounter = 0; // Traverse the list of table names which has records on this page (that array is populated by the $dblist object during the function getTableMenu()): reset($dblist->activeTables); while(list($table)=each($dblist->activeTables)) { // Load full table definitions: t3lib_div::loadTCA($table); if (!isset($dblist->externalTables[$table])) { // Creating special conditions for each table: switch($table) { case 'tt_board': $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_board]',$this->MOD_SETTINGS['tt_board'],$this->MOD_MENU['tt_board'],'db_layout.php',''); break; case 'tt_address': $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_address]',$this->MOD_SETTINGS['tt_address'],$this->MOD_MENU['tt_address'],'db_layout.php',''); break; case 'tt_links': $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_links]',$this->MOD_SETTINGS['tt_links'],$this->MOD_MENU['tt_links'],'db_layout.php',''); break; case 'tt_calender': $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_calender]',$this->MOD_SETTINGS['tt_calender'],$this->MOD_MENU['tt_calender'],'db_layout.php',''); break; case 'tt_products': $h_func = t3lib_BEfunc::getFuncMenu($this->id,'SET[tt_products]',$this->MOD_SETTINGS['tt_products'],$this->MOD_MENU['tt_products'],'db_layout.php',''); break; case 'tt_guest': case 'tt_news': case 'fe_users': // Nothing
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -