📄 class.tx_cms_layout.php
字号:
} } // Start table: $this->oddColumnsTDParams = ''; // CSH: $out = t3lib_BEfunc::cshItem($this->descrTable,'func_'.$pKey,$GLOBALS['BACK_PATH']). ' <table border="0" cellpadding="0" cellspacing="0" class="typo3-page-pages"> '.$this->addelement(1,'',$theData,' class="c-headLine"',20). $out.' </table>'; } $this->oddColumnsTDParams = ''; return $out; } /** * Renders Content Elements from the tt_content table from page id * * @param integer Page id * @return string HTML for the listing */ function getTable_tt_content($id) { global $TCA; $this->initializeLanguages(); // Initialize: $RTE = $GLOBALS['BE_USER']->isRTE(); $lMarg=1; $showHidden = $this->tt_contentConfig['showHidden']?'':t3lib_BEfunc::BEenableFields('tt_content'); $pageTitleParamForAltDoc='&recTitle='.rawurlencode(t3lib_BEfunc::getRecordTitle('pages',t3lib_BEfunc::getRecordWSOL('pages',$id),TRUE)); // Get labels for CTypes and tt_content element fields in general: $this->CType_labels =array(); foreach($TCA['tt_content']['columns']['CType']['config']['items'] as $val) { $this->CType_labels[$val[1]]=$GLOBALS['LANG']->sL($val[0]); } $this->itemLabels =array(); foreach($TCA['tt_content']['columns'] as $name => $val) { $this->itemLabels[$name]=$GLOBALS['LANG']->sL($val['label']); } // Select display mode: if (!$this->tt_contentConfig['single']) { // MULTIPLE column display mode, side by side: // Setting language list: $langList = $this->tt_contentConfig['sys_language_uid']; if ($this->tt_contentConfig['languageMode']) { if ($this->tt_contentConfig['languageColsPointer']) { $langList='0,'.$this->tt_contentConfig['languageColsPointer']; } else { $langList=implode(',',array_keys($this->tt_contentConfig['languageCols'])); } $languageColumn = array(); } $langListArr = explode(',',$langList); $defLanguageCount = array(); $defLangBinding = array(); // For EACH languages... : foreach($langListArr as $lP) { // If NOT languageMode, then we'll only be through this once. $showLanguage = $this->defLangBinding && $lP==0 ? ' AND sys_language_uid IN (0,-1)' : ' AND sys_language_uid='.$lP; $cList = explode(',',$this->tt_contentConfig['cols']); $content = array(); $head = array(); // For EACH column, render the content into a variable: foreach($cList as $key) { if (!$lP) $defLanguageCount[$key] = array(); // Select content elements from this column/language: $queryParts = $this->makeQueryArray('tt_content', $id, 'AND colPos='.intval($key).$showHidden.$showLanguage); $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts); // If it turns out that there are not content elements in the column, then display a big button which links directly to the wizard script: if ($this->doEdit && $this->option_showBigButtons && !intval($key) && !$GLOBALS['TYPO3_DB']->sql_num_rows($result)) { $onClick = "window.location.href='db_new_content_el.php?id=".$id.'&colPos='.intval($key).'&sys_language_uid='.$lP.'&uid_pid='.$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';"; $theNewButton = $GLOBALS['SOBE']->doc->t3Button($onClick,$GLOBALS['LANG']->getLL('newPageContent')); $content[$key].= '<img src="clear.gif" width="1" height="5" alt="" /><br />'.$theNewButton; } // Traverse any selected elements and render their display code: $rowArr = $this->getResult($result); foreach($rowArr as $rKey => $row) { t3lib_BEfunc::workspaceOL('tt_content', $row); if ((int)$row['t3ver_state']!=2) { $singleElementHTML = ''; if (!$lP) $defLanguageCount[$key][] = $row['uid']; $editUidList.= $row['uid'].','; $singleElementHTML.= $this->tt_content_drawHeader($row,$this->tt_contentConfig['showInfo']?15:5, $this->defLangBinding && $lP>0, TRUE); $isRTE = $RTE && $this->isRTEforField('tt_content',$row,'bodytext'); $singleElementHTML.= '<div '.($row['_ORIG_uid'] ? ' class="ver-element"' :'').'>'.$this->tt_content_drawItem($row,$isRTE).'</div>'; if ($this->defLangBinding && $this->tt_contentConfig['languageMode']) { $defLangBinding[$key][$lP][$row[($lP ? 'l18n_parent' : 'uid')]] = $singleElementHTML; } else { $content[$key].= $singleElementHTML; } } else { unset($rowArr[$rKey]); } } // Add new-icon link, header: $newP = $this->newContentElementOnClick($id,$key,$lP); $head[$key].= $this->tt_content_drawColHeader(t3lib_BEfunc::getProcessedValue('tt_content','colPos',$key), ($this->doEdit&&count($rowArr)?'&edit[tt_content]['.$editUidList.']=edit'.$pageTitleParamForAltDoc:''), $newP); $editUidList = ''; } // For EACH column, fit the rendered content into a table cell: $out=''; foreach($cList as $k => $key) { if (!$k) { $out.= ' <td><img src="clear.gif" width="'.$lMarg.'" height="1" alt="" /></td>'; } else { $out.= ' <td><img src="clear.gif" width="4" height="1" alt="" /></td> <td bgcolor="black"><img src="clear.gif" width="1" height="1" alt="" /></td> <td><img src="clear.gif" width="4" height="1" alt="" /></td>'; } $out.= ' <td valign="top">'.$head[$key].$content[$key].'</td>'; // Storing content for use if languageMode is set: if ($this->tt_contentConfig['languageMode']) { $languageColumn[$key][$lP] = $head[$key].$content[$key]; if (!$this->defLangBinding) { $languageColumn[$key][$lP].='<br /><br />'.$this->newLanguageButton($this->getNonTranslatedTTcontentUids($defLanguageCount[$key],$id,$lP),$lP); } } } // Wrap the cells into a table row: $out = ' <table border="0" cellpadding="0" cellspacing="0" width="480" class="typo3-page-cols"> <tr>'.$out.' </tr> </table>'; // CSH: $out.= t3lib_BEfunc::cshItem($this->descrTable,'columns_multi',$GLOBALS['BACK_PATH']); } // If language mode, then make another presentation: // Notice that THIS presentation will override the value of $out! But it needs the code above to execute since $languageColumn is filled with content we need! if ($this->tt_contentConfig['languageMode']) { // Get language selector: $languageSelector = $this->languageSelector($id); // Reset out - we will make new content here: $out=''; // Separator between language columns (black thin line) $midSep = ' <td><img src="clear.gif" width="4" height="1" alt="" /></td> <td bgcolor="black"><img src="clear.gif" width="1" height="1" alt="" /></td> <td><img src="clear.gif" width="4" height="1" alt="" /></td>'; // Traverse languages found on the page and build up the table displaying them side by side: $cCont=array(); $sCont=array(); foreach($langListArr as $lP) { // Header: $cCont[$lP]=' <td valign="top" align="center" class="bgColor6"><strong>'.htmlspecialchars($this->tt_contentConfig['languageCols'][$lP]).'</strong></td>'; // "View page" icon is added: $viewLink = '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($this->id,$this->backPath,t3lib_BEfunc::BEgetRootLine($this->id),'','','&L='.$lP)).'">'. '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/zoom.gif','width="12" height="12"').' class="absmiddle" title="" alt="" />'. '</a>'; // Language overlay page header: if ($lP) { list($lpRecord) = t3lib_BEfunc::getRecordsByField('pages_language_overlay','pid',$id,'AND sys_language_uid='.intval($lP)); t3lib_BEfunc::workspaceOL('pages_language_overlay',$lpRecord); $params='&edit[pages_language_overlay]['.$lpRecord['uid'].']=edit&overrideVals[pages_language_overlay][sys_language_uid]='.$lP; $lPLabel = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon(t3lib_iconWorks::getIconImage('pages_language_overlay',$lpRecord,$this->backPath,' class="absmiddle"'),'pages_language_overlay',$lpRecord['uid']). $viewLink. ($GLOBALS['BE_USER']->check('tables_modify','pages_language_overlay') ? '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath)).'">'. '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL('edit',1).'" class="absmiddle" alt="" />'. '</a>' : ''). htmlspecialchars(t3lib_div::fixed_lgd_cs($lpRecord['title'],20)); } else { $lPLabel = $viewLink; } $sCont[$lP]=' <td nowrap="nowrap">'.$lPLabel.'</td>'; } // Add headers: $out.=' <tr>'.implode($midSep,$cCont).' </tr>'; $out.=' <tr>'.implode($midSep,$sCont).' </tr>'; // Traverse previously built content for the columns: foreach($languageColumn as $cKey => $cCont) { $out.=' <tr> <td valign="top">'.implode('</td>'.$midSep.' <td valign="top">',$cCont).'</td> </tr>'; if ($this->defLangBinding) { // "defLangBinding" mode foreach($defLanguageCount[$cKey] as $defUid) { $cCont=array(); foreach($langListArr as $lP) { $cCont[] = $defLangBinding[$cKey][$lP][$defUid]. '<br/>'.$this->newLanguageButton($this->getNonTranslatedTTcontentUids(array($defUid),$id,$lP),$lP); } $out.=' <tr> <td valign="top">'.implode('</td>'.$midSep.' <td valign="top">',$cCont).'</td> </tr>'; } // Create spacer: $cCont=array(); foreach($langListArr as $lP) { $cCont[] = ' '; } $out.=' <tr> <td valign="top">'.implode('</td>'.$midSep.' <td valign="top">',$cCont).'</td> </tr>'; } } // Finally, wrap it all in a table and add the language selector on top of it: $out = $languageSelector.' <table border="0" cellpadding="0" cellspacing="0" width="480" class="typo3-page-langMode"> '.$out.' </table>'; // CSH: $out.= t3lib_BEfunc::cshItem($this->descrTable,'language_list',$GLOBALS['BACK_PATH']); } } else { // SINGLE column mode (columns shown beneath each other):#debug('single column'); if ($this->tt_contentConfig['sys_language_uid']==0 || !$this->defLangBinding) { // Initialize: if ($this->defLangBinding && $this->tt_contentConfig['sys_language_uid']==0) { $showLanguage = ' AND sys_language_uid IN (0,-1)'; $lP = 0; } else { $showLanguage = ' AND sys_language_uid='.$this->tt_contentConfig['sys_language_uid']; $lP = $this->tt_contentConfig['sys_language_uid']; } $cList = explode(',',$this->tt_contentConfig['showSingleCol']); $content=array(); $out=''; // Expand the table to some preset dimensions: $out.=' <tr> <td><img src="clear.gif" width="'.$lMarg.'" height="1" alt="" /></td> <td valign="top"><img src="clear.gif" width="150" height="1" alt="" /></td> <td><img src="clear.gif" width="10" height="1" alt="" /></td> <td valign="top"><img src="clear.gif" width="300" height="1" alt="" /></td> </tr>'; // Traverse columns to display top-on-top while(list($counter,$key)=each($cList)) { // Select content elements: $queryParts = $this->makeQueryArray('tt_content', $id, 'AND colPos='.intval($key).$showHidden.$showLanguage); $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts); $c = 0; $rowArr = $this->getResult($result); $rowOut = ''; // If it turns out that there are not content elements in the column, then display a big button which links directly to the wizard script: if ($this->doEdit && $this->option_showBigButtons && !intval($key) && !$GLOBALS['TYPO3_DB']->sql_num_rows($result)) { $onClick="window.location.href='db_new_content_el.php?id=".$id.'&colPos='.intval($key).'&sys_language_uid='.$lP.'&uid_pid='.$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';"; $theNewButton=$GLOBALS['SOBE']->doc->t3Button($onClick,$GLOBALS['LANG']->getLL('newPageContent')); $theNewButton='<img src="clear.gif" width="1" height="5" alt="" /><br />'.$theNewButton; } else $theNewButton=''; // Traverse any selected elements: foreach($rowArr as $rKey => $row) { t3lib_BEfunc::workspaceOL('tt_content', $row); if ((int)$row['t3ver_state']!=2) { $c++; $editUidList.=$row['uid'].','; $isRTE=$RTE && $this->isRTEforField('tt_content',$row,'bodytext'); // Create row output: $rowOut.=' <tr> <td></td> <td valign="top">'.$this->tt_content_drawHeader($row).'</td> <td> </td> <td'.($row['_ORIG_uid'] ? ' class="ver-element"' :'').' valign="top">'.$this->tt_content_drawItem($row,$isRTE).'</td> </tr>'; // If the element was not the last element, add a divider line: if ($c != $GLOBALS['TYPO3_DB']->sql_num_rows($result)) { $rowOut.=' <tr> <td></td> <td colspan="3"><img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/stiblet_medium2.gif','width="468" height="1"').' class="c-divider" alt="" /></td> </tr>'; } } else { unset($rowArr[$rKey]); } } // Add spacer between sections in the vertical list if ($counter) { $out.=' <tr> <td></td> <td colspan="3"><br /><br /><br /><br /></td> </tr>'; } // Add section header: $newP = $this->newContentElementOnClick($id,$key,$this->tt_contentConfig['sys_language_uid']); $out.=' <!-- Column header: --> <tr> <td></td> <td valign="top" colspan="3">'. $this->tt_content_drawColHeader(t3lib_BEfunc::getProcessedValue('tt_content','colPos',$key), ($this->doEdit&&count($rowArr)?'&edit[tt_content]['.$editUidList.']=edit'.$pageTitleParamForAltDoc:''), $newP). $theNewButton. '<br /></td> </tr>'; // Finally, add the content from the records in this column: $out.=$rowOut; } // Finally, wrap all table rows in one, big table: $out = ' <table border="0" cellpadding="0" cellspacing="0" width="400" class="typo3-page-columnsMode"> '.$out.'
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -