本文整理汇总了PHP中t3lib_BEfunc::RTEsetup方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_BEfunc::RTEsetup方法的具体用法?PHP t3lib_BEfunc::RTEsetup怎么用?PHP t3lib_BEfunc::RTEsetup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_BEfunc
的用法示例。
在下文中一共展示了t3lib_BEfunc::RTEsetup方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkValue_flex_procInData_travDS
/**
* Processing of the sheet/language data array
* When it finds a field with a value the processing is done by ->checkValue_SW() by default but if a call back function name is given that method in this class will be called for the processing instead.
*
* @param array New values (those being processed): Multidimensional Data array for sheet/language, passed by reference!
* @param array Current values: Multidimensional Data array. May be empty array() if not needed (for callBackFunctions)
* @param array Uploaded files array for sheet/language. May be empty array() if not needed (for callBackFunctions)
* @param array Data structure which fits the data array
* @param array A set of parameters to pass through for the calling of the evaluation functions / call back function
* @param string Call back function, default is checkValue_SW(). If $this->callBackObj is set to an object, the callback function in that object is called instead.
* @param [type] $structurePath: ...
* @return void
* @see checkValue_flex_procInData()
*/
function checkValue_flex_procInData_travDS(&$dataValues, $dataValues_current, $uploadedFiles, $DSelements, $pParams, $callBackFunc, $structurePath)
{
if (is_array($DSelements)) {
// For each DS element:
foreach ($DSelements as $key => $dsConf) {
// Array/Section:
if ($DSelements[$key]['type'] == 'array') {
if (is_array($dataValues[$key]['el'])) {
if ($DSelements[$key]['section']) {
$newIndexCounter = 0;
foreach ($dataValues[$key]['el'] as $ik => $el) {
if (is_array($el)) {
if (!is_array($dataValues_current[$key]['el'])) {
$dataValues_current[$key]['el'] = array();
}
$theKey = key($el);
if (is_array($dataValues[$key]['el'][$ik][$theKey]['el'])) {
$this->checkValue_flex_procInData_travDS($dataValues[$key]['el'][$ik][$theKey]['el'], is_array($dataValues_current[$key]['el'][$ik]) ? $dataValues_current[$key]['el'][$ik][$theKey]['el'] : array(), $uploadedFiles[$key]['el'][$ik][$theKey]['el'], $DSelements[$key]['el'][$theKey]['el'], $pParams, $callBackFunc, $structurePath . $key . '/el/' . $ik . '/' . $theKey . '/el/');
// If element is added dynamically in the flexform of TCEforms, we map the ID-string to the next numerical index we can have in that particular section of elements:
// The fact that the order changes is not important since order is controlled by a separately submitted index.
if (substr($ik, 0, 3) == "ID-") {
$newIndexCounter++;
$this->newIndexMap[$ik] = (is_array($dataValues_current[$key]['el']) && count($dataValues_current[$key]['el']) ? max(array_keys($dataValues_current[$key]['el'])) : 0) + $newIndexCounter;
// Set mapping index
$dataValues[$key]['el'][$this->newIndexMap[$ik]] = $dataValues[$key]['el'][$ik];
// Transfer values
unset($dataValues[$key]['el'][$ik]);
// Unset original
}
}
}
}
} else {
if (!isset($dataValues[$key]['el'])) {
$dataValues[$key]['el'] = array();
}
$this->checkValue_flex_procInData_travDS($dataValues[$key]['el'], $dataValues_current[$key]['el'], $uploadedFiles[$key]['el'], $DSelements[$key]['el'], $pParams, $callBackFunc, $structurePath . $key . '/el/');
}
}
} else {
if (is_array($dsConf['TCEforms']['config']) && is_array($dataValues[$key])) {
foreach ($dataValues[$key] as $vKey => $data) {
if ($callBackFunc) {
if (is_object($this->callBackObj)) {
$res = $this->callBackObj->{$callBackFunc}($pParams, $dsConf['TCEforms']['config'], $dataValues[$key][$vKey], $dataValues_current[$key][$vKey], $uploadedFiles[$key][$vKey], $structurePath . $key . '/' . $vKey . '/');
} else {
$res = $this->{$callBackFunc}($pParams, $dsConf['TCEforms']['config'], $dataValues[$key][$vKey], $dataValues_current[$key][$vKey], $uploadedFiles[$key][$vKey], $structurePath . $key . '/' . $vKey . '/');
}
} else {
// Default
list($CVtable, $CVid, $CVcurValue, $CVstatus, $CVrealPid, $CVrecFID, $CVtscPID) = $pParams;
$res = $this->checkValue_SW(array(), $dataValues[$key][$vKey], $dsConf['TCEforms']['config'], $CVtable, $CVid, $dataValues_current[$key][$vKey], $CVstatus, $CVrealPid, $CVrecFID, '', $uploadedFiles[$key][$vKey], array(), $CVtscPID);
// Look for RTE transformation of field:
if ($dataValues[$key]['_TRANSFORM_' . $vKey] == 'RTE' && !$this->dontProcessTransformations) {
// Unsetting trigger field - we absolutely don't want that into the data storage!
unset($dataValues[$key]['_TRANSFORM_' . $vKey]);
if (isset($res['value'])) {
// Calculating/Retrieving some values here:
list(, , $recFieldName) = explode(':', $CVrecFID);
$theTypeString = t3lib_BEfunc::getTCAtypeValue($CVtable, $this->checkValue_currentRecord);
$specConf = t3lib_BEfunc::getSpecConfParts('', $dsConf['TCEforms']['defaultExtras']);
// Find, thisConfig:
$RTEsetup = $this->BE_USER->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($CVtscPID));
$thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'], $CVtable, $recFieldName, $theTypeString);
// Get RTE object, draw form and set flag:
$RTEobj = t3lib_BEfunc::RTEgetObj();
if (is_object($RTEobj)) {
$res['value'] = $RTEobj->transformContent('db', $res['value'], $CVtable, $recFieldName, $this->checkValue_currentRecord, $specConf, $thisConfig, '', $CVrealPid);
} else {
debug('NO RTE OBJECT FOUND!');
}
}
}
}
// Adding the value:
if (isset($res['value'])) {
$dataValues[$key][$vKey] = $res['value'];
}
// Finally, check if new and old values are different (or no .vDEFbase value is found) and if so, we record the vDEF value for diff'ing.
// We do this after $dataValues has been updated since I expect that $dataValues_current holds evaluated values from database (so this must be the right value to compare with).
if (substr($vKey, -9) != '.vDEFbase') {
if ($this->clear_flexFormData_vDEFbase) {
$dataValues[$key][$vKey . '.vDEFbase'] = '';
} elseif ($this->updateModeL10NdiffData && $GLOBALS['TYPO3_CONF_VARS']['BE']['flexFormXMLincludeDiffBase'] && $vKey !== 'vDEF' && (strcmp($dataValues[$key][$vKey], $dataValues_current[$key][$vKey]) || !isset($dataValues_current[$key][$vKey . '.vDEFbase']) || $this->updateModeL10NdiffData === 'FORCE_FFUPD')) {
// Now, check if a vDEF value is submitted in the input data, if so we expect this has been processed prior to this operation (normally the case since those fields are higher in the form) and we can use that:
if (isset($dataValues[$key]['vDEF'])) {
//.........这里部分代码省略.........
示例2: init
/**
* Constructor:
* Initializes a lot of variables, setting JavaScript functions in header etc.
*
* @return void
*/
function init()
{
global $BE_USER, $BACK_PATH, $LANG, $TYPO3_CONF_VARS;
// Main GPvars:
$this->siteUrl = t3lib_div::getIndpEnv('TYPO3_SITE_URL');
$this->act = t3lib_div::_GP('act');
$this->expandPage = t3lib_div::_GP('expandPage');
$this->expandFolder = t3lib_div::_GP('expandFolder');
$this->pointer = t3lib_div::_GP('pointer');
$this->P = t3lib_div::_GP('P');
$this->PM = t3lib_div::_GP('PM');
// Find RTE parameters
$this->bparams = t3lib_div::_GP('bparams');
$this->contentTypo3Language = t3lib_div::_GP('contentTypo3Language');
$this->contentTypo3Charset = t3lib_div::_GP('contentTypo3Charset');
$this->editorNo = t3lib_div::_GP('editorNo');
$this->RTEtsConfigParams = t3lib_div::_GP('RTEtsConfigParams');
$pArr = explode('|', $this->bparams);
$pRteArr = explode(':', $pArr[1]);
$this->editorNo = $this->editorNo ? $this->editorNo : $pRteArr[0];
$this->contentTypo3Language = $this->contentTypo3Language ? $this->contentTypo3Language : $pRteArr[1];
$this->contentTypo3Charset = $this->contentTypo3Charset ? $this->contentTypo3Charset : $pRteArr[2];
$this->RTEtsConfigParams = $this->RTEtsConfigParams ? $this->RTEtsConfigParams : $pArr[2];
// Find "mode"
$this->mode = t3lib_div::_GP('mode');
if (!$this->mode) {
$this->mode = 'rte';
}
// init fileProcessor
$this->fileProcessor = t3lib_div::makeInstance('t3lib_basicFileFunctions');
$this->fileProcessor->init($GLOBALS['FILEMOUNTS'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
// init hook objects:
$this->hookObjects = array();
if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.browse_links.php']['browseLinksHook'])) {
foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.browse_links.php']['browseLinksHook'] as $classData) {
$processObject = t3lib_div::getUserObj($classData);
if (!$processObject instanceof t3lib_browseLinksHook) {
throw new UnexpectedValueException('$processObject must implement interface t3lib_browseLinksHook', 1195115652);
}
$parameters = array();
$processObject->init($this, $parameters);
$this->hookObjects[] = $processObject;
}
}
// 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 = '';
$classSelected = array();
if ((string) $this->mode == 'rte') {
$RTEtsConfigParts = explode(':', $this->RTEtsConfigParams);
$addPassOnParams .= '&RTEtsConfigParams=' . rawurlencode($this->RTEtsConfigParams);
$addPassOnParams .= $this->contentTypo3Language ? '&contentTypo3Language=' . rawurlencode($this->contentTypo3Language) : '';
$addPassOnParams .= $this->contentTypo3Charset ? '&contentTypo3Charset=' . 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->thisConfig['classesLinks']) {
$this->setClass = $this->curUrlArray['class'];
if ($this->thisConfig['classesAnchor']) {
$classesAnchorArray = t3lib_div::trimExplode(',', $this->thisConfig['classesAnchor'], 1);
} else {
$classesAnchorArray = t3lib_div::trimExplode(',', $this->thisConfig['classesLinks'], 1);
}
$anchorTypes = array('page', 'url', 'file', 'mail', 'spec');
$classesAnchor = array();
$classesAnchor['all'] = array();
if (is_array($RTEsetup['properties']['classesAnchor.'])) {
foreach ($RTEsetup['properties']['classesAnchor.'] as $label => $conf) {
if (in_array($conf['class'], $classesAnchorArray)) {
//.........这里部分代码省略.........
示例3: isRTEforField
/**
* Checking if the RTE is available/enabled for a certain table/field and if so, it returns true.
* Used to determine if the RTE button should be displayed.
*
* @param string Table name
* @param array Record row (needed, if there are RTE dependencies based on other fields in the record)
* @param string Field name
* @return boolean Returns true if the rich text editor would be enabled/available for the field name specified.
*/
function isRTEforField($table, $row, $field)
{
$specConf = $this->getSpecConfForField($table, $row, $field);
$p = t3lib_BEfunc::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
if (isset($specConf['richtext']) && (!$p['flag'] || !$row[$p['flag']])) {
t3lib_BEfunc::fixVersioningPid($table, $row);
list($tscPID, $thePidValue) = t3lib_BEfunc::getTSCpid($table, $row['uid'], $row['pid']);
if ($thePidValue >= 0) {
// If the pid-value is not negative (that is, a pid could NOT be fetched)
$RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($tscPID));
$RTEtypeVal = t3lib_BEfunc::getTCAtypeValue($table, $row);
$thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'], $table, $field, $RTEtypeVal);
if (!$thisConfig['disabled']) {
return TRUE;
}
}
}
return FALSE;
}
示例4: init
/**
* Constructor:
* Initializes a lot of variables, setting JavaScript functions in header etc.
*
* @return void
*/
function init()
{
global $BE_USER, $BACK_PATH;
// 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');
// Find "mode"
$this->mode = t3lib_div::_GP('mode');
if (!$this->mode) {
$this->mode = 'rte';
}
// Creating backend template object:
$this->doc = t3lib_div::makeInstance('template');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
// Load the Prototype library and browse_links.js
$this->doc->getPageRenderer()->loadPrototype();
$this->doc->loadJavascriptLib('js/browse_links.js');
// init hook objects:
$this->hookObjects = array();
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['browseLinksHook'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.browse_links.php']['browseLinksHook'] as $classData) {
$processObject = t3lib_div::getUserObj($classData);
if (!$processObject instanceof t3lib_browseLinksHook) {
throw new UnexpectedValueException('$processObject must implement interface t3lib_browseLinksHook', 1195039394);
}
$parameters = array();
$processObject->init($this, $parameters);
$this->hookObjects[] = $processObject;
}
}
// 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');
// init fileProcessor
$this->fileProcessor = t3lib_div::makeInstance('t3lib_basicFileFunctions');
$this->fileProcessor->init($GLOBALS['FILEMOUNTS'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
// CurrentUrl - the current link url must be passed around if it exists
if ($this->mode == 'wizard') {
$currentLinkParts = t3lib_div::unQuoteFilenames($this->P['currentValue'], TRUE);
$initialCurUrlArray = array('href' => $currentLinkParts[0], 'target' => $currentLinkParts[1], 'class' => $currentLinkParts[2], 'title' => $currentLinkParts[3]);
$this->curUrlArray = is_array(t3lib_div::_GP('curUrl')) ? array_merge($initialCurUrlArray, t3lib_div::_GP('curUrl')) : $initialCurUrlArray;
$this->curUrlInfo = $this->parseCurUrl($this->siteURL . '?id=' . $this->curUrlArray['href'], $this->siteURL);
if ($this->curUrlInfo['pageid'] == 0 && $this->curUrlArray['href']) {
// pageid == 0 means that this is not an internal (page) link
if (file_exists(PATH_site . rawurldecode($this->curUrlArray['href']))) {
// check if this is a link to a file
if (t3lib_div::isFirstPartOfStr($this->curUrlArray['href'], PATH_site)) {
$currentLinkParts[0] = substr($this->curUrlArray['href'], strlen(PATH_site));
}
$this->curUrlInfo = $this->parseCurUrl($this->siteURL . $this->curUrlArray['href'], $this->siteURL);
} elseif (strstr($this->curUrlArray['href'], '@')) {
// check for email link
if (t3lib_div::isFirstPartOfStr($this->curUrlArray['href'], 'mailto:')) {
$currentLinkParts[0] = substr($this->curUrlArray['href'], 7);
}
$this->curUrlInfo = $this->parseCurUrl('mailto:' . $this->curUrlArray['href'], $this->siteURL);
} else {
// nothing of the above. this is an external link
if (strpos($this->curUrlArray['href'], '://') === false) {
$currentLinkParts[0] = 'http://' . $this->curUrlArray['href'];
}
$this->curUrlInfo = $this->parseCurUrl($currentLinkParts[0], $this->siteURL);
}
} elseif (!$this->curUrlArray['href']) {
$this->curUrlInfo = array();
$this->act = 'page';
} else {
$this->curUrlInfo = $this->parseCurUrl($this->siteURL . '?id=' . $this->curUrlArray['href'], $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'];
}
// Rich Text Editor specific configuration:
$addPassOnParams = '';
if ((string) $this->mode == 'rte') {
$RTEtsConfigParts = explode(':', $this->RTEtsConfigParams);
$addPassOnParams .= '&RTEtsConfigParams=' . rawurlencode($this->RTEtsConfigParams);
$RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
//.........这里部分代码省略.........
示例5: getSingleField_typeText
/**
* Generation of TCEform elements of the type "text"
* This will render a <textarea> OR RTE area form field, possibly with various control/validation features
*
* @param string The table name of the record
* @param string The field name which this element is supposed to edit
* @param array The record data array where the value(s) for the field can be found
* @param array An array with additional configuration options.
* @return string The HTML code for the TCEform field
*/
function getSingleField_typeText($table, $field, $row, &$PA)
{
// Init config:
$config = $PA['fieldConf']['config'];
$evalList = t3lib_div::trimExplode(',', $config['eval'], 1);
if ($this->renderReadonly || $config['readOnly']) {
return $this->getSingleField_typeNone_render($config, $PA['itemFormElValue']);
}
// Setting columns number:
$cols = t3lib_div::intInRange($config['cols'] ? $config['cols'] : 30, 5, $this->maxTextareaWidth);
// Setting number of rows:
$origRows = $rows = t3lib_div::intInRange($config['rows'] ? $config['rows'] : 5, 1, 20);
if (strlen($PA['itemFormElValue']) > $this->charsPerRow * 2) {
$cols = $this->maxTextareaWidth;
$rows = t3lib_div::intInRange(round(strlen($PA['itemFormElValue']) / $this->charsPerRow), count(explode(LF, $PA['itemFormElValue'])), 20);
if ($rows < $origRows) {
$rows = $origRows;
}
}
if (in_array('required', $evalList)) {
$this->requiredFields[$table . '_' . $row['uid'] . '_' . $field] = $PA['itemFormElName'];
}
// Init RTE vars:
$RTEwasLoaded = 0;
// Set true, if the RTE is loaded; If not a normal textarea is shown.
$RTEwouldHaveBeenLoaded = 0;
// Set true, if the RTE would have been loaded if it wasn't for the disable-RTE flag in the bottom of the page...
// "Extra" configuration; Returns configuration for the field based on settings found in the "types" fieldlist. Traditionally, this is where RTE configuration has been found.
$specConf = $this->getSpecConfFromString($PA['extra'], $PA['fieldConf']['defaultExtras']);
// Setting up the altItem form field, which is a hidden field containing the value
$altItem = '<input type="hidden" name="' . htmlspecialchars($PA['itemFormElName']) . '" value="' . htmlspecialchars($PA['itemFormElValue']) . '" />';
// If RTE is generally enabled (TYPO3_CONF_VARS and user settings)
if ($this->RTEenabled) {
$p = t3lib_BEfunc::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
if (isset($specConf['richtext']) && (!$p['flag'] || !$row[$p['flag']])) {
// If the field is configured for RTE and if any flag-field is not set to disable it.
t3lib_BEfunc::fixVersioningPid($table, $row);
list($tscPID, $thePidValue) = $this->getTSCpid($table, $row['uid'], $row['pid']);
// If the pid-value is not negative (that is, a pid could NOT be fetched)
if ($thePidValue >= 0) {
$RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($tscPID));
$RTEtypeVal = t3lib_BEfunc::getTCAtypeValue($table, $row);
$thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'], $table, $field, $RTEtypeVal);
if (!$thisConfig['disabled']) {
if (!$this->disableRTE) {
$this->RTEcounter++;
// Find alternative relative path for RTE images/links:
$eFile = t3lib_parsehtml_proc::evalWriteFile($specConf['static_write'], $row);
$RTErelPath = is_array($eFile) ? dirname($eFile['relEditFile']) : '';
// Get RTE object, draw form and set flag:
$RTEobj = t3lib_BEfunc::RTEgetObj();
$item = $RTEobj->drawRTE($this, $table, $field, $row, $PA, $specConf, $thisConfig, $RTEtypeVal, $RTErelPath, $thePidValue);
// Wizard:
$item = $this->renderWizards(array($item, $altItem), $config['wizards'], $table, $row, $field, $PA, $PA['itemFormElName'], $specConf, 1);
$RTEwasLoaded = 1;
} else {
$RTEwouldHaveBeenLoaded = 1;
$this->commentMessages[] = $PA['itemFormElName'] . ': RTE is disabled by the on-page RTE-flag (probably you can enable it by the check-box in the bottom of this page!)';
}
} else {
$this->commentMessages[] = $PA['itemFormElName'] . ': RTE is disabled by the Page TSconfig, "RTE"-key (eg. by RTE.default.disabled=0 or such)';
}
} else {
$this->commentMessages[] = $PA['itemFormElName'] . ': PID value could NOT be fetched. Rare error, normally with new records.';
}
} else {
if (!isset($specConf['richtext'])) {
$this->commentMessages[] = $PA['itemFormElName'] . ': RTE was not configured for this field in TCA-types';
}
if (!(!$p['flag'] || !$row[$p['flag']])) {
$this->commentMessages[] = $PA['itemFormElName'] . ': Field-flag (' . $PA['flag'] . ') has been set to disable RTE!';
}
}
}
// Display ordinary field if RTE was not loaded.
if (!$RTEwasLoaded) {
if ($specConf['rte_only']) {
// Show message, if no RTE (field can only be edited with RTE!)
$item = '<p><em>' . htmlspecialchars($this->getLL('l_noRTEfound')) . '</em></p>';
} else {
if ($specConf['nowrap']) {
$wrap = 'off';
} else {
$wrap = $config['wrap'] ? $config['wrap'] : 'virtual';
}
$classes = array();
if ($specConf['fixed-font']) {
$classes[] = 'fixed-font';
}
if ($specConf['enable-tab']) {
//.........这里部分代码省略.........
示例6: getRTEConfig
/**
* Get the RTE configuration from Page TSConfig
*
* @return array RTE configuration array
*/
protected function getRTEConfig()
{
global $BE_USER;
$RTEtsConfigParts = explode(':', t3lib_div::_GP('RTEtsConfigParams'));
$RTEsetup = $BE_USER->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
return t3lib_BEfunc::RTEsetup($RTEsetup['properties'], $RTEtsConfigParts[0], $RTEtsConfigParts[2], $RTEtsConfigParts[4]);
}
示例7: main_user
/**
* Rich Text Editor (RTE) user element selector
*
* @param [type] $openKeys: ...
* @return [type] ...
*/
function main_user($openKeys)
{
global $LANG, $BACK_PATH, $BE_USER;
// Starting content:
$content .= $this->doc->startPage($LANG->getLL('Insert Custom Element', 1));
$RTEtsConfigParts = explode(':', t3lib_div::_GP('RTEtsConfigParams'));
$RTEsetup = $BE_USER->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
$thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'], $RTEtsConfigParts[0], $RTEtsConfigParts[2], $RTEtsConfigParts[4]);
if (is_array($thisConfig['userElements.'])) {
$categories = array();
foreach ($thisConfig['userElements.'] as $k => $value) {
$ki = intval($k);
$v = $thisConfig['userElements.'][$ki . '.'];
if (substr($k, -1) == "." && is_array($v)) {
$subcats = array();
$openK = $ki;
if ($openKeys[$openK]) {
$mArray = '';
switch ((string) $v['load']) {
case 'images_from_folder':
$mArray = array();
if ($v['path'] && @is_dir(PATH_site . $v['path'])) {
$files = t3lib_div::getFilesInDir(PATH_site . $v['path'], 'gif,jpg,jpeg,png', 0, '');
if (is_array($files)) {
$c = 0;
foreach ($files as $filename) {
$iInfo = @getimagesize(PATH_site . $v['path'] . $filename);
$iInfo = $this->calcWH($iInfo, 50, 100);
$ks = (string) (100 + $c);
$mArray[$ks] = $filename;
$mArray[$ks . "."] = array('content' => '<img src="' . $this->siteUrl . $v['path'] . $filename . '" />', '_icon' => '<img src="' . $this->siteUrl . $v['path'] . $filename . '" ' . $iInfo[3] . ' />', 'description' => $LANG->getLL('filesize') . ': ' . str_replace(' ', ' ', t3lib_div::formatSize(@filesize(PATH_site . $v['path'] . $filename))) . ', ' . $LANG->getLL('pixels', 1) . ': ' . $iInfo[0] . 'x' . $iInfo[1]);
$c++;
}
}
}
break;
}
if (is_array($mArray)) {
if ($v['merge']) {
$v = t3lib_div::array_merge_recursive_overrule($mArray, $v);
} else {
$v = $mArray;
}
}
foreach ($v as $k2 => $dummyValue) {
$k2i = intval($k2);
if (substr($k2, -1) == '.' && is_array($v[$k2i . '.'])) {
$title = trim($v[$k2i]);
if (!$title) {
$title = '[' . $LANG->getLL('noTitle', 1) . ']';
} else {
$title = $LANG->sL($title, 1);
}
$description = $LANG->sL($v[$k2i . '.']['description'], 1) . '<br />';
if (!$v[$k2i . '.']['dontInsertSiteUrl']) {
$v[$k2i . '.']['content'] = str_replace('###_URL###', $this->siteUrl, $v[$k2i . '.']['content']);
}
$logo = $v[$k2i . '.']['_icon'] ? $v[$k2i . '.']['_icon'] : '';
$onClickEvent = '';
switch ((string) $v[$k2i . '.']['mode']) {
case 'wrap':
$wrap = explode('|', $v[$k2i . '.']['content']);
$onClickEvent = 'wrapHTML(' . $LANG->JScharCode($wrap[0]) . ',' . $LANG->JScharCode($wrap[1]) . ',false);';
break;
case 'processor':
$script = trim($v[$k2i . '.']['submitToScript']);
if (substr($script, 0, 4) != 'http') {
$script = $this->siteUrl . $script;
}
if ($script) {
$onClickEvent = 'processSelection(' . $LANG->JScharCode($script) . ');';
}
break;
case 'insert':
default:
$onClickEvent = 'insertHTML(' . $LANG->JScharCode($v[$k2i . '.']['content']) . ');';
break;
}
$A = array('<a href="#" onClick="' . $onClickEvent . 'return false;">', '</a>');
$subcats[$k2i] = '<tr>
<td><img src="clear.gif" width="18" height="1" /></td>
<td class="bgColor4" valign="top">' . $A[0] . $logo . $A[1] . '</td>
<td class="bgColor4" valign="top">' . $A[0] . '<strong>' . $title . '</strong><br />' . $description . $A[1] . '</td>
</tr>';
}
}
ksort($subcats);
}
$categories[$ki] = implode('', $subcats);
}
}
ksort($categories);
# Render menu of the items:
$lines = array();
//.........这里部分代码省略.........
示例8: preinit
/**
* Pre-initialization - the point is to do some processing before the actual init() function; In between we might have some magic-image processing going on...
*
* @return [type] ...
*/
function preinit()
{
global $BE_USER;
// Current site url:
$this->siteUrl = t3lib_div::getIndpEnv("TYPO3_SITE_URL");
// Determine nature of current url:
$this->act = t3lib_div::_GP("act");
$this->modData = $BE_USER->getModuleData("rte_select_image.php", "ses");
if ($this->act != "image") {
if (isset($this->act)) {
$this->modData["act"] = $this->act;
$BE_USER->pushModuleData("rte_select_image.php", $this->modData);
} else {
$this->act = $this->modData["act"];
}
}
$expandPage = t3lib_div::_GP("expandFolder");
if (isset($expandPage)) {
$this->modData["expandFolder"] = $expandPage;
$BE_USER->pushModuleData("rte_select_image.php", $this->modData);
} else {
t3lib_div::_GETset($this->modData["expandFolder"], 'expandFolder');
}
if (!$this->act) {
$this->act = "magic";
}
$RTEtsConfigParts = explode(":", t3lib_div::_GP("RTEtsConfigParams"));
if (count($RTEtsConfigParts) < 2) {
die("Error: The GET parameter 'RTEtsConfigParams' was missing. Close the window.");
}
$RTEsetup = $GLOBALS["BE_USER"]->getTSConfig("RTE", t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
$this->thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup["properties"], $RTEtsConfigParts[0], $RTEtsConfigParts[2], $RTEtsConfigParts[4]);
$this->imgPath = $RTEtsConfigParts[6];
$this->allowedItems = array_diff(explode(",", "magic,plain,upload"), t3lib_div::trimExplode(",", $this->thisConfig["blindImageOptions"], 1));
reset($this->allowedItems);
if (!in_array($this->act, $this->allowedItems)) {
$this->act = current($this->allowedItems);
}
}
示例9: init
function init()
{
global $BE_USER, $BACK_PATH;
// 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');
// Find "mode"
$this->mode = t3lib_div::_GP('mode');
if (!$this->mode) {
$this->mode = 'rte';
}
// init hook objects:
$this->hookObjects = array();
if (intval(phpversion()) >= 5 && TYPO3_branch > 4.1) {
include_once 'include_php5.inc';
} else {
include_once 'include_php4.inc';
}
// Site URL
$this->siteURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL');
// Current site url
// Rich Text Editor specific configuration:
$addPassOnParams = '';
if ((string) $this->mode == 'wizard') {
$RTEtsConfigParts = explode(':', $this->RTEtsConfigParams);
$addPassOnParams .= '&RTEtsConfigParams=' . rawurlencode($this->RTEtsConfigParams);
$RTEsetup = $GLOBALS['BE_USER']->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
$this->thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'], $RTEtsConfigParts[0], $RTEtsConfigParts[2], $RTEtsConfigParts[4]);
}
// the script to link to
$this->thisScript = t3lib_div::getIndpEnv('SCRIPT_NAME');
// init fileProcessor
$this->fileProcessor = t3lib_div::makeInstance('t3lib_basicFileFunctions');
$this->fileProcessor->init($GLOBALS['FILEMOUNTS'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
// CurrentUrl - the current link url must be passed around if it exists
if ($this->mode == 'wizard') {
$currentLinkParts = t3lib_div::trimExplode(' ', $this->P['currentValue']);
$initialCurUrlArray = array('href' => $currentLinkParts[0], 'target' => $currentLinkParts[1], 'class' => $currentLinkParts[2], 'title' => $currentLinkParts[3]);
$this->curUrlArray = is_array(t3lib_div::_GP('curUrl')) ? array_merge($initialCurUrlArray, t3lib_div::_GP('curUrl')) : $initialCurUrlArray;
$this->curUrlInfo = $this->parseCurUrl($this->siteURL . '?id=' . $this->curUrlArray['href'], $this->siteURL);
if ($this->curUrlInfo['pageid'] == 0 && $this->curUrlArray['href']) {
// pageid == 0 means that this is not an internal (page) link
if (@file_exists(PATH_site . rawurldecode($this->curUrlArray['href']))) {
// check if this is a link to a file
if (t3lib_div::isFirstPartOfStr($this->curUrlArray['href'], PATH_site)) {
$currentLinkParts[0] = substr($this->curUrlArray['href'], strlen(PATH_site));
}
$this->curUrlInfo = $this->parseCurUrl($this->siteURL . $this->curUrlArray['href'], $this->siteURL);
} elseif (strstr($this->curUrlArray['href'], '@')) {
// check for email link
if (t3lib_div::isFirstPartOfStr($this->curUrlArray['href'], 'mailto:')) {
$currentLinkParts[0] = substr($this->curUrlArray['href'], 7);
}
$this->curUrlInfo = $this->parseCurUrl('mailto:' . $currentLinkParts[0], $this->siteURL);
} elseif (strstr($this->curUrlArray['href'], 'record:')) {
$handel = t3lib_div::trimExplode(':', $this->curUrlArray['href']);
if (is_array($this->thisConfig['linkhandler.'][$handel[1] . '.'])) {
$row = t3lib_BEfunc::getRecord($handel[1], $handel[2]);
if (is_array($this->thisConfig['linkhandler.'][$handel[1] . '.'][$row['pid'] . '.'])) {
$this->curUrlInfo['info'] = $row['pid'];
$this->curUrlInfo['pageid'] = $this->curUrlInfo['info'];
$this->expandPage();
} else {
$this->curUrlInfo = array();
}
$this->curUrlInfo['cElement'] = $handel[2];
} else {
echo "in PageTSconfig you should define RTE.default.linkhandler." . $handel[1];
echo "<br /> Example Config tt_news:";
echo "<pre>\nRTE.default.linkhandler {\n\ttt_news {\n\t\tdefault {\n\t\t\t# instead of default you could write the id of the storage folder\n\t\t\t# id of the Single News Page\n\t\t\tparameter = 27\n\t\t\tadditionalParams = &tx_ttnews[tt_news]={field:uid}\n\t\t\tadditionalParams.insertData = 1\n\t\t\t# you need: uid, hidden, header [this is the displayed title] (use xx as header to select other properties)\n\t\t\t# you can provide: bodytext [alternative title], starttime, endtime [to display the current status]\n\t\t\tselect = uid,title as header,hidden,starttime,endtime,bodytext\n\t\t\tsorting = crdate\n\t\t}\n\t}\n}\n</pre>";
die;
//message to user; wrong config
}
} else {
// nothing of the above. this is an external link
if (strpos($this->curUrlArray['href'], '://') === false) {
$currentLinkParts[0] = 'http://' . $this->curUrlArray['href'];
}
$this->curUrlInfo = $this->parseCurUrl($currentLinkParts[0], $this->siteURL);
}
} elseif (!$this->curUrlArray['href']) {
$this->curUrlInfo = array();
$this->act = 'page';
} else {
$this->curUrlInfo = $this->parseCurUrl($this->siteURL . '?id=' . $this->curUrlArray['href'], $this->siteURL);
$this->curUrlInfo['info'] = $this->curUrlInfo['pageid'];
}
} 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:
//.........这里部分代码省略.........
示例10: main_parse_html
/**
* Rich Text Editor (RTE) html parser
*
* @param [type] $openKeys: ...
* @return [type] ...
*/
function main_parse_html($openKeys)
{
global $BE_USER, $TYPO3_CONF_VARS;
$editorNo = t3lib_div::_GP('editorNo');
$html = t3lib_div::_GP('content');
$RTEtsConfigParts = explode(':', t3lib_div::_GP('RTEtsConfigParams'));
$RTEsetup = $BE_USER->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
$thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'], $RTEtsConfigParts[0], $RTEtsConfigParts[2], $RTEtsConfigParts[4]);
$HTMLParser = t3lib_div::makeInstance('t3lib_parsehtml');
if (is_array($thisConfig['enableWordClean.'])) {
$HTMLparserConfig = $thisConfig['enableWordClean.']['HTMLparser.'];
if (is_array($HTMLparserConfig)) {
$this->keepSpanTagsWithId($HTMLparserConfig);
$HTMLparserConfig = $HTMLParser->HTMLparserConfig($HTMLparserConfig);
}
}
if (is_array($HTMLparserConfig)) {
$html = $HTMLParser->HTMLcleaner($html, $HTMLparserConfig[0], $HTMLparserConfig[1], $HTMLparserConfig[2], $HTMLparserConfig[3]);
}
if (is_array($TYPO3_CONF_VARS['EXTCONF'][$this->extKey][$this->prefixId]['cleanPastedContent'])) {
foreach ($TYPO3_CONF_VARS['EXTCONF'][$this->extKey][$this->prefixId]['cleanPastedContent'] as $classRef) {
$hookObj = t3lib_div::getUserObj($classRef);
if (method_exists($hookObj, 'cleanPastedContent_afterCleanWord')) {
$html = $hookObj->cleanPastedContent_afterCleanWord($html, $thisConfig);
}
}
}
return $html;
}
示例11: init
/**
* Initialisation
*
* @return [type] ...
*/
function init()
{
global $BE_USER, $BACK_PATH, $TYPO3_CONF_VARS;
// Main GPvars:
$this->siteUrl = t3lib_div::getIndpEnv('TYPO3_SITE_URL');
$this->act = t3lib_div::_GP('act');
$this->expandPage = t3lib_div::_GP('expandPage');
$this->expandFolder = t3lib_div::_GP('expandFolder');
// Find RTE parameters
$this->bparams = t3lib_div::_GP('bparams');
$this->editorNo = t3lib_div::_GP('editorNo');
$this->sys_language_content = t3lib_div::_GP('sys_language_content');
$this->RTEtsConfigParams = t3lib_div::_GP('RTEtsConfigParams');
if (!$this->editorNo) {
$pArr = explode('|', $this->bparams);
$pRteArr = explode(':', $pArr[1]);
$this->editorNo = $pRteArr[0];
$this->sys_language_content = $pRteArr[1];
$this->RTEtsConfigParams = $pArr[2];
}
// 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');
if (!$this->act) {
$this->act = 'magic';
}
// init fileProcessor
$this->fileProcessor = t3lib_div::makeInstance('t3lib_basicFileFunctions');
$this->fileProcessor->init($GLOBALS['FILEMOUNTS'], $GLOBALS['TYPO3_CONF_VARS']['BE']['fileExtensions']);
$RTEtsConfigParts = explode(':', $this->RTEtsConfigParams);
$RTEsetup = $BE_USER->getTSConfig('RTE', t3lib_BEfunc::getPagesTSconfig($RTEtsConfigParts[5]));
$this->thisConfig = t3lib_BEfunc::RTEsetup($RTEsetup['properties'], $RTEtsConfigParts[0], $RTEtsConfigParts[2], $RTEtsConfigParts[4]);
$this->imgPath = $RTEtsConfigParts[6];
if (is_array($this->thisConfig['buttons.']) && is_array($this->thisConfig['buttons.']['image.'])) {
$this->buttonConfig = $this->thisConfig['buttons.']['image.'];
t3lib_div::loadTCA('tx_dam');
if (is_array($this->buttonConfig['title.']) && is_array($TCA['tx_dam']['columns'][$this->buttonConfig['title.']['useDAMColumn']])) {
$this->imgTitleDAMColumn = $this->buttonConfig['title.']['useDAMColumn'];
}
if (is_array($this->buttonConfig['properties.'])) {
if ($this->buttonConfig['properties.']['removeItems']) {
$this->removedProperties = t3lib_div::trimExplode(',', $this->buttonConfig['properties.']['removeItems'], 1);
}
if (is_array($this->buttonConfig['properties.']['class.']) && trim($this->buttonConfig['properties.']['class.']['default'])) {
$this->defaultClass = trim($this->buttonConfig['properties.']['class.']['default']);
}
}
}
if (is_array($this->thisConfig['proc.']) && $this->thisConfig['proc.']['plainImageMode']) {
$plainImageMode = $this->thisConfig['proc.']['plainImageMode'];
$this->lockPlainWidth = $plainImageMode == 'lockDimensions' ? 'true' : 'false';
$this->lockPlainHeight = $this->lockPlainWidth || $plainImageMode == 'lockRatio' || $plainImageMode == 'lockRatioWhenSmaller' ? 'true' : 'false';
}
if (!$this->imgTitleDAMColumn) {
$this->imgTitleDAMColumn = 'caption';
}
$this->allowedItems = explode(',', 'magic,plain,image,upload');
$clientInfo = t3lib_div::clientInfo();
if ($clientInfo['BROWSER'] !== 'opera') {
$this->allowedItems[] = 'dragdrop';
}
if (is_array($this->buttonConfig['options.']) && $this->buttonConfig['options.']['removeItems']) {
$this->allowedItems = array_diff($this->allowedItems, t3lib_div::trimExplode(',', $this->buttonConfig['options.']['removeItems'], 1));
} else {
$this->allowedItems = array_diff($this->allowedItems, t3lib_div::trimExplode(',', $this->thisConfig['blindImageOptions'], 1));
}
reset($this->allowedItems);
if (!in_array($this->act, $this->allowedItems)) {
$this->act = current($this->allowedItems);
}
if ($this->act == 'magic') {
if (is_array($this->buttonConfig['options.']) && is_array($this->buttonConfig['options.']['magic.'])) {
if ($this->buttonConfig['options.']['magic.']['maxWidth']) {
$this->magicMaxWidth = $this->buttonConfig['options.']['magic.']['maxWidth'];
}
if ($this->buttonConfig['options.']['magic.']['maxHeight']) {
$this->magicMaxHeight = $this->buttonConfig['options.']['magic.']['maxHeight'];
}
}
// These defaults allow images to be based on their width - to a certain degree - by setting a high height. Then we're almost certain the image will be based on the width
if (!$this->magicMaxWidth) {
$this->magicMaxWidth = 300;
}
if (!$this->magicMaxHeight) {
$this->magicMaxHeight = 1000;
}
} elseif ($this->act == 'plain') {
if (is_array($this->buttonConfig['options.']) && is_array($this->buttonConfig['options.']['plain.'])) {
//.........这里部分代码省略.........