本文整理汇总了PHP中TYPO3\CMS\Core\Imaging\IconFactory::getIconForRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP IconFactory::getIconForRecord方法的具体用法?PHP IconFactory::getIconForRecord怎么用?PHP IconFactory::getIconForRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Imaging\IconFactory
的用法示例。
在下文中一共展示了IconFactory::getIconForRecord方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLocalizations
/**
* Gets all localizations of the current record.
*
* @param string $table The table
* @param array $parentRec The current record
* @param string $bgColClass Class for the background color of a column
* @param string $pad Pad reference
* @return string HTML table rows
*/
public function getLocalizations($table, $parentRec, $bgColClass, $pad)
{
$lines = array();
$tcaCtrl = $GLOBALS['TCA'][$table]['ctrl'];
if ($table != 'pages' && BackendUtility::isTableLocalizable($table) && !$tcaCtrl['transOrigPointerTable']) {
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
$queryBuilder->getQueryContext()->setContext(QueryContextType::UNRESTRICTED);
$queryBuilder->select('*')->from($table)->where($queryBuilder->expr()->eq($tcaCtrl['transOrigPointerField'], (int) $parentRec['uid']))->andWhere($queryBuilder->expr()->neq($tcaCtrl['languageField'], 0));
if (isset($tcaCtrl['delete']) && $tcaCtrl['delete']) {
$queryBuilder->andWhere($queryBuilder->expr()->eq($tcaCtrl['delete'], 0));
}
if (isset($tcaCtrl['versioningWS']) && $tcaCtrl['versioningWS']) {
$queryBuilder->andWhere($queryBuilder->expr()->eq('t3ver_wsid', $parentRec['t3ver_wsid']));
}
$rows = $queryBuilder->execute()->fetchAll();
if (is_array($rows)) {
$modeData = '';
if ($pad == 'normal') {
$mode = $this->clipData['normal']['mode'] == 'copy' ? 'copy' : 'cut';
$modeData = ' <strong>(' . $this->clLabel($mode, 'cm') . ')</strong>';
}
foreach ($rows as $rec) {
$lines[] = '
<tr>
<td nowrap="nowrap" class="col-icon">' . $this->iconFactory->getIconForRecord($table, $rec, Icon::SIZE_SMALL)->render() . '</td>
<td nowrap="nowrap" width="95%">' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(BackendUtility::getRecordTitle($table, $rec), $this->getBackendUser()->uc['titleLen'])) . $modeData . '</td>
<td nowrap="nowrap" class="col-control"></td>
</tr>';
}
}
}
return implode('', $lines);
}
示例2: renderRecordDetailsTable
/**
* Shows the infos of a directmail record in a table
*
* @param array $row DirectMail DB record
*
* @return string the HTML output
*/
protected function renderRecordDetailsTable(array $row)
{
if (!$row['issent']) {
if ($GLOBALS['BE_USER']->check('tables_modify', 'sys_dmail')) {
// $requestUri = rawurlencode(GeneralUtility::linkThisScript(array('sys_dmail_uid' => $row['uid'], 'createMailFrom_UID' => '', 'createMailFrom_URL' => '')));
$requestUri = BackendUtility::getModuleUrl('DirectMailNavFrame_DirectMail') . '&id=' . $this->id . '&CMD=info&sys_dmail_uid=' . $row['uid'] . '&fetchAtOnce=1';
$editParams = BackendUtility::editOnClick('&edit[sys_dmail][' . $row['uid'] . ']=edit', $GLOBALS['BACK_PATH'], $requestUri);
$content = '<a href="#" onClick="' . $editParams . '" title="' . $this->getLanguageService()->getLL("dmail_edit") . '">' . $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL) . '<b>' . $this->getLanguageService()->getLL('dmail_edit') . '</b></a>';
} else {
$content = $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL) . ' (' . $this->getLanguageService()->getLL('dmail_noEdit_noPerms') . ')';
}
} else {
$content = $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL) . '(' . $this->getLanguageService()->getLL('dmail_noEdit_isSent') . ')';
}
$content = '<thead >
<th>' . DirectMailUtility::fName('subject') . ' <b>' . GeneralUtility::fixed_lgd_cs(htmlspecialchars($row['subject']), 60) . '</b></th>
<th style="text-align: right;">' . $content . '</th>
</thead>';
$nameArr = explode(',', 'from_name,from_email,replyto_name,replyto_email,organisation,return_path,priority,attachment,type,page,sendOptions,includeMedia,flowedFormat,sys_language_uid,plainParams,HTMLParams,encoding,charset,issent,renderedsize');
foreach ($nameArr as $name) {
$content .= '
<tr class="db_list_normal">
<td>' . DirectMailUtility::fName($name) . '</td>
<td>' . htmlspecialchars(BackendUtility::getProcessedValue('sys_dmail', $name, $row[$name])) . '</td>
</tr>';
}
$content = '<table width="460" class="table table-striped table-hover">' . $content . '</table>';
$sectionTitle = $this->iconFactory->getIconForRecord('sys_dmail', $row, Icon::SIZE_SMALL)->render() . ' ' . htmlspecialchars($row['subject']);
return $this->doc->section($sectionTitle, $content, 1, 1, 0, true);
}
示例3: getLocalizations
/**
* Gets all localizations of the current record.
*
* @param string $table The table
* @param array $parentRec The current record
* @param string $bgColClass Class for the background color of a column
* @param string $pad Pad reference
* @return string HTML table rows
*/
public function getLocalizations($table, $parentRec, $bgColClass, $pad)
{
$lines = array();
$tcaCtrl = $GLOBALS['TCA'][$table]['ctrl'];
if ($table != 'pages' && BackendUtility::isTableLocalizable($table) && !$tcaCtrl['transOrigPointerTable']) {
$where = array();
$where[] = $tcaCtrl['transOrigPointerField'] . '=' . (int) $parentRec['uid'];
$where[] = $tcaCtrl['languageField'] . '<>0';
if (isset($tcaCtrl['delete']) && $tcaCtrl['delete']) {
$where[] = $tcaCtrl['delete'] . '=0';
}
if (isset($tcaCtrl['versioningWS']) && $tcaCtrl['versioningWS']) {
$where[] = 't3ver_wsid=' . $parentRec['t3ver_wsid'];
}
$rows = $this->getDatabaseConnection()->exec_SELECTgetRows('*', $table, implode(' AND ', $where));
if (is_array($rows)) {
$modeData = '';
if ($pad == 'normal') {
$mode = $this->clipData['normal']['mode'] == 'copy' ? 'copy' : 'cut';
$modeData = ' <strong>(' . $this->clLabel($mode, 'cm') . ')</strong>';
}
foreach ($rows as $rec) {
$lines[] = '
<tr>
<td nowrap="nowrap" class="col-icon">' . $this->iconFactory->getIconForRecord($table, $rec, Icon::SIZE_SMALL)->render() . '</td>
<td nowrap="nowrap" width="95%">' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(BackendUtility::getRecordTitle($table, $rec), $this->getBackendUser()->uc['titleLen'])) . $modeData . '</td>
<td nowrap="nowrap" class="col-control"></td>
</tr>';
}
}
}
return implode('', $lines);
}
示例4: getList
/**
* Get the list of pages to show.
* This function is called recursively
*
* @param array $pageArray The Page Array
* @param array $lines Lines that have been processed up to this point
* @param int $pageDepth The level of the current $pageArray being processed
* @return array
*/
protected function getList($pageArray, $lines = array(), $pageDepth = 0)
{
if (!is_array($pageArray)) {
return $lines;
}
foreach ($pageArray as $identifier => $_) {
if (!MathUtility::canBeInterpretedAsInteger($identifier)) {
continue;
}
$line = array();
$line['padding'] = $pageDepth * 20;
if (isset($pageArray[$identifier . '_'])) {
$line['link'] = htmlspecialchars(GeneralUtility::linkThisScript(array('id' => $identifier)));
$line['icon'] = $this->iconFactory->getIconForRecord('pages', BackendUtility::getRecordWSOL('pages', $identifier), Icon::SIZE_SMALL)->render();
$line['title'] = htmlspecialchars('ID: ' . $identifier);
$line['pageTitle'] = GeneralUtility::fixed_lgd_cs($pageArray[$identifier], 30);
$line['includedFiles'] = $pageArray[$identifier . '_']['includeLines'] === 0 ? '' : $pageArray[$identifier . '_']['includeLines'];
$line['lines'] = $pageArray[$identifier . '_']['writtenLines'] === 0 ? '' : $pageArray[$identifier . '_']['writtenLines'];
} else {
$line['link'] = '';
$line['icon'] = $this->iconFactory->getIconForRecord('pages', BackendUtility::getRecordWSOL('pages', $identifier), Icon::SIZE_SMALL)->render();
$line['title'] = '';
$line['pageTitle'] = GeneralUtility::fixed_lgd_cs($pageArray[$identifier], 30);
$line['includedFiles'] = '';
$line['lines'] = '';
}
$lines[] = $line;
$lines = $this->getList($pageArray[$identifier . '.'], $lines, $pageDepth + 1);
}
return $lines;
}
示例5: renderMenuEntry
/**
* Returns the recent documents list as an array
*
* @param array $document
* @param string $md5sum
* @param bool $isRecentDoc
* @param bool $isFirstDoc
* @return array All recent documents as list-items
*/
protected function renderMenuEntry($document, $md5sum, $isRecentDoc = false, $isFirstDoc = false)
{
$table = $document[3]['table'];
$uid = $document[3]['uid'];
$record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL($table, $uid);
if (!is_array($record)) {
// Record seems to be deleted
return '';
}
$label = htmlspecialchars(strip_tags(htmlspecialchars_decode($document[0])));
$icon = $this->iconFactory->getIconForRecord($table, $record, Icon::SIZE_SMALL)->render();
$link = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('record_edit') . '&' . $document[2];
$pageId = (int) $document[3]['uid'];
if ($document[3]['table'] !== 'pages') {
$pageId = (int) $document[3]['pid'];
}
$onClickCode = 'jump(' . GeneralUtility::quoteJSvalue($link) . ', \'web_list\', \'web\', ' . $pageId . '); TYPO3.OpendocsMenu.toggleMenu(); return false;';
if (!$isRecentDoc) {
$title = $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:rm.closeDoc', true);
// Open document
$closeIcon = $this->iconFactory->getIcon('actions-close', Icon::SIZE_SMALL)->render('inline');
$entry = '
<li class="opendoc">
<a href="#" class="dropdown-list-link dropdown-link-list-add-close" onclick="' . htmlspecialchars($onClickCode) . '" target="content">' . $icon . ' ' . $label . '</a>
<a href="#" class="dropdown-list-link-close" data-opendocsidentifier="' . $md5sum . '" title="' . $title . '">' . $closeIcon . '</a>
</li>';
} else {
// Recently used document
$entry = '
<li>
<a href="#" class="dropdown-list-link" onclick="' . htmlspecialchars($onClickCode) . '" target="content">' . $icon . ' ' . $label . '</a>
</li>';
}
return $entry;
}
示例6: viewEditRecord
/**
* Action to edit records
*
* @param array $record sys_action record
* @return string list of records
*/
protected function viewEditRecord($record)
{
$content = '';
$actionList = array();
$dbAnalysis = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\RelationHandler::class);
$dbAnalysis->setFetchAllFields(true);
$dbAnalysis->start($record['t4_recordsToEdit'], '*');
$dbAnalysis->getFromDB();
// collect the records
foreach ($dbAnalysis->itemArray as $el) {
$path = BackendUtility::getRecordPath($el['id'], $this->taskObject->perms_clause, $this->getBackendUser()->uc['titleLen']);
$record = BackendUtility::getRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);
$title = BackendUtility::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]);
$description = $this->getLanguageService()->sL($GLOBALS['TCA'][$el['table']]['ctrl']['title'], true);
// @todo: which information could be needful
if (isset($record['crdate'])) {
$description .= ' - ' . BackendUtility::dateTimeAge($record['crdate']);
}
$link = BackendUtility::getModuleUrl('record_edit', array('edit[' . $el['table'] . '][' . $el['id'] . ']' => 'edit', 'returnUrl' => $this->moduleUrl), false, true);
$actionList[$el['id']] = array('uid' => 'record-' . $el['table'] . '-' . $el['id'], 'title' => $title, 'description' => BackendUtility::getRecordTitle($el['table'], $dbAnalysis->results[$el['table']][$el['id']]), 'descriptionHtml' => $description, 'link' => $link, 'icon' => '<span title="' . htmlspecialchars($path) . '">' . $this->iconFactory->getIconForRecord($el['table'], $dbAnalysis->results[$el['table']][$el['id']], Icon::SIZE_SMALL)->render() . '</span>');
}
// Render the record list
$content .= $this->taskObject->renderListMenu($actionList);
return $content;
}
示例7: renderList
/**
* Render the list of pages to show.
* This function is called recursively
*
* @param array $pageArray The Page Array
* @param array $lines Lines that have been processed up to this point
* @param int $pageDepth The level of the current $pageArray being processed
* @return array
*/
protected function renderList($pageArray, $lines = array(), $pageDepth = 0)
{
$cellStyle = 'padding-left: ' . $pageDepth * 20 . 'px';
if (!is_array($pageArray)) {
return $lines;
}
foreach ($pageArray as $identifier => $_) {
if (!MathUtility::canBeInterpretedAsInteger($identifier)) {
continue;
}
if (isset($pageArray[$identifier . '_'])) {
$lines[] = '
<tr>
<td nowrap style="' . $cellStyle . '">
<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('id' => $identifier))) . '" title="' . htmlspecialchars('ID: ' . $identifier) . '">' . $this->iconFactory->getIconForRecord('pages', BackendUtility::getRecordWSOL('pages', $identifier), Icon::SIZE_SMALL)->render() . GeneralUtility::fixed_lgd_cs($pageArray[$identifier], 30) . '</a></td>
<td>' . ($pageArray[$identifier . '_']['includeLines'] === 0 ? '' : $pageArray[$identifier . '_']['includeLines']) . '</td>
<td>' . ($pageArray[$identifier . '_']['writtenLines'] === 0 ? '' : $pageArray[$identifier . '_']['writtenLines']) . '</td>
</tr>';
} else {
$lines[] = '<tr>
<td nowrap style="' . $cellStyle . '">' . $this->iconFactory->getIconForRecord('pages', BackendUtility::getRecordWSOL('pages', $identifier), Icon::SIZE_SMALL)->render() . GeneralUtility::fixed_lgd_cs($pageArray[$identifier], 30) . '</td>
<td></td>
<td></td>
</tr>';
}
$lines = $this->renderList($pageArray[$identifier . '.'], $lines, $pageDepth + 1);
}
return $lines;
}
示例8: renderForeignRecordHeader
/**
* Renders the HTML header for a foreign record, such as the title, toggle-function, drag'n'drop, etc.
* Later on the command-icons are inserted here.
*
* @param array $data Current data
* @return string The HTML code of the header
*/
protected function renderForeignRecordHeader(array $data)
{
$languageService = $this->getLanguageService();
$inlineConfig = $data['inlineParentConfig'];
$foreignTable = $inlineConfig['foreign_table'];
$rec = $data['databaseRow'];
// Init:
$domObjectId = $this->inlineStackProcessor->getCurrentStructureDomObjectIdPrefix($data['inlineFirstPid']);
$objectId = $domObjectId . '-' . $foreignTable . '-' . $rec['uid'];
$recordTitle = $data['recordTitle'];
if (empty($recordTitle)) {
$recordTitle = '<em>[' . $languageService->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', true) . ']</em>';
}
$altText = BackendUtility::getRecordIconAltText($rec, $foreignTable);
$iconImg = '<span title="' . $altText . '" id="' . htmlspecialchars($objectId) . '_icon' . '">' . $this->iconFactory->getIconForRecord($foreignTable, $rec, Icon::SIZE_SMALL)->render() . '</span>';
$label = '<span id="' . $objectId . '_label">' . $recordTitle . '</span>';
$ctrl = $this->renderForeignRecordHeaderControl($data);
$thumbnail = false;
// Renders a thumbnail for the header
if (!empty($inlineConfig['appearance']['headerThumbnail']['field'])) {
$fieldValue = $rec[$inlineConfig['appearance']['headerThumbnail']['field']];
$firstElement = array_shift(GeneralUtility::trimExplode('|', array_shift(GeneralUtility::trimExplode(',', $fieldValue))));
$fileUid = array_pop(BackendUtility::splitTable_Uid($firstElement));
if (!empty($fileUid)) {
try {
$fileObject = ResourceFactory::getInstance()->getFileObject($fileUid);
} catch (\InvalidArgumentException $e) {
$fileObject = null;
}
if ($fileObject && $fileObject->isMissing()) {
$flashMessage = \TYPO3\CMS\Core\Resource\Utility\BackendUtility::getFlashMessageForMissingFile($fileObject);
$thumbnail = $flashMessage->render();
} elseif ($fileObject) {
$imageSetup = $inlineConfig['appearance']['headerThumbnail'];
unset($imageSetup['field']);
if (!empty($rec['crop'])) {
$imageSetup['crop'] = $rec['crop'];
}
$imageSetup = array_merge(array('width' => '45', 'height' => '45c'), $imageSetup);
$processedImage = $fileObject->process(ProcessedFile::CONTEXT_IMAGECROPSCALEMASK, $imageSetup);
// Only use a thumbnail if the processing process was successful by checking if image width is set
if ($processedImage->getProperty('width')) {
$imageUrl = $processedImage->getPublicUrl(true);
$thumbnail = '<img src="' . $imageUrl . '" ' . 'width="' . $processedImage->getProperty('width') . '" ' . 'height="' . $processedImage->getProperty('height') . '" ' . 'alt="' . htmlspecialchars($altText) . '" ' . 'title="' . htmlspecialchars($altText) . '">';
}
}
}
}
if (!empty($inlineConfig['appearance']['headerThumbnail']['field']) && $thumbnail) {
$mediaContainer = '<div class="form-irre-header-cell form-irre-header-thumbnail" id="' . $objectId . '_thumbnailcontainer">' . $thumbnail . '</div>';
} else {
$mediaContainer = '<div class="form-irre-header-cell form-irre-header-icon" id="' . $objectId . '_iconcontainer">' . $iconImg . '</div>';
}
$header = $mediaContainer . '
<div class="form-irre-header-cell form-irre-header-body">' . $label . '</div>
<div class="form-irre-header-cell form-irre-header-control t3js-formengine-irre-control">' . $ctrl . '</div>';
return $header;
}
示例9: getIconForRecordWithMockRecordWithHiddenFlagReturnsNormalIconAndOverlay
/**
* Tests the returns of tt_content + mock record with hidden flag
*
* @test
*/
public function getIconForRecordWithMockRecordWithHiddenFlagReturnsNormalIconAndOverlay()
{
$GLOBALS['TCA'] = array('tt_content' => array('ctrl' => array('enablecolumns' => array('disabled' => 'hidden'), 'typeicon_column' => 'CType', 'typeicon_classes' => array('text' => 'mimetypes-x-content-text'))));
$mockRecord = $this->mockRecord;
$mockRecord['hidden'] = '1';
$result = $this->subject->getIconForRecord('tt_content', $mockRecord)->render();
$this->assertContains('<span class="t3js-icon icon icon-size-default icon-state-default icon-mimetypes-x-content-text" data-identifier="mimetypes-x-content-text">', $result);
$this->assertContains('<span class="icon-overlay icon-overlay-hidden">', $result);
}
示例10: getFormLine
/**
* Return one line in the form
*
* @param int|string $index An integer: the line counter for which to create the line. Use "#" to create an template for javascript (used by ExtJS)
* @return string HTML code for one input line for one new page
*/
protected function getFormLine($index)
{
if (is_numeric($index)) {
$label = $index + 1;
} else {
// used as template for JavaScript
$index = '{0}';
$label = '{1}';
}
$content = '' . '<div class="form-section" id="form-line-' . $index . '">' . '<div class="row">' . '<div class="form-group col-sm-6">' . '<label for="page_new_' . $index . '">' . $this->getLanguageService()->getLL('wiz_newPages_page') . ' ' . $label . ':' . '</label>' . '<div class="form-control-wrap">' . '<input class="form-control" type="text" id="page_new_' . $index . '" name="data[pages][NEW' . $index . '][title]" />' . '</div>' . '</div>' . '<div class="form-group col-sm-6">' . '<label>' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_general.xlf:LGL.type') . '</label>' . '<div class="form-control-wrap">' . '<div class="input-group">' . '<div id="page_new_icon_' . $index . '" class="input-group-addon input-group-icon">' . $this->iconFactory->getIconForRecord('pages', array(), Icon::SIZE_SMALL)->render() . '</div>' . '<select class="form-control form-control-adapt t3js-wizardcrpages-select-doktype" name="data[pages][NEW' . $index . '][doktype]" data-target="#page_new_icon_' . $index . '">' . $this->typeSelectHtml . '</select>' . '</div>' . '</div>' . '</div>' . '</div>' . '</div>';
return $content;
}
示例11: createButtons
/**
* Create the panel of buttons
*
* @return void
*/
protected function createButtons()
{
$buttonBar = $this->view->getModuleTemplate()->getDocHeaderComponent()->getButtonBar();
$uriBuilder = $this->objectManager->get(UriBuilder::class);
$uriBuilder->setRequest($this->request);
$buttons = [['table' => 'tx_news_domain_model_news', 'label' => 'module.createNewNewsRecord', 'action' => 'newNews'], ['table' => 'tx_news_domain_model_tag', 'label' => 'module.createNewTag', 'action' => 'newTag'], ['table' => 'sys_category', 'label' => 'module.createNewCategory', 'action' => 'newCategory']];
foreach ($buttons as $key => $tableConfiguration) {
if ($this->getBackendUser()->isAdmin() || GeneralUtility::inList($this->getBackendUser()->groupData['tables_modify'], $tableConfiguration['table'])) {
$viewButton = $buttonBar->makeLinkButton()->setHref($uriBuilder->reset()->setRequest($this->request)->uriFor($tableConfiguration['action'], array(), 'Administration'))->setTitle($this->getLanguageService()->sL('LLL:EXT:news/Resources/Private/Language/locallang_be.xlf:' . $tableConfiguration['label'], true))->setIcon($this->iconFactory->getIconForRecord($tableConfiguration['table'], [], Icon::SIZE_SMALL));
$buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, $key);
}
}
}
示例12: makeConfigurationForm
/**
* Create configuration form
*
* @param array $inData Form configuration data
* @return void
*/
public function makeConfigurationForm($inData)
{
$nameSuggestion = '';
// Page tree export options:
if (isset($inData['pagetree']['id'])) {
$this->standaloneView->assign('treeHTML', $this->treeHTML);
$opt = array('-2' => $this->lang->getLL('makeconfig_tablesOnThisPage'), '-1' => $this->lang->getLL('makeconfig_expandedTree'), '0' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_0'), '1' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_1'), '2' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_2'), '3' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_3'), '4' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_4'), '999' => $this->lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.depth_infi'));
$this->standaloneView->assign('levelSelectOptions', $opt);
$this->standaloneView->assign('tableSelectOptions', $this->getTableSelectOptions('pages'));
$nameSuggestion .= 'tree_PID' . $inData['pagetree']['id'] . '_L' . $inData['pagetree']['levels'];
}
// Single record export:
if (is_array($inData['record'])) {
$records = array();
foreach ($inData['record'] as $ref) {
$rParts = explode(':', $ref);
$tName = $rParts[0];
$rUid = $rParts[1];
$nameSuggestion .= $tName . '_' . $rUid;
$rec = BackendUtility::getRecordWSOL($tName, $rUid);
if (!empty($rec)) {
$records[] = array('icon' => $this->iconFactory->getIconForRecord($tName, $rec, Icon::SIZE_SMALL)->render(), 'title' => BackendUtility::getRecordTitle($tName, $rec, true), 'tableName' => $tName, 'recordUid' => $rUid);
}
}
$this->standaloneView->assign('records', $records);
}
// Single tables/pids:
if (is_array($inData['list'])) {
// Display information about pages from which the export takes place
$tableList = array();
foreach ($inData['list'] as $reference) {
$referenceParts = explode(':', $reference);
$tableName = $referenceParts[0];
if ($this->getBackendUser()->check('tables_select', $tableName)) {
// If the page is actually the root, handle it differently
// NOTE: we don't compare integers, because the number actually comes from the split string above
if ($referenceParts[1] === '0') {
$iconAndTitle = $this->iconFactory->getIcon('apps-pagetree-root', Icon::SIZE_SMALL)->render() . $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
} else {
$record = BackendUtility::getRecordWSOL('pages', $referenceParts[1]);
$iconAndTitle = $this->iconFactory->getIconForRecord('pages', $record, Icon::SIZE_SMALL)->render() . BackendUtility::getRecordTitle('pages', $record, true);
}
$tableList[] = array('tableName' => $tableName, 'iconAndTitle' => $iconAndTitle, 'reference' => $reference);
}
}
$this->standaloneView->assign('tableList', $tableList);
}
$this->standaloneView->assign('externalReferenceTableSelectOptions', $this->getTableSelectOptions());
$this->standaloneView->assign('externalStaticTableSelectOptions', $this->getTableSelectOptions());
$this->standaloneView->assign('nameSuggestion', $nameSuggestion);
}
示例13: getPageRecordData
/**
* Get the rendered page title including onclick menu
*
* @param $detailPid
* @return string
*/
public function getPageRecordData($detailPid)
{
$pageRecord = BackendUtilityCore::getRecord('pages', $detailPid);
if (is_array($pageRecord)) {
$data = '<span title="Uid: ' . htmlspecialchars($pageRecord['uid']) . '">' . $this->iconFactory->getIconForRecord('pages', $pageRecord, Icon::SIZE_SMALL)->render() . '</span>' . htmlspecialchars(BackendUtilityCore::getRecordTitle('pages', $pageRecord));
$content = BackendUtilityCore::wrapClickMenuOnIcon($data, 'pages', $pageRecord['uid'], true, '', '+info,edit');
} else {
/** @var $message FlashMessage */
$text = sprintf($this->getLanguageService()->sL(self::LLPATH . 'pagemodule.pageNotAvailable', true), $detailPid);
$message = GeneralUtility::makeInstance(FlashMessage::class, $text, '', FlashMessage::WARNING);
$content = $message->render();
}
return $content;
}
示例14: intval
/**
* Shows the status of the mailer engine.
* TODO: Should really only show some entries, or provide a browsing interface.
*
* @return string List of the mailing status
*/
function cmd_mailerengine()
{
$invokeMessage = "";
// enable manual invocation of mailer engine; enabled by default
$enableTrigger = !(isset($this->params['menu.']['dmail_mode.']['mailengine.']['disable_trigger']) && $this->params['menu.']['dmail_mode.']['mailengine.']['disable_trigger']);
if ($enableTrigger && GeneralUtility::_GP('invokeMailerEngine')) {
/* @var $flashMessage FlashMessage */
$flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', '<strong>' . $this->getLanguageService()->getLL('dmail_mailerengine_log') . '</strong><br />' . nl2br($this->invokeMEngine()), $this->getLanguageService()->getLL('dmail_mailerengine_invoked'), FlashMessage::INFO);
$invokeMessage = $flashMessage->render();
}
// Invoke engine
if ($enableTrigger) {
$out = '<p>' . $this->getLanguageService()->getLL('dmail_mailerengine_manual_explain') . '<br /><br /><a class="t3-link" href="' . BackendUtility::getModuleUrl('txdirectmailM1_txdirectmailM5') . '&id=' . $this->id . '&invokeMailerEngine=1"><strong>' . $this->getLanguageService()->getLL('dmail_mailerengine_invoke_now') . '</strong></a></p>';
$invokeMessage .= '<div style="padding-top: 20px;"></div>';
$invokeMessage .= $this->doc->section(BackendUtility::cshItem($this->cshTable, 'mailerengine_invoke', $GLOBALS["BACK_PATH"]) . $this->getLanguageService()->getLL('dmail_mailerengine_manual_invoke'), $out, 1, 1, 0, TRUE);
$invokeMessage .= '<div style="padding-top: 20px;"></div>';
}
// Display mailer engine status
$res = $GLOBALS["TYPO3_DB"]->exec_SELECTquery('uid,pid,subject,scheduled,scheduled_begin,scheduled_end', 'sys_dmail', 'pid=' . intval($this->id) . ' AND scheduled>0' . BackendUtility::deleteClause('sys_dmail'), '', 'scheduled DESC');
$out = '<tr class="t3-row-header">
<td> </td>
<td><b>' . $this->getLanguageService()->getLL('dmail_mailerengine_subject') . ' </b></td>
<td><b>' . $this->getLanguageService()->getLL('dmail_mailerengine_scheduled') . ' </b></td>
<td><b>' . $this->getLanguageService()->getLL('dmail_mailerengine_delivery_begun') . ' </b></td>
<td><b>' . $this->getLanguageService()->getLL('dmail_mailerengine_delivery_ended') . ' </b></td>
<td style="text-align: center;"><b> ' . $this->getLanguageService()->getLL('dmail_mailerengine_number_sent') . ' </b></td>
<td style="text-align: center;"><b> ' . $this->getLanguageService()->getLL('dmail_mailerengine_delete') . ' </b></td>
</tr>';
while ($row = $GLOBALS["TYPO3_DB"]->sql_fetch_assoc($res)) {
$countres = $GLOBALS["TYPO3_DB"]->exec_SELECTquery('count(*)', 'sys_dmail_maillog', 'mid=' . intval($row['uid']) . ' AND response_type=0' . ' AND html_sent>0');
list($count) = $GLOBALS["TYPO3_DB"]->sql_fetch_row($countres);
$out .= '<tr class="db_list_normal">
<td>' . $this->iconFactory->getIconForRecord('sys_dmail', $row, Icon::SIZE_SMALL)->render() . '</td>
<td>' . $this->linkDMail_record(htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['subject'], 100)) . ' ', $row['uid']) . '</td>
<td>' . BackendUtility::datetime($row['scheduled']) . ' </td>
<td>' . ($row['scheduled_begin'] ? BackendUtility::datetime($row['scheduled_begin']) : '') . ' </td>
<td>' . ($row['scheduled_end'] ? BackendUtility::datetime($row['scheduled_end']) : '') . ' </td>
<td style="text-align: center;">' . ($count ? $count : ' ') . '</td>
<td style="text-align: center;">' . $this->deleteLink($row['uid']) . '</td>
</tr>';
}
$out = $invokeMessage . '<table class="table table-striped table-hover">' . $out . '</table>';
return $this->doc->section(BackendUtility::cshItem($this->cshTable, 'mailerengine_status', $GLOBALS["BACK_PATH"]) . $this->getLanguageService()->getLL('dmail_mailerengine_status'), $out, 1, 1, 0, TRUE);
}
示例15: createButtons
/**
* Create the panel of buttons
*
* @return void
*/
protected function createButtons()
{
$buttonBar = $this->view->getModuleTemplate()->getDocHeaderComponent()->getButtonBar();
$uriBuilder = $this->objectManager->get(UriBuilder::class);
$uriBuilder->setRequest($this->request);
$buttons = [['table' => 'tx_news_domain_model_news', 'label' => 'module.createNewNewsRecord', 'action' => 'newNews'], ['table' => 'tx_news_domain_model_tag', 'label' => 'module.createNewTag', 'action' => 'newTag'], ['table' => 'sys_category', 'label' => 'module.createNewCategory', 'action' => 'newCategory']];
foreach ($buttons as $key => $tableConfiguration) {
if ($this->getBackendUser()->isAdmin() || GeneralUtility::inList($this->getBackendUser()->groupData['tables_modify'], $tableConfiguration['table'])) {
$viewButton = $buttonBar->makeLinkButton()->setHref($uriBuilder->reset()->setRequest($this->request)->uriFor($tableConfiguration['action'], [], 'Administration'))->setTitle($this->getLanguageService()->sL('LLL:EXT:news/Resources/Private/Language/locallang_be.xlf:' . $tableConfiguration['label']))->setIcon($this->iconFactory->getIconForRecord($tableConfiguration['table'], [], Icon::SIZE_SMALL));
$buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, $key);
}
}
/** @var Clipboard clipObj */
$clipBoard = GeneralUtility::makeInstance(Clipboard::class);
$clipBoard->initializeClipboard();
$elFromTable = $clipBoard->elFromTable('tx_news_domain_model_news');
if (!empty($elFromTable)) {
$viewButton = $buttonBar->makeLinkButton()->setHref($clipBoard->pasteUrl('', $this->pageUid))->setOnClick('return ' . $clipBoard->confirmMsg('pages', BackendUtilityCore::getRecord('pages', $this->pageUid), 'into', $elFromTable))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:clip_pasteInto'))->setIcon($this->iconFactory->getIcon('actions-document-paste-into', ICON::SIZE_SMALL));
$buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 4);
}
}