本文整理汇总了PHP中TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs方法的典型用法代码示例。如果您正苦于以下问题:PHP GeneralUtility::fixed_lgd_cs方法的具体用法?PHP GeneralUtility::fixed_lgd_cs怎么用?PHP GeneralUtility::fixed_lgd_cs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Utility\GeneralUtility
的用法示例。
在下文中一共展示了GeneralUtility::fixed_lgd_cs方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPath
/**
* Generate the page path for docHeader
*
* @return string The page path
*/
public function getPath()
{
$pageRecord = $this->recordArray;
$title = '';
// Is this a real page
if (is_array($pageRecord) && $pageRecord['uid']) {
$title = substr($pageRecord['_thePathFull'], 0, -1);
// Remove current page title
$pos = strrpos($title, $pageRecord['title']);
if ($pos !== false) {
$title = substr($title, 0, $pos);
}
} elseif (!empty($pageRecord['combined_identifier'])) {
try {
$resourceObject = ResourceFactory::getInstance()->getInstance()->getObjectFromCombinedIdentifier($pageRecord['combined_identifier']);
$title = $resourceObject->getStorage()->getName() . ':';
$title .= $resourceObject->getParentFolder()->getReadablePath();
} catch (ResourceDoesNotExistException $e) {
}
}
// Setting the path of the page
// crop the title to title limit (or 50, if not defined)
$beUser = $this->getBackendUser();
$cropLength = empty($beUser->uc['titleLen']) ? 50 : $beUser->uc['titleLen'];
$croppedTitle = GeneralUtility::fixed_lgd_cs($title, -$cropLength);
if ($croppedTitle !== $title) {
$pagePath = '<abbr title="' . htmlspecialchars($title) . '">' . htmlspecialchars($croppedTitle) . '</abbr>';
} else {
$pagePath = htmlspecialchars($title);
}
return $pagePath;
}
示例2: main
function main(&$backRef, $menuItems, $tableID, $srcId)
{
$this->backRef = $backRef;
$this->beUser = $GLOBALS['BE_USER'];
$this->LANG = $GLOBALS['LANG'];
$this->includeLocalLang();
if (($tableID == 'dragDrop_tt_news_cat' || $tableID == 'tt_news_cat_CM') && $srcId) {
$table = 'tt_news_cat';
$rec = BackendUtility::getRecordWSOL($table, $srcId);
// fetch page record to get editing permissions
$lCP = $this->beUser->calcPerms(BackendUtility::getRecord('pages', $rec['pid']));
$doEdit = $lCP & 16;
// if ($doEdit && $tableID == 'dragDrop_tt_news_cat') {
// $dstId = intval(GeneralUtility::_GP('dstId'));
// $menuItems['moveinto'] = $this->dragDrop_moveCategory($srcId,$dstId);
// $menuItems['copyinto'] = $this->dragDrop_copyCategory($srcId,$dstId);
// }
if ($tableID == 'tt_news_cat_CM') {
$menuItems = array();
if ($doEdit) {
$menuItems['edit'] = $this->DB_edit($table, $srcId);
$menuItems['new'] = $this->DB_new($table, $rec);
$menuItems['newsub'] = $this->DB_new($table, $rec, true);
}
$menuItems['info'] = $this->backRef->DB_info($table, $srcId);
if ($doEdit) {
$menuItems['hide'] = $this->DB_hideUnhide($table, $rec, 'hidden');
$elInfo = array(GeneralUtility::fixed_lgd_cs(BackendUtility::getRecordTitle('tt_news_cat', $rec), $this->beUser->uc['titleLen']));
$menuItems['spacer2'] = 'spacer';
$menuItems['delete'] = $this->DB_delete($table, $srcId, $elInfo);
}
}
}
return $menuItems;
}
示例3: main
/**
* Main processing, creating the list of new record tables to select from.
*
* @return void
*/
public function main()
{
// if commerce parameter is missing use default controller
if (!GeneralUtility::_GP('parentCategory')) {
parent::main();
return;
}
// If there was a page - or if the user is admin
// (admins has access to the root) we proceed:
if ($this->pageinfo['uid'] || $this->getBackendUserAuthentication()->isAdmin()) {
// Acquiring TSconfig for this module/current page:
$this->web_list_modTSconfig = BackendUtility::getModTSconfig($this->pageinfo['uid'], 'mod.web_list');
// allow only commerce related tables
$this->allowedNewTables = array('tx_commerce_categories', 'tx_commerce_products');
$this->deniedNewTables = GeneralUtility::trimExplode(',', $this->web_list_modTSconfig['properties']['deniedNewTables'], true);
// Acquiring TSconfig for this module/parent page:
$this->web_list_modTSconfig_pid = BackendUtility::getModTSconfig($this->pageinfo['pid'], 'mod.web_list');
$this->allowedNewTables_pid = GeneralUtility::trimExplode(',', $this->web_list_modTSconfig_pid['properties']['allowedNewTables'], true);
$this->deniedNewTables_pid = GeneralUtility::trimExplode(',', $this->web_list_modTSconfig_pid['properties']['deniedNewTables'], true);
// More init:
if (!$this->showNewRecLink('pages')) {
$this->newPagesInto = 0;
}
if (!$this->showNewRecLink('pages', $this->allowedNewTables_pid, $this->deniedNewTables_pid)) {
$this->newPagesAfter = 0;
}
// Set header-HTML and return_url
if (is_array($this->pageinfo) && $this->pageinfo['uid']) {
$iconImgTag = IconUtility::getSpriteIconForRecord('pages', $this->pageinfo, array('title' => htmlspecialchars($this->pageinfo['_thePath'])));
$title = strip_tags($this->pageinfo[SettingsFactory::getInstance()->getTcaValue('pages.ctrl.label')]);
} else {
$iconImgTag = IconUtility::getSpriteIcon('apps-pagetree-root', array('title' => htmlspecialchars($this->pageinfo['_thePath'])));
$title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
}
$this->code = '<span class="typo3-moduleHeader">' . $this->doc->wrapClickMenuOnIcon($iconImgTag, 'pages', $this->pageinfo['uid']) . htmlspecialchars(GeneralUtility::fixed_lgd_cs($title, 45)) . '</span><br />';
$this->R_URI = $this->returnUrl;
// GENERATE the HTML-output depending on mode (pagesOnly is the page wizard)
// Regular new element:
if (!$this->pagesOnly) {
$this->regularNew();
} elseif ($this->showNewRecLink('pages')) {
// Pages only wizard
$this->pagesOnly();
}
// Add all the content to an output section
$this->content .= $this->doc->section('', $this->code);
// Setting up the buttons and markers for docheader
$docHeaderButtons = $this->getButtons();
$markers['CSH'] = $docHeaderButtons['csh'];
$markers['CONTENT'] = $this->content;
// Build the <body> for the module
$this->content = $this->doc->startPage($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:db_new.php.pagetitle'));
$this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
$this->content .= $this->doc->endPage();
$this->content = $this->doc->insertStylesAndJS($this->content);
}
}
示例4: main
public function main()
{
global $BE_USER, $LANG, $BACK_PATH, $TCA_DESCR, $TCA, $CLIENT, $TYPO3_CONF_VARS, $TYPO3_DB;
$this->pageinfo = BackendUtility::readPageAccess($this->id, $this->perms_clause);
$access = is_array($this->pageinfo) ? 1 : 0;
$this->pageId = $this->pageinfo['uid'];
if ($this->id && $access || $BE_USER->user['admin'] && !$this->id) {
// Draw the header.
$this->doc = GeneralUtility::makeInstance('template');
$this->doc->backPath = $BACK_PATH;
$this->doc->form = '<form action="mod.php?M=web_txvalidateurlsM1" method="POST">';
// JavaScript
$this->doc->JScode = '
<script language="javascript" type="text/javascript">
script_ended = 0;
function jumpToUrl(URL)
{
document.location = URL;
}
</script>
';
$this->doc->postCode = '
<script language="javascript" type="text/javascript">
script_ended = 1;
if (top.fsMod) top.fsMod.recentIds["web"] = 0;
</script>
';
$headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />' . $LANG->sL('LLL:EXT:lang/locallang_core.xml:labels.path') . ': ' . GeneralUtility::fixed_lgd_cs($this->pageinfo['_thePath'], 50);
$this->content .= $this->doc->startPage($LANG->getLL('title'));
$this->content .= $this->doc->header($LANG->getLL('title'));
$this->content .= $this->doc->spacer(5);
$this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));
$this->content .= $this->doc->divider(5);
// Render content:
$this->moduleContent();
// ShortCut
if ($BE_USER->mayMakeShortcut()) {
$this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));
}
$this->content .= $this->doc->spacer(10);
$this->content .= '</div>';
} else {
// If no access or if ID == zero
$this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $BACK_PATH;
$this->content .= $this->doc->startPage($LANG->getLL('title'));
$this->content .= $this->doc->header($LANG->getLL('title'));
$this->content .= $this->doc->spacer(5);
$this->content .= $this->doc->spacer(10);
}
}
示例5: main
/**
* Main Task center module
*
* @return string HTML content.
* @todo Define visibility
*/
public function main()
{
if ($id = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('display')) {
return $this->urlInIframe($this->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('impexp') . 'app/index.php?tx_impexp[action]=export&preset[load]=1&preset[select]=' . $id, 1);
} else {
// Thumbnail folder and files:
$tempDir = $this->userTempFolder();
if ($tempDir) {
$thumbnails = \TYPO3\CMS\Core\Utility\GeneralUtility::getFilesInDir($tempDir, 'png,gif,jpg', 1);
}
$clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
$usernames = \TYPO3\CMS\Backend\Utility\BackendUtility::getUserNames();
// Create preset links:
$presets = $this->getPresets();
$opt = array();
$opt[] = '
<tr class="bgColor5 tableheader">
<td>Icon:</td>
<td>Preset Title:</td>
<td>Public</td>
<td>Owner:</td>
<td>Page:</td>
<td>Path:</td>
<td>Meta data:</td>
</tr>';
if (is_array($presets)) {
foreach ($presets as $presetCfg) {
$configuration = unserialize($presetCfg['preset_data']);
$thumbnailFile = $thumbnails[$configuration['meta']['thumbnail']];
$title = strlen($presetCfg['title']) ? $presetCfg['title'] : '[' . $presetCfg['uid'] . ']';
$opt[] = '
<tr class="bgColor4">
<td>' . ($thumbnailFile ? '<img src="' . $this->backPath . '../' . substr($tempDir, strlen(PATH_site)) . basename($thumbnailFile) . '" hspace="2" width="70" style="border: solid black 1px;" alt="" /><br />' : ' ') . '</td>
<td nowrap="nowrap"><a href="index.php?SET[function]=tx_impexp&display=' . $presetCfg['uid'] . '">' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($title, 30)) . '</a> </td>
<td>' . ($presetCfg['public'] ? 'Yes' : ' ') . '</td>
<td>' . ($presetCfg['user_uid'] === $GLOBALS['BE_USER']->user['uid'] ? 'Own' : '[' . $usernames[$presetCfg['user_uid']]['username'] . ']') . '</td>
<td>' . ($configuration['pagetree']['id'] ? $configuration['pagetree']['id'] : ' ') . '</td>
<td>' . htmlspecialchars($configuration['pagetree']['id'] ? \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordPath($configuration['pagetree']['id'], $clause, 20) : '[Single Records]') . '</td>
<td>
<strong>' . htmlspecialchars($configuration['meta']['title']) . '</strong><br />' . htmlspecialchars($configuration['meta']['description']) . ($configuration['meta']['notes'] ? '<br /><br /><strong>Notes:</strong> <em>' . htmlspecialchars($configuration['meta']['notes']) . '</em>' : '') . '
</td>
</tr>';
}
$content = '<table border="0" cellpadding="0" cellspacing="1" class="lrPadding">' . implode('', $opt) . '</table>';
}
}
// Output:
$theOutput .= $this->pObj->doc->spacer(5);
$theOutput .= $this->pObj->doc->section('Export presets', $content, 0, 1);
return $theOutput;
}
示例6: wrapTitle
/**
* Wrapping $title in a-tags.
*
* @param string $title Title
* @param string $row Record
* @param int $bank Pointer (which mount point number)
*
* @return string
*/
public function wrapTitle($title, &$row, $bank = 0)
{
if (!is_array($row) || !is_numeric($bank)) {
if (TYPO3_DLOG) {
GeneralUtility::devLog('wrapTitle (articleview) gets passed invalid parameters.', COMMERCE_EXTKEY, 3);
}
return '';
}
// Max. size for Title of 255
$title = trim($title) ? GeneralUtility::fixed_lgd_cs($title, 255) : $this->getLL('leaf.noTitle');
$aOnClick = 'if(top.content.list_frame){top.content.list_frame.location.href=top.TS.PATH_typo3+\'alt_doc.php?' . 'returnUrl=\'+top.rawurlencode(top.content.list_frame.document.location.pathname+' . 'top.content.list_frame.document.location.search)+\'&' . $this->getJumpToParam($row) . '\';}';
$res = $this->noOnclick ? $title : '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . htmlspecialchars(strip_tags($title)) . '</a>';
return $res;
}
示例7: main
/**
* Main function of the module.
* Write the content to $this->content
*/
function main()
{
// Access check!
// The page will show only if there is a valid page and if this page may be viewed by the user
$this->pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($this->id, $this->perms_clause);
$access = is_array($this->pageinfo) ? 1 : 0;
$this->doc = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
if ($this->id && $access || $GLOBALS['BE_USER']->user['admin'] && !$this->id) {
// Draw the header.
$this->doc->form = '<form action="" method="POST">';
// JavaScript
$this->doc->JScode = '
<script language="javascript" type="text/javascript">
script_ended = 0;
function jumpToUrl(URL) {
document.location = URL;
}
</script>
';
$this->doc->postCode = '
<script language="javascript" type="text/javascript">
script_ended = 1;
if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';
</script>
';
$headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.path') . ': ' . GeneralUtility::fixed_lgd_cs($this->pageinfo['_thePath'], -50);
$this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
$this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
$this->content .= $this->doc->spacer(5);
$this->content .= $this->doc->section('', $this->doc->funcMenu($headerSection, \TYPO3\CMS\Backend\Utility\BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'])));
$this->content .= $this->doc->divider(5);
// Render content:
$this->moduleContent();
// ShortCut
if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
$this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));
}
$this->content .= $this->doc->spacer(10);
} else {
// If no access or if ID == zero
$this->content .= $this->doc->startPage($GLOBALS['LANG']->getLL('title'));
$this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
$this->content .= $this->doc->spacer(5);
$this->content .= $this->doc->spacer(10);
}
}
示例8: main
/**
* Main method
*
* @param CLickMenu $backRef
* @param array $menuItems
* @param string $table
* @param int $uid
*
* @return array
*/
public function main($backRef, array $menuItems, $table = '', $uid = 0)
{
if ($table === 'tt_content') {
$this->setLanguageService($GLOBALS['LANG']);
// add "paste reference after" if user is allowed to use CType shortcut
if ($this->getBackendUser()->checkAuthMode('tt_content', 'CType', 'shortcut', 'explicitAllow')) {
if ($menuItems['pasteafter']) {
unset($menuItems['pasteafter']);
$selItem = $backRef->clipObj->getSelectedRecord();
$targetItem = BackendUtility::getRecordRaw('tt_content', 'uid = ' . $uid, 'colPos,tx_gridelements_container,tx_gridelements_columns');
$elInfo = array(GeneralUtility::fixed_lgd_cs($selItem['_RECORD_TITLE'], $this->getBackendUser()->uc['titleLen']), $backRef->root ? $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] : GeneralUtility::fixed_lgd_cs(BackendUtility::getRecordTitle($table, $backRef->rec), $this->getBackendUser()->uc['titleLen']), $backRef->clipObj->currentMode());
$menuItems['pasteafter'] = $this->DB_paste($backRef, $table, -$uid, 'after', $elInfo, $targetItem, false);
if ($backRef->clipObj->currentMode() === 'copy') {
$menuItems['pastereference'] = $this->DB_paste($backRef, $table, -$uid, 'after', $elInfo, $targetItem, true);
}
}
}
}
return $menuItems;
}
示例9: render
/**
* Renders the current page path
*
* @return string the rendered page path
* @see template::getPagePath() Note: can't call this method as it's protected!
*/
public function render()
{
$id = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
$pageRecord = \TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1));
// Is this a real page
if ($pageRecord['uid']) {
$title = $pageRecord['_thePathFull'];
} else {
$title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
}
// Setting the path of the page
$pagePath = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.path', TRUE) . ': <span class="typo3-docheader-pagePath">';
// crop the title to title limit (or 50, if not defined)
$cropLength = empty($GLOBALS['BE_USER']->uc['titleLen']) ? 50 : $GLOBALS['BE_USER']->uc['titleLen'];
$croppedTitle = \TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($title, -$cropLength);
if ($croppedTitle !== $title) {
$pagePath .= '<abbr title="' . htmlspecialchars($title) . '">' . htmlspecialchars($croppedTitle) . '</abbr>';
} else {
$pagePath .= htmlspecialchars($title);
}
$pagePath .= '</span>';
return $pagePath;
}
示例10: renderFilesInFolder
/**
* For TYPO3 Element Browser: Expand folder of files.
*
* @param Folder $folder The folder path to expand
* @param array $extensionList List of fileextensions to show
* @param bool $noThumbs Whether to show thumbnails or not. If set, no thumbnails are shown.
* @return string HTML output
*/
public function renderFilesInFolder(Folder $folder, array $extensionList = [], $noThumbs = false)
{
if (!$folder->checkActionPermission('read')) {
return '';
}
$lang = $this->getLanguageService();
$titleLen = (int) $this->getBackendUser()->uc['titleLen'];
if ($this->searchWord !== '') {
$files = $this->fileRepository->searchByName($folder, $this->searchWord);
} else {
$extensionList = !empty($extensionList) && $extensionList[0] === '*' ? [] : $extensionList;
$files = $this->getFilesInFolder($folder, $extensionList);
}
$filesCount = count($files);
$lines = array();
// Create the header of current folder:
$folderIcon = $this->iconFactory->getIconForResource($folder, Icon::SIZE_SMALL);
$lines[] = '
<tr>
<th class="col-title" nowrap="nowrap">' . $folderIcon . ' ' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($folder->getIdentifier(), $titleLen)) . '</th>
<th class="col-control" nowrap="nowrap"></th>
<th class="col-clipboard" nowrap="nowrap">
<a href="#" class="btn btn-default" id="t3js-importSelection" title="' . $lang->getLL('importSelection', true) . '">' . $this->iconFactory->getIcon('actions-document-import-t3d', Icon::SIZE_SMALL) . '</a>
<a href="#" class="btn btn-default" id="t3js-toggleSelection" title="' . $lang->getLL('toggleSelection', true) . '">' . $this->iconFactory->getIcon('actions-document-select', Icon::SIZE_SMALL) . '</a>
</th>
<th nowrap="nowrap"> </th>
</tr>';
if ($filesCount === 0) {
$lines[] = '
<tr>
<td colspan="4">No files found.</td>
</tr>';
}
foreach ($files as $fileObject) {
$fileExtension = $fileObject->getExtension();
// Thumbnail/size generation:
$imgInfo = array();
if (!$noThumbs && GeneralUtility::inList(strtolower($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] . ',' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext']), strtolower($fileExtension))) {
$processedFile = $fileObject->process(ProcessedFile::CONTEXT_IMAGEPREVIEW, array('width' => 64, 'height' => 64));
$imageUrl = $processedFile->getPublicUrl(true);
$imgInfo = array($fileObject->getProperty('width'), $fileObject->getProperty('height'));
$pDim = $imgInfo[0] . 'x' . $imgInfo[1] . ' pixels';
$clickIcon = '<img src="' . $imageUrl . '"' . ' width="' . $processedFile->getProperty('width') . '"' . ' height="' . $processedFile->getProperty('height') . '"' . ' hspace="5" vspace="5" border="1" />';
} else {
$clickIcon = '';
$pDim = '';
}
// Create file icon:
$size = ' (' . GeneralUtility::formatSize($fileObject->getSize()) . 'bytes' . ($pDim ? ', ' . $pDim : '') . ')';
$icon = '<span title="' . htmlspecialchars($fileObject->getName() . $size) . '">' . $this->iconFactory->getIconForResource($fileObject, Icon::SIZE_SMALL) . '</span>';
// Create links for adding the file:
$filesIndex = count($this->elements);
$this->elements['file_' . $filesIndex] = array('type' => 'file', 'table' => 'sys_file', 'uid' => $fileObject->getUid(), 'fileName' => $fileObject->getName(), 'filePath' => $fileObject->getUid(), 'fileExt' => $fileExtension, 'fileIcon' => $icon);
if ($this->fileIsSelectableInFileList($fileObject, $imgInfo)) {
$ATag = '<a href="#" class="btn btn-default" title="' . htmlspecialchars($fileObject->getName()) . '" data-file-index="' . htmlspecialchars($filesIndex) . '" data-close="0">';
$ATag_alt = '<a href="#" title="' . htmlspecialchars($fileObject->getName()) . '" data-file-index="' . htmlspecialchars($filesIndex) . '" data-close="1">';
$ATag_e = '</a>';
$bulkCheckBox = '<label class="btn btn-default btn-checkbox"><input type="checkbox" class="typo3-bulk-item" name="file_' . $filesIndex . '" value="0" /><span class="t3-icon fa"></span></label>';
} else {
$ATag = '';
$ATag_alt = '';
$ATag_e = '';
$bulkCheckBox = '';
}
// Create link to showing details about the file in a window:
$Ahref = BackendUtility::getModuleUrl('show_item', array('type' => 'file', 'table' => '_FILE', 'uid' => $fileObject->getCombinedIdentifier(), 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')));
// Combine the stuff:
$filenameAndIcon = $ATag_alt . $icon . htmlspecialchars(GeneralUtility::fixed_lgd_cs($fileObject->getName(), $titleLen)) . $ATag_e;
// Show element:
$lines[] = '
<tr class="file_list_normal">
<td class="col-title" nowrap="nowrap">' . $filenameAndIcon . ' </td>
<td class="col-control">
<div class="btn-group">' . $ATag . '<span title="' . $lang->getLL('addToList', true) . '">' . $this->iconFactory->getIcon('actions-edit-add', Icon::SIZE_SMALL)->render() . '</span>' . $ATag_e . '
<a href="' . htmlspecialchars($Ahref) . '" class="btn btn-default" title="' . $lang->getLL('info', true) . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL) . '</a>
</td>
<td class="col-clipboard" valign="top">' . $bulkCheckBox . '</td>
<td nowrap="nowrap"> ' . $pDim . '</td>
</tr>';
if ($pDim) {
$lines[] = '
<tr>
<td class="filelistThumbnail" colspan="4">' . $ATag_alt . $clickIcon . $ATag_e . '</td>
</tr>';
}
}
$out = '<h3>' . $lang->getLL('files', true) . ' ' . $filesCount . ':</h3>';
$out .= GeneralUtility::makeInstance(FolderUtilityRenderer::class, $this)->getFileSearchField($this->searchWord);
$out .= '<div id="filelist">';
$out .= $this->getBulkSelector($filesCount);
// Wrap all the rows in table tags:
$out .= '
//.........这里部分代码省略.........
示例11: ext_printFields
/**
* This functions returns the HTML-code that creates the editor-layout of the module.
*
* @param [type] $theConstants: ...
* @param [type] $category: ...
* @return [type] ...
* @todo Define visibility
*/
public function ext_printFields($theConstants, $category)
{
reset($theConstants);
$output = '<script type="text/javascript" src="' . $GLOBALS['BACK_PATH'] . 'js/constantEditor.js"></script>
';
$subcat = '';
if (is_array($this->categories[$category])) {
$help = $this->helpConfig;
if (!$this->doNotSortCategoriesBeforeMakingForm) {
asort($this->categories[$category]);
}
foreach ($this->categories[$category] as $name => $type) {
$params = $theConstants[$name];
if (is_array($params)) {
if ($subcat != $params['subcat_name']) {
$subcat = $params['subcat_name'];
$subcat_name = $params['subcat_name'] ? $this->subCategories[$params['subcat_name']][0] : 'Others';
$output .= '<h3 class="typo3-tstemplate-ceditor-subcat">' . $subcat_name . '</h3>';
}
$label = $GLOBALS['LANG']->sL($params['label']);
$label_parts = explode(':', $label, 2);
if (count($label_parts) == 2) {
$head = trim($label_parts[0]);
$body = trim($label_parts[1]);
} else {
$head = trim($label_parts[0]);
$body = '';
}
if (strlen($head) > 35) {
if (!$body) {
$body = $head;
}
$head = GeneralUtility::fixed_lgd_cs($head, 35);
}
$typeDat = $this->ext_getTypeData($params['type']);
$checked = '';
$p_field = '';
$raname = substr(md5($params['name']), 0, 10);
$aname = '\'' . $raname . '\'';
list($fN, $fV, $params) = $this->ext_fNandV($params);
switch ($typeDat['type']) {
case 'int':
case 'int+':
$p_field = '<input id="' . $fN . '" type="text" name="' . $fN . '" value="' . $fV . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(5) . ' onChange="uFormUrl(' . $aname . ')" />';
if ($typeDat['paramstr']) {
$p_field .= ' Range: ' . $typeDat['paramstr'];
} elseif ($typeDat['type'] == 'int+') {
$p_field .= ' Range: 0 - ';
} else {
$p_field .= ' (Integer)';
}
break;
case 'color':
$colorNames = explode(',', ',' . $this->HTMLcolorList);
$p_field = '';
foreach ($colorNames as $val) {
$sel = '';
if ($val == strtolower($params['value'])) {
$sel = ' selected';
}
$p_field .= '<option value="' . htmlspecialchars($val) . '"' . $sel . '>' . $val . '</option>';
}
$p_field = '<select id="select-' . $fN . '" rel="' . $fN . '" name="C' . $fN . '" class="typo3-tstemplate-ceditor-color-select" onChange="uFormUrl(' . $aname . ');">' . $p_field . '</select>';
$p_field .= '<input type="text" id="input-' . $fN . '" rel="' . $fN . '" name="' . $fN . '" class="typo3-tstemplate-ceditor-color-input" value="' . $fV . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(7) . ' onChange="uFormUrl(' . $aname . ')" />';
break;
case 'wrap':
$wArr = explode('|', $fV);
$p_field = '<input type="text" id="' . $fN . '" name="' . $fN . '" value="' . $wArr[0] . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(29) . ' onChange="uFormUrl(' . $aname . ')" />';
$p_field .= ' | ';
$p_field .= '<input type="text" name="W' . $fN . '" value="' . $wArr[1] . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(15) . ' onChange="uFormUrl(' . $aname . ')" />';
break;
case 'offset':
$wArr = explode(',', $fV);
$labels = GeneralUtility::trimExplode(',', $typeDat['paramstr']);
$p_field = ($labels[0] ? $labels[0] : 'x') . ':<input type="text" name="' . $fN . '" value="' . $wArr[0] . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(4) . ' onChange="uFormUrl(' . $aname . ')" />';
$p_field .= ' , ';
$p_field .= ($labels[1] ? $labels[1] : 'y') . ':<input type="text" name="W' . $fN . '" value="' . $wArr[1] . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(4) . ' onChange="uFormUrl(' . $aname . ')" />';
$labelsCount = count($labels);
for ($aa = 2; $aa < $labelsCount; $aa++) {
if ($labels[$aa]) {
$p_field .= ' , ' . $labels[$aa] . ':<input type="text" name="W' . $aa . $fN . '" value="' . $wArr[$aa] . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(4) . ' onChange="uFormUrl(' . $aname . ')" />';
} else {
$p_field .= '<input type="hidden" name="W' . $aa . $fN . '" value="' . $wArr[$aa] . '" />';
}
}
break;
case 'options':
if (is_array($typeDat['params'])) {
$p_field = '';
foreach ($typeDat['params'] as $val) {
$vParts = explode('=', $val, 2);
$label = $vParts[0];
//.........这里部分代码省略.........
示例12: editPanel
/**
* Generates the "edit panels" which can be shown for a page or records on a page when the Admin Panel is enabled for a backend users surfing the frontend.
* With the "edit panel" the user will see buttons with links to editing, moving, hiding, deleting the element
* This function is used for the cObject EDITPANEL and the stdWrap property ".editPanel"
*
* @param string $content A content string containing the content related to the edit panel. For cObject "EDITPANEL" this is empty but not so for the stdWrap property. The edit panel is appended to this string and returned.
* @param array $conf TypoScript configuration properties for the editPanel
* @param string $currentRecord 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 $dataArr Alternative data array to use. Default is $this->data
* @param string $table
* @param array $allow
* @param int $newUID
* @param array $hiddenFields
* @return string The input content string with the editPanel appended. This function returns only an edit panel appended to the content string if a backend user is logged in (and has the correct permissions). Otherwise the content string is directly returned.
*/
public function editPanel($content, array $conf, $currentRecord = '', array $dataArr = array(), $table = '', array $allow = array(), $newUID = 0, array $hiddenFields = array())
{
$hiddenFieldString = $command = '';
// Special content is about to be shown, so the cache must be disabled.
$this->frontendController->set_no_cache('Frontend edit panel is shown', TRUE);
$formName = 'TSFE_EDIT_FORM_' . substr($this->frontendController->uniqueHash(), 0, 4);
$formTag = '<form name="' . $formName . '" id ="' . $formName . '" action="' . htmlspecialchars(GeneralUtility::getIndpEnv('REQUEST_URI')) . '" method="post" enctype="' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype']) . '" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
$sortField = $GLOBALS['TCA'][$table]['ctrl']['sortby'];
$labelField = $GLOBALS['TCA'][$table]['ctrl']['label'];
$hideField = $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'];
$panel = '';
if (isset($allow['toolbar']) && $this->backendUser->adminPanel instanceof AdminPanelView) {
$panel .= $this->backendUser->adminPanel->ext_makeToolBar();
}
if (isset($allow['edit'])) {
$icon = IconUtility::getSpriteIcon('actions-document-open', array('title' => $this->backendUser->extGetLL('p_editRecord')));
$panel .= $this->editPanelLinkWrap($icon, $formName, 'edit', $dataArr['_LOCALIZED_UID'] ? $table . ':' . $dataArr['_LOCALIZED_UID'] : $currentRecord);
}
// Hiding in workspaces because implementation is incomplete
if (isset($allow['move']) && $sortField && $this->backendUser->workspace === 0) {
$icon = IconUtility::getSpriteIcon('actions-move-up', array('title' => $this->backendUser->extGetLL('p_moveUp')));
$panel .= $this->editPanelLinkWrap($icon, $formName, 'up');
$icon = IconUtility::getSpriteIcon('actions-move-down', array('title' => $this->backendUser->extGetLL('p_moveDown')));
$panel .= $this->editPanelLinkWrap($icon, $formName, 'down');
}
// Hiding in workspaces because implementation is incomplete
// Hiding for localizations because it is unknown what should be the function in that case
if (isset($allow['hide']) && $hideField && $this->backendUser->workspace === 0 && !$dataArr['_LOCALIZED_UID']) {
if ($dataArr[$hideField]) {
$icon = IconUtility::getSpriteIcon('actions-edit-unhide', array('title' => $this->backendUser->extGetLL('p_unhide')));
$panel .= $this->editPanelLinkWrap($icon, $formName, 'unhide');
} else {
$icon = IconUtility::getSpriteIcon('actions-edit-hide', array('title' => $this->backendUser->extGetLL('p_hide')));
$panel .= $this->editPanelLinkWrap($icon, $formName, 'hide', '', $this->backendUser->extGetLL('p_hideConfirm'));
}
}
if (isset($allow['new'])) {
if ($table === 'pages') {
$icon = IconUtility::getSpriteIcon('actions-page-new', array('title' => $this->backendUser->extGetLL('p_newSubpage')));
$panel .= $this->editPanelLinkWrap($icon, $formName, 'new', $currentRecord, '');
} else {
$icon = IconUtility::getSpriteIcon('actions-document-new', array('title' => $this->backendUser->extGetLL('p_newRecordAfter')));
$panel .= $this->editPanelLinkWrap($icon, $formName, 'new', $currentRecord, '', $newUID);
}
}
// Hiding in workspaces because implementation is incomplete
// Hiding for localizations because it is unknown what should be the function in that case
if (isset($allow['delete']) && $this->backendUser->workspace === 0 && !$dataArr['_LOCALIZED_UID']) {
$icon = IconUtility::getSpriteIcon('actions-edit-delete', array('title' => $this->backendUser->extGetLL('p_delete')));
$panel .= $this->editPanelLinkWrap($icon, $formName, 'delete', '', $this->backendUser->extGetLL('p_deleteConfirm'));
}
// Final
$labelTxt = $this->cObj->stdWrap($conf['label'], $conf['label.']);
foreach ((array) $hiddenFields as $name => $value) {
$hiddenFieldString .= '<input type="hidden" name="TSFE_EDIT[' . htmlspecialchars($name) . ']" value="' . htmlspecialchars($value) . '"/>' . LF;
}
$panel = '<!-- BE_USER Edit Panel: -->
' . $formTag . $hiddenFieldString . '
<input type="hidden" name="TSFE_EDIT[cmd]" value="" />
<input type="hidden" name="TSFE_EDIT[record]" value="' . $currentRecord . '" />
<div class="typo3-editPanel">' . $panel . ($labelTxt ? '<div class="typo3-editPanel-label">' . sprintf($labelTxt, htmlspecialchars(GeneralUtility::fixed_lgd_cs($dataArr[$labelField], 50))) . '</div>' : '') . '
</div>
</form>';
// Wrap the panel
if ($conf['innerWrap']) {
$panel = $this->cObj->wrap($panel, $conf['innerWrap']);
}
if ($conf['innerWrap.']) {
$panel = $this->cObj->stdWrap($panel, $conf['innerWrap.']);
}
// Wrap the complete panel
if ($conf['outerWrap']) {
$panel = $this->cObj->wrap($panel, $conf['outerWrap']);
}
if ($conf['outerWrap.']) {
$panel = $this->cObj->stdWrap($panel, $conf['outerWrap.']);
}
if ($conf['printBeforeContent']) {
$finalOut = $panel . $content;
} else {
$finalOut = $content . $panel;
}
$hidden = $this->isDisabled($table, $dataArr) ? ' typo3-feedit-element-hidden' : '';
$outerWrapConfig = isset($conf['stdWrap.']) ? $conf['stdWrap.'] : array('wrap' => '<div class="typo3-feedit-element' . $hidden . '">|</div>');
$finalOut = $this->cObj->stdWrap($finalOut, $outerWrapConfig);
//.........这里部分代码省略.........
示例13: wrapTitle
/**
* Wrapping $title in a-tags.
*
* @param string $title Title
* @param string $row Item record
* @param int $bank Pointer (which mount point number)
*
* @return string
*/
public function wrapTitle($title, $row, $bank = 0)
{
if (!is_array($row) || !is_numeric($bank)) {
if (TYPO3_DLOG) {
\TYPO3\CMS\Core\Utility\GeneralUtility::devLog('wrapTitle (CommerceTeam\\Commerce\\Tree\\Leaf\\View) gets passed invalid parameters.', COMMERCE_EXTKEY, 3);
}
return '';
}
// Max. size for Title of 255
$title = '' != $title ? GeneralUtility::fixed_lgd_cs($title, 255) : $this->getLL('leaf.noTitle');
$aOnClick = 'return jumpTo(\'' . $this->getJumpToParam($row) . '\',this,\'' . $this->domIdPrefix . $row['uid'] . '_' . $bank . '\',\'\');';
if ($this->noRootOnclick && 0 == $row['uid'] || $this->noOnclick) {
$res = htmlspecialchars(strip_tags($title));
} else {
$res = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . htmlspecialchars(strip_tags($title)) . '</a>';
}
return $res;
}
示例14: renderText
/**
* Processing of larger amounts of text (usually from RTE/bodytext fields) with word wrapping etc.
*
* @param string $input Input string
* @return string Output string
*/
public function renderText($input)
{
$input = strip_tags($input);
$input = GeneralUtility::fixed_lgd_cs($input, 1500);
return nl2br(htmlspecialchars(trim($input), ENT_QUOTES, 'UTF-8', false));
}
示例15: getProcessedValue
//.........这里部分代码省略.........
if (MathUtility::canBeInterpretedAsInteger($explodedValue)) {
$relationTableNameForField = $relationTableName;
} else {
list($relationTableNameForField, $explodedValue) = self::splitTable_Uid($explodedValue);
}
$relationRecord = static::getRecordWSOL($relationTableNameForField, $explodedValue);
$finalValues[] = static::getRecordTitle($relationTableNameForField, $relationRecord);
}
$l = implode(', ', $finalValues);
} else {
$l = implode(', ', GeneralUtility::trimExplode(',', $value, TRUE));
}
break;
case 'check':
if (!is_array($theColConf['items']) || count($theColConf['items']) == 1) {
$l = $value ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:yes') : $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:no');
} else {
$lA = array();
foreach ($theColConf['items'] as $key => $val) {
if ($value & pow(2, $key)) {
$lA[] = $GLOBALS['LANG']->sL($val[0]);
}
}
$l = implode(', ', $lA);
}
break;
case 'input':
// Hide value 0 for dates, but show it for everything else
if (isset($value)) {
if (GeneralUtility::inList($theColConf['eval'], 'date')) {
// Handle native date field
if (isset($theColConf['dbType']) && $theColConf['dbType'] === 'date') {
$dateTimeFormats = $GLOBALS['TYPO3_DB']->getDateTimeFormats($table);
$emptyValue = $dateTimeFormats['date']['empty'];
$value = $value !== $emptyValue ? strtotime($value) : 0;
}
if (!empty($value)) {
$l = self::date($value) . ' (' . ($GLOBALS['EXEC_TIME'] - $value > 0 ? '-' : '') . self::calcAge(abs($GLOBALS['EXEC_TIME'] - $value), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears')) . ')';
}
} elseif (GeneralUtility::inList($theColConf['eval'], 'time')) {
if (!empty($value)) {
$l = self::time($value, FALSE);
}
} elseif (GeneralUtility::inList($theColConf['eval'], 'timesec')) {
if (!empty($value)) {
$l = self::time($value);
}
} elseif (GeneralUtility::inList($theColConf['eval'], 'datetime')) {
// Handle native date/time field
if (isset($theColConf['dbType']) && $theColConf['dbType'] === 'datetime') {
$dateTimeFormats = $GLOBALS['TYPO3_DB']->getDateTimeFormats($table);
$emptyValue = $dateTimeFormats['datetime']['empty'];
$value = $value !== $emptyValue ? strtotime($value) : 0;
}
if (!empty($value)) {
$l = self::datetime($value);
}
} else {
$l = $value;
}
}
break;
case 'flex':
$l = strip_tags($value);
break;
default:
if ($defaultPassthrough) {
$l = $value;
} elseif ($theColConf['MM']) {
$l = 'N/A';
} elseif ($value) {
$l = GeneralUtility::fixed_lgd_cs(strip_tags($value), 200);
}
}
// If this field is a password field, then hide the password by changing it to a random number of asterisk (*)
if (stristr($theColConf['eval'], 'password')) {
$l = '';
$randomNumber = rand(5, 12);
for ($i = 0; $i < $randomNumber; $i++) {
$l .= '*';
}
}
/*****************
*HOOK: post-processing the human readable output from a record
****************/
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['postProcessValue'])) {
// Create NULL-reference
$null = NULL;
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['postProcessValue'] as $_funcRef) {
$params = array('value' => $l, 'colConf' => $theColConf);
$l = GeneralUtility::callUserFunction($_funcRef, $params, $null);
}
}
if ($fixed_lgd_chars) {
return GeneralUtility::fixed_lgd_cs($l, $fixed_lgd_chars);
} else {
return $l;
}
}
}