📄 class.tx_cms_webinfo_lang.php
字号:
<?php/**************************************************************** Copyright notice** (c) 1999-2005 Kasper Skaarhoj (kasperYYYY@typo3.com)* All rights reserved** This script is part of the TYPO3 project. The TYPO3 project is* free software; you can redistribute it and/or modify* it under the terms of the GNU General Public License as published by* the Free Software Foundation; either version 2 of the License, or* (at your option) any later version.** The GNU General Public License can be found at* http://www.gnu.org/copyleft/gpl.html.* A copy is found in the textfile GPL.txt and important notices to the license* from the author is found in LICENSE.txt distributed with these scripts.*** This script is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the* GNU General Public License for more details.** This copyright notice MUST APPEAR in all copies of the script!***************************************************************//** * Contains a class with functions for page related overview of translations. * * $Id: class.tx_cms_webinfo_lang.php 1997 2007-02-05 18:24:44Z ingmars $ * * @author Kasper Skaarhoj <kasperYYYY@typo3.com> *//** * [CLASS/FUNCTION INDEX of SCRIPT] * * * * 66: class tx_cms_webinfo_lang extends t3lib_extobjbase * 73: function modMenu() * 102: function main() * 171: function renderL10nTable(&$tree) * 342: function getSystemLanguages() * 364: function getLangStatus($pageId, $langId) * 393: function getLocalizedElementInfo($pageId,$sysLang) * 471: function getContentElementCount($pageId,$sysLang) * * TOTAL FUNCTIONS: 7 * (This index is automatically created/updated by the extension "extdeveval") * */require_once(PATH_t3lib.'class.t3lib_pagetree.php');require_once(PATH_t3lib.'class.t3lib_extobjbase.php');/** * Class for displaying translation status of pages in the tree. * * @author Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage tx_cms */class tx_cms_webinfo_lang extends t3lib_extobjbase { /** * Returns the menu array * * @return array */ function modMenu() { global $LANG; $menuArray = array ( 'depth' => array( 0 => $LANG->getLL('depth_0'), 1 => $LANG->getLL('depth_1'), 2 => $LANG->getLL('depth_2'), 3 => $LANG->getLL('depth_3') ), ); // Languages: $lang = $this->getSystemLanguages(); $menuArray['lang']=array( 0 => '[All]' ); foreach($lang as $langRec) { $menuArray['lang'][$langRec['uid']] = $langRec['title']; } return $menuArray; } /** * MAIN function for page information of localization * * @return string Output HTML for the module. */ function main() { global $BACK_PATH,$LANG,$SOBE; if ($this->pObj->id) { $theOutput = ''; // Depth selector: $h_func = t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[depth]',$this->pObj->MOD_SETTINGS['depth'],$this->pObj->MOD_MENU['depth'],'index.php'); $h_func.= t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[lang]',$this->pObj->MOD_SETTINGS['lang'],$this->pObj->MOD_MENU['lang'],'index.php'); $theOutput.= $h_func; // Add CSH: $theOutput.= t3lib_BEfunc::cshItem('_MOD_web_info','lang',$GLOBALS['BACK_PATH'],'|<br/>'); // Showing the tree: // Initialize starting point of page tree: $treeStartingPoint = intval($this->pObj->id); $treeStartingRecord = t3lib_BEfunc::getRecordWSOL('pages', $treeStartingPoint); $depth = $this->pObj->MOD_SETTINGS['depth']; // Initialize tree object: $tree = t3lib_div::makeInstance('t3lib_pageTree'); $tree->init('AND '.$GLOBALS['BE_USER']->getPagePermsClause(1)); $tree->addField('l18n_cfg'); // Creating top icon; the current page $HTML = t3lib_iconWorks::getIconImage('pages', $treeStartingRecord, $GLOBALS['BACK_PATH'],'align="top"'); $tree->tree[] = array( 'row' => $treeStartingRecord, 'HTML'=>$HTML ); // Create the tree from starting point: if ($depth) $tree->getTree($treeStartingPoint, $depth, ''); #debug($tree->tree); // Add CSS needed: $css_content = ' TABLE#langTable { margin-top: 10px; } TABLE#langTable TR TD { padding-left : 2px; padding-right : 2px; white-space: nowrap; } TD.c-blocked { background-color: red; } TD.c-ok { background-color: #669966; } TD.c-fallback { } TD.c-leftLine {border-left: 2px solid black; } .bgColor5 { font-weight: bold; } '; $marker = '/*###POSTCSSMARKER###*/'; $this->pObj->content = str_replace($marker,$css_content.chr(10).$marker,$this->pObj->content); // Render information table: $theOutput.= $this->renderL10nTable($tree); } return $theOutput; } /** * Rendering the localization information table. * * @param array The Page tree data * @return string HTML for the localization information table. */ function renderL10nTable(&$tree) { global $LANG; // System languages retrieved: $languages = $this->getSystemLanguages(); // Title length: $titleLen = $GLOBALS['BE_USER']->uc['titleLen']; // Put together the TREE: $output = ''; $newOL_js = array(); $langRecUids = array(); foreach($tree->tree as $data) { $tCells = array(); $langRecUids[0][] = $data['row']['uid']; // Page icons / titles etc. $tCells[] = '<td'.($data['row']['_CSSCLASS'] ? ' class="'.$data['row']['_CSSCLASS'].'"' : '').'>'. $data['HTML']. htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['title'],$titleLen)). (strcmp($data['row']['nav_title'],'') ? ' [Nav: <em>'.htmlspecialchars(t3lib_div::fixed_lgd_cs($data['row']['nav_title'],$titleLen)).'</em>]' : ''). '</td>'; // DEFAULT language: // "View page" link is created: $viewPageLink= '<a href="#" onclick="'. htmlspecialchars(t3lib_BEfunc::viewOnClick($data['row']['uid'],$GLOBALS['BACK_PATH'],'','','','&L=###LANG_UID###')).'">'. '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/zoom.gif','width="12" height="12"').' title="'.$LANG->getLL('lang_renderl10n_viewPage','1').'" border="0" alt="" />'. '</a>'; $status = $data['row']['l18n_cfg']&1 ? 'c-blocked' : 'c-ok'; // Create links: $info = ''; $editUid = $data['row']['uid']; $params = '&edit[pages]['.$editUid.']=edit';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -