本文整理汇总了PHP中TYPO3\CMS\Core\Utility\GeneralUtility::formatForTextarea方法的典型用法代码示例。如果您正苦于以下问题:PHP GeneralUtility::formatForTextarea方法的具体用法?PHP GeneralUtility::formatForTextarea怎么用?PHP GeneralUtility::formatForTextarea使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\GeneralUtility
的用法示例。
在下文中一共展示了GeneralUtility::formatForTextarea方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: drawRTE
/**
* Draws the RTE as a form field or whatever is needed (inserts JavaApplet, creates iframe, renders ....)
* Default is to output the transformed content in a plain textarea field. This mode is great for debugging transformations!
*
* @param object $pObj Reference to parent object, which is an instance of the TCEforms.
* @param string $table The table name
* @param string $field The field name
* @param array $row The current row from which field is being rendered
* @param array $PA Array of standard content for rendering form fields from TCEforms. See TCEforms for details on this. Includes for instance the value and the form field name, java script actions and more.
* @param array $specConf "special" configuration - what is found at position 4 in the types configuration of a field from record, parsed into an array.
* @param array $thisConfig Configuration for RTEs; A mix between TSconfig and otherwise. Contains configuration for display, which buttons are enabled, additional transformation information etc.
* @param string $RTEtypeVal Record "type" field value.
* @param string $RTErelPath Relative path for images/links in RTE; this is used when the RTE edits content from static files where the path of such media has to be transformed forth and back!
* @param integer $thePidValue PID value of record (true parent page id)
* @return string HTML code for RTE!
* @todo Define visibility
*/
public function drawRTE(&$pObj, $table, $field, $row, $PA, $specConf, $thisConfig, $RTEtypeVal, $RTErelPath, $thePidValue)
{
// Transform value:
$value = $this->transformContent('rte', $PA['itemFormElValue'], $table, $field, $row, $specConf, $thisConfig, $RTErelPath, $thePidValue);
// Create item:
$item = '
' . $this->triggerField($PA['itemFormElName']) . '
<textarea name="' . htmlspecialchars($PA['itemFormElName']) . '"' . $pObj->formWidthText('48', 'off') . ' rows="20" wrap="off" style="background-color: #99eebb;">' . GeneralUtility::formatForTextarea($value) . '</textarea>';
// Return form item:
return $item;
}
示例2: render
//.........这里部分代码省略.........
$addParams = '';
}
$dontMd5FieldNames = isset($conf['dontMd5FieldNames.']) ? $this->cObj->stdWrap($conf['dontMd5FieldNames'], $conf['dontMd5FieldNames.']) : $conf['dontMd5FieldNames'];
if ($dontMd5FieldNames) {
$fName = $confData['fieldname'];
} else {
$fName = md5($confData['fieldname']);
}
// Accessibility: Set id = fieldname attribute:
$accessibility = isset($conf['accessibility.']) ? $this->cObj->stdWrap($conf['accessibility'], $conf['accessibility.']) : $conf['accessibility'];
if ($accessibility || $xhtmlStrict) {
$elementIdAttribute = ' id="' . $prefix . $fName . '"';
} else {
$elementIdAttribute = '';
}
// Create form field based on configuration/type:
switch ($confData['type']) {
case 'textarea':
$cols = trim($fParts[1]) ? (int) $fParts[1] : 20;
$compensateFieldWidth = isset($conf['compensateFieldWidth.']) ? $this->cObj->stdWrap($conf['compensateFieldWidth'], $conf['compensateFieldWidth.']) : $conf['compensateFieldWidth'];
$compWidth = doubleval($compensateFieldWidth ? $compensateFieldWidth : $GLOBALS['TSFE']->compensateFieldWidth);
$compWidth = $compWidth ? $compWidth : 1;
$cols = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($cols * $compWidth, 1, 120);
$rows = trim($fParts[2]) ? \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($fParts[2], 1, 30) : 5;
$wrap = trim($fParts[3]);
$noWrapAttr = isset($conf['noWrapAttr.']) ? $this->cObj->stdWrap($conf['noWrapAttr'], $conf['noWrapAttr.']) : $conf['noWrapAttr'];
if ($noWrapAttr || $wrap === 'disabled') {
$wrap = '';
} else {
$wrap = $wrap ? ' wrap="' . $wrap . '"' : ' wrap="virtual"';
}
$noValueInsert = isset($conf['noValueInsert.']) ? $this->cObj->stdWrap($conf['noValueInsert'], $conf['noValueInsert.']) : $conf['noValueInsert'];
$default = $this->cObj->getFieldDefaultValue($noValueInsert, $confData['fieldname'], str_replace('\\n', LF, trim($parts[2])));
$fieldCode = sprintf('<textarea name="%s"%s cols="%s" rows="%s"%s%s>%s</textarea>', $confData['fieldname'], $elementIdAttribute, $cols, $rows, $wrap, $addParams, GeneralUtility::formatForTextarea($default));
break;
case 'input':
case 'password':
$size = trim($fParts[1]) ? (int) $fParts[1] : 20;
$compensateFieldWidth = isset($conf['compensateFieldWidth.']) ? $this->cObj->stdWrap($conf['compensateFieldWidth'], $conf['compensateFieldWidth.']) : $conf['compensateFieldWidth'];
$compWidth = doubleval($compensateFieldWidth ? $compensateFieldWidth : $GLOBALS['TSFE']->compensateFieldWidth);
$compWidth = $compWidth ? $compWidth : 1;
$size = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($size * $compWidth, 1, 120);
$noValueInsert = isset($conf['noValueInsert.']) ? $this->cObj->stdWrap($conf['noValueInsert'], $conf['noValueInsert.']) : $conf['noValueInsert'];
$default = $this->cObj->getFieldDefaultValue($noValueInsert, $confData['fieldname'], trim($parts[2]));
if ($confData['type'] == 'password') {
$default = '';
}
$max = trim($fParts[2]) ? ' maxlength="' . \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($fParts[2], 1, 1000) . '"' : '';
$theType = $confData['type'] == 'input' ? 'text' : 'password';
$fieldCode = sprintf('<input type="%s" name="%s"%s size="%s"%s value="%s"%s />', $theType, $confData['fieldname'], $elementIdAttribute, $size, $max, htmlspecialchars($default), $addParams);
break;
case 'file':
$size = trim($fParts[1]) ? \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($fParts[1], 1, 60) : 20;
$fieldCode = sprintf('<input type="file" name="%s"%s size="%s"%s />', $confData['fieldname'], $elementIdAttribute, $size, $addParams);
break;
case 'check':
// alternative default value:
$noValueInsert = isset($conf['noValueInsert.']) ? $this->cObj->stdWrap($conf['noValueInsert'], $conf['noValueInsert.']) : $conf['noValueInsert'];
$default = $this->cObj->getFieldDefaultValue($noValueInsert, $confData['fieldname'], trim($parts[2]));
$checked = $default ? ' checked="checked"' : '';
$fieldCode = sprintf('<input type="checkbox" value="%s" name="%s"%s%s%s />', 1, $confData['fieldname'], $elementIdAttribute, $checked, $addParams);
break;
case 'select':
$option = '';
$valueParts = explode(',', $parts[2]);
// size
示例3: getSingleField_typeText
//.........这里部分代码省略.........
$altItem = '<input type="hidden" name="' . htmlspecialchars($PA['itemFormElName']) . '" value="' . htmlspecialchars($PA['itemFormElValue']) . '" />';
$item = '';
// If RTE is generally enabled (TYPO3_CONF_VARS and user settings)
if ($this->RTEenabled) {
$p = BackendUtility::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']);
// If the field is configured for RTE and if any flag-field is not set to disable it.
if (isset($specConf['richtext']) && (!$p['flag'] || !$row[$p['flag']])) {
BackendUtility::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 = $this->getBackendUserAuthentication()->getTSConfig('RTE', BackendUtility::getPagesTSconfig($tscPID));
$RTEtypeVal = BackendUtility::getTCAtypeValue($table, $row);
$thisConfig = BackendUtility::RTEsetup($RTEsetup['properties'], $table, $field, $RTEtypeVal);
if (!$thisConfig['disabled']) {
if (!$this->disableRTE) {
$this->RTEcounter++;
// Find alternative relative path for RTE images/links:
$eFile = RteHtmlParser::evalWriteFile($specConf['static_write'], $row);
$RTErelPath = is_array($eFile) ? dirname($eFile['relEditFile']) : '';
// Get RTE object, draw form and set flag:
$RTEobj = BackendUtility::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) {
// Show message, if no RTE (field can only be edited with RTE!)
if ($specConf['rte_only']) {
$item = '<p><em>' . htmlspecialchars($this->getLL('l_noRTEfound')) . '</em></p>';
} else {
if ($specConf['nowrap']) {
$wrap = 'off';
} else {
$wrap = $config['wrap'] ?: 'virtual';
}
$classes = array();
if ($specConf['fixed-font']) {
$classes[] = 'fixed-font';
}
if ($specConf['enable-tab']) {
$classes[] = 'enable-tab';
}
$formWidthText = $this->formWidthText($cols, $wrap);
// Extract class attributes from $formWidthText (otherwise it would be added twice to the output)
$res = array();
if (preg_match('/ class="(.+?)"/', $formWidthText, $res)) {
$formWidthText = str_replace(' class="' . $res[1] . '"', '', $formWidthText);
$classes = array_merge($classes, explode(' ', $res[1]));
}
if (count($classes)) {
$class = ' class="tceforms-textarea ' . implode(' ', $classes) . '"';
} else {
$class = 'tceforms-textarea';
}
$evalList = GeneralUtility::trimExplode(',', $config['eval'], TRUE);
foreach ($evalList as $func) {
switch ($func) {
case 'required':
$this->registerRequiredProperty('field', $table . '_' . $row['uid'] . '_' . $field, $PA['itemFormElName']);
break;
default:
// Pair hook to the one in \TYPO3\CMS\Core\DataHandling\DataHandler::checkValue_input_Eval()
// and \TYPO3\CMS\Core\DataHandling\DataHandler::checkValue_text_Eval()
$evalObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tce']['formevals'][$func] . ':&' . $func);
if (is_object($evalObj) && method_exists($evalObj, 'deevaluateFieldValue')) {
$_params = array('value' => $PA['itemFormElValue']);
$PA['itemFormElValue'] = $evalObj->deevaluateFieldValue($_params);
}
}
}
$iOnChange = implode('', $PA['fieldChangeFunc']);
$item .= '
<textarea ' . 'id="' . uniqid('tceforms-textarea-') . '" ' . 'name="' . $PA['itemFormElName'] . '"' . $formWidthText . $class . ' ' . 'rows="' . $rows . '" ' . 'wrap="' . $wrap . '" ' . 'onchange="' . htmlspecialchars($iOnChange) . '"' . $this->getPlaceholderAttribute($table, $field, $config, $row) . $PA['onFocus'] . '>' . GeneralUtility::formatForTextarea($PA['itemFormElValue']) . '</textarea>';
$item = $this->renderWizards(array($item, $altItem), $config['wizards'], $table, $row, $field, $PA, $PA['itemFormElName'], $specConf, $RTEwouldHaveBeenLoaded);
}
}
// Return field HTML:
return $item;
}
示例4: getQueryResultCode
/**
* [Describe function...]
*
* @param string $mQ
* @param pointer $res
* @param string $table
* @return string
* @todo Define visibility
*/
public function getQueryResultCode($mQ, $res, $table)
{
$out = '';
$cPR = array();
switch ($mQ) {
case 'count':
$row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$cPR['header'] = 'Count';
$cPR['content'] = '<BR><strong>' . $row[0] . '</strong> records selected.';
break;
case 'all':
$rowArr = array();
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$rowArr[] = $this->resultRowDisplay($row, $GLOBALS['TCA'][$table], $table);
$lrow = $row;
}
if (is_array($this->hookArray['beforeResultTable'])) {
foreach ($this->hookArray['beforeResultTable'] as $_funcRef) {
$out .= GeneralUtility::callUserFunction($_funcRef, $GLOBALS['SOBE']->MOD_SETTINGS, $this);
}
}
if (count($rowArr)) {
$out .= '<table border="0" cellpadding="2" cellspacing="1" width="100%">' . $this->resultRowTitles($lrow, $GLOBALS['TCA'][$table], $table) . implode(LF, $rowArr) . '</table>';
}
if (!$out) {
$out = '<em>No rows selected!</em>';
}
$cPR['header'] = 'Result';
$cPR['content'] = $out;
break;
case 'csv':
$rowArr = array();
$first = 1;
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if ($first) {
$rowArr[] = $this->csvValues(array_keys($row), ',', '');
$first = 0;
}
$rowArr[] = $this->csvValues($row, ',', '"', $GLOBALS['TCA'][$table], $table);
}
if (count($rowArr)) {
$out .= '<textarea name="whatever" rows="20" wrap="off"' . $GLOBALS['SOBE']->doc->formWidthText($this->formW, '', 'off') . ' class="fixed-font">' . GeneralUtility::formatForTextarea(implode(LF, $rowArr)) . '</textarea>';
if (!$this->noDownloadB) {
$out .= '<BR><input type="submit" name="download_file" value="Click to download file" onClick="window.location.href=\'' . $this->downloadScript . '\';">';
}
// Downloads file:
if (GeneralUtility::_GP('download_file')) {
$filename = 'TYPO3_' . $table . '_export_' . date('dmy-Hi') . '.csv';
$mimeType = 'application/octet-stream';
header('Content-Type: ' . $mimeType);
header('Content-Disposition: attachment; filename=' . $filename);
echo implode(CRLF, $rowArr);
die;
}
}
if (!$out) {
$out = '<em>No rows selected!</em>';
}
$cPR['header'] = 'Result';
$cPR['content'] = $out;
break;
case 'explain':
default:
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$out .= '<br />' . \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($row);
}
$cPR['header'] = 'Explain SQL query';
$cPR['content'] = $out;
}
return $cPR;
}
示例5: main
//.........这里部分代码省略.........
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postTCEProcessingHook'])) {
$postTCEProcessingHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postTCEProcessingHook'];
if (is_array($postTCEProcessingHook)) {
$hookParameters = array('POST' => $POST, 'tce' => $tce);
foreach ($postTCEProcessingHook as $hookFunction) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
}
}
}
$content = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('sys_template', $tplRow) . '<strong>' . htmlspecialchars($tplRow['title']) . '</strong>' . htmlspecialchars(trim($tplRow['sitetitle']) ? ' (' . $tplRow['sitetitle'] . ')' : '');
$theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('templateInformation'), $content, 0, 1);
if ($manyTemplatesMenu) {
$theOutput .= $this->pObj->doc->section('', $manyTemplatesMenu);
}
$theOutput .= $this->pObj->doc->spacer(10);
$numberOfRows = 35;
// If abort pressed, nothing should be edited:
if ($POST['abort'] || \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($POST['abort_x']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($POST['abort_y']) || $POST['saveclose'] || \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($POST['saveclose_x']) && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($POST['saveclose_y'])) {
unset($e);
}
if ($e['title']) {
$outCode = '<input type="Text" name="data[title]" value="' . htmlspecialchars($tplRow['title']) . '"' . $this->pObj->doc->formWidth() . '>';
$outCode .= '<input type="Hidden" name="e[title]" value="1">';
$theOutput .= $this->pObj->doc->spacer(15);
$theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('title'), $outCode, TRUE);
}
if ($e['sitetitle']) {
$outCode = '<input type="Text" name="data[sitetitle]" value="' . htmlspecialchars($tplRow['sitetitle']) . '"' . $this->pObj->doc->formWidth() . '>';
$outCode .= '<input type="Hidden" name="e[sitetitle]" value="1">';
$theOutput .= $this->pObj->doc->spacer(15);
$theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('sitetitle'), $outCode, TRUE);
}
if ($e['description']) {
$outCode = '<textarea name="data[description]" rows="5" class="fixed-font enable-tab"' . $this->pObj->doc->formWidthText(48, '', '') . '>' . \TYPO3\CMS\Core\Utility\GeneralUtility::formatForTextarea($tplRow['description']) . '</textarea>';
$outCode .= '<input type="Hidden" name="e[description]" value="1">';
$theOutput .= $this->pObj->doc->spacer(15);
$theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('description'), $outCode, TRUE);
}
if ($e['constants']) {
$outCode = '<textarea name="data[constants]" rows="' . $numberOfRows . '" wrap="off" class="fixed-font enable-tab"' . $this->pObj->doc->formWidthText(48, 'width:98%;height:70%', 'off') . ' class="fixed-font">' . \TYPO3\CMS\Core\Utility\GeneralUtility::formatForTextarea($tplRow['constants']) . '</textarea>';
$outCode .= '<input type="Hidden" name="e[constants]" value="1">';
// Display "Include TypoScript file content?" checkbox
$outCode .= \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncCheck($this->pObj->id, 'SET[includeTypoScriptFileContent]', $this->pObj->MOD_SETTINGS['includeTypoScriptFileContent'], '', '&e[constants]=1', 'id="checkIncludeTypoScriptFileContent"');
$outCode .= '<label for="checkIncludeTypoScriptFileContent">' . $GLOBALS['LANG']->getLL('includeTypoScriptFileContent') . '</label><br />';
$theOutput .= $this->pObj->doc->spacer(15);
$theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('constants'), '', TRUE);
$theOutput .= $this->pObj->doc->sectionEnd() . $outCode;
}
if ($e['file']) {
$path = PATH_site . $GLOBALS['TCA']['sys_template']['columns']['resources']['config']['uploadfolder'] . '/' . $e[file];
$fI = \TYPO3\CMS\Core\Utility\GeneralUtility::split_fileref($e[file]);
if (@is_file($path) && \TYPO3\CMS\Core\Utility\GeneralUtility::inList($this->pObj->textExtensions, $fI['fileext'])) {
if (filesize($path) < $GLOBALS['TCA']['sys_template']['columns']['resources']['config']['max_size'] * 1024) {
$fileContent = \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($path);
$outCode = $GLOBALS['LANG']->getLL('file') . ' <strong>' . $e[file] . '</strong><BR>';
$outCode .= '<textarea name="edit[file]" rows="' . $numberOfRows . '" wrap="off" class="fixed-font enable-tab"' . $this->pObj->doc->formWidthText(48, 'width:98%;height:70%', 'off') . ' class="fixed-font">' . \TYPO3\CMS\Core\Utility\GeneralUtility::formatForTextarea($fileContent) . '</textarea>';
$outCode .= '<input type="Hidden" name="edit[filename]" value="' . $e[file] . '">';
$outCode .= '<input type="Hidden" name="e[file]" value="' . htmlspecialchars($e[file]) . '">';
$theOutput .= $this->pObj->doc->spacer(15);
$theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('editResource'), '');
$theOutput .= $this->pObj->doc->sectionEnd() . $outCode;
} else {
$theOutput .= $this->pObj->doc->spacer(15);
$fileToBig = sprintf($GLOBALS['LANG']->getLL('filesizeExceeded'), $GLOBALS['TCA']['sys_template']['columns']['resources']['config']['max_size']);
$filesizeNotAllowed = sprintf($GLOBALS['LANG']->getLL('notAllowed'), $GLOBALS['TCA']['sys_template']['columns']['resources']['config']['max_size']);
$theOutput .= $this->pObj->doc->section('<font color=red>' . $fileToBig . '</font>', $filesizeNotAllowed, 0, 0, 0, 1);
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:67,代码来源:TypoScriptTemplateInformationModuleFunctionController.php
示例6: main
/**
* The main processing method if this class
*
* @return string Information of the template status or the taken actions as HTML string
*/
public function main()
{
$lang = $this->getLanguageService();
$lang->includeLLFile('EXT:tstemplate/Resources/Private/Language/locallang_info.xlf');
$this->pObj->MOD_MENU['includeTypoScriptFileContent'] = TRUE;
$e = $this->pObj->e;
// Checking for more than one template an if, set a menu...
$manyTemplatesMenu = $this->pObj->templateMenu();
$template_uid = 0;
if ($manyTemplatesMenu) {
$template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage'];
}
// Initialize
$existTemplate = $this->initialize_editor($this->pObj->id, $template_uid);
$tplRow = $GLOBALS['tplRow'];
$saveId = 0;
if ($existTemplate) {
$saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
}
// Create extension template
$newId = $this->pObj->createTemplate($this->pObj->id, $saveId);
if ($newId) {
// Switch to new template
$urlParameters = array('id' => $this->pObj->id, 'SET[templatesOnPage]' => $newId);
$aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
HttpUtility::redirect($aHref);
}
$tce = NULL;
$theOutput = '';
if ($existTemplate) {
// Update template ?
$POST = GeneralUtility::_POST();
if ($POST['submit'] || MathUtility::canBeInterpretedAsInteger($POST['submit_x']) && MathUtility::canBeInterpretedAsInteger($POST['submit_y']) || $POST['saveclose'] || MathUtility::canBeInterpretedAsInteger($POST['saveclose_x']) && MathUtility::canBeInterpretedAsInteger($POST['saveclose_y'])) {
// Set the data to be saved
$recData = array();
$alternativeFileName = array();
if (is_array($POST['data'])) {
foreach ($POST['data'] as $field => $val) {
switch ($field) {
case 'constants':
case 'config':
$recData['sys_template'][$saveId][$field] = $val;
break;
}
}
}
if (!empty($recData)) {
$recData['sys_template'][$saveId] = $this->processTemplateRowBeforeSaving($recData['sys_template'][$saveId]);
// Create new tce-object
$tce = GeneralUtility::makeInstance(DataHandler::class);
$tce->stripslashes_values = FALSE;
$tce->alternativeFileName = $alternativeFileName;
// Initialize
$tce->start($recData, array());
// Saved the stuff
$tce->process_datamap();
// Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
$tce->clear_cacheCmd('all');
// tce were processed successfully
$this->tce_processed = TRUE;
// re-read the template ...
$this->initialize_editor($this->pObj->id, $template_uid);
$tplRow = $GLOBALS['tplRow'];
// reload template menu
$manyTemplatesMenu = $this->pObj->templateMenu();
}
}
// Hook post updating template/TCE processing
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postTCEProcessingHook'])) {
$postTCEProcessingHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/tstemplate_info/class.tx_tstemplateinfo.php']['postTCEProcessingHook'];
if (is_array($postTCEProcessingHook)) {
$hookParameters = array('POST' => $POST, 'tce' => $tce);
foreach ($postTCEProcessingHook as $hookFunction) {
GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
}
}
}
$content = '<a href="#" class="t3-js-clickmenutrigger" data-table="sys_template" data-uid="' . $tplRow['uid'] . '" data-listframe="1">' . IconUtility::getSpriteIconForRecord('sys_template', $tplRow) . '</a><strong>' . htmlspecialchars($tplRow['title']) . '</strong>' . htmlspecialchars(trim($tplRow['sitetitle']) ? ' (' . $tplRow['sitetitle'] . ')' : '');
$theOutput .= $this->pObj->doc->section($lang->getLL('templateInformation'), $content, 0, 1);
if ($manyTemplatesMenu) {
$theOutput .= $this->pObj->doc->section('', $manyTemplatesMenu);
}
$theOutput .= $this->pObj->doc->spacer(10);
$numberOfRows = 35;
// If abort pressed, nothing should be edited:
if ($POST['saveclose'] || MathUtility::canBeInterpretedAsInteger($POST['saveclose_x']) && MathUtility::canBeInterpretedAsInteger($POST['saveclose_y'])) {
unset($e);
}
if (isset($e['constants'])) {
$outCode = '<textarea name="data[constants]" rows="' . $numberOfRows . '" wrap="off" class="text-monospace enable-tab"' . $this->pObj->doc->formWidth(48, TRUE, 'width:98%;height:70%') . ' class="text-monospace">' . GeneralUtility::formatForTextarea($tplRow['constants']) . '</textarea>';
$outCode .= '<input type="hidden" name="e[constants]" value="1">';
// Display "Include TypoScript file content?" checkbox
$outCode .= '<div class="checkbox"><label for="checkIncludeTypoScriptFileContent">' . BackendUtility::getFuncCheck($this->pObj->id, 'SET[includeTypoScriptFileContent]', $this->pObj->MOD_SETTINGS['includeTypoScriptFileContent'], '', '&e[constants]=1', 'id="checkIncludeTypoScriptFileContent"');
$outCode .= $lang->getLL('includeTypoScriptFileContent') . '</label></div><br />';
$theOutput .= $this->pObj->doc->spacer(15);
//.........这里部分代码省略.........
开发者ID:adrolli,项目名称:TYPO3.CMS,代码行数:101,代码来源:TypoScriptTemplateInformationModuleFunctionController.php
示例7: getTableHTML
/**
* Creates the HTML for the Table Wizard:
*
* @param array $cfgArr Table config array
* @param array $row Current parent record array
* @return string HTML for the table wizard
* @access private
* @todo Define visibility
*/
public function getTableHTML($cfgArr, $row)
{
// Traverse the rows:
$tRows = array();
$k = 0;
foreach ($cfgArr as $cellArr) {
if (is_array($cellArr)) {
// Initialize:
$cells = array();
$a = 0;
// Traverse the columns:
foreach ($cellArr as $cellContent) {
if ($this->inputStyle) {
$cells[] = '<input type="text"' . $this->doc->formWidth(20) . ' name="TABLE[c][' . ($k + 1) * 2 . '][' . ($a + 1) * 2 . ']" value="' . htmlspecialchars($cellContent) . '" />';
} else {
$cellContent = preg_replace('/<br[ ]?[\\/]?>/i', LF, $cellContent);
$cells[] = '<textarea ' . $this->doc->formWidth(20) . ' rows="5" name="TABLE[c][' . ($k + 1) * 2 . '][' . ($a + 1) * 2 . ']">' . \TYPO3\CMS\Core\Utility\GeneralUtility::formatForTextarea($cellContent) . '</textarea>';
}
// Increment counter:
$a++;
}
// CTRL panel for a table row (move up/down/around):
$onClick = 'document.wizardForm.action+=\'#ANC_' . (($k + 1) * 2 - 2) . '\';';
$onClick = ' onclick="' . htmlspecialchars($onClick) . '"';
$ctrl = '';
$brTag = $this->inputStyle ? '' : '<br />';
if ($k != 0) {
$ctrl .= '<input type="image" name="TABLE[row_up][' . ($k + 1) * 2 . ']"' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->doc->backPath, 'gfx/pil2up.gif', '') . $onClick . ' title="' . $GLOBALS['LANG']->getLL('table_up', 1) . '" />' . $brTag;
} else {
$ctrl .= '<input type="image" name="TABLE[row_bottom][' . ($k + 1) * 2 . ']"' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->doc->backPath, 'gfx/turn_up.gif', '') . $onClick . ' title="' . $GLOBALS['LANG']->getLL('table_bottom', 1) . '" />' . $brTag;
}
$ctrl .= '<input type="image" name="TABLE[row_remove][' . ($k + 1) * 2 . ']"' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->doc->backPath, 'gfx/garbage.gif', '') . $onClick . ' title="' . $GLOBALS['LANG']->getLL('table_removeRow', 1) . '" />' . $brTag;
// FIXME what is $tLines? See wizard_forms.php for the same.
if ($k + 1 != count($tLines)) {
$ctrl .= '<input type="image" name="TABLE[row_down][' . ($k + 1) * 2 . ']"' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->doc->backPath, 'gfx/pil2down.gif', '') . $onClick . ' title="' . $GLOBALS['LANG']->getLL('table_down', 1) . '" />' . $brTag;
} else {
$ctrl .= '<input type="image" name="TABLE[row_top][' . ($k + 1) * 2 . ']"' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->doc->backPath, 'gfx/turn_down.gif', '') . $onClick . ' title="' . $GLOBALS['LANG']->getLL('table_top', 1) . '" />' . $brTag;
}
$ctrl .= '<input type="image" name="TABLE[row_add][' . ($k + 1) * 2 . ']"' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->doc->backPath, 'gfx/add.gif', '') . $onClick . ' title="' . $GLOBALS['LANG']->getLL('table_addRow', 1) . '" />' . $brTag;
$tRows[] = '
<tr class="bgColor4">
<td class="bgColor5"><a name="ANC_' . ($k + 1) * 2 . '"></a><span class="c-wizButtonsV">' . $ctrl . '</span></td>
<td>' . implode('</td>
<td>', $cells) . '</td>
</tr>';
// Increment counter:
$k++;
}
}
// CTRL panel for a table column (move left/right/around/delete)
$cells = array();
$cells[] = '';
// Finding first row:
$firstRow = reset($cfgArr);
if (is_array($firstRow)) {
// Init:
$a = 0;
$cols = count($firstRow);
// Traverse first row:
foreach ($firstRow as $temp) {
$ctrl = '';
if ($a != 0) {
$ctrl .= '<input type="image" name="TABLE[col_left][' . ($a + 1) * 2 . ']"' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->doc->backPath, 'gfx/pil2left.gif', '') . ' title="' . $GLOBALS['LANG']->getLL('table_left', 1) . '" />';
} else {
$ctrl .= '<input type="image" name="TABLE[col_end][' . ($a + 1) * 2 . ']"' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->doc->backPath, 'gfx/turn_left.gif', '') . ' title="' . $GLOBALS['LANG']->getLL('table_end', 1) . '" />';
}
$ctrl .= '<input type="image" name="TABLE[col_remove][' . ($a + 1) * 2 . ']"' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->doc->backPath, 'gfx/garbage.gif', '') . ' title="' . $GLOBALS['LANG']->getLL('table_removeColumn', 1) . '" />';
if ($a + 1 != $cols) {
$ctrl .= '<input type="image" name="TABLE[col_right][' . ($a + 1) * 2 . ']"' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->doc->backPath, 'gfx/pil2right.gif', '') . ' title="' . $GLOBALS['LANG']->getLL('table_right', 1) . '" />';
} else {
$ctrl .= '<input type="image" name="TABLE[col_start][' . ($a + 1) * 2 . ']"' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->doc->backPath, 'gfx/turn_right.gif', '') . ' title="' . $GLOBALS['LANG']->getLL('table_start', 1) . '" />';
}
$ctrl .= '<input type="image" name="TABLE[col_add][' . ($a + 1) * 2 . ']"' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($this->doc->backPath, 'gfx/add.gif', '') . ' title="' . $GLOBALS['LANG']->getLL('table_addColumn', 1) . '" />';
$cells[] = '<span class="c-wizButtonsH">' . $ctrl . '</span>';
// Incr. counter:
$a++;
}
$tRows[] = '
<tr class="bgColor5">
<td align="center">' . implode('</td>
<td align="center">', $cells) . '</td>
</tr>';
}
$content = '';
// Implode all table rows into a string, wrapped in table tags.
$content .= '
<!--
Table wizard
-->
//.........这里部分代码省略.........
示例8: phpinformation
/**
* Outputs system information
*
* @return void
* @todo Define visibility
*/
public function phpinformation()
{
$headCode = 'PHP information';
$sVar = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('_ARRAY');
$sVar['CONST: PHP_OS'] = PHP_OS;
$sVar['CONST: TYPO3_OS'] = TYPO3_OS;
$sVar['CONST: PATH_thisScript'] = PATH_thisScript;
$sVar['CONST: php_sapi_name()'] = PHP_SAPI;
$sVar['OTHER: TYPO3_VERSION'] = TYPO3_version;
$sVar['OTHER: PHP_VERSION'] = phpversion();
$sVar['imagecreatefromgif()'] = function_exists('imagecreatefromgif');
$sVar['imagecreatefrompng()'] = function_exists('imagecreatefrompng');
$sVar['imagecreatefromjpeg()'] = function_exists('imagecreatefromjpeg');
$sVar['imagegif()'] = function_exists('imagegif');
$sVar['imagepng()'] = function_exists('imagepng');
$sVar['imagejpeg()'] = function_exists('imagejpeg');
$sVar['imagettftext()'] = function_exists('imagettftext');
$sVar['OTHER: IMAGE_TYPES'] = function_exists('imagetypes') ? imagetypes() : 0;
$sVar['OTHER: memory_limit'] = ini_get('memory_limit');
$gE_keys = explode(',', 'SERVER_PORT,SERVER_SOFTWARE,GATEWAY_INTERFACE,SCRIPT_NAME,PATH_TRANSLATED');
foreach ($gE_keys as $k) {
$sVar['SERVER: ' . $k] = $_SERVER[$k];
}
$gE_keys = explode(',', 'image_processing,gdlib,gdlib_png,im,im_path,im_path_lzw,im_version_5,im_negate_mask,im_imvMaskState,im_combine_filename');
foreach ($gE_keys as $k) {
$sVar['T3CV_GFX: ' . $k] = $GLOBALS['TYPO3_CONF_VARS']['GFX'][$k];
}
$debugInfo = array('### DEBUG SYSTEM INFORMATION - START ###');
foreach ($sVar as $kkk => $vvv) {
$debugInfo[] = str_pad(substr($kkk, 0, 20), 20) . ': ' . $vvv;
}
$debugInfo[] = '### DEBUG SYSTEM INFORMATION - END ###';
// Get the template file
$templateFile = @file_get_contents(PATH_site . $this->templateFilePath . 'PhpInformation.html');
// Get the template part from the file
$template = \TYPO3\CMS\Core\Html\HtmlParser::getSubpart($templateFile, '###TEMPLATE###');
// Define the markers content
$markers = array('explanation' => 'Please copy/paste the information from this text field into an email or bug-report as "Debug System Information" whenever you wish to get support or report problems. This information helps others to check if your system has some obvious misconfiguration and you\'ll get your help faster!', 'debugInfo' => \TYPO3\CMS\Core\Utility\GeneralUtility::formatForTextarea(implode(LF, $debugInfo)));
// Fill the markers
$content = \TYPO3\CMS\Core\Html\HtmlParser::substituteMarkerArray($template, $markers, '###|###', TRUE, FALSE);
// Add the content to the message array
$this->message($headCode, 'DEBUG information', $content);
// Start with various server information
$getEnvArray = array();
$gE_keys = explode(',', 'QUERY_STRING,HTTP_ACCEPT,HTTP_ACCEPT_ENCODING,HTTP_ACCEPT_LANGUAGE,HTTP_CONNECTION,HTTP_COOKIE,HTTP_HOST,HTTP_USER_AGENT,REMOTE_ADDR,REMOTE_HOST,REMOTE_PORT,SERVER_ADDR,SERVER_ADMIN,SERVER_NAME,SERVER_PORT,SERVER_SIGNATURE,SERVER_SOFTWARE,GATEWAY_INTERFACE,SERVER_PROTOCOL,REQUEST_METHOD,SCRIPT_NAME,PATH_TRANSLATED,HTTP_REFERER,PATH_INFO');
foreach ($gE_keys as $k) {
$getEnvArray[$k] = getenv($k);
}
$this->message($headCode, 'TYPO3\\CMS\\Core\\Utility\\GeneralUtility::getIndpEnv()', $this->viewArray(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('_ARRAY')));
$this->message($headCode, 'getenv()', $this->viewArray($getEnvArray));
$this->message($headCode, '_ENV', $this->viewArray($_ENV));
$this->message($headCode, '_SERVER', $this->viewArray($_SERVER));
$this->message($headCode, '_COOKIE', $this->viewArray($_COOKIE));
$this->message($headCode, '_GET', $this->viewArray($_GET));
// Start with the phpinfo() part
ob_start();
phpinfo();
$contents = explode('<body>', ob_get_contents());
ob_end_clean();
$contents = explode('</body>', $contents[1]);
// Do code cleaning: phpinfo() is not XHTML1.1 compliant
$phpinfo = str_replace('<font', '<span', $contents[0]);
$phpinfo = str_replace('</font', '</span', $phpinfo);
$phpinfo = str_replace('<img border="0"', '<img', $phpinfo);
$phpinfo = str_replace('<a name=', '<a id=', $phpinfo);
// Add phpinfo() to the message array
$this->message($headCode, 'phpinfo()', '
<div class="phpinfo">
' . $phpinfo . '
</div>
');
// Output the page
$this->output($this->outputWrapper($this->printAll()));
}
示例9: getTableHTML
/**
* Creates the HTML for the Table Wizard:
*
* @param array $configuration Table config array
* @return string HTML for the table wizard
* @internal
*/
public function getTableHTML($configuration)
{
// Traverse the rows:
$tRows = array();
$k = 0;
$countLines = count($configuration);
foreach ($configuration as $cellArr) {
if (is_array($cellArr)) {
// Initialize:
$cells = array();
$a = 0;
// Traverse the columns:
foreach ($cellArr as $cellContent) {
if ($this->inputStyle) {
$cells[] = '<input class="form-control" type="text"' . $this->doc->formWidth(20) . ' name="TABLE[c][' . ($k + 1) * 2 . '][' . ($a + 1) * 2 . ']" value="' . htmlspecialchars($cellContent) . '" />';
} else {
$cellContent = preg_replace('/<br[ ]?[\\/]?>/i', LF, $cellContent);
$cells[] = '<textarea class="form-control" ' . $this->doc->formWidth(20) . ' rows="6" name="TABLE[c][' . ($k + 1) * 2 . '][' . ($a + 1) * 2 . ']">' . GeneralUtility::formatForTextarea($cellContent) . '</textarea>';
}
// Increment counter:
$a++;
}
// CTRL panel for a table row (move up/down/around):
$onClick = 'document.wizardForm.action+=' . GeneralUtility::quoteJSvalue('#ANC_' . (($k + 1) * 2 - 2)) . ';';
$onClick = ' onclick="' . htmlspecialchars($onClick) . '"';
$ctrl = '';
if ($k !== 0) {
$ctrl .= '<button class="btn btn-default" name="TABLE[row_up][' . ($k + 1) * 2 . ']" title="' . $this->getLanguageService()->getLL('table_up', TRUE) . '"' . $onClick . '><span class="t3-icon fa fa-fw fa-angle-up"></span></button>';
} else {
$ctrl .= '<button class="btn btn-default" name="TABLE[row_bottom][' . ($k + 1) * 2 . ']" title="' . $this->getLanguageService()->getLL('table_bottom', TRUE) . '"' . $onClick . '><span class="t3-icon fa fa-fw fa-angle-double-down"></span></button>';
}
if ($k + 1 !== $countLines) {
$ctrl .= '<button class="btn btn-default" name="TABLE[row_down][' . ($k + 1) * 2 . ']" title="' . $this->getLanguageService()->getLL('table_down', TRUE) . '"' . $onClick . '><span class="t3-icon fa fa-fw fa-angle-down"></span></button>';
} else {
$ctrl .= '<button class="btn btn-default" name="TABLE[row_top][' . ($k + 1) * 2 . ']" title="' . $this->getLanguageService()->getLL('table_top', TRUE) . '"' . $onClick . '><span class="t3-icon fa fa-fw fa-angle-double-up"></span></button>';
}
$ctrl .= '<button class="btn btn-default" name="TABLE[row_remove][' . ($k + 1) * 2 . ']" title="' . $this->getLanguageService()->getLL('table_removeRow', TRUE) . '"' . $onClick . '><span class="t3-icon fa fa-fw fa-trash"></span></button>';
$ctrl .= '<button class="btn btn-default" name="TABLE[row_add][' . ($k + 1) * 2 . ']" title="' . $this->getLanguageService()->getLL('table_addRow', TRUE) . '"' . $onClick . '><span class="t3-icon fa fa-fw fa-plus"></span></button>';
$tRows[] = '
<tr>
<td>
<a name="ANC_' . ($k + 1) * 2 . '"></a>
<span class="btn-group' . ($this->inputStyle ? '' : '-vertical') . '">' . $ctrl . '</span>
</td>
<td>' . implode('</td>
<td>', $cells) . '</td>
</tr>';
// Increment counter:
$k++;
}
}
// CTRL panel for a table column (move left/right/around/delete)
$cells = array();
$cells[] = '';
// Finding first row:
$firstRow = reset($configuration);
if (is_array($firstRow)) {
$cols = count($firstRow);
for ($a = 1; $a <= $cols; $a++) {
$b = $a * 2;
$ctrl = '';
if ($a !== 1) {
$ctrl .= '<button class="btn btn-default" name="TABLE[col_left][' . $b . ']" title="' . $this->getLanguageService()->getLL('table_left', TRUE) . '"><span class="t3-icon fa fa-fw fa-angle-left"></span></button>';
} else {
$ctrl .= '<button class="btn btn-default" name="TABLE[col_end][' . $b . ']" title="' . $this->getLanguageService()->getLL('table_end', TRUE) . '"><span class="t3-icon fa fa-fw fa-angle-double-right"></span></button>';
}
if ($a != $cols) {
$ctrl .= '<button class="btn btn-default" name="TABLE[col_right][' . $b . ']" title="' . $this->getLanguageService()->getLL('table_right', TRUE) . '"><span class="t3-icon fa fa-fw fa-angle-right"></span></button>';
} else {
$ctrl .= '<button class="btn btn-default" name="TABLE[col_start][' . $b . ']" title="' . $this->getLanguageService()->getLL('table_start', TRUE) . '"><span class="t3-icon fa fa-fw fa-angle-double-left"></span></button>';
}
$ctrl .= '<button class="btn btn-default" name="TABLE[col_remove][' . $b . ']" title="' . $this->getLanguageService()->getLL('table_removeColumn', TRUE) . '"><span class="t3-icon fa fa-fw fa-trash"></span></button>';
$ctrl .= '<button class="btn btn-default" name="TABLE[col_add][' . $b . ']" title="' . $this->getLanguageService()->getLL('table_addColumn', TRUE) . '"><span class="t3-icon fa fa-fw fa-plus"></span></button>';
$cells[] = '<span class="btn-group">' . $ctrl . '</span>';
}
$tRows[] = '
<tfoot>
<tr>
<td>' . implode('</td>
<td>', $cells) . '</td>
</tr>
</tfoot>';
}
$content = '';
// Implode all table rows into a string, wrapped in table tags.
$content .= '
<!-- Table wizard -->
<div class="table-fit table-fit-inline-block">
<table id="typo3-tablewizard" class="table table-center">
' . implode('', $tRows) . '
</table>
</div>';
//.........这里部分代码省略.........
示例10: intval
//.........这里部分代码省略.........
if (is_array($idLists['PLAINLIST'])) {
$output .= '<br />' . $GLOBALS["LANG"]->getLL('stats_plainlist');
$output .= '<ul><li>' . join('</li><li>', $idLists['PLAINLIST']) . '</li></ul>';
}
}
if (GeneralUtility::_GP('returnDisable')) {
if (is_array($idLists['tt_address'])) {
$c = $this->disableRecipients(DirectMailUtility::fetchRecordsListValues($idLists['tt_address'], 'tt_address'), 'tt_address');
$output .= '<br />' . $c . ' ' . $GLOBALS["LANG"]->getLL('stats_emails_disabled');
}
if (is_array($idLists['fe_users'])) {
$c = $this->disableRecipients(DirectMailUtility::fetchRecordsListValues($idLists['fe_users'], 'fe_users'), 'fe_users');
$output .= '<br />' . $c . ' ' . $GLOBALS["LANG"]->getLL('stats_website_users_disabled');
}
}
if (GeneralUtility::_GP('returnCSV')) {
$emails = array();
if (is_array($idLists['tt_address'])) {
$arr = DirectMailUtility::fetchRecordsListValues($idLists['tt_address'], 'tt_address');
foreach ($arr as $v) {
$emails[] = $v['email'];
}
}
if (is_array($idLists['fe_users'])) {
$arr = DirectMailUtility::fetchRecordsListValues($idLists['fe_users'], 'fe_users');
foreach ($arr as $v) {
$emails[] = $v['email'];
}
}
if (is_array($idLists['PLAINLIST'])) {
$emails = array_merge($emails, $idLists['PLAINLIST']);
}
$output .= '<br />' . $GLOBALS["LANG"]->getLL('stats_emails_returned_list') . '<br />';
$output .= '<textarea' . $GLOBALS["TBE_TEMPLATE"]->formWidthText() . ' rows="6" name="nothing">' . GeneralUtility::formatForTextarea(implode(LF, $emails)) . '</textarea>';
}
}
//Find Unknown Recipient
if (GeneralUtility::_GP('unknownList') || GeneralUtility::_GP('unknownDisable') || GeneralUtility::_GP('unknownCSV')) {
$res = $GLOBALS["TYPO3_DB"]->exec_SELECTquery('rid,rtbl,email', 'sys_dmail_maillog', 'mid=' . intval($row['uid']) . ' AND response_type=-127' . ' AND (return_code=550 OR return_code=553)');
$idLists = array();
while ($rrow = $GLOBALS["TYPO3_DB"]->sql_fetch_assoc($res)) {
switch ($rrow['rtbl']) {
case 't':
$idLists['tt_address'][] = $rrow['rid'];
break;
case 'f':
$idLists['fe_users'][] = $rrow['rid'];
break;
case 'P':
$idLists['PLAINLIST'][] = $rrow['email'];
break;
default:
$idLists[$rrow['rtbl']][] = $rrow['rid'];
break;
}
}
if (GeneralUtility::_GP('unknownList')) {
if (is_array($idLists['tt_address'])) {
$output .= '<br />' . $GLOBALS["LANG"]->getLL('stats_emails') . '<br />' . DirectMailUtility::getRecordList(DirectMailUtility::fetchRecordsListValues($idLists['tt_address'], 'tt_address'), 'tt_address', $this->id, 1, $this->sys_dmail_uid);
}
if (is_array($idLists['fe_users'])) {
$output .= '<br />' . $GLOBALS["LANG"]->getLL('stats_website_users') . DirectMailUtility::getRecordList(DirectMailUtility::fetchRecordsListValues($idLists['fe_users'], 'fe_users'), 'fe_users', $this->id, 1, $this->sys_dmail_uid);
}
if (is_array($idLists['PLAINLIST'])) {
$output .= '<br />' . $GLOBALS["LANG"]->getLL('stats_plainlist');
$output .= '<ul><li>' . join('</li><li>', $idLists['PLAINLIST']) . '</li></ul>';
示例11: array
//.........这里部分代码省略.........
$hiddenMapped[] = $this->makeHidden('CSV_IMPORT[cat][' . $k . ']', $catUID);
}
}
$out .= implode('', $hiddenMapped);
break;
case 'startImport':
//starting import & show errors
//read csv
if ($this->indata['first_fieldname']) {
//read csv
$csvData = $this->readCSV();
$csvData = array_slice($csvData, 1);
} else {
//read csv
$csvData = $this->readCSV();
}
//show not imported record and reasons,
$result = $this->doImport($csvData);
$out = '<hr /><h3>' . $GLOBALS['LANG']->getLL('mailgroup_import_done') . '</h3>';
$defaultOrder = array('new', 'update', 'invalid_email', 'double');
if (!empty($this->params['resultOrder'])) {
$resultOrder = GeneralUtility::trimExplode(',', $this->params['resultOrder']);
} else {
$resultOrder = array();
}
$diffOrder = array_diff($defaultOrder, $resultOrder);
$endOrder = array_merge($resultOrder, $diffOrder);
foreach ($endOrder as $order) {
$tblLines = array();
$tblLines[] = array($GLOBALS['LANG']->getLL('mailgroup_import_report_' . $order));
if (is_array($result[$order])) {
foreach ($result[$order] as $k => $v) {
$mapKeys = array_keys($v);
$tblLines[] = array($k + 1, $v[$mapKeys[0]], $v['email']);
}
}
$out .= $this->formatTable($tblLines, array('nowrap', 'first' => 'colspan="3"'), 1, array(1));
}
//back button
$out .= $this->makeHidden(array('CMD' => 'displayImport', 'importStep[back]' => 'import', 'CSV_IMPORT[newFile]' => $this->indata['newFile'], 'CSV_IMPORT[storage]' => $this->indata['storage'], 'CSV_IMPORT[remove_existing]' => $this->indata['remove_existing'], 'CSV_IMPORT[first_fieldname]' => $this->indata['first_fieldname'], 'CSV_IMPORT[delimiter]' => $this->indata['delimiter'], 'CSV_IMPORT[encapsulation]' => $this->indata['encapsulation'], 'CSV_IMPORT[valid_email]' => $this->indata['valid_email'], 'CSV_IMPORT[remove_dublette]' => $this->indata['remove_dublette'], 'CSV_IMPORT[update_unique]' => $this->indata['update_unique'], 'CSV_IMPORT[record_unique]' => $this->indata['record_unique'], 'CSV_IMPORT[all_html]' => $this->indata['all_html'], 'CSV_IMPORT[charset]' => $this->indata['charset']));
$hiddenMapped = array();
foreach ($this->indata['map'] as $fieldNr => $fieldMapped) {
$hiddenMapped[] = $this->makeHidden('CSV_IMPORT[map][' . $fieldNr . ']', $fieldMapped);
}
if (is_array($this->indata['cat'])) {
foreach ($this->indata['cat'] as $k => $catUID) {
$hiddenMapped[] = $this->makeHidden('CSV_IMPORT[cat][' . $k . ']', $catUID);
}
}
$out .= implode('', $hiddenMapped);
break;
case 'upload':
default:
//show upload file form
$out = '<hr /><h3>' . $GLOBALS['LANG']->getLL('mailgroup_import_header_upload') . '</h3>';
$tempDir = $this->userTempFolder();
$tblLines[] = $GLOBALS['LANG']->getLL('mailgroup_import_upload_file') . '<input type="file" name="upload_1" size="30" />';
if ($this->indata['mode'] == 'file' && !((strpos($currentFileInfo['file'], 'import') === false ? 0 : 1) && $currentFileInfo['realFileext'] === 'txt')) {
$tblLines[] = $GLOBALS['LANG']->getLL('mailgroup_import_current_file') . '<b>' . $currentFileMessage . '</b>';
}
if ((strpos($currentFileInfo['file'], 'import') === false ? 0 : 1) && $currentFileInfo['realFileext'] === 'txt') {
$handleCSV = fopen($this->indata['newFile'], 'r');
$this->indata['csv'] = fread($handleCSV, filesize($this->indata['newFile']));
fclose($handleCSV);
}
$tblLines[] = '';
$tblLines[] = '<b>' . $GLOBALS['LANG']->getLL('mailgroup_import_or') . '</b>';
$tblLines[] = '';
$tblLines[] = $GLOBALS['LANG']->getLL('mailgroup_import_paste_csv');
$tblLines[] = '<textarea name="CSV_IMPORT[csv]" rows="25" wrap="off"' . $this->parent->doc->formWidthText(48, '', 'off') . '>' . GeneralUtility::formatForTextarea($this->indata['csv']) . '</textarea>';
$tblLines[] = '<input type="submit" name="CSV_IMPORT[next]" value="' . $GLOBALS['LANG']->getLL('mailgroup_import_next') . '" />';
$out .= implode('<br />', $tblLines);
$out .= '<input type="hidden" name="CMD" value="displayImport" />
<input type="hidden" name="importStep[next]" value="conf" />
<input type="hidden" name="file[upload][1][target]" value="' . htmlspecialchars($tempDir) . '" ' . ($_POST['importNow'] ? 'disabled' : '') . '/>
<input type="hidden" name="file[upload][1][data]" value="1" />
<input type="hidden" name="CSV_IMPORT[newFile]" value ="' . $this->indata['newFile'] . '">';
break;
}
$theOutput = $this->parent->doc->section($GLOBALS['LANG']->getLL('mailgroup_import') . BackendUtility::cshItem($this->cshTable, 'mailgroup_import', $GLOBALS['BACK_PATH']), $out, 1, 1, 0, TRUE);
/**
* Hook for cmd_displayImport
* use it to manipulate the steps in the import process
*/
if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail/mod3/class.tx_directmail_recipient_list.php']['cmd_displayImport'])) {
$hookObjectsArr = array();
foreach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['direct_mail/mod3/class.tx_directmail_recipient_list.php']['cmd_displayImport'] as $classRef) {
$hookObjectsArr[] =& GeneralUtility::getUserObj($classRef);
}
}
if (is_array($hookObjectsArr)) {
foreach ($hookObjectsArr as $hookObj) {
if (method_exists($hookObj, 'cmd_displayImport')) {
$theOutput = '';
$theOutput = $hookObj->cmd_displayImport($this);
}
}
}
return $theOutput;
}
示例12: makeSaveForm
/**
* Create configuration form
*
* @param array $inData Form configurat data
* @param array $row Table row accumulation variable. This is filled with table rows.
* @return void Sets content in $this->content
* @todo Define visibility
*/
public function makeSaveForm($inData, &$row)
{
// Presets:
$row[] = '
<tr class="tableheader bgColor5">
<td colspan="2">' . $this->lang->getLL('makesavefo_presets', TRUE) . '</td>
</tr>';
$opt = array('');
$where = '(public>0 OR user_uid=' . (int) $this->getBackendUser()->user['uid'] . ')' . ($inData['pagetree']['id'] ? ' AND (item_uid=' . (int) $inData['pagetree']['id'] . ' OR item_uid=0)' : '');
$presets = $this->getDatabaseConnection()->exec_SELECTgetRows('*', 'tx_impexp_presets', $where);
if (is_array($presets)) {
foreach ($presets as $presetCfg) {
$opt[$presetCfg['uid']] = $presetCfg['title'] . ' [' . $presetCfg['uid'] . ']' . ($presetCfg['public'] ? ' [Public]' : '') . ($presetCfg['user_uid'] === $this->getBackendUser()->user['uid'] ? ' [Own]' : '');
}
}
$row[] = '
<tr class="bgColor4">
<td><strong>' . $this->lang->getLL('makesavefo_presets', TRUE) . '</strong>' . BackendUtility::cshItem('xMOD_tx_impexp', 'presets', $GLOBALS['BACK_PATH'], '') . '</td>
<td>
' . $this->lang->getLL('makesavefo_selectPreset', TRUE) . '<br/>
' . $this->renderSelectBox('preset[select]', '', $opt) . '
<br/>
<input type="submit" value="' . $this->lang->getLL('makesavefo_load', TRUE) . '" name="preset[load]" />
<input type="submit" value="' . $this->lang->getLL('makesavefo_save', TRUE) . '" name="preset[save]" onclick="return confirm(\'' . $this->lang->getLL('makesavefo_areYouSure', TRUE) . '\');" />
<input type="submit" value="' . $this->lang->getLL('makesavefo_delete', TRUE) . '" name="preset[delete]" onclick="return confirm(\'' . $this->lang->getLL('makesavefo_areYouSure', TRUE) . '\');" />
<input type="submit" value="' . $this->lang->getLL('makesavefo_merge', TRUE) . '" name="preset[merge]" onclick="return confirm(\'' . $this->lang->getLL('makesavefo_areYouSure', TRUE) . '\');" />
<br/>
' . $this->lang->getLL('makesavefo_titleOfNewPreset', TRUE) . '
<input type="text" name="tx_impexp[preset][title]" value="' . htmlspecialchars($inData['preset']['title']) . '"' . $this->doc->formWidth(30) . ' /><br/>
<label for="checkPresetPublic">' . $this->lang->getLL('makesavefo_public', TRUE) . '</label>
<input type="checkbox" name="tx_impexp[preset][public]" id="checkPresetPublic" value="1"' . ($inData['preset']['public'] ? ' checked="checked"' : '') . ' /><br/>
</td>
</tr>';
// Output options:
$row[] = '
<tr class="tableheader bgColor5">
<td colspan="2">' . $this->lang->getLL('makesavefo_outputOptions', TRUE) . '</td>
</tr>';
// Meta data:
$thumbnailFiles = array();
foreach ($this->getThumbnailFiles() as $thumbnailFile) {
$thumbnailFiles[$thumbnailFile->getCombinedIdentifier()] = $thumbnailFile->getName();
}
if (!empty($thumbnailFiles)) {
array_unshift($thumbnailFiles, '');
}
$thumbnail = NULL;
if (!empty($inData['meta']['thumbnail'])) {
$thumbnail = $this->getFile($inData['meta']['thumbnail']);
}
$saveFolder = $this->getDefaultImportExportFolder();
$row[] = '
<tr class="bgColor4">
<td><strong>' . $this->lang->getLL('makesavefo_metaData', TRUE) . '</strong>' . BackendUtility::cshItem('xMOD_tx_impexp', 'metadata', $GLOBALS['BACK_PATH'], '') . '</td>
<td>
' . $this->lang->getLL('makesavefo_title', TRUE) . ' <br/>
<input type="text" name="tx_impexp[meta][title]" value="' . htmlspecialchars($inData['meta']['title']) . '"' . $this->doc->formWidth(30) . ' /><br/>
' . $this->lang->getLL('makesavefo_description', TRUE) . ' <br/>
<input type="text" name="tx_impexp[meta][description]" value="' . htmlspecialchars($inData['meta']['description']) . '"' . $this->doc->formWidth(30) . ' /><br/>
' . $this->lang->getLL('makesavefo_notes', TRUE) . ' <br/>
<textarea name="tx_impexp[meta][notes]"' . $this->doc->formWidth(30, 1) . '>' . GeneralUtility::formatForTextarea($inData['meta']['notes']) . '</textarea><br/>
' . (!empty($thumbnailFiles) ? '
' . $this->lang->getLL('makesavefo_thumbnail', TRUE) . '<br/>
' . $this->renderSelectBox('tx_impexp[meta][thumbnail]', $inData['meta']['thumbnail'], $thumbnailFiles) : '') . '<br/>
' . ($thumbnail ? '<img src="' . htmlspecialchars($thumbnail->getPublicUrl(TRUE)) . '" vspace="5" style="border: solid black 1px;" alt="" /><br/>' : '') . '
' . $this->lang->getLL('makesavefo_uploadThumbnail', TRUE) . '<br/>
' . ($saveFolder ? '<input type="file" name="upload_1" ' . $this->doc->formWidth(30) . ' size="30" /><br/>
<input type="hidden" name="file[upload][1][target]" value="' . htmlspecialchars($saveFolder->getCombinedIdentifier()) . '" />
<input type="hidden" name="file[upload][1][data]" value="1" /><br />' : '') . '
</td>
</tr>';
// Add file options:
$opt = array();
if ($this->export->compress) {
$opt['t3d_compressed'] = $this->lang->getLL('makesavefo_t3dFileCompressed');
}
$opt['t3d'] = $this->lang->getLL('makesavefo_t3dFile');
$opt['xml'] = $this->lang->getLL('makesavefo_xml');
$fileName = '';
if ($saveFolder) {
$fileName = sprintf($this->lang->getLL('makesavefo_filenameSavedInS', TRUE), $saveFolder->getCombinedIdentifier()) . '<br/>
<input type="text" name="tx_impexp[filename]" value="' . htmlspecialchars($inData['filename']) . '"' . $this->doc->formWidth(30) . ' /><br/>';
}
$row[] = '
<tr class="bgColor4">
<td><strong>' . $this->lang->getLL('makesavefo_fileFormat', TRUE) . '</strong>' . BackendUtility::cshItem('xMOD_tx_impexp', 'fileFormat', $GLOBALS['BACK_PATH'], '') . '</td>
<td>' . $this->renderSelectBox('tx_impexp[filetype]', $inData['filetype'], $opt) . '<br/>
' . $this->lang->getLL('makesavefo_maxSizeOfFiles', TRUE) . '<br/>
<input type="text" name="tx_impexp[maxFileSize]" value="' . htmlspecialchars($inData['maxFileSize']) . '"' . $this->doc->formWidth(10) . ' /><br/>
' . $fileName . '
</td>
</tr>';
//.........这里部分代码省略.........
示例13: renderOverview
/**
* Render the module content in HTML
*
* @param array Translation data for configuration
* @param integer Sys language uid
* @param array Configuration record
* @return string HTML content
*/
function renderOverview()
{
global $LANG;
$sysLang = $this->sysLang;
$accumObj = $this->l10ncfgObj->getL10nAccumulatedInformationsObjectForLanguage($sysLang);
$accum = $accumObj->getInfoArray();
$l10ncfg = $this->l10ncfg;
$output = '';
$showSingle = GeneralUtility::_GET('showSingle');
if ($l10ncfg['displaymode'] > 0) {
$showSingle = $showSingle ? $showSingle : 'NONE';
if ($l10ncfg['displaymode'] == 2) {
$noAnalysis = true;
}
} else {
$noAnalysis = false;
}
// Traverse the structure and generate HTML output:
foreach ($accum as $pId => $page) {
$output .= '<h3>' . $page['header']['icon'] . htmlspecialchars($page['header']['title']) . ' [' . $pId . ']</h3>';
$tableRows = array();
foreach ($accum[$pId]['items'] as $table => $elements) {
foreach ($elements as $elementUid => $data) {
if (is_array($data['fields'])) {
$FtableRows = array();
$flags = array();
if (!$noAnalysis || $showSingle === $table . ':' . $elementUid) {
foreach ($data['fields'] as $key => $tData) {
if (is_array($tData)) {
list(, $uidString, $fieldName) = explode(':', $key);
list($uidValue) = explode('/', $uidString);
$diff = '';
$edit = true;
$noChangeFlag = !strcmp(trim($tData['diffDefaultValue']), trim($tData['defaultValue']));
if ($uidValue === 'NEW') {
$diff = '<em>' . $LANG->getLL('render_overview.new.message') . '</em>';
$flags['new']++;
} elseif (!isset($tData['diffDefaultValue'])) {
$diff = '<em>' . $LANG->getLL('render_overview.nodiff.message') . '</em>';
$flags['unknown']++;
} elseif ($noChangeFlag) {
$diff = $LANG->getLL('render_overview.nochange.message');
$edit = true;
$flags['noChange']++;
} else {
$diff = $this->diffCMP($tData['diffDefaultValue'], $tData['defaultValue']);
$flags['update']++;
}
if (!$this->modeOnlyChanged || !$noChangeFlag) {
$fieldCells = array();
$fieldCells[] = '<b>' . htmlspecialchars($fieldName) . '</b>' . ($tData['msg'] ? '<br/><em>' . htmlspecialchars($tData['msg']) . '</em>' : '');
$fieldCells[] = nl2br(htmlspecialchars($tData['defaultValue']));
$fieldCells[] = $edit && $this->modeWithInlineEdit ? $tData['fieldType'] === 'text' ? '<textarea name="' . htmlspecialchars('translation[' . $table . '][' . $elementUid . '][' . $key . ']') . '" cols="60" rows="5">' . GeneralUtility::formatForTextarea($tData['translationValue']) . '</textarea>' : '<input name="' . htmlspecialchars('translation[' . $table . '][' . $elementUid . '][' . $key . ']') . '" value="' . htmlspecialchars($tData['translationValue']) . '" size="60" />' : nl2br(htmlspecialchars($tData['translationValue']));
$fieldCells[] = $diff;
if ($page['header']['prevLang']) {
reset($tData['previewLanguageValues']);
$fieldCells[] = nl2br(htmlspecialchars(current($tData['previewLanguageValues'])));
}
$FtableRows[] = '<tr class="db_list_normal"><td>' . implode('</td><td>', $fieldCells) . '</td></tr>';
}
}
}
}
if (count($FtableRows) || $noAnalysis) {
// Link:
if ($this->modeShowEditLinks) {
reset($data['fields']);
list(, $uidString) = explode(':', key($data['fields']));
if (substr($uidString, 0, 3) !== 'NEW') {
$editId = is_array($data['translationInfo']['translations'][$sysLang]) ? $data['translationInfo']['translations'][$sysLang]['uid'] : $data['translationInfo']['uid'];
$editLink = ' - <a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick('&edit[' . $data['translationInfo']['translation_table'] . '][' . $editId . ']=edit', $this->doc->backPath)) . '"><em>[' . $LANG->getLL('render_overview.clickedit.message') . ']</em></a>';
} else {
$editLink = ' - <a href="' . htmlspecialchars($this->doc->issueCommand('&cmd[' . $table . '][' . $data['translationInfo']['uid'] . '][localize]=' . $sysLang)) . '"><em>[' . $LANG->getLL('render_overview.clicklocalize.message') . ']</em></a>';
}
} else {
$editLink = '';
}
$tableRows[] = '<tr class="t3-row-header">
<td colspan="2" style="width:300px;"><a href="' . htmlspecialchars('index.php?id=' . GeneralUtility::_GET('id') . '&showSingle=' . rawurlencode($table . ':' . $elementUid)) . '">' . htmlspecialchars($table . ':' . $elementUid) . '</a>' . $editLink . '</td>
<td colspan="3" style="width:200px;">' . htmlspecialchars(GeneralUtility::arrayToLogString($flags)) . '</td>
</tr>';
if (!$showSingle || $showSingle === $table . ':' . $elementUid) {
$tableRows[] = '<tr class="bgColor-20 tableheader">
<td>Fieldname:</td>
<td width="25%">Default:</td>
<td width="25%">Translation:</td>
<td width="25%">Diff:</td>
' . ($page['header']['prevLang'] ? '<td width="25%">PrevLang:</td>' : '') . '
</tr>';
$tableRows = array_merge($tableRows, $FtableRows);
}
}
//.........这里部分代码省略.........
示例14: makeSaveForm
/**
* Create configuration form
*
* @param array $inData Form configurat data
* @param array $row Table row accumulation variable. This is filled with table rows.
* @return void Sets content in $this->content
* @todo Define visibility
*/
public function makeSaveForm($inData, &$row)
{
global $LANG;
// Presets:
$row[] = '
<tr class="tableheader bgColor5">
<td colspan="2">' . $LANG->getLL('makesavefo_presets', 1) . '</td>
</tr>';
$opt = array('');
$presets = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'tx_impexp_presets', '(public>0 OR user_uid=' . intval($GLOBALS['BE_USER']->user['uid']) . ')' . ($inData['pagetree']['id'] ? ' AND (item_uid=' . intval($inData['pagetree']['id']) . ' OR item_uid=0)' : ''));
if (is_array($presets)) {
foreach ($presets as $presetCfg) {
$opt[$presetCfg['uid']] = $presetCfg['title'] . ' [' . $presetCfg['uid'] . ']' . ($presetCfg['public'] ? ' [Public]' : '') . ($presetCfg['user_uid'] === $GLOBALS['BE_USER']->user['uid'] ? ' [Own]' : '');
}
}
$row[] = '
<tr class="bgColor4">
<td><strong>' . $LANG->getLL('makesavefo_presets', 1) . '</strong>' . \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_tx_impexp', 'presets', $GLOBALS['BACK_PATH'], '') . '</td>
<td>
' . $LANG->getLL('makesavefo_selectPreset', 1) . '<br/>
' . $this->renderSelectBox('preset[select]', '', $opt) . '
<br/>
<input type="submit" value="' . $LANG->getLL('makesavefo_load', 1) . '" name="preset[load]" />
<input type="submit" value="' . $LANG->getLL('makesavefo_save', 1) . '" name="preset[save]" onclick="return confirm(\'' . $LANG->getLL('makesavefo_areYouSure', 1) . '\');" />
<input type="submit" value="' . $LANG->getLL('makesavefo_delete', 1) . '" name="preset[delete]" onclick="return confirm(\'' . $LANG->getLL('makesavefo_areYouSure', 1) . '\');" />
<input type="submit" value="' . $LANG->getLL('makesavefo_merge', 1) . '" name="preset[merge]" onclick="return confirm(\'' . $LANG->getLL('makesavefo_areYouSure', 1) . '\');" />
<br/>
' . $LANG->getLL('makesavefo_titleOfNewPreset', 1) . '
<input type="text" name="tx_impexp[preset][title]" value="' . htmlspecialchars($inData['preset']['title']) . '"' . $this->doc->formWidth(30) . ' /><br/>
<label for="checkPresetPublic">' . $LANG->getLL('makesavefo_public', 1) . '</label>
<input type="checkbox" name="tx_impexp[preset][public]" id="checkPresetPublic" value="1"' . ($inData['preset']['public'] ? ' checked="checked"' : '') . ' /><br/>
</td>
</tr>';
// Output options:
$row[] = '
<tr class="tableheader bgColor5">
<td colspan="2">' . $LANG->getLL('makesavefo_outputOptions', 1) . '</td>
</tr>';
// Meta data:
$tempDir = $this->userTempFolder();
if ($tempDir) {
$thumbnails = \TYPO3\CMS\Core\Utility\GeneralUtility::getFilesInDir($tempDir, 'png,gif,jpg');
array_unshift($thumbnails, '');
} else {
$thumbnails = FALSE;
}
$row[] = '
<tr class="bgColor4">
<td><strong>' . $LANG->getLL('makesavefo_metaData', 1) . '</strong>' . \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_tx_impexp', 'metadata', $GLOBALS['BACK_PATH'], '') . '</td>
<td>
' . $LANG->getLL('makesavefo_title', 1) . ' <br/>
<input type="text" name="tx_impexp[meta][title]" value="' . htmlspecialchars($inData['meta']['title']) . '"' . $this->doc->formWidth(30) . ' /><br/>
' . $LANG->getLL('makesavefo_description', 1) . ' <br/>
<input type="text" name="tx_impexp[meta][description]" value="' . htmlspecialchars($inData['meta']['description']) . '"' . $this->doc->formWidth(30) . ' /><br/>
' . $LANG->getLL('makesavefo_notes', 1) . ' <br/>
<textarea name="tx_impexp[meta][notes]"' . $this->doc->formWidth(30, 1) . '>' . \TYPO3\CMS\Core\Utility\GeneralUtility::formatForTextarea($inData['meta']['notes']) . '</textarea><br/>
' . (is_array($thumbnails) ? '
' . $LANG->getLL('makesavefo_thumbnail', 1) . '<br/>
' . $this->renderSelectBox('tx_impexp[meta][thumbnail]', $inData['meta']['thumbnail'], $thumbnails) . '<br/>
' . ($inData['meta']['thumbnail'] ? '<img src="' . $this->doc->backPath . '../' . substr($tempDir, strlen(PATH_site)) . $thumbnails[$inData['meta']['thumbnail']] . '" vspace="5" style="border: solid black 1px;" alt="" /><br/>' : '') . '
' . $LANG->getLL('makesavefo_uploadThumbnail', 1) . '<br/>
<input type="file" name="upload_1" ' . $this->doc->formWidth(30) . ' size="30" /><br/>
<input type="hidden" name="file[upload][1][target]" value="' . htmlspecialchars($tempDir) . '" />
<input type="hidden" name="file[upload][1][data]" value="1" /><br />
' : '') . '
</td>
</tr>';
// Add file options:
$savePath = $this->userSaveFolder();
$opt = array();
if ($this->export->compress) {
$opt['t3d_compressed'] = $LANG->getLL('makesavefo_t3dFileCompressed');
}
$opt['t3d'] = $LANG->getLL('makesavefo_t3dFile');
$opt['xml'] = $LANG->getLL('makesavefo_xml');
$row[] = '
<tr class="bgColor4">
<td><strong>' . $LANG->getLL('makesavefo_fileFormat', 1) . '</strong>' . \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_tx_impexp', 'fileFormat', $GLOBALS['BACK_PATH'], '') . '</td>
<td>' . $this->renderSelectBox('tx_impexp[filetype]', $inData['filetype'], $opt) . '<br/>
' . $LANG->getLL('makesavefo_maxSizeOfFiles', 1) . '<br/>
<input type="text" name="tx_impexp[maxFileSize]" value="' . htmlspecialchars($inData['maxFileSize']) . '"' . $this->doc->formWidth(10) . ' /><br/>
' . ($savePath ? sprintf($LANG->getLL('makesavefo_filenameSavedInS', 1), substr($savePath, strlen(PATH_site))) . '<br/>
<input type="text" name="tx_impexp[filename]" value="' . htmlspecialchars($inData['filename']) . '"' . $this->doc->formWidth(30) . ' /><br/>' : '') . '
</td>
</tr>';
// Add buttons:
$row[] = '
<tr class="bgColor4">
<td> </td>
<td><input type="submit" value="' . $LANG->getLL('makesavefo_update', 1) . '" /> - <input type="submit" value="' . $LANG->getLL('makesavefo_downloadExport', 1) . '" name="tx_impexp[download_export]" />' . ($savePath ? ' - <input type="submit" value="' . $LANG->getLL('importdata_saveToFilename', 1) . '" name="tx_impexp[save_export]" />' : '') . '</td>
</tr>';
}
示例15: htmlspecialchars
/**
* show the quickmail input form (first step)
*
* @return string HTML input form
*/
function cmd_quickmail()
{
$theOutput = '';
$indata = GeneralUtility::_GP('quickmail');
$senderName = $indata['senderName'] ? $indata['senderName'] : $GLOBALS['BE_USER']->user['realName'];
$senderMail = $indata['senderEmail'] ? $indata['senderEmail'] : $GLOBALS['BE_USER']->user['email'];
// Set up form:
$theOutput .= '<input type="hidden" name="id" value="' . $this->id . '" />';
$theOutput .= $GLOBALS['LANG']->getLL('quickmail_sender_name') . '<br /><input type="text" name="quickmail[senderName]" value="' . htmlspecialchars($senderName) . '"' . $this->doc->formWidth() . ' /><br />';
$theOutput .= $GLOBALS['LANG']->getLL('quickmail_sender_email') . '<br /><input type="text" name="quickmail[senderEmail]" value="' . htmlspecialchars($senderMail) . '"' . $this->doc->formWidth() . ' /><br />';
$theOutput .= $GLOBALS['LANG']->getLL('dmail_subject') . '<br /><input type="text" name="quickmail[subject]" value="' . htmlspecialchars($indata['subject']) . '"' . $this->doc->formWidth() . ' /><br />';
$theOutput .= $GLOBALS['LANG']->getLL('quickmail_message') . '<br /><textarea rows="20" name="quickmail[message]"' . $this->doc->formWidthText() . '>' . GeneralUtility::formatForTextarea($indata['message']) . '</textarea><br />';
$theOutput .= $GLOBALS['LANG']->getLL('quickmail_break_lines') . ' <input type="checkbox" name="quickmail[breakLines]" value="1"' . ($indata['breakLines'] ? ' checked="checked"' : '') . ' /><br /><br />';
$theOutput .= '<input type="Submit" name="quickmail[send]" value="' . $GLOBALS['LANG']->getLL('dmail_wiz_next') . '" />';
return $theOutput;
}