⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class.tx_rtehtmlarea_browse_links.php

📁 Typo3, 开源里边最强大的
💻 PHP
📖 第 1 页 / 共 3 页
字号:
<?php/****************************************************************  Copyright notice**  (c) 1999-2004 Kasper Skaarhoj (kasperYYYY@typo3.com)*  (c) 2005-2006 Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca>*  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!***************************************************************//** * Displays the page/file tree for browsing database records or files. * Used from TCEFORMS an other elements * In other words: This is the ELEMENT BROWSER! * * Adapted for htmlArea RTE by Stanislas Rolland * * $Id: class.tx_rtehtmlarea_browse_links.php 1676 2006-08-15 04:51:33Z stanrolland $ * * @author	Kasper Skaarhoj <kasperYYYY@typo3.com> * @author	Stanislas Rolland <stanislas.rolland(arobas)fructifor.ca> */require_once (PATH_typo3.'class.browse_links.php');require_once (PATH_t3lib.'class.t3lib_basicfilefunc.php');/** * Class which generates the page tree * * @author	Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage core */class tx_rtehtmlarea_pageTree extends rtePageTree {		/**	 * Create the page navigation tree in HTML	 *	 * @param	array		Tree array	 * @return	string		HTML output.	 */	function printTree($treeArr='')	{		global $BACK_PATH;		$titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);		if (!is_array($treeArr))	$treeArr=$this->tree;		$out='';		$c=0;		foreach($treeArr as $k => $v)	{			$c++;			$bgColorClass = ($c+1)%2 ? 'bgColor' : 'bgColor-10';			if ($GLOBALS['SOBE']->browser->curUrlInfo['act']=='page' && $GLOBALS['SOBE']->browser->curUrlInfo['pageid']==$v['row']['uid'] && $GLOBALS['SOBE']->browser->curUrlInfo['pageid'])	{				$arrCol='<td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" /></td>';				$bgColorClass='bgColor4';			} else {				$arrCol='<td></td>';			}			$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&editorNo='.$GLOBALS['SOBE']->browser->editorNo.'&contentTypo3Language='.$GLOBALS['SOBE']->browser->contentTypo3Language.'&contentTypo3Charset='.$GLOBALS['SOBE']->browser->contentTypo3Charset.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandPage='.$v['row']['uid'].'\');';			$cEbullet = $this->ext_isLinkable($v['row']['doktype'],$v['row']['uid']) ?						'<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/arrowbullet.gif','width="18" height="16"').' alt="" /></a>' :						'';			$out.='				<tr class="'.$bgColorClass.'">					<td nowrap="nowrap"'.($v['row']['_CSSCLASS'] ? ' class="'.$v['row']['_CSSCLASS'].'"' : '').'>'.					$v['HTML'].					$this->wrapTitle($this->getTitleStr($v['row'],$titleLen),$v['row'],$this->ext_pArrPages).					'</td>'.					$arrCol.					'<td>'.$cEbullet.'</td>				</tr>';		}		$out='			<!--				Navigation Page Tree:			-->			<table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">				'.$out.'			</table>';		return $out;	}}/** * Base extension class which generates the folder tree. * Used directly by the RTE. * * @author	Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage core */class tx_rtehtmlarea_folderTree extends rteFolderTree {		/**	 * Wrapping the title in a link, if applicable.	 *	 * @param	string		Title, ready for output.	 * @param	array		The "record"	 * @return	string		Wrapping title string.	 */	function wrapTitle($title,$v)	{		if ($this->ext_isLinkable($v))	{			$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&editorNo='.$GLOBALS['SOBE']->browser->editorNo.'&contentTypo3Language='.$GLOBALS['SOBE']->browser->contentTypo3Language.'&contentTypo3Charset='.$GLOBALS['SOBE']->browser->contentTypo3Charset.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['path']).'\');';			return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$title.'</a>';		} else {			return '<span class="typo3-dimmed">'.$title.'</span>';		}	}		/**	 * Create the folder navigation tree in HTML	 *	 * @param	mixed		Input tree array. If not array, then $this->tree is used.	 * @return	string		HTML output of the tree.	 */	function printTree($treeArr='')	{		global $BACK_PATH;		$titleLen=intval($GLOBALS['BE_USER']->uc['titleLen']);		if (!is_array($treeArr))	$treeArr=$this->tree;		$out='';		$c=0;			// Preparing the current-path string (if found in the listing we will see a red blinking arrow).		if (!$GLOBALS['SOBE']->browser->curUrlInfo['value'])	{			$cmpPath='';		} else if (substr(trim($GLOBALS['SOBE']->browser->curUrlInfo['info']),-1)!='/')	{			$cmpPath=PATH_site.dirname($GLOBALS['SOBE']->browser->curUrlInfo['info']).'/';		} else {			$cmpPath=PATH_site.$GLOBALS['SOBE']->browser->curUrlInfo['info'];		}			// Traverse rows for the tree and print them into table rows:		foreach($treeArr as $k => $v)	{			$c++;			$bgColorClass=($c+1)%2 ? 'bgColor' : 'bgColor-10';				// Creating blinking arrow, if applicable:			if ($GLOBALS['SOBE']->browser->curUrlInfo['act']=='file' && $cmpPath==$v['row']['path'])	{				$arrCol='<td><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/blinkarrow_right.gif','width="5" height="9"').' class="c-blinkArrowR" alt="" /></td>';				$bgColorClass='bgColor4';			} else {				$arrCol='<td></td>';			}				// Create arrow-bullet for file listing (if folder path is linkable):			$aOnClick = 'return jumpToUrl(\''.$this->thisScript.'?act='.$GLOBALS['SOBE']->browser->act.'&editorNo='.$GLOBALS['SOBE']->browser->editorNo.'&contentTypo3Language='.$GLOBALS['SOBE']->browser->contentTypo3Language.'&contentTypo3Charset='.$GLOBALS['SOBE']->browser->contentTypo3Charset.'&mode='.$GLOBALS['SOBE']->browser->mode.'&expandFolder='.rawurlencode($v['row']['path']).'\');';			$cEbullet = $this->ext_isLinkable($v['row']) ? '<a href="#" onclick="'.htmlspecialchars($aOnClick).'"><img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/ol/arrowbullet.gif','width="18" height="16"').' alt="" /></a>' : '';				// Put table row with folder together:			$out.='				<tr class="'.$bgColorClass.'">					<td nowrap="nowrap">'.$v['HTML'].$this->wrapTitle(t3lib_div::fixed_lgd_cs($v['row']['title'],$titleLen),$v['row']).'</td>					'.$arrCol.'					<td>'.$cEbullet.'</td>				</tr>';		}		$out='			<!--				Folder tree:			-->			<table border="0" cellpadding="0" cellspacing="0" id="typo3-tree">				'.$out.'			</table>';		return $out;	}}/** * Script class for the Element Browser window. * * @author	Kasper Skaarhoj <kasperYYYY@typo3.com> * @package TYPO3 * @subpackage core */class tx_rtehtmlarea_browse_links extends browse_links {		// Internal, static:	var $setTarget;			// Target (RTE specific)	var $setClass;			// Class (RTE specific)	var $setTitle;			// Title (RTE specific)		var $contentTypo3Language;	var $contentTypo3Charset;		var $editorNo;	var $buttonConfig = array();		/**	 * Constructor:	 * Initializes a lot of variables, setting JavaScript functions in header etc.	 *	 * @return	void	 */	function init()	{		global $BE_USER,$BACK_PATH,$LANG;			// Main GPvars:		$this->pointer = t3lib_div::_GP('pointer');		$this->bparams = t3lib_div::_GP('bparams');		$this->P = t3lib_div::_GP('P');		$this->RTEtsConfigParams = t3lib_div::_GP('RTEtsConfigParams');		$this->expandPage = t3lib_div::_GP('expandPage');		$this->expandFolder = t3lib_div::_GP('expandFolder');		$this->PM = t3lib_div::_GP('PM');		$this->contentTypo3Language = t3lib_div::_GP('typo3ContentLanguage');		$this->contentTypo3Charset = t3lib_div::_GP('typo3ContentCharset');		$this->editorNo = t3lib_div::_GP('editorNo');					// Find "mode"		$this->mode=t3lib_div::_GP('mode');		if (!$this->mode)	{			$this->mode='rte';		}					// Site URL		$this->siteURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL');	// Current site url					// the script to link to		$this->thisScript = t3lib_div::getIndpEnv('SCRIPT_NAME');					// CurrentUrl - the current link url must be passed around if it exists		if ($this->mode=='wizard')	{			$currentLinkParts = t3lib_div::trimExplode(' ',$this->P['currentValue']);			$this->curUrlArray = array(				'target' => $currentLinkParts[1]			);			$this->curUrlInfo=$this->parseCurUrl($this->siteURL.'?id='.$currentLinkParts[0],$this->siteURL);		} else {			$this->curUrlArray = t3lib_div::_GP('curUrl');			if ($this->curUrlArray['all'])	{				$this->curUrlArray=t3lib_div::get_tag_attributes($this->curUrlArray['all']);			}			$this->curUrlInfo=$this->parseCurUrl($this->curUrlArray['href'],$this->siteURL);		}			// Determine nature of current url:		$this->act=t3lib_div::_GP('act');		if (!$this->act)	{			$this->act=$this->curUrlInfo['act'];		}			// Initializing the titlevalue		$this->setTitle = $LANG->csConvObj->conv($this->curUrlArray['title'], 'utf-8', $LANG->charSet);			// Rich Text Editor specific configuration:		$addPassOnParams='';		if ((string)$this->mode=='rte')	{			$RTEtsConfigParts = explode(':',$this->RTEtsConfigParams);			$addPassOnParams .= '&RTEtsConfigParams='.rawurlencode($this->RTEtsConfigParams);			$addPassOnParams .= ($this->contentTypo3Language ? '&typo3ContentLanguage=' . rawurlencode($this->contentTypo3Language) : '');			$addPassOnParams .= ($this->contentTypo3Charset ? '&typo3ContentCharset=' . rawurlencode($this->contentTypo3Charset) : '');			$RTEsetup = $BE_USER->getTSConfig('RTE',t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));			$this->thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'],$RTEtsConfigParts[0],$RTEtsConfigParts[2],$RTEtsConfigParts[4]);			if (is_array($this->thisConfig['buttons.']) && is_array($this->thisConfig['buttons.']['link.'])) {				$this->buttonConfig = $this->thisConfig['buttons.']['link.'];			}			if($this->thisConfig['classesAnchor']) {				$this->setClass = $this->curUrlArray['class'];				$classesAnchorArray = t3lib_div::trimExplode(',',$this->thisConfig['classesAnchor'],1);				$anchorTypes = array( 'page', 'url', 'file', 'mail', 'spec');				$classesAnchor = array();				$classesAnchorDefault = array();				$this->classesAnchorDefaultTitle = array();				$classesAnchor['all'] = array();				if (is_array($RTEsetup['properties']['classesAnchor.'])) {					reset($RTEsetup['properties']['classesAnchor.']);					while(list($label,$conf)=each($RTEsetup['properties']['classesAnchor.'])) {						$classesAnchor['all'][] = $conf['class'];						if (in_array($conf['type'], $anchorTypes)) {							$classesAnchor[$conf['type']][] = $conf['class'];							if (is_array($this->thisConfig['classesAnchor.']) && is_array($this->thisConfig['classesAnchor.']['default.']) && $this->thisConfig['classesAnchor.']['default.'][$conf['type']] == $conf['class']) {								$classesAnchorDefault[$conf['type']] = $conf['class'];								if ($conf['titleText']) {									$string = trim($conf['titleText']);									if (substr($string,0,4)=='LLL:') {       // language file										$arr = explode(':',$string);										if($arr[0] == 'LLL' && $arr[1] == 'EXT') {											$BE_lang = $LANG->lang;											$BE_origCharset = $LANG->origCharSet;											$LANG->lang = $this->contentTypo3Language;											$LANG->origCharSet = $LANG->csConvObj->charSetArray[$this->contentTypo3Language];											$LANG->origCharSet = $LANG->origCharSet ? $LANG->origCharSet : 'iso-8859-1';											$string = $LANG->getLLL($arr[3], $LANG->readLLfile($arr[1].':'.$arr[2]), true);											$LANG->lang = $BE_lang;											$LANG->origCharSet = $BE_origCharset;										}									}									$this->classesAnchorDefaultTitle[$conf['type']] = $string;								}							}						}					}				}				$this->classesAnchorJSOptions = array();				reset($anchorTypes);				while (list(, $anchorType) = each($anchorTypes) ) {					reset($classesAnchorArray);					while(list(,$class)=each($classesAnchorArray)) {						if (!in_array($class, $classesAnchor['all']) || (in_array($class, $classesAnchor['all']) && is_array($classesAnchor[$anchorType]) && in_array($class, $classesAnchor[$anchorType]))) {							$selected = '';							if ($this->setClass == $class) $selected = 'selected="selected"';							if (!$this->setClass && $classesAnchorDefault[$anchorType] == $class) {								$selected = 'selected="selected"';							}							$this->classesAnchorJSOptions[$anchorType] .= '<option ' . $selected . ' value="' .$class . '">' . $class . '</option>';						}					}					if ($this->classesAnchorJSOptions[$anchorType]) {						$selected = '';						if (!$this->setClass && !$classesAnchorDefault[$anchorType])  $selected = 'selected="selected"';						$this->classesAnchorJSOptions[$anchorType] =  '<option ' . $selected . ' value=""></option>' . $this->classesAnchorJSOptions[$anchorType];					}				}			}		}			// Initializing the target value (RTE)		$this->setTarget = $this->curUrlArray['target'];		if ($this->thisConfig['defaultLinkTarget'] && !isset($this->curUrlArray['target']))	{			$this->setTarget=$this->thisConfig['defaultLinkTarget'];		}			// Creating backend template object:		$this->doc = t3lib_div::makeInstance('template');		$this->doc->docType= 'xhtml_trans';		$this->doc->backPath = $BACK_PATH;			// BEGIN accumulation of header JavaScript:		$JScode = '';		$JScode.= '

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -