📄 db_layout.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!***************************************************************//** * Module: Web>Page * * This module lets you view a page in a more Content Management like style than the ordinary record-list * * $Id: db_layout.php 2154 2007-02-27 08:50:30Z ingorenner $ * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj * XHTML compliant * * @author Kasper Skaarhoj <kasperYYYY@typo3.com> *//** * [CLASS/FUNCTION INDEX of SCRIPT] * * * * 106: class ext_posMap extends t3lib_positionMap * 117: function wrapRecordTitle($str,$row) * 130: function wrapColumnHeader($str,$vv) * 144: function onClickInsertRecord($row,$vv,$moveUid,$pid) * 160: function wrapRecordHeader($str,$row) * * * 181: class SC_db_layout * 230: function init() * 283: function menuConfig() * 372: function clearCache() * 387: function main() * 489: function renderQuickEdit() * 886: function renderListContent() * 1165: function printContent() * * SECTION: Other functions * 1192: function getNumberOfHiddenElements() * 1205: function local_linkThisScript($params) * 1217: function exec_languageQuery($id) * * TOTAL FUNCTIONS: 14 * (This index is automatically created/updated by the extension "extdeveval") * */unset($MCONF);require('conf.php');require($BACK_PATH.'init.php');require($BACK_PATH.'template.php');$LANG->includeLLFile('EXT:cms/layout/locallang.xml');require_once(PATH_t3lib.'class.t3lib_pagetree.php');require_once(PATH_t3lib.'class.t3lib_page.php');require_once(PATH_t3lib.'class.t3lib_recordlist.php');require_once(PATH_typo3.'class.db_list.inc');require_once('class.tx_cms_layout.php');require_once(PATH_t3lib.'class.t3lib_positionmap.php');$BE_USER->modAccess($MCONF,1);// Will open up records locked by current user. It's assumed that the locking should end if this script is hit.t3lib_BEfunc::lockRecords();// Exits if 'cms' extension is not loaded:t3lib_extMgm::isLoaded('cms',1);/** * Local extension of position map class * * @author Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage core */class ext_posMap extends t3lib_positionMap { var $dontPrintPageInsertIcons = 1; var $l_insertNewRecordHere='newContentElement'; /** * Wrapping the title of the record. * * @param string The title value. * @param array The record row. * @return string Wrapped title string. */ function wrapRecordTitle($str,$row) { $aOnClick = 'jumpToUrl(\''.$GLOBALS['SOBE']->local_linkThisScript(array('edit_record'=>'tt_content:'.$row['uid'])).'\');return false;'; return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$str.'</a>'; } /** * Wrapping the column header * * @param string Header value * @param string Column info. * @return string * @see printRecordMap() */ function wrapColumnHeader($str,$vv) { $aOnClick = 'jumpToUrl(\''.$GLOBALS['SOBE']->local_linkThisScript(array('edit_record'=>'_EDIT_COL:'.$vv)).'\');return false;'; return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$str.'</a>'; } /** * Create on-click event value. * * @param array The record. * @param string Column position value. * @param integer Move uid * @param integer PID value. * @return string */ function onClickInsertRecord($row,$vv,$moveUid,$pid) { if (is_array($row)) { $location=$GLOBALS['SOBE']->local_linkThisScript(array('edit_record'=>'tt_content:new/-'.$row['uid'].'/'.$row['colPos'])); } else { $location=$GLOBALS['SOBE']->local_linkThisScript(array('edit_record'=>'tt_content:new/'.$pid.'/'.$vv)); } return 'jumpToUrl(\''.$location.'\');return false;'; } /** * Wrapping the record header (from getRecordHeader()) * * @param string HTML content * @param array Record array. * @return string HTML content */ function wrapRecordHeader($str,$row) { if ($row['uid']==$this->moveUid) { return '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'],'gfx/content_client.gif','width="7" height="10"').' alt="" />'.$str; } else return $str; }}/** * Script Class for Web > Layout module * * @author Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage core */class SC_db_layout { // Internal, GPvars: var $id; // Page Id for which to make the listing var $pointer; // Pointer - for browsing list of records. var $imagemode; // Thumbnails or not var $search_field; // Search-fields var $search_levels; // Search-levels var $showLimit; // Show-limit var $returnUrl; // Return URL var $clear_cache; // Clear-cache flag - if set, clears page cache for current id. var $popView; // PopView id - for opening a window with the page var $edit_record; // QuickEdit: Variable, that tells quick edit what to show/edit etc. Format is [tablename]:[uid] with some exceptional values for both parameters (with special meanings). var $new_unique_uid; // QuickEdit: If set, this variable tells quick edit that the last edited record had this value as UID and we should look up the new, real uid value in sys_log. // Internal, static: var $perms_clause; // Page select perms clause var $modTSconfig; // Module TSconfig var $pageinfo; // Current ids page record var $doc; // Document template object var $backPath; // Back path of the module var $descrTable; // "Pseudo" Description -table name var $colPosList; // List of column-integers to edit. Is set from TSconfig, default is "1,0,2,3" var $EDIT_CONTENT; // Flag: If content can be edited or not. var $CALC_PERMS; // Users permissions integer for this page. var $current_sys_language; // Currently selected language for editing content elements var $MCONF=array(); // Module configuration var $MOD_MENU=array(); // Menu configuration var $MOD_SETTINGS=array(); // Module settings (session variable) var $include_once=array(); // Array, where files to include is accumulated in the init() function // Internal, dynamic: var $content; // Module output accumulation var $topFuncMenu; // Function menu temporary storage var $editIcon; // Temporary storage for page edit icon /** * Initializing the module * * @return void */ function init() { global $BE_USER; // Setting module configuration / page select clause $this->MCONF = $GLOBALS['MCONF']; $this->perms_clause = $BE_USER->getPagePermsClause(1); $this->backPath = $GLOBALS['BACK_PATH']; // GPvars: $this->id = intval(t3lib_div::_GP('id')); $this->pointer = t3lib_div::_GP('pointer'); $this->imagemode = t3lib_div::_GP('imagemode'); $this->clear_cache = t3lib_div::_GP('clear_cache'); $this->popView = t3lib_div::_GP('popView'); $this->edit_record = t3lib_div::_GP('edit_record'); $this->new_unique_uid = t3lib_div::_GP('new_unique_uid'); $this->search_field = t3lib_div::_GP('search_field'); $this->search_levels = t3lib_div::_GP('search_levels'); $this->showLimit = t3lib_div::_GP('showLimit'); $this->returnUrl = t3lib_div::_GP('returnUrl'); // Load page info array: $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id,$this->perms_clause); // Initialize menu $this->menuConfig(); // Setting sys language from session var: $this->current_sys_language=intval($this->MOD_SETTINGS['language']); // Include scripts: QuickEdit if ($this->MOD_SETTINGS['function']==0) { $this->include_once[]=PATH_t3lib.'class.t3lib_tceforms.php'; $this->include_once[]=PATH_t3lib.'class.t3lib_clipboard.php'; $this->include_once[]=PATH_t3lib.'class.t3lib_loaddbgroup.php'; $this->include_once[]=PATH_t3lib.'class.t3lib_transferdata.php'; } // Include scripts: Clear-cache cmd. if ($this->clear_cache) { $this->include_once[]=PATH_t3lib.'class.t3lib_tcemain.php'; } // CSH / Descriptions: $this->descrTable = '_MOD_'.$this->MCONF['name']; } /** * Initialize menu array * * @return void */ function menuConfig() { global $BE_USER,$LANG,$TYPO3_CONF_VARS; // MENU-ITEMS: $this->MOD_MENU = array( 'tt_board' => array( 0 => $LANG->getLL('m_tt_board_0'), 'expand' => $LANG->getLL('m_tt_board_expand') ), 'tt_address' => array( 0 => $LANG->getLL('m_tt_address_0'), 1 => $LANG->getLL('m_tt_address_1'), 2 => $LANG->getLL('m_tt_address_2') ), 'tt_links' => array( 0 => $LANG->getLL('m_default'), 1 => $LANG->getLL('m_tt_links_1'), 2 => $LANG->getLL('m_tt_links_2') ), 'tt_calender' => array ( 0 => $LANG->getLL('m_default'), 'date' => $LANG->getLL('m_tt_calender_date'), 'date_ext' => $LANG->getLL('m_tt_calender_date_ext'), 'todo' => $LANG->getLL('m_tt_calender_todo'), 'todo_ext' => $LANG->getLL('m_tt_calender_todo_ext') ), 'tt_products' => array ( 0 => $LANG->getLL('m_default'), 'ext' => $LANG->getLL('m_tt_products_ext') ), 'tt_content_showHidden' => '', 'showPalettes' => '', 'showDescriptions' => '', 'disableRTE' => '', 'function' => array(
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -