本文整理汇总了PHP中TYPO3\CMS\Backend\Template\DocumentTemplate::formWidthText方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentTemplate::formWidthText方法的具体用法?PHP DocumentTemplate::formWidthText怎么用?PHP DocumentTemplate::formWidthText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Template\DocumentTemplate
的用法示例。
在下文中一共展示了DocumentTemplate::formWidthText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: main
/**
* Main function, redering the actual content of the editing page
*
* @return void
* @todo Define visibility
*/
public function main()
{
//TODO: change locallang*.php to locallang*.xml
$docHeaderButtons = $this->getButtons();
$this->content = $this->doc->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_edit.php.pagetitle'));
// Hook before compiling the output
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'])) {
$preOutputProcessingHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['preOutputProcessingHook'];
if (is_array($preOutputProcessingHook)) {
$hookParameters = array('content' => &$this->content, 'target' => &$this->target);
foreach ($preOutputProcessingHook as $hookFunction) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
}
}
}
$pageContent = $this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_edit.php.pagetitle') . ' ' . htmlspecialchars($this->fileObject->getName()));
$pageContent .= $this->doc->spacer(2);
$code = '';
$extList = $GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext'];
if ($extList && \TYPO3\CMS\Core\Utility\GeneralUtility::inList($extList, $this->fileObject->getExtension())) {
// Read file content to edit:
$fileContent = $this->fileObject->getContents();
// Making the formfields
$hValue = 'file_edit.php?target=' . rawurlencode($this->origTarget) . '&returnUrl=' . rawurlencode($this->returnUrl);
// Edit textarea:
$code .= '
<div id="c-edit">
<textarea rows="30" name="file[editfile][0][data]" wrap="off"' . $this->doc->formWidthText(48, 'width:98%;height:80%', 'off') . ' class="fixed-font enable-tab">' . \TYPO3\CMS\Core\Utility\GeneralUtility::formatForTextarea($fileContent) . '</textarea>
<input type="hidden" name="file[editfile][0][target]" value="' . $this->fileObject->getUid() . '" />
<input type="hidden" name="redirect" value="' . htmlspecialchars($hValue) . '" />
</div>
<br />';
// Make shortcut:
if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
$this->MCONF['name'] = 'xMOD_file_edit.php';
$docHeaderButtons['shortcut'] = $this->doc->makeShortcutIcon('target', '', $this->MCONF['name'], 1);
} else {
$docHeaderButtons['shortcut'] = '';
}
} else {
$code .= sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:file_edit.php.coundNot'), $extList);
}
// Ending of section and outputting editing form:
$pageContent .= $this->doc->sectionEnd();
$pageContent .= $code;
// Hook after compiling the output
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['postOutputProcessingHook'])) {
$postOutputProcessingHook =& $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/file_edit.php']['postOutputProcessingHook'];
if (is_array($postOutputProcessingHook)) {
$hookParameters = array('pageContent' => &$pageContent, 'target' => &$this->target);
foreach ($postOutputProcessingHook as $hookFunction) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($hookFunction, $hookParameters, $this);
}
}
}
// Add the HTML as a section:
$markerArray = array('CSH' => $docHeaderButtons['csh'], 'FUNC_MENU' => \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']), 'BUTTONS' => $docHeaderButtons, 'PATH' => $this->title, 'CONTENT' => $pageContent);
$this->content .= $this->doc->moduleBody(array(), $docHeaderButtons, $markerArray);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}