📄 db_layout.php
字号:
break; case 'tt_content': $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')):$LANG->getLL('hiddenCE').' ('.$q_count.')').'</label>'; $dblist->tt_contentConfig['showCommands'] = 1; // Boolean: Display up/down arrows and edit icons for tt_content records $dblist->tt_contentConfig['showInfo'] = 1; // Boolean: Display info-marks or not $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 // Setting up the tt_content columns to show: if (is_array($TCA['tt_content']['columns']['colPos']['config']['items'])) { $colList = array(); foreach($TCA['tt_content']['columns']['colPos']['config']['items'] as $temp) { $colList[] = $temp[1]; } } else { // ... should be impossible that colPos has no array. But this is the fallback should it make any sense: $colList = array('1','0','2','3'); } if (strcmp($this->colPosList,'')) { $colList = array_intersect(t3lib_div::intExplode(',',$this->colPosList),$colList); } // If only one column found, display the single-column view. if (count($colList)==1) { $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 $dblist->tt_contentConfig['showSingleCol'] = current($colList); // The column(s) to show if single mode (under each other) } $dblist->tt_contentConfig['cols'] = implode(',',$colList); // The order of the rows: Default is left(1), Normal(0), right(2), margin(3) $dblist->tt_contentConfig['showHidden'] = $this->MOD_SETTINGS['tt_content_showHidden']; $dblist->tt_contentConfig['sys_language_uid'] = intval($this->current_sys_language); // If the function menu is set to "Language": if ($this->MOD_SETTINGS['function']==2) { $dblist->tt_contentConfig['single'] = 0; $dblist->tt_contentConfig['languageMode'] = 1; $dblist->tt_contentConfig['languageCols'] = $this->MOD_MENU['language']; $dblist->tt_contentConfig['languageColsPointer'] = $this->current_sys_language; } break; } } else { $h_func = ''; } // Start the dblist object: $dblist->itemsLimitSingleTable = 1000; $dblist->start($this->id,$table,$this->pointer,$this->search_field,$this->search_levels,$this->showLimit); $dblist->counter = $CMcounter; $dblist->ext_function = $this->MOD_SETTINGS['function']; // Render versioning selector: $dblist->HTMLcode.= $this->doc->getVersionSelector($this->id); // Generate the list of elements here: $dblist->generateList(); // Adding the list content to the tableOutput variable: $tableOutput[$table]= ($h_func?$h_func.'<br /><img src="clear.gif" width="1" height="4" alt="" /><br />':''). $dblist->HTMLcode. ($h_func_b?'<img src="clear.gif" width="1" height="10" alt="" /><br />'.$h_func_b:''); // ... and any accumulated JavaScript goes the same way! $tableJSOutput[$table] = $dblist->JScode; // Increase global counter: $CMcounter+= $dblist->counter; // Reset variables after operation: $dblist->HTMLcode=''; $dblist->JScode=''; $h_func = ''; $h_func_b = ''; } // END: traverse tables // For Context Sensitive Menus: $CMparts = $this->doc->getContextMenuCode(); $this->doc->bodyTagAdditions = $CMparts[1]; $this->doc->JScode.= $CMparts[0]; $this->doc->postCode.= $CMparts[2]; // Draw the page properties. $headerSection = $this->doc->getHeader('pages',$this->pageinfo,$this->pageinfo['_thePath'],$this->modTSconfig['properties']['disableIconToolbar']?1:0).'<br />'. $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.path',1).': '. '<span title="'.htmlspecialchars($this->pageinfo['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'],-50)).'</span>'; if (!$this->modTSconfig['properties']['disableIconToolbar']) { // Create icon "toolbar" for common operations like creating/moving elements/pages etc. $toolBar=''; // History: $toolBar.='<a href="#" onclick="'.htmlspecialchars('jumpToUrl(\''.$BACK_PATH.'show_rechis.php?element='.rawurlencode('pages:'.$this->id).'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')).'#latest\');return false;').'">'. '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/history2.gif','width="13" height="12"').' vspace="2" hspace="2" align="top" title="'.$LANG->getLL('recordHistory',1).'" alt="" />'. '</a>'; // New content element $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"').' vspace="2" hspace="1" align="top" title="'.$LANG->getLL('newContentElement',1).'" alt="" />'. '</a>'; // Move page: $toolBar.='<a href="'.htmlspecialchars($BACK_PATH.'move_el.php?table=pages&uid='.$this->id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'. '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/move_page.gif','width="11" height="12"').' vspace="2" hspace="2" align="top" title="'.$LANG->getLL('move_page',1).'" alt="" />'. '</a>'; // Create new page (wizard): $toolBar.='<a href="#" onclick="'.htmlspecialchars('jumpToUrl(\''.$BACK_PATH.'db_new.php?id='.$this->id.'&pagesOnly=1&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')).'\');return false;').'">'. '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/new_page.gif','width="13" height="12"').' hspace="0" vspace="2" align="top" title="'.$LANG->getLL('newPage',1).'" alt="" />'. '</a>'; // Edit page properties: $params='&edit[pages]['.$this->id.']=edit'; $toolBar.='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$BACK_PATH)).'">'. '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/edit2.gif','width="11" height="12"').' hspace="2" vspace="2" align="top" title="'.$LANG->getLL('editPageProperties',1).'" alt="" />'. '</a>'; // Add CSH (Context Sensitive Help) icon to tool bar: $toolBar.= t3lib_BEfunc::cshItem($this->descrTable,'columns_'.$this->MOD_SETTINGS['function'],$BACK_PATH,'',FALSE,'margin-top: 0px; margin-bottom: 0px;'); // Wrap the toolbar into a table: $headerSection.=' <table border="0" cellpadding="0" cellspacing="0" class="bgColor4"> <tr> <td>'.$toolBar.'</td> </tr> </table>'; } // Create menu of table-icons for jumping to table-listing anchor points: if ($this->MOD_SETTINGS['function']!=3 && count($tableOutput)>1) { $goToTable_menu = '<td valign="top" width="1%" nowrap="nowrap">'.$h_menu.'</td>'; } else { $goToTable_menu = ''; } // Compile the whole header section into a table: Toolbar, Table selector, Function menu(s), Page-edit icon: $hS2=' <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td valign="top" width="99%">'.$headerSection.'</td> '.$goToTable_menu.' <td valign="top" width="1%">'.$this->topFuncMenu.'</td> <td valign="top" align="right" width="1%"><img src="clear.gif" width="1" height="3" alt="" /><br />'.$this->editIcon.'</td> </tr> </table>'; // Create page properties: $this->content.=$this->doc->startPage($LANG->getLL('title')); $this->content.=$this->doc->section('',$hS2); // Now, create listing based on which element is selected in the function menu: if ($this->MOD_SETTINGS['function']==3) { // Making page info: $this->content.=$this->doc->spacer(10); $this->content.=$this->doc->section($LANG->getLL('pageInformation'),$dblist->getPageInfoBox($this->pageinfo,$this->CALC_PERMS&2),0,1); } else { // Add the content for each table we have rendered (traversing $tableOutput variable) foreach($tableOutput as $table => $output) { $this->content.=$this->doc->section('<a name="'.$table.'"></a>'.$dblist->activeTables[$table],$output,TRUE,TRUE,0,TRUE); $this->content.=$this->doc->spacer(15); $this->content.=$this->doc->sectionEnd(); } // Making search form: if (!$this->modTSconfig['properties']['disableSearchBox'] && count($tableOutput)) { $this->content.=$this->doc->section($LANG->sL('LLL:EXT:lang/locallang_core.php:labels.search'),$dblist->getSearchBox(),0,1); } // Making display of Sys-notes (from extension "sys_note") $dblist->id=$this->id; $sysNotes = $dblist->showSysNotesForPage(); if ($sysNotes) { $this->content.=$this->doc->spacer(10); $this->content.=$this->doc->section($LANG->getLL('internalNotes'),$sysNotes,0,1); } // Display advanced options: Clear cache, new record link etc: if (!$this->modTSconfig['properties']['disableAdvanced']) { // Clear cache links: $af_content = $this->doc->clearCacheMenu($this->id); // "Create new record" link: if (!$this->modTSconfig['properties']['noCreateRecordsLink']) { $af_content.=' <!-- Link for creating a new record: --> <div id="typo3-newRecordLink"> <a href="'.htmlspecialchars($BACK_PATH.'db_new.php?id='.$this->id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'. '<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/new_el.gif','width="11" height="12"').' alt="" />'. $LANG->getLL('newRecordGeneral',1). '</a> </div>'; } // Add content of the advanced-options section: $this->content.=$this->doc->spacer(10); $this->content.=$this->doc->section($LANG->getLL('advancedFunctions'),$af_content,0,1); } // Add spacer in bottom of page: $this->content.=$this->doc->spacer(10); } } /** * Print accumulated content of module * * @return void */ function printContent() { echo $this->content; } /******************************* * * Other functions * ******************************/ /** * Returns the number of hidden elements (including those hidden by start/end times) on the current page (for the current sys_language) * * @return void */ function getNumberOfHiddenElements() { $q_res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'tt_content', 'pid='.intval($this->id).' AND sys_language_uid='.intval($this->current_sys_language).t3lib_BEfunc::BEenableFields('tt_content',1).t3lib_BEfunc::deleteClause('tt_content').t3lib_BEfunc::versioningPlaceholderClause('tt_content')); list($q_count) = $GLOBALS['TYPO3_DB']->sql_fetch_row($q_res); return $q_count; } /** * Returns URL to the current script. * In particular the "popView" and "new_unique_uid" Get vars are unset. * * @param array Parameters array, merged with global GET vars. * @return string URL */ function local_linkThisScript($params) { $params['popView']=''; $params['new_unique_uid']=''; return t3lib_div::linkThisScript($params); } /** * Returns a SQL query for selecting sys_language records. * * @param integer Page id: If zero, the query will select all sys_language records from root level which are NOT hidden. If set to another value, the query will select all sys_language records that has a pages_language_overlay record on that page (and is not hidden, unless you are admin user) * @return string Return query string. */ function exec_languageQuery($id) { if ($id) { $exQ = t3lib_BEfunc::deleteClause('pages_language_overlay') . ($GLOBALS['BE_USER']->isAdmin()?'':' AND sys_language.hidden=0'); return $GLOBALS['TYPO3_DB']->exec_SELECTquery( 'sys_language.*', 'pages_language_overlay,sys_language', 'pages_language_overlay.sys_language_uid=sys_language.uid AND pages_language_overlay.pid='.intval($id).$exQ, 'pages_language_overlay.sys_language_uid,sys_language.uid,sys_language.pid,sys_language.tstamp,sys_language.hidden,sys_language.title,sys_language.static_lang_isocode,sys_language.flag', 'sys_language.title' ); } else { return $GLOBALS['TYPO3_DB']->exec_SELECTquery( 'sys_language.*', 'sys_language', 'sys_language.hidden=0', '', 'sys_language.title' ); } }}// Include extension?if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/layout/db_layout.php']) { include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/cms/layout/db_layout.php']);}// Make instance:$SOBE = t3lib_div::makeInstance('SC_db_layout');$SOBE->init();// Include files?foreach($SOBE->include_once as $INC_FILE) include_once($INC_FILE);$SOBE->clearCache();$SOBE->main();$SOBE->printContent();?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -