本文整理汇总了PHP中t3lib_div::deHSCentities方法的典型用法代码示例。如果您正苦于以下问题:PHP t3lib_div::deHSCentities方法的具体用法?PHP t3lib_div::deHSCentities怎么用?PHP t3lib_div::deHSCentities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t3lib_div
的用法示例。
在下文中一共展示了t3lib_div::deHSCentities方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: editIcons
/**
* Adds an edit icon to the content string. The edit icon links to alt_doc.php with proper parameters for editing the table/fields of the context.
* This implements TYPO3 context sensitive editing facilities. Only backend users will have access (if properly configured as well).
*
* @param string The content to which the edit icons should be appended
* @param string The parameters defining which table and fields to edit. Syntax is [tablename]:[fieldname],[fieldname],[fieldname],... OR [fieldname],[fieldname],[fieldname],... (basically "[tablename]:" is optional, default table is the one of the "current record" used in the function). The fieldlist is sent as "&columnsOnly=" parameter to alt_doc.php
* @param array TypoScript properties for configuring the edit icons.
* @param string The "table:uid" of the record being shown. If empty string then $this->currentRecord is used. For new records (set by $conf['newRecordFromTable']) it's auto-generated to "[tablename]:NEW"
* @param array Alternative data array to use. Default is $this->data
* @param string Additional URL parameters for the link pointing to alt_doc.php
* @return string The input content string, possibly with edit icons added (not necessarily in the end but just after the last string of normal content.
*/
public function editIcons($content, $params, array $conf = array(), $currentRecord = '', array $dataArr = array(), $addUrlParamStr = '', $table, $editUid, $fieldList)
{
// Special content is about to be shown, so the cache must be disabled.
$GLOBALS['TSFE']->set_no_cache();
$style = $conf['styleAttribute'] ? ' style="' . htmlspecialchars($conf['styleAttribute']) . '"' : '';
$iconTitle = $this->cObj->stdWrap($conf['iconTitle'], $conf['iconTitle.']);
$iconImg = $conf['iconImg'] ? $conf['iconImg'] : '<img src="' . TYPO3_mainDir . 'gfx/edit_fe.gif" width="11" height="12" border="0" align="top" title="' . t3lib_div::deHSCentities(htmlspecialchars($iconTitle)) . '"' . $style . ' class="frontEndEditIcons" alt="" />';
$nV = t3lib_div::_GP('ADMCMD_view') ? 1 : 0;
$adminURL = t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir;
$icon = $this->editPanelLinkWrap_doWrap($iconImg, $adminURL . 'alt_doc.php?edit[' . $table . '][' . $editUid . ']=edit&columnsOnly=' . rawurlencode($fieldList) . '&noView=' . $nV . $addUrlParamStr, $currentRecord);
if ($conf['beforeLastTag'] < 0) {
$content = $icon . $content;
} elseif ($conf['beforeLastTag'] > 0) {
$cBuf = rtrim($content);
$securCount = 30;
while ($securCount && substr($cBuf, -1) == '>' && substr($cBuf, -4) != '</a>') {
$cBuf = rtrim(preg_replace('/<[^<]*>$/', '', $cBuf));
$securCount--;
}
$content = strlen($cBuf) && $securCount ? substr($content, 0, strlen($cBuf)) . $icon . substr($content, strlen($cBuf)) : ($content = $icon . $content);
} else {
$content .= $icon;
}
return $content;
}
示例2: stdWrap_htmlSpecialChars
/**
* htmlSpecialChars
* Transforms HTML tags to readable text by replacing special characters with their HTML entity
* When preserveEntities returns true, existing entities will be left untouched
*
* @param string Input value undergoing processing in this function.
* @param array stdWrap properties for htmlSpecalChars.
* @return string The processed input value
*/
public function stdWrap_htmlSpecialChars($content = '', $conf = array())
{
$content = htmlSpecialChars($content);
if ($conf['htmlSpecialChars.']['preserveEntities']) {
$content = t3lib_div::deHSCentities($content);
}
return $content;
}
示例3: getRecursiveSelect
/**
* Finding tree and offer setting of values recursively.
*
* @param integer Page id.
* @param string Select clause
* @return string Select form element for recursive levels (if any levels are found)
*/
public function getRecursiveSelect($id, $perms_clause)
{
// Initialize tree object:
$tree = t3lib_div::makeInstance('t3lib_pageTree');
$tree->init('AND ' . $perms_clause);
$tree->addField('perms_userid', 1);
$tree->makeHTML = 0;
$tree->setRecs = 1;
// Make tree:
$tree->getTree($id, $this->getLevels, '');
// If there are a hierarchy of page ids, then...
if ($GLOBALS['BE_USER']->user['uid'] && count($tree->orig_ids_hierarchy)) {
// Init:
$label_recur = $GLOBALS['LANG']->getLL('recursive');
$label_levels = $GLOBALS['LANG']->getLL('levels');
$label_pA = $GLOBALS['LANG']->getLL('pages_affected');
$theIdListArr = array();
$opts = '
<option value=""></option>';
// Traverse the number of levels we want to allow recursive setting of permissions for:
for ($a = $this->getLevels; $a > 0; $a--) {
if (is_array($tree->orig_ids_hierarchy[$a])) {
foreach ($tree->orig_ids_hierarchy[$a] as $theId) {
if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->user['uid'] == $tree->recs[$theId]['perms_userid']) {
$theIdListArr[] = $theId;
}
}
$lKey = $this->getLevels - $a + 1;
$opts .= '
<option value="' . htmlspecialchars(implode(',', $theIdListArr)) . '">' . t3lib_div::deHSCentities(htmlspecialchars($label_recur . ' ' . $lKey . ' ' . $label_levels)) . ' (' . count($theIdListArr) . ' ' . $label_pA . ')' . '</option>';
}
}
// Put the selector box together:
$theRecursiveSelect = '<br />
<select name="mirror[pages][' . $id . ']">
' . $opts . '
</select>
<br /><br />';
} else {
$theRecursiveSelect = '';
}
// Return selector box element:
return $theRecursiveSelect;
}
示例4: getTabMenu
/**
* Creates a tab menu from an array definition
*
* Returns a tab menu for a module
* Requires the JS function jumpToUrl() to be available
*
* @param mixed $id is the "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=...
* @param string $elementName it the form elements name, probably something like "SET[...]"
* @param string $currentValue is the value to be selected currently.
* @param array $menuItems is an array with the menu items for the selector box
* @param string $script is the script to send the &id to, if empty it's automatically found
* @param string $addParams is additional parameters to pass to the script.
* @return string HTML code for tab menu
*/
function getTabMenu($mainParams, $elementName, $currentValue, $menuItems, $script = '', $addparams = '')
{
// read page TSconfig
$useTabs = tx_dam::config_checkValueEnabled('mod.txdamM1_SHARED.useTabs');
if ($useTabs && is_array($menuItems)) {
if (!is_array($mainParams)) {
$mainParams = array('id' => $mainParams);
}
$mainParams = t3lib_div::implodeArrayForUrl('', $mainParams);
if (!$script) {
$script = basename(PATH_thisScript);
}
$menuDef = array();
foreach ($menuItems as $value => $label) {
$menuDef[$value]['isActive'] = !strcmp($currentValue, $value);
$menuDef[$value]['label'] = t3lib_div::deHSCentities(htmlspecialchars($label));
// original: $menuDef[$value]['url'] = htmlspecialchars($script.'?'.$mainParams.$addparams.'&'.$elementName.'='.$value);
$menuDef[$value]['url'] = $script . '?' . $mainParams . $addparams . '&' . $elementName . '=' . $value;
}
$this->content .= $this->doc->getTabMenuRaw($menuDef);
return '';
} else {
return t3lib_BEfunc::getFuncMenu($this->id, $elementName, $currentValue, $menuItems);
}
}
示例5: getTabMenu
/**
* Creates a tab menu from an array definition
*
* Returns a tab menu for a module
* Requires the JS function jumpToUrl() to be available
*
* @param mixed $id is the "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=...
* @param string $elementName it the form elements name, probably something like "SET[...]"
* @param string $currentValue is the value to be selected currently.
* @param array $menuItems is an array with the menu items for the selector box
* @param string $script is the script to send the &id to, if empty it's automatically found
* @param string $addParams is additional parameters to pass to the script.
* @return string HTML code for tab menu
* @author Rene Fritz <r.fritz@colorcube.de>
*/
function getTabMenu($mainParams, $elementName, $currentValue, $menuItems, $script = '', $addparams = '')
{
$content = '';
if (is_array($menuItems)) {
if (!is_array($mainParams)) {
$mainParams = array('id' => $mainParams);
}
$mainParams = t3lib_div::implodeArrayForUrl('', $mainParams);
if (!$script) {
$script = basename(PATH_thisScript);
}
$menuDef = array();
foreach ($menuItems as $value => $label) {
$menuDef[$value]['isActive'] = !strcmp($currentValue, $value);
$menuDef[$value]['label'] = t3lib_div::deHSCentities(htmlspecialchars($label));
$menuDef[$value]['url'] = $script . '?' . $mainParams . $addparams . '&' . $elementName . '=' . $value;
}
$content = $this->getTabMenuRaw($menuDef);
}
return $content;
}
示例6: RTE2XML
/**
* Transforms a RTE Field to valid XML
*
*
* @param string HTML String which should be transformed
* @return mixed false if transformation failed, string with XML if all fine
*/
function RTE2XML($content, $withStripBadUTF8 = 0)
{
//function RTE2XML($content,$withStripBadUTF8=$GLOBALS['BE_USER']->getModuleData('l10nmgr/cm1/checkUTF8', '')) {
//if (!$withStripBadUTF8) {
// $withStripBadUTF8 = $GLOBALS['BE_USER']->getModuleData('l10nmgr/cm1/checkUTF8', '');
//}
//echo '###'.$withStripBadUTF8;
$content_org = $content;
// First call special transformations (registered using hooks)
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['l10nmgr']['transformation'])) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['l10nmgr']['transformation'] as $classReference) {
$processingObject = t3lib_div::getUserObj($classReference);
$content = $processingObject->transform_rte($content, $this->parseHTML);
}
}
$content = $this->parseHTML->TS_images_rte($content);
$content = $this->parseHTML->TS_links_rte($content);
$content = $this->parseHTML->TS_transform_rte($content, 1);
//substitute & with &
//$content=str_replace('&','&',$content); Changed by DZ 2011-05-11
$content = str_replace('<hr>', '<hr />', $content);
$content = str_replace('<br>', '<br />', $content);
$content = t3lib_div::deHSCentities($content);
if ($withStripBadUTF8 == 1) {
$content = tx_l10nmgr_utf8tools::utf8_bad_strip($content);
}
if ($this->isValidXMLString($content)) {
return $content;
} else {
return false;
}
}
示例7: bidir_htmlspecialchars
/**
* Converts htmlspecialchars forth ($dir=1) AND back ($dir=-1)
*
* @param string Input value
* @param integer Direction: forth ($dir=1, dir=2 for preserving entities) AND back ($dir=-1)
* @return string Output value
*/
function bidir_htmlspecialchars($value, $dir)
{
if ($dir == 1) {
$value = htmlspecialchars($value);
} elseif ($dir == 2) {
$value = t3lib_div::deHSCentities(htmlspecialchars($value));
} elseif ($dir == -1) {
$value = str_replace('>', '>', $value);
$value = str_replace('<', '<', $value);
$value = str_replace('"', '"', $value);
$value = str_replace('&', '&', $value);
}
return $value;
}
示例8: sendNotificationEmail
/**
* sendNotificationEmail
*
* sends the notification email, uses the TYPO3 mail functions
*
* @param string $toEMail
* @param string $subject
* @param string $html_body
* @param int $sendAsHTML
* @access public
* @return void
*/
public function sendNotificationEmail($toEMail, $subject, $html_body, $sendAsHTML = 1)
{
/*{{{*/
// don't send a mail twice to the same user (for example if he is
// responsible AND observer)
if (in_array($toEMail, $this->alreadySentTo)) {
return;
}
$this->alreadySentTo[] = $toEMail;
// only send a mail to the current user (who actually made the changes)
// if configured so
if ($GLOBALS['TSFE']->fe_user->user['email'] == $toEMail && !$this->conf['sendNotificationsToSelf']) {
return;
}
// Only ASCII is allowed in the header
$subject = html_entity_decode(t3lib_div::deHSCentities($subject), ENT_QUOTES, $GLOBALS['TSFE']->renderCharset);
$subject = t3lib_div::encodeHeader($subject, 'base64', $GLOBALS['TSFE']->renderCharset);
// create the plain message body
$message = html_entity_decode(strip_tags($html_body), ENT_QUOTES, $GLOBALS['TSFE']->renderCharset);
// inspired by code from tt_products, thanks
if ($this->getNumericTYPO3versionNumber() >= 4005000) {
$Typo3_htmlmail = t3lib_div::makeInstance('t3lib_mail_Message');
$Typo3_htmlmail->setSubject($subject);
$Typo3_htmlmail->setFrom(array($this->conf['email_notifications.']['from_email'] => $this->conf['email_notifications.']['from_name']));
// add Attachments
if (is_array($files) && count($files) > 0) {
foreach ($files as $attachment) {
$Typo3_htmlmail->attach(Swift_Attachment::fromPath($uploadPath . $attachment));
}
}
if ($sendAsHTML) {
$Typo3_htmlmail->setBody($html_body, 'text/html');
if ($message && $this->conf['email_notifications.']['addPlainTextPart']) {
$Typo3_htmlmail->addPart($message, 'text/plain');
}
} else {
$Typo3_htmlmail->addPart($message, 'text/plain');
}
$Typo3_htmlmail->setTo(explode(',', $toEMail));
$Typo3_htmlmail->send();
} else {
$Typo3_htmlmail = t3lib_div::makeInstance('t3lib_htmlmail');
$Typo3_htmlmail->start();
$Typo3_htmlmail->subject = $subject;
$Typo3_htmlmail->from_email = $this->conf['email_notifications.']['from_email'];
$Typo3_htmlmail->from_name = $this->conf['email_notifications.']['from_name'];
$Typo3_htmlmail->replyto_email = $Typo3_htmlmail->from_email;
$Typo3_htmlmail->replyto_name = $Typo3_htmlmail->from_name;
$Typo3_htmlmail->organisation = '';
// add Attachments
if (is_array($files) && count($files) > 0) {
foreach ($files as $attachment) {
$Typo3_htmlmail->addAttachment($uploadPath . $attachment);
}
}
if ($sendAsHTML) {
$Typo3_htmlmail->theParts['html']['content'] = $html_body;
$Typo3_htmlmail->theParts['html']['path'] = t3lib_div::getIndpEnv('TYPO3_REQUEST_HOST') . '/';
$Typo3_htmlmail->extractMediaLinks();
$Typo3_htmlmail->extractHyperLinks();
$Typo3_htmlmail->fetchHTMLMedia();
$Typo3_htmlmail->substMediaNamesInHTML(0);
// 0 = relative
$Typo3_htmlmail->substHREFsInHTML();
$Typo3_htmlmail->setHTML($Typo3_htmlmail->encodeMsg($Typo3_htmlmail->theParts['html']['content']));
if ($message && $this->conf['email_notifications.']['addPlainTextPart']) {
$Typo3_htmlmail->addPlain($message);
}
} else {
$Typo3_htmlmail->addPlain($message);
}
$Typo3_htmlmail->setHeaders();
$Typo3_htmlmail->setContent();
$Typo3_htmlmail->setRecipient(explode(',', $toEMail));
$Typo3_htmlmail->sendTheMail();
}
}
示例9: _getSelectField
function _getSelectField($elementName, $currentValue, $menuItems)
{
$options = array();
foreach ($menuItems as $value => $label) {
$options[] = '<option value="' . htmlspecialchars($value) . '"' . (!strcmp($currentValue, $value) ? ' selected="selected"' : '') . '>' . t3lib_div::deHSCentities(htmlspecialchars($label)) . '</option>';
}
if (count($options) > 0) {
return '
<select name="' . $elementName . '" >
' . implode('
', $options) . '
</select>
';
}
}
示例10: sL
/**
* splitLabel function
* Historically labels were exploded by '|' and each part would correspond
* to the translation of the language found at the same 'index' in the TYPO3_languages constant.
* Today all translations are based on $LOCAL_LANG variables.
* 'language-splitted' labels can therefore refer to a local-lang file + index instead!
* It's highly recommended to use the 'local_lang' method
* (and thereby it's highly deprecated to use 'language-splitted' label strings)
* Refer to 'Inside TYPO3' for more details
*
* @param string Label key/reference
* @param boolean If set, the return value is htmlspecialchar'ed
* @return string
* @access public
*/
public function sL($input, $hsc = 0)
{
// Using obsolete 'language-splitted' labels:
if (strcmp(substr($input, 0, 4), 'LLL:')) {
$t = explode('|', $input);
$out = $t[$this->langSplitIndex] ? $t[$this->langSplitIndex] : $t[0];
return $this->hscAndCharConv($out, $hsc);
// LOCAL_LANG:
} else {
// If cached label
if (!isset($this->LL_labels_cache[$this->lang][$input])) {
$restStr = trim(substr($input, 4));
$extPrfx = '';
// ll-file refered to is found in an extension.
if (!strcmp(substr($restStr, 0, 4), 'EXT:')) {
$restStr = trim(substr($restStr, 4));
$extPrfx = 'EXT:';
}
$parts = explode(':', $restStr);
$parts[0] = $extPrfx . $parts[0];
// Getting data if not cached
if (!isset($this->LL_files_cache[$parts[0]])) {
$this->LL_files_cache[$parts[0]] = $this->readLLfile($parts[0]);
// If the current language is found in another file, load that as well:
$lFileRef = $this->localizedFileRef($parts[0]);
if ($lFileRef && is_string($this->LL_files_cache[$parts[0]][$this->lang]) && $this->LL_files_cache[$parts[0]][$this->lang] == 'EXT') {
$tempLL = $this->readLLfile($lFileRef);
$this->LL_files_cache[$parts[0]][$this->lang] = $tempLL[$this->lang];
}
// Overriding file?
// @deprecated since TYPO3 4.3, remove in TYPO3 4.5, please use the generic method in
// t3lib_div::readLLfile and the global array $GLOBALS['TYPO3_CONF_VARS']['SYS']['locallangXMLOverride']
if (isset($GLOBALS['TYPO3_CONF_VARS']['BE']['XLLfile'][$parts[0]])) {
t3lib_div::deprecationLog('Usage of $TYPO3_CONF_VARS[\'BE\'][\'XLLfile\'] is deprecated since TYPO3 4.3. Use $TYPO3_CONF_VARS[\'SYS\'][\'locallangXMLOverride\'][] to include the file ' . $fileRef . ' instead.');
$ORarray = $this->readLLfile($GLOBALS['TYPO3_CONF_VARS']['BE']['XLLfile'][$parts[0]]);
$this->LL_files_cache[$parts[0]] = t3lib_div::array_merge_recursive_overrule($this->LL_files_cache[$parts[0]], $ORarray);
}
}
$this->LL_labels_cache[$this->lang][$input] = $this->getLLL($parts[1], $this->LL_files_cache[$parts[0]]);
}
// For the cached output charset conversion has already happened!
// So perform HSC right here.
$output = $this->LL_labels_cache[$this->lang][$input];
if ($hsc) {
$output = t3lib_div::deHSCentities(htmlspecialchars($output));
}
return $output . ($this->debugKey ? ' [' . $input . ']' : '');
}
}
示例11: getFuncMenu
/**
* Returns a selector box "function menu" for a module
* Requires the JS function jumpToUrl() to be available
* See Inside TYPO3 for details about how to use / make Function menus
* Usage: 50
*
* @param mixed $id is the "&id=" parameter value to be sent to the module, but it can be also a parameter array which will be passed instead of the &id=...
* @param string $elementName it the form elements name, probably something like "SET[...]"
* @param string $currentValue is the value to be selected currently.
* @param array $menuItems is an array with the menu items for the selector box
* @param string $script is the script to send the &id to, if empty it's automatically found
* @param string $addParams is additional parameters to pass to the script.
* @return string HTML code for selector box
*/
public static function getFuncMenu($mainParams, $elementName, $currentValue, $menuItems, $script = '', $addparams = '')
{
if (is_array($menuItems)) {
if (!is_array($mainParams)) {
$mainParams = array('id' => $mainParams);
}
$mainParams = t3lib_div::implodeArrayForUrl('', $mainParams);
if (!$script) {
$script = basename(PATH_thisScript);
$mainParams .= t3lib_div::_GET('M') ? '&M=' . rawurlencode(t3lib_div::_GET('M')) : '';
}
$options = array();
foreach ($menuItems as $value => $label) {
$options[] = '<option value="' . htmlspecialchars($value) . '"' . (!strcmp($currentValue, $value) ? ' selected="selected"' : '') . '>' . t3lib_div::deHSCentities(htmlspecialchars($label)) . '</option>';
}
if (count($options)) {
$onChange = 'jumpToUrl(\'' . $script . '?' . $mainParams . $addparams . '&' . $elementName . '=\'+this.options[this.selectedIndex].value,this);';
return '
<!-- Function Menu of module -->
<select name="' . $elementName . '" onchange="' . htmlspecialchars($onChange) . '">
' . implode('
', $options) . '
</select>
';
}
}
}
示例12: getSingleField_typeSelect_singlebox
/**
* Creates a selectorbox list (renderMode = "singlebox")
* (Render function for getSingleField_typeSelect())
*
* @param string See getSingleField_typeSelect()
* @param string See getSingleField_typeSelect()
* @param array See getSingleField_typeSelect()
* @param array See getSingleField_typeSelect()
* @param array (Redundant) content of $PA['fieldConf']['config'] (for convenience)
* @param array Items available for selection
* @param string Label for no-matching-value
* @return string The HTML code for the item
* @see getSingleField_typeSelect()
*/
function getSingleField_typeSelect_singlebox($table, $field, $row, &$PA, $config, $selItems, $nMV_label)
{
// Get values in an array (and make unique, which is fine because there can be no duplicates anyway):
$itemArray = array_flip($this->extractValuesOnlyFromValueLabelList($PA['itemFormElValue']));
$disabled = '';
if ($this->renderReadonly || $config['readOnly']) {
$disabled = ' disabled="disabled"';
}
// Traverse the Array of selector box items:
$opt = array();
$restoreCmd = array();
// Used to accumulate the JS needed to restore the original selection.
$c = 0;
foreach ($selItems as $p) {
// Selected or not by default:
$sM = '';
if (isset($itemArray[$p[1]])) {
$sM = ' selected="selected"';
$restoreCmd[] = $this->elName($PA['itemFormElName'] . '[]') . '.options[' . $c . '].selected=1;';
unset($itemArray[$p[1]]);
}
// Non-selectable element:
$nonSel = '';
if (!strcmp($p[1], '--div--')) {
$nonSel = ' onclick="this.selected=0;" class="c-divider"';
}
// Icon style for option tag:
if ($config['iconsInOptionTags']) {
$styleAttrValue = $this->optionTagStyle($p[2]);
}
// Compile <option> tag:
$opt[] = '<option value="' . htmlspecialchars($p[1]) . '"' . $sM . $nonSel . ($styleAttrValue ? ' style="' . htmlspecialchars($styleAttrValue) . '"' : '') . '>' . t3lib_div::deHSCentities(htmlspecialchars($p[0])) . '</option>';
$c++;
}
// Remaining values:
if (count($itemArray) && !$PA['fieldTSConfig']['disableNoMatchingValueElement'] && !$config['disableNoMatchingValueElement']) {
foreach ($itemArray as $theNoMatchValue => $temp) {
// Compile <option> tag:
array_unshift($opt, '<option value="' . htmlspecialchars($theNoMatchValue) . '" selected="selected">' . t3lib_div::deHSCentities(htmlspecialchars(@sprintf($nMV_label, $theNoMatchValue))) . '</option>');
}
}
// Compile selector box:
$sOnChange = implode('', $PA['fieldChangeFunc']);
$selector_itemListStyle = isset($config['itemListStyle']) ? ' style="' . htmlspecialchars($config['itemListStyle']) . '"' : ' style="' . $this->defaultMultipleSelectorStyle . '"';
$size = intval($config['size']);
$cssPrefix = $size === 1 ? 'tceforms-select' : 'tceforms-multiselect';
$size = $config['autoSizeMax'] ? t3lib_div::intInRange(count($selItems) + 1, t3lib_div::intInRange($size, 1), $config['autoSizeMax']) : $size;
$selectBox = '<select id="' . uniqid($cssPrefix) . '" name="' . $PA['itemFormElName'] . '[]"' . $this->insertDefStyle('select', $cssPrefix) . ($size ? ' size="' . $size . '"' : '') . ' multiple="multiple" onchange="' . htmlspecialchars($sOnChange) . '"' . $PA['onFocus'] . $selector_itemListStyle . $disabled . '>
' . implode('
', $opt) . '
</select>';
// Add an empty hidden field which will send a blank value if all items are unselected.
if (!$disabled) {
$item .= '<input type="hidden" name="' . htmlspecialchars($PA['itemFormElName']) . '" value="" />';
}
// Put it all into a table:
$item .= '
<table border="0" cellspacing="0" cellpadding="0" width="1" class="typo3-TCEforms-select-singlebox">
<tr>
<td>
' . $selectBox . '
<br/>
<em>' . htmlspecialchars($this->getLL('l_holdDownCTRL')) . '</em>
</td>
<td valign="top">
<a href="#" onclick="' . htmlspecialchars($this->elName($PA['itemFormElName'] . '[]') . '.selectedIndex=-1;' . implode('', $restoreCmd) . ' return false;') . '" title="' . htmlspecialchars($this->getLL('l_revertSelection')) . '">' . t3lib_iconWorks::getSpriteIcon('actions-edit-undo') . '</a>
</td>
</tr>
</table>
';
return $item;
}
示例13: getEncodingSelect
/**
* Returns a selector box with charset encodings
*
* @param string $elementName it the form elements name, probably something like "SET[...]"
* @param string $currentKey is the key to be selected currently.
* @param string $firstEntry is the key to be placed on top as first (default) entry.
* @param string $unsetEntries List of keys that should be removed (comma list).
* @return string HTML code for selector box
*/
function getEncodingSelect($elementName, $currentKey, $firstEntry = '', $unsetEntries = '')
{
$menuItems = array('utf-8' => 'UTF-8', 'iso-8859-1' => 'ISO-8859-1 (Western Europe)', 'iso-8859-2' => 'ISO-8859-2 (Central Europe)', 'iso-8859-3' => 'ISO-8859-3 (Latin 3)', 'iso-8859-4' => 'ISO-8859-4 (Baltic)', 'iso-8859-5' => 'ISO-8859-5 (Cyrillic)', 'iso-8859-6' => 'ISO-8859-6 (Arabic)', 'iso-8859-7' => 'ISO-8859-7 (Greek)', 'iso-8859-7' => 'ISO-8859-8 (Hebrew)', 'iso-8859-9' => 'ISO-8859-9 (Turkish)', 'iso-8859-14' => 'ISO-8859-14 (Celtic)', 'iso-8859-15' => 'ISO-8859-15 (Latin 9)', 'windows-1250' => 'Windows 1250 (ANSI - Central Europe)', 'windows-1251' => 'Windows 1251 (ANSI - Cyrillic)', 'windows-1252' => 'Windows 1252 (ANSI - Western Europe)', 'windows-1253' => 'Windows 1253 (ANSI - Greek)', 'windows-1254' => 'Windows 1254 (ANSI - Turkish)', 'windows-1255' => 'Windows 1255 (ANSI - Hebrew)', 'windows-1256' => 'Windows 1256 (ANSI - Arabic)', 'windows-1257' => 'Windows 1257 (ANSI - Baltic)', 'windows-1258' => 'Windows 1258 (ANSI - Vietnamese)', 'koi-8r' => 'KOI-8R (Russian)', 'shift_jis' => 'Shift JIS (Japanese)', 'euc-jp' => 'EUC-JP (Japanese)', 'gb2312' => 'GB2312 / EUC-CN (Chinese Simplified)', 'big5' => 'Big5 (Chinese)', 'ascii' => 'ASCII');
if ($firstEntry and $menuItems[$firstEntry]) {
$entry = array($firstEntry => $menuItems[$firstEntry]);
unset($menuItems[$firstEntry]);
$menuItems = array_merge($entry, $menuItems);
}
$unsetEntries = explode(',', $unsetEntries);
foreach ($unsetEntries as $entry) {
unset($menuItems[$entry]);
}
$options = array();
foreach ($menuItems as $value => $label) {
$options[] = '<option value="' . htmlspecialchars($value) . '"' . (!strcmp($currentKey, $value) ? ' selected="selected"' : '') . '>' . t3lib_div::deHSCentities(htmlspecialchars($label)) . '</option>';
}
if (count($options)) {
return '
<!-- charset encoding menu -->
<select name="' . $elementName . '">
' . implode('
', $options) . '
</select>
';
}
}
示例14: drawRTE
//.........这里部分代码省略.........
$tableAB = 'static_languages';
$whereClause = 'lg_iso_2 = ' . $TYPO3_DB->fullQuoteStr(strtoupper($this->contentISOLanguage), $tableAB);
$res = $TYPO3_DB->exec_SELECTquery($selectFields, $tableAB, $whereClause);
while ($languageRow = $TYPO3_DB->sql_fetch_assoc($res)) {
$this->contentTypo3Language = strtolower(trim($languageRow['lg_typo3']));
}
}
}
// Character sets: interface and content
$this->charset = $LANG->charSet;
$this->OutputCharset = $this->charset;
$this->contentCharset = $LANG->csConvObj->charSetArray[$this->contentTypo3Language];
$this->contentCharset = $this->contentCharset ? $this->contentCharset : 'iso-8859-1';
$this->origContentCharSet = $this->contentCharset;
$this->contentCharset = trim($TYPO3_CONF_VARS['BE']['forceCharset']) ? trim($TYPO3_CONF_VARS['BE']['forceCharset']) : $this->contentCharset;
/* =======================================
* TOOLBAR CONFIGURATION
* =======================================
*/
$this->initializeToolbarConfiguration();
/* =======================================
* SET STYLES
* =======================================
*/
$RTEWidth = isset($BE_USER->userTS['options.']['RTESmallWidth']) ? $BE_USER->userTS['options.']['RTESmallWidth'] : '530';
$RTEHeight = isset($BE_USER->userTS['options.']['RTESmallHeight']) ? $BE_USER->userTS['options.']['RTESmallHeight'] : '380';
$RTEWidth = $RTEWidth + ($this->TCEform->docLarge ? isset($BE_USER->userTS['options.']['RTELargeWidthIncrement']) ? $BE_USER->userTS['options.']['RTELargeWidthIncrement'] : '150' : 0);
$RTEWidth -= $inline->getStructureDepth() > 0 ? ($inline->getStructureDepth() + 1) * $inline->getLevelMargin() : 0;
if (isset($this->thisConfig['RTEWidthOverride'])) {
if (strstr($this->thisConfig['RTEWidthOverride'], '%')) {
if ($this->client['browser'] != 'msie') {
$RTEWidth = intval($this->thisConfig['RTEWidthOverride']) > 0 ? $this->thisConfig['RTEWidthOverride'] : '100%';
}
} else {
$RTEWidth = intval($this->thisConfig['RTEWidthOverride']) > 0 ? intval($this->thisConfig['RTEWidthOverride']) : $RTEWidth;
}
}
$RTEWidth = strstr($RTEWidth, '%') ? $RTEWidth : $RTEWidth . 'px';
$RTEHeight = $RTEHeight + ($this->TCEform->docLarge ? isset($BE_USER->userTS['options.']['RTELargeHeightIncrement']) ? $BE_USER->userTS['options.']['RTELargeHeightIncrement'] : 0 : 0);
$RTEHeightOverride = intval($this->thisConfig['RTEHeightOverride']);
$RTEHeight = $RTEHeightOverride > 0 ? $RTEHeightOverride : $RTEHeight;
$editorWrapWidth = '99%';
$editorWrapHeight = '100%';
$this->RTEdivStyle = 'position:relative; left:0px; top:0px; height:' . $RTEHeight . 'px; width:' . $RTEWidth . '; border: 1px solid black; padding: 2px 2px 2px 2px;';
/* =======================================
* LOAD CSS AND JAVASCRIPT
* =======================================
*/
// Preloading the pageStyle and including RTE skin stylesheets
$this->addPageStyle();
$this->addSkin();
// Loading JavaScript files and code
if ($this->TCEform->RTEcounter == 1) {
$this->TCEform->additionalJS_pre['rtehtmlarea-loadJScode'] = $this->loadJScode($this->TCEform->RTEcounter);
}
$this->TCEform->additionalCode_pre['rtehtmlarea-loadJSfiles'] = $this->loadJSfiles($this->TCEform->RTEcounter);
$pageRenderer = $GLOBALS['SOBE']->doc->getPageRenderer();
$pageRenderer->enableExtJSQuickTips();
if (!$GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->ID]['enableCompressedScripts']) {
$pageRenderer->enableExtJsDebug();
}
/* =======================================
* DRAW THE EDITOR
* =======================================
*/
// Transform value:
$value = $this->transformContent('rte', $PA['itemFormElValue'], $table, $field, $row, $specConf, $thisConfig, $RTErelPath, $thePidValue);
// Further content transformation by registered plugins
foreach ($this->registeredPlugins as $pluginId => $plugin) {
if ($this->isPluginEnabled($pluginId) && method_exists($plugin, "transformContent")) {
$value = $plugin->transformContent($value);
}
}
// Register RTE windows
$this->TCEform->RTEwindows[] = $PA['itemFormElName'];
$textAreaId = htmlspecialchars($PA['itemFormElName']);
// Check if wizard_rte called this for fullscreen edtition; if so, change the size of the RTE to fullscreen using JS
if (basename(PATH_thisScript) == 'wizard_rte.php') {
$this->fullScreen = true;
$editorWrapWidth = '100%';
$editorWrapHeight = '100%';
$this->RTEdivStyle = 'position:relative; left:0px; top:0px; height:100%; width:100%; border: 1px solid black; padding: 2px 0px 2px 2px;';
}
// Register RTE in JS:
$this->TCEform->additionalJS_post[] = $this->registerRTEinJS($this->TCEform->RTEcounter, $table, $row['uid'], $field, $textAreaId);
// Set the save option for the RTE:
$this->TCEform->additionalJS_submit[] = $this->setSaveRTE($this->TCEform->RTEcounter, $this->TCEform->formName, $textAreaId);
$this->TCEform->additionalJS_delete[] = $this->setDeleteRTE($this->TCEform->RTEcounter, $this->TCEform->formName, $textAreaId);
// Draw the textarea
$visibility = 'hidden';
$item = $this->triggerField($PA['itemFormElName']) . '
<div id="pleasewait' . $textAreaId . '" class="pleasewait" style="display: block;" >' . $LANG->getLL('Please wait') . '</div>
<div id="editorWrap' . $textAreaId . '" class="editorWrap" style="visibility: hidden; width:' . $editorWrapWidth . '; height:' . $editorWrapHeight . ';">
<textarea id="RTEarea' . $textAreaId . '" name="' . htmlspecialchars($PA['itemFormElName']) . '" style="' . t3lib_div::deHSCentities(htmlspecialchars($this->RTEdivStyle)) . '">' . t3lib_div::formatForTextarea($value) . '</textarea>
</div>' . ($TYPO3_CONF_VARS['EXTCONF'][$this->ID]['enableDebugMode'] ? '<div id="HTMLAreaLog"></div>' : '') . '
';
}
// Return form item:
return $item;
}
示例15: stdWrap
//.........这里部分代码省略.........
$content = $GLOBALS['TSFE']->csConv($content, $tmp_charset);
}
}
if ($conf['age']) {
$content = $this->calcAge($GLOBALS['EXEC_TIME'] - $content, $conf['age']);
}
if ($conf['case']) {
$content = $this->HTMLcaseshift($content, $conf['case']);
}
if ($conf['bytes']) {
$content = t3lib_div::formatSize($content, $conf['bytes.']['labels']);
}
if ($conf['substring']) {
$content = $this->substring($content, $conf['substring']);
}
if ($conf['removeBadHTML']) {
$content = $this->removeBadHTML($content, $conf['removeBadHTML.']);
}
if ($conf['cropHTML']) {
$content = $this->cropHTML($content, $conf['cropHTML']);
}
if ($conf['stripHtml']) {
$content = strip_tags($content);
}
if ($conf['crop']) {
$content = $this->crop($content, $conf['crop']);
}
if ($conf['rawUrlEncode']) {
$content = rawurlencode($content);
}
if ($conf['htmlSpecialChars']) {
$content = htmlSpecialChars($content);
if ($conf['htmlSpecialChars.']['preserveEntities']) {
$content = t3lib_div::deHSCentities($content);
}
}
if ($conf['doubleBrTag']) {
$content = preg_replace("/\r?\n[\t ]*\r?\n/", $conf['doubleBrTag'], $content);
}
if ($conf['br']) {
$content = nl2br($content);
}
if ($conf['brTag']) {
$content = str_replace(LF, $conf['brTag'], $content);
}
if ($conf['encapsLines.']) {
$content = $this->encaps_lineSplit($content, $conf['encapsLines.']);
}
if ($conf['keywords']) {
$content = $this->keywords($content);
}
if ($conf['innerWrap'] || $conf['innerWrap.']) {
$content = $this->wrap($content, $this->stdWrap($conf['innerWrap'], $conf['innerWrap.']));
}
if ($conf['innerWrap2'] || $conf['innerWrap2.']) {
$content = $this->wrap($content, $this->stdWrap($conf['innerWrap2'], $conf['innerWrap2.']));
}
if ($conf['fontTag']) {
$content = $this->wrap($content, $conf['fontTag']);
}
if ($conf['addParams.']) {
$content = $this->addParams($content, $conf['addParams.']);
}
if ($conf['textStyle.']) {
$content = $this->textStyle($content, $conf['textStyle.']);
}