本文整理汇总了PHP中TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendUtility::viewOnClick方法的具体用法?PHP BackendUtility::viewOnClick怎么用?PHP BackendUtility::viewOnClick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Utility\BackendUtility
的用法示例。
在下文中一共展示了BackendUtility::viewOnClick方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: adminLinks
/**
* Administrative links for a table / record
*
* @param string $table Table name
* @param array $row Record for which administrative links are generated.
*
* @return string HTML link tags.
*/
public function adminLinks($table, array $row)
{
if ($table !== 'tx_commerce_products') {
return parent::adminLinks($table, $row);
} else {
$language = $this->getLanguageService();
// Edit link:
$adminLink = '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick('&edit[' . $table . '][' . $row['uid'] . ']=edit', $this->doc->backPath)) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-open', array('title' => $language->sL('LLL:EXT:lang/locallang_core.xml:cm.edit', TRUE))) . '</a>';
// Delete link:
$adminLink .= '<a href="' . htmlspecialchars($this->doc->issueCommand('&cmd[' . $table . '][' . $row['uid'] . '][delete]=1')) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-delete', array('title' => $language->sL('LLL:EXT:lang/locallang_core.php:cm.delete', TRUE))) . '</a>';
if ($row['pid'] == -1) {
// get page TSconfig
$pagesTyposcriptConfig = \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig($GLOBALS['_POST']['popViewId']);
if ($pagesTyposcriptConfig['tx_commerce.']['singlePid']) {
$previewPageId = $pagesTyposcriptConfig['tx_commerce.']['singlePid'];
} else {
$previewPageId = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][COMMERCE_EXTKEY]['extConf']['previewPageID'];
}
$sysLanguageUid = (int) $row['sys_language_uid'];
/**
* Product
*
* @var $product Tx_Commerce_Domain_Model_Product
*/
$product = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Tx_Commerce_Domain_Model_Product', $row['t3ver_oid'], $sysLanguageUid);
$product->loadData();
$getVars = ($sysLanguageUid > 0 ? '&L=' . $sysLanguageUid : '') . '&ADMCMD_vPrev[' . rawurlencode($table . ':' . $row['t3ver_oid']) . ']=' . $row['uid'] . '&no_cache=1&tx_commerce_pi1[showUid]=' . $product->getUid() . '&tx_commerce_pi1[catUid]=' . current($product->getMasterparentCategory());
$adminLink .= '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($previewPageId, $this->doc->backPath, \TYPO3\CMS\Backend\Utility\BackendUtility::BEgetRootLine($row['_REAL_PID']), '', '', $getVars)) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-view') . '</a>';
}
return $adminLink;
}
}
示例2: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @return array all available buttons as an associated array
*/
protected function getButtons()
{
$buttons = array('view' => '', 'shortcut' => '');
if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
$buttons['shortcut'] = $this->doc->makeShortcutIcon('tx_impexp', '', $this->MCONF['name']);
}
// Input data grabbed:
$inData = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('tx_impexp');
if ((string) $inData['action'] == 'import') {
if ($this->id && is_array($this->pageinfo) || $GLOBALS['BE_USER']->user['admin'] && !$this->id) {
if (is_array($this->pageinfo) && $this->pageinfo['uid']) {
// View
$buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($this->pageinfo['uid'], $this->doc->backPath, \TYPO3\CMS\Backend\Utility\BackendUtility::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-view') . '</a>';
}
}
}
return $buttons;
}
示例3: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*/
protected function getButtons()
{
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
// CSH
$cshButton = $buttonBar->makeHelpButton()->setModuleName('_MOD_web_func')->setFieldName('');
$buttonBar->addButton($cshButton);
if ($this->id && is_array($this->pageinfo)) {
// View page
$viewButton = $buttonBar->makeLinkButton()->setOnClick(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid'])))->setTitle($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage'))->setIcon($this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL))->setHref('#');
$buttonBar->addButton($viewButton);
// Shortcut
$shortcutButton = $buttonBar->makeShortcutButton()->setModuleName($this->moduleName)->setGetVariables(['id', 'edit_record', 'pointer', 'new_unique_uid', 'search_field', 'search_levels', 'showLimit'])->setSetVariables(array_keys($this->MOD_MENU));
$buttonBar->addButton($shortcutButton);
}
}
示例4: getTable_tt_content
//.........这里部分代码省略.........
// If not, a new header without any buttons will be generated.
if (isset($columnConfig['colPos']) && $columnConfig['colPos'] !== '' && $head[$columnKey] && GeneralUtility::inList($this->tt_contentConfig['activeCols'], $columnConfig['colPos'])) {
$grid .= $head[$columnKey] . $content[$columnKey];
} elseif (isset($columnConfig['colPos']) && $columnConfig['colPos'] !== '' && GeneralUtility::inList($this->tt_contentConfig['activeCols'], $columnConfig['colPos'])) {
$grid .= $this->tt_content_drawColHeader($this->getLanguageService()->getLL('noAccess'), '', '');
} elseif (isset($columnConfig['colPos']) && $columnConfig['colPos'] !== '' && !GeneralUtility::inList($this->tt_contentConfig['activeCols'], $columnConfig['colPos'])) {
$grid .= $this->tt_content_drawColHeader($this->getLanguageService()->sL($columnConfig['name']) . ' (' . $this->getLanguageService()->getLL('noAccess') . ')', '', '');
} elseif (isset($columnConfig['name']) && $columnConfig['name'] !== '') {
$grid .= $this->tt_content_drawColHeader($this->getLanguageService()->sL($columnConfig['name']) . ' (' . $this->getLanguageService()->getLL('notAssigned') . ')', '', '');
} else {
$grid .= $this->tt_content_drawColHeader($this->getLanguageService()->getLL('notAssigned'), '', '');
}
$grid .= '</td>';
}
$grid .= '</tr>';
}
$out .= $grid . '</table></div>';
}
// CSH:
$out .= BackendUtility::cshItem($this->descrTable, 'columns_multi');
}
// If language mode, then make another presentation:
// Notice that THIS presentation will override the value of $out!
// But it needs the code above to execute since $languageColumn is filled with content we need!
if ($this->tt_contentConfig['languageMode']) {
// Get language selector:
$languageSelector = $this->languageSelector($id);
// Reset out - we will make new content here:
$out = '';
// Traverse languages found on the page and build up the table displaying them side by side:
$cCont = array();
$sCont = array();
foreach ($langListArr as $lP) {
// Header:
$lP = (int) $lP;
$cCont[$lP] = '
<td valign="top" class="t3-page-column" data-language-uid="' . $lP . '">
<h2>' . htmlspecialchars($this->tt_contentConfig['languageCols'][$lP]) . '</h2>
</td>';
// "View page" icon is added:
$viewLink = '';
if (!VersionState::cast($this->getPageLayoutController()->pageinfo['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)) {
$onClick = BackendUtility::viewOnClick($this->id, '', BackendUtility::BEgetRootLine($this->id), '', '', '&L=' . $lP);
$viewLink = '<a href="#" class="btn btn-default btn-sm" onclick="' . htmlspecialchars($onClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true) . '">' . $this->iconFactory->getIcon('actions-view', Icon::SIZE_SMALL)->render() . '</a>';
}
// Language overlay page header:
if ($lP) {
list($lpRecord) = BackendUtility::getRecordsByField('pages_language_overlay', 'pid', $id, 'AND sys_language_uid=' . $lP);
BackendUtility::workspaceOL('pages_language_overlay', $lpRecord);
$params = '&edit[pages_language_overlay][' . $lpRecord['uid'] . ']=edit&overrideVals[pages_language_overlay][sys_language_uid]=' . $lP;
$recordIcon = BackendUtility::wrapClickMenuOnIcon($this->iconFactory->getIconForRecord('pages_language_overlay', $lpRecord, Icon::SIZE_SMALL)->render(), 'pages_language_overlay', $lpRecord['uid']);
$editLink = $this->getBackendUser()->check('tables_modify', 'pages_language_overlay') ? '<a href="#" class="btn btn-default btn-sm" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params)) . '" title="' . $this->getLanguageService()->getLL('edit', true) . '">' . $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL)->render() . '</a>' : '';
$lPLabel = '<div class="btn-group">' . $viewLink . $editLink . '</div>' . ' ' . $recordIcon . ' ' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($lpRecord['title'], 20));
} else {
$params = '&edit[pages][' . $this->id . ']=edit';
$recordIcon = BackendUtility::wrapClickMenuOnIcon($this->iconFactory->getIconForRecord('pages', $this->pageRecord, Icon::SIZE_SMALL)->render(), 'pages', $this->id);
$editLink = $this->getBackendUser()->check('tables_modify', 'pages_language_overlay') ? '<a href="#" class="btn btn-default btn-sm" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params)) . '" title="' . $this->getLanguageService()->getLL('edit', true) . '">' . $this->iconFactory->getIcon('actions-open', Icon::SIZE_SMALL)->render() . '</a>' : '';
$lPLabel = '<div class="btn-group">' . $viewLink . $editLink . '</div>' . ' ' . $recordIcon . ' ' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($this->pageRecord['title'], 20));
}
$sCont[$lP] = '
<td nowrap="nowrap" class="t3-page-column t3-page-lang-label">' . $lPLabel . '</td>';
}
// Add headers:
$out .= '<tr>' . implode($cCont) . '</tr>';
$out .= '<tr>' . implode($sCont) . '</tr>';
unset($cCont, $sCont);
// Traverse previously built content for the columns:
foreach ($languageColumn as $cKey => $cCont) {
$out .= '<tr>';
foreach ($cCont as $languageId => $columnContent) {
$out .= '<td valign="top" class="t3-grid-cell t3-page-column t3js-page-column t3js-page-lang-column t3js-page-lang-column-' . $languageId . '">' . $columnContent . '</td>';
}
$out .= '</tr>';
if ($this->defLangBinding) {
// "defLangBinding" mode
foreach ($defLanguageCount[$cKey] as $defUid) {
$cCont = array();
foreach ($langListArr as $lP) {
$cCont[] = $defLangBinding[$cKey][$lP][$defUid] . $this->newLanguageButton($this->getNonTranslatedTTcontentUids(array($defUid), $id, $lP), $lP, $cKey);
}
$out .= '
<tr>
<td valign="top" class="t3-grid-cell">' . implode('</td>' . '
<td valign="top" class="t3-grid-cell">', $cCont) . '</td>
</tr>';
}
}
}
// Finally, wrap it all in a table and add the language selector on top of it:
$out = $languageSelector . '
<div class="t3-grid-container">
<table cellpadding="0" cellspacing="0" class="t3-page-columns t3-grid-table t3js-page-columns">
' . $out . '
</table>
</div>';
// CSH:
$out .= BackendUtility::cshItem($this->descrTable, 'language_list');
}
return $out;
}
示例5: adminLinks
/**
* Administrative links for a table / record
*
* @param string $table Table name
* @param array $row Record for which administrative links are generated.
* @return string HTML link tags.
*/
public function adminLinks($table, $row)
{
// Edit link:
$editUrl = BackendUtility::getModuleUrl('record_edit', ['edit' => [$table => [$row['uid'] => 'edit']], 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')]);
$adminLink = '<a class="btn btn-default" href="' . htmlspecialchars($editUrl) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.edit', true) . '">' . $this->moduleTemplate->getIconFactory()->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '</a>';
// Delete link:
$adminLink .= '<a class="btn btn-default" href="' . htmlspecialchars(BackendUtility::getLinkToDataHandlerAction('&cmd[' . $table . '][' . $row['uid'] . '][delete]=1')) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.delete', true) . '">' . $this->moduleTemplate->getIconFactory()->getIcon('actions-edit-delete', Icon::SIZE_SMALL)->render() . '</a>';
if ($table === 'pages') {
// If another page module was specified, replace the default Page module with the new one
$newPageModule = trim($GLOBALS['BE_USER']->getTSConfigVal('options.overridePageModule'));
$pageModule = BackendUtility::isModuleSetInTBE_MODULES($newPageModule) ? $newPageModule : 'web_layout';
// Perform some access checks:
$a_wl = $GLOBALS['BE_USER']->check('modules', 'web_list');
$a_wp = $GLOBALS['BE_USER']->check('modules', $pageModule);
$adminLink .= '<a class="btn btn-default" href="#" onclick="top.loadEditId(' . $row['uid'] . ');top.goToModule(' . GeneralUtility::quoteJSvalue($pageModule) . '); return false;">' . $this->moduleTemplate->getIconFactory()->getIcon('actions-page-open', Icon::SIZE_SMALL)->render() . '</a>';
$adminLink .= '<a class="btn btn-default" href="#" onclick="top.loadEditId(' . $row['uid'] . ');top.goToModule(\'web_list\'); return false;">' . $this->moduleTemplate->getIconFactory()->getIcon('actions-system-list-open', Icon::SIZE_SMALL)->render() . '</a>';
// "View page" icon is added:
$adminLink .= '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($row['uid'], '', BackendUtility::BEgetRootLine($row['uid']))) . '">' . $this->moduleTemplate->getIconFactory()->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . '</a>';
} else {
if ($row['pid'] == -1) {
$getVars = '&ADMCMD_vPrev[' . rawurlencode($table . ':' . $row['t3ver_oid']) . ']=' . $row['uid'];
// "View page" icon is added:
$adminLink .= '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($row['_REAL_PID'], '', BackendUtility::BEgetRootLine($row['_REAL_PID']), '', '', $getVars)) . '">' . $this->moduleTemplate->getIconFactory()->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . '</a>';
}
}
return '<div class="btn-group btn-group-sm" role="group">' . $adminLink . '</div>';
}
示例6: getRecordActions
/**
* Returns the rendered record actions
*
* @param string $table
* @param int $uid
* @return string
*/
protected function getRecordActions($table, $uid)
{
if ($table === '' || $uid < 0) {
return '';
}
// Edit button
$urlParameters = ['edit' => [$table => [$uid => 'edit']], 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')];
$url = BackendUtility::getModuleUrl('record_edit', $urlParameters);
$pageActionIcons = '
<a class="btn btn-default btn-sm" href="' . htmlspecialchars($url) . '">
' . $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render() . '
</a>';
// History button
$urlParameters = ['element' => $table . ':' . $uid, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')];
$url = BackendUtility::getModuleUrl('record_history', $urlParameters);
$pageActionIcons .= '
<a class="btn btn-default btn-sm" href="' . htmlspecialchars($url) . '">
' . $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL)->render() . '
</a>';
if ($table === 'pages') {
// Recordlist button
$url = BackendUtility::getModuleUrl('web_list', array('id' => $uid, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')));
$pageActionIcons .= '
<a class="btn btn-default btn-sm" href="' . htmlspecialchars($url) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.showList') . '">
' . $this->iconFactory->getIcon('actions-system-list-open', Icon::SIZE_SMALL)->render() . '
</a>';
// View page button
$viewOnClick = BackendUtility::viewOnClick($uid, '', BackendUtility::BEgetRootLine($uid));
$pageActionIcons .= '
<a class="btn btn-default btn-sm" href="#" onclick="' . htmlspecialchars($viewOnClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true) . '">
' . $this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . '
</a>';
}
return '
<div class="btn-group" role="group">
' . $pageActionIcons . '
</div>';
}
示例7: makeControl
/**
* Creates the control panel for a single record in the listing.
*
* @param string $table The table
* @param mixed[] $row The record for which to make the control panel.
* @throws \UnexpectedValueException
* @return string HTML table with the control panel (unless disabled)
*/
public function makeControl($table, $row)
{
$module = $this->getModule();
$rowUid = $row['uid'];
if (ExtensionManagementUtility::isLoaded('version') && isset($row['_ORIG_uid'])) {
$rowUid = $row['_ORIG_uid'];
}
$cells = array('primary' => array(), 'secondary' => array());
// If the listed table is 'pages' we have to request the permission settings for each page:
$localCalcPerms = 0;
if ($table == 'pages') {
$localCalcPerms = $this->getBackendUserAuthentication()->calcPerms(BackendUtility::getRecord('pages', $row['uid']));
}
$permsEdit = $table === 'pages' && $this->getBackendUserAuthentication()->checkLanguageAccess(0) && $localCalcPerms & Permission::PAGE_EDIT || $table !== 'pages' && $this->calcPerms & Permission::CONTENT_EDIT;
$permsEdit = $this->overlayEditLockPermissions($table, $row, $permsEdit);
// "Show" link (only pages and tt_content elements)
if ($table == 'pages' || $table == 'tt_content') {
$viewAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($table === 'tt_content' ? $this->id : $row['uid'], '', '', $table === 'tt_content' ? '#' . $row['uid'] : '')) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true) . '">' . $this->iconFactory->getIcon('actions-view', Icon::SIZE_SMALL)->render() . '</a>';
$this->addActionToCellGroup($cells, $viewAction, 'view');
}
// "Edit" link: ( Only if permissions to edit the page-record of the content of the parent page ($this->id)
if ($permsEdit) {
$params = '&edit[' . $table . '][' . $row['uid'] . ']=edit';
$iconIdentifier = 'actions-open';
$overlayIdentifier = !$this->isEditable($table) ? 'overlay-readonly' : null;
$editAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, '', -1)) . '" title="' . $this->getLanguageService()->getLL('edit', true) . '">' . $this->iconFactory->getIcon($iconIdentifier, Icon::SIZE_SMALL, $overlayIdentifier)->render() . '</a>';
} else {
$editAction = $this->spaceIcon;
}
$this->addActionToCellGroup($cells, $editAction, 'edit');
// "Info": (All records)
$onClick = 'top.launchView(' . GeneralUtility::quoteJSvalue($table) . ', ' . (int) $row['uid'] . '); return false;';
$viewBigAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . $this->getLanguageService()->getLL('showInfo', true) . '">' . $this->iconFactory->getIcon('actions-document-info', Icon::SIZE_SMALL)->render() . '</a>';
$this->addActionToCellGroup($cells, $viewBigAction, 'viewBig');
// "Move" wizard link for pages/tt_content elements:
if ($permsEdit && ($table === 'tt_content' || $table === 'pages')) {
$onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('move_element') . '&table=' . $table . '&uid=' . $row['uid']) . ');';
$linkTitleLL = $this->getLanguageService()->getLL('move_' . ($table === 'tt_content' ? 'record' : 'page'), true);
$icon = $table == 'pages' ? $this->iconFactory->getIcon('actions-page-move', Icon::SIZE_SMALL) : $this->iconFactory->getIcon('actions-document-move', Icon::SIZE_SMALL);
$moveAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . $linkTitleLL . '">' . $icon->render() . '</a>';
$this->addActionToCellGroup($cells, $moveAction, 'move');
}
// If the table is NOT a read-only table, then show these links:
if ($this->isEditable($table)) {
// "Revert" link (history/undo)
$moduleUrl = BackendUtility::getModuleUrl('record_history', array('element' => $table . ':' . $row['uid']));
$onClick = 'return jumpExt(' . GeneralUtility::quoteJSvalue($moduleUrl) . ',\'#latest\');';
$historyAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars($onClick) . '" title="' . $this->getLanguageService()->getLL('history', true) . '">' . $this->iconFactory->getIcon('actions-document-history-open', Icon::SIZE_SMALL)->render() . '</a>';
$this->addActionToCellGroup($cells, $historyAction, 'history');
// Versioning:
if (ExtensionManagementUtility::isLoaded('version') && !ExtensionManagementUtility::isLoaded('workspaces')) {
$vers = BackendUtility::selectVersionsOfRecord($table, $row['uid'], 'uid', $this->getBackendUserAuthentication()->workspace, false, $row);
// If table can be versionized.
if (is_array($vers)) {
$href = BackendUtility::getModuleUrl('web_txversionM1', array('table' => $table, 'uid' => $row['uid']));
$versionAction = '<a class="btn btn-default" href="' . htmlspecialchars($href) . '" title="' . $this->getLanguageService()->getLL('displayVersions', true) . '">' . $this->iconFactory->getIcon('actions-version-page-open', Icon::SIZE_SMALL)->render() . '</a>';
$this->addActionToCellGroup($cells, $versionAction, 'version');
}
}
// "Edit Perms" link:
if ($table === 'pages' && $this->getBackendUserAuthentication()->check('modules', 'system_BeuserTxPermission') && ExtensionManagementUtility::isLoaded('beuser')) {
$href = BackendUtility::getModuleUrl('system_BeuserTxPermission') . '&id=' . $row['uid'] . '&return_id=' . $row['uid'] . '&edit=1';
$permsAction = '<a class="btn btn-default" href="' . htmlspecialchars($href) . '" title="' . $this->getLanguageService()->getLL('permissions', true) . '">' . $this->iconFactory->getIcon('status-status-locked', Icon::SIZE_SMALL)->render() . '</a>';
$this->addActionToCellGroup($cells, $permsAction, 'perms');
}
// "New record after" link (ONLY if the records in the table are sorted by a "sortby"-row
// or if default values can depend on previous record):
if (($GLOBALS['TCA'][$table]['ctrl']['sortby'] || $GLOBALS['TCA'][$table]['ctrl']['useColumnsForDefaultValues']) && $permsEdit) {
if ($table !== 'pages' && $this->calcPerms & Permission::CONTENT_EDIT || $table === 'pages' && $this->calcPerms & Permission::PAGE_NEW) {
if ($this->showNewRecLink($table)) {
$params = '&edit[' . $table . '][' . -($row['_MOVE_PLH'] ? $row['_MOVE_PLH_uid'] : $row['uid']) . ']=new';
$icon = $table == 'pages' ? $this->iconFactory->getIcon('actions-page-new', Icon::SIZE_SMALL) : $this->iconFactory->getIcon('actions-add', Icon::SIZE_SMALL);
$newAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, '', -1)) . '" title="' . $this->getLanguageService()->getLL('new' . ($table == 'pages ' ? 'Page' : 'Record'), true) . '">' . $icon->render() . '</a>';
$this->addActionToCellGroup($cells, $newAction, 'new');
}
}
}
// "Up/Down" links
if ($permsEdit && $GLOBALS['TCA'][$table]['ctrl']['sortby'] && !$this->sortField && !$this->searchLevels) {
if (isset($this->currentTable['prev'][$row['uid']])) {
// Up
$params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . $this->currentTable['prev'][$row['uid']];
$moveUpAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars('return jumpToUrl(' . BackendUtility::getLinkToDataHandlerAction($params, -1) . ');') . '" title="' . $this->getLanguageService()->getLL('moveUp', true) . '">' . $this->iconFactory->getIcon('actions-move-up', Icon::SIZE_SMALL)->render() . '</a>';
} else {
$moveUpAction = $this->spaceIcon;
}
$this->addActionToCellGroup($cells, $moveUpAction, 'moveUp');
if ($this->currentTable['next'][$row['uid']]) {
// Down
$params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . $this->currentTable['next'][$row['uid']];
$moveDownAction = '<a class="btn btn-default" href="#" onclick="' . htmlspecialchars('return jumpToUrl(' . BackendUtility::getLinkToDataHandlerAction($params, -1) . ');') . '" title="' . $this->getLanguageService()->getLL('moveDown', true) . '">' . $this->iconFactory->getIcon('actions-move-down', Icon::SIZE_SMALL)->render() . '</a>';
} else {
//.........这里部分代码省略.........
示例8: renderModule
/**
* Rendering the information
*
* @param array The Page tree data
* @return string HTML for the information table.
*/
public function renderModule(\TYPO3\CMS\Backend\Tree\View\PageTreeView $tree)
{
// Initialize:
$searchPath = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('pathPrefixSearch'));
$cmd = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('cmd');
$entry = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('entry');
$searchForm_replace = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_replace');
$searchForm_delete = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('_delete');
$trackSameUrl = array();
$this->searchResultCounter = 0;
// Traverse tree:
$output = '';
$cc = 0;
foreach ($tree->tree as $row) {
// Get all pagepath entries for page:
$pathCacheInfo = $this->getPathCache($row['row']['uid']);
// Row title:
$rowTitle = $row['HTML'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordTitle('pages', $row['row'], true);
$cellAttrib = $row['row']['_CSSCLASS'] ? ' class="' . $row['row']['_CSSCLASS'] . '"' : '';
// Add at least one empty element:
if (!count($pathCacheInfo)) {
// Add title:
$tCells = array();
$tCells[] = '<td nowrap="nowrap"' . $cellAttrib . '>' . $rowTitle . '</td>';
// Empty row:
$tCells[] = '<td colspan="10" align="center"> </td>';
// Compile Row:
$output .= '
<tr class="bgColor' . ($cc % 2 ? '-20' : '-10') . '">
' . implode('
', $tCells) . '
</tr>';
$cc++;
} else {
foreach ($pathCacheInfo as $c => $inf) {
// Init:
$deletedEntry = false;
$hash = $inf['pagepath'] . '|' . $inf['rootpage_id'] . '|' . $inf['language_id'];
// MP is not a part of this because the path itself should be different simply because the MP makes a different path! (see UriGeneratorAndResolver::pagePathtoID())
// Add icon/title and ID:
$tCells = array();
if (!$c) {
$tCells[] = '<td nowrap="nowrap" rowspan="' . count($pathCacheInfo) . '"' . $cellAttrib . '>' . $rowTitle . '</td>';
$tCells[] = '<td rowspan="' . count($pathCacheInfo) . '">' . $inf['page_id'] . '</td>';
}
// Add values from alternative field used to generate URL:
$baseRow = $row['row'];
// page row as base.
$onClick = \TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick('&edit[pages][' . $row['row']['uid'] . ']=edit&columnsOnly=title,nav_title,alias,tx_realurl_pathsegment', $this->pObj->doc->backPath);
$editIcon = '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $this->pObj->doc->backPath) . '</a>';
$onClick = \TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($row['row']['uid'], $this->pObj->doc->backPath, '', '', '', '');
$editIcon .= '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . $this->getIcon('gfx/zoom.gif', 'width="12" height="12"', $this->pObj->doc->backPath) . '</a>';
if ($inf['language_id'] > 0) {
// For alternative languages, show another list of fields, form page overlay record:
$editIcon = '';
list($olRec) = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('pages_language_overlay', 'pid', $row['row']['uid'], ' AND sys_language_uid=' . intval($inf['language_id']));
if (is_array($olRec)) {
$baseRow = array_merge($baseRow, $olRec);
$onClick = \TYPO3\CMS\Backend\Utility\BackendUtility::editOnClick('&edit[pages_language_overlay][' . $olRec['uid'] . ']=edit&columnsOnly=title,nav_title', $this->pObj->doc->backPath);
$editIcon = '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . $this->getIcon('gfx/edit2.gif', 'width="11" height="12"', $this->pObj->doc->backPath) . '</a>';
$onClick = \TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($row['row']['uid'], $this->pObj->doc->backPath, '', '', '', '&L=' . $olRec['sys_language_uid']);
$editIcon .= '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . $this->getIcon('gfx/zoom.gif', 'width="12" height="12"', $this->pObj->doc->backPath) . '</a>';
} else {
$baseRow = array();
}
}
$tCells[] = '<td>' . $editIcon . '</td>';
// Sources for segment:
$sources = count($baseRow) ? implode(' | ', array($baseRow['tx_realurl_pathsegment'], $baseRow['alias'], $baseRow['nav_title'], $baseRow['title'])) : '';
$tCells[] = '<td nowrap="nowrap">' . htmlspecialchars($sources) . '</td>';
// Show page path:
if (strcmp($searchPath, '') && \TYPO3\CMS\Core\Utility\GeneralUtility::isFirstPartOfStr($inf['pagepath'], $searchPath) && !$inf['expire']) {
// Delete entry:
if ($searchForm_delete) {
$this->deletePathCacheEntry($inf['cache_id']);
$deletedEntry = true;
$pagePath = '[DELETED]';
} elseif ($searchForm_replace) {
$replacePart = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::_POST('pathPrefixReplace'));
$this->editPathCacheEntry($inf['cache_id'], $replacePart . substr($inf['pagepath'], strlen($searchPath)));
$pagePath = '<span class="typo3-red">' . htmlspecialchars($replacePart) . '</span>' . htmlspecialchars(substr($inf['pagepath'], strlen($searchPath)));
} else {
$pagePath = '<span class="typo3-red">' . htmlspecialchars(substr($inf['pagepath'], 0, strlen($searchPath))) . '</span>' . htmlspecialchars(substr($inf['pagepath'], strlen($searchPath)));
$this->searchResultCounter++;
}
} else {
// Delete entries:
if ($cmd === 'edit' && (!strcmp($entry, $inf['cache_id']) || !strcmp($entry, 'ALL'))) {
$pagePath = '<input type="text" name="edit[' . $inf['cache_id'] . ']" value="' . htmlspecialchars($inf['pagepath']) . '" size="40" />';
if ($cmd === 'edit' && $entry != 'ALL') {
$pagePath .= $this->saveCancelButtons();
}
} else {
$pagePath = htmlspecialchars($inf['pagepath']);
//.........这里部分代码省略.........
示例9: viewPageIcon
/**
* Makes link to page $id in frontend (view page)
* Returns an icon which links to the frontend index.php document for viewing the page with id $id
* $id must be a page-uid
* If the BE_USER has access to Web>List then a link to that module is shown as well (with return-url)
*
* @param int $id The page id
* @param string $_ @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
* @return string HTML string with linked icon(s)
*/
public function viewPageIcon($id, $_ = '')
{
// If access to Web>List for user, then link to that module.
$str = BackendUtility::getListViewLink(array('id' => $id, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showList'));
// Make link to view page
$str .= '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($id, '', BackendUtility::BEgetRootLine($id))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', true) . '">' . $this->iconFactory->getIcon('actions-document-view', Icon::SIZE_SMALL)->render() . '</a>';
return $str;
}
示例10: viewPageIcon
/**
* Makes link to page $id in frontend (view page)
* Returns an magnifier-glass icon which links to the frontend index.php document for viewing the page with id $id
* $id must be a page-uid
* If the BE_USER has access to Web>List then a link to that module is shown as well (with return-url)
*
* @param integer $id The page id
* @param string $backPath The current "BACK_PATH" (the back relative to the typo3/ directory)
* @param string $addParams Additional parameters for the image tag(s)
* @return string HTML string with linked icon(s)
* @todo Define visibility
*/
public function viewPageIcon($id, $backPath, $addParams = 'hspace="3"')
{
// If access to Web>List for user, then link to that module.
$str = BackendUtility::getListViewLink(array('id' => $id, 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')), $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showList'));
// Make link to view page
$str .= '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($id, $backPath, BackendUtility::BEgetRootLine($id))) . '">' . '<img' . IconUtility::skinImg($backPath, 'gfx/zoom.gif', 'width="12" height="12"') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '"' . ($addParams ? ' ' . trim($addParams) : '') . ' hspace="3" alt="" />' . '</a>';
return $str;
}
示例11: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
* @param string $function Identifier for function of module
* @return array all available buttons as an assoc. array
*/
protected function getButtons($function = '')
{
$lang = $this->getLanguageService();
$buttons = array('view' => '', 'history_page' => '', 'new_content' => '', 'move_page' => '', 'move_record' => '', 'new_page' => '', 'edit_page' => '', 'edit_language' => '', 'csh' => '', 'shortcut' => '', 'cache' => '', 'savedok' => '', 'save_close' => '', 'savedokshow' => '', 'closedok' => '', 'deletedok' => '', 'undo' => '', 'history_record' => '');
// View page
$buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($this->pageinfo['uid'], $GLOBALS['BACK_PATH'], BackendUtility::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
// Shortcut
if ($this->getBackendUser()->mayMakeShortcut()) {
$buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']);
}
// Cache
if (!$this->modTSconfig['properties']['disableAdvanced']) {
$buttons['cache'] = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_layout', array('id' => $this->pageinfo['uid'], 'clear_cache' => '1'))) . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.clear_cache', TRUE) . '">' . IconUtility::getSpriteIcon('actions-system-cache-clear') . '</a>';
}
if (!$this->modTSconfig['properties']['disableIconToolbar']) {
// Move record
if (MathUtility::canBeInterpretedAsInteger($this->eRParts[1])) {
$urlParameters = ['table' => $this->eRParts[0], 'uid' => $this->eRParts[1], 'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')];
$buttons['move_record'] = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('move_element', $urlParameters)) . '">' . IconUtility::getSpriteIcon('actions-' . ($this->eRParts[0] == 'tt_content' ? 'document' : 'page') . '-move', array('class' => 'c-inputButton', 'title' => $lang->getLL('move_' . ($this->eRParts[0] == 'tt_content' ? 'record' : 'page'), TRUE))) . '</a>';
}
// Edit page properties and page language overlay icons
if ($this->CALC_PERMS & Permission::PAGE_EDIT) {
// Edit localized page_language_overlay only when one specific language is selected
if ($this->MOD_SETTINGS['function'] == 1 && $this->current_sys_language > 0) {
$overlayRecord = $this->getDatabaseConnection()->exec_SELECTgetSingleRow('uid', 'pages_language_overlay', 'pid = ' . (int) $this->id . ' ' . 'AND sys_language_uid = ' . (int) $this->current_sys_language . BackendUtility::deleteClause('pages_language_overlay') . BackendUtility::versioningPlaceholderClause('pages_language_overlay'), '', '', '', 'sys_language_uid');
$editLanguageOnClick = htmlspecialchars(BackendUtility::editOnClick('&edit[pages_language_overlay][' . $overlayRecord['uid'] . ']=edit'));
$buttons['edit_language'] = '<a href="#" ' . 'onclick="' . $editLanguageOnClick . '"' . 'title="' . $lang->getLL('editPageLanguageOverlayProperties', TRUE) . '">' . IconUtility::getSpriteIcon('mimetypes-x-content-page-language-overlay') . '</a>';
}
// Edit page properties
$editPageOnClick = htmlspecialchars(BackendUtility::editOnClick('&edit[pages][' . $this->id . ']=edit'));
$buttons['edit_page'] = '<a href="#" ' . 'onclick="' . $editPageOnClick . '"' . 'title="' . $lang->getLL('editPageProperties', TRUE) . '">' . IconUtility::getSpriteIcon('actions-page-open') . '</a>';
}
// Add CSH (Context Sensitive Help) icon to tool bar
if ($function == 'quickEdit') {
$buttons['csh'] = BackendUtility::cshItem($this->descrTable, 'quickEdit');
} else {
$buttons['csh'] = BackendUtility::cshItem($this->descrTable, 'columns_' . $this->MOD_SETTINGS['function']);
}
if ($function == 'quickEdit') {
// Save record
$buttons['savedok'] = IconUtility::getSpriteIcon('actions-document-save', array('html' => '<input type="image" name="_savedok" class="c-inputButton" src="clear.gif" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDoc', TRUE) . '" />'));
// Save and close
$buttons['save_close'] = IconUtility::getSpriteIcon('actions-document-save-close', array('html' => '<input type="image" class="c-inputButton" name="_saveandclosedok" src="clear.gif" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveCloseDoc', TRUE) . '" />'));
// Save record and show page
$buttons['savedokshow'] = '<a href="#" onclick="' . htmlspecialchars('document.editform.redirect.value+=\'&popView=1\'; TBE_EDITOR.checkAndDoSubmit(1); return false;') . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.saveDocShow', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-save-view') . '</a>';
// Close record
$buttons['closedok'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(' . GeneralUtility::quoteJSvalue($this->closeUrl) . '); return false;') . '" title="' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:rm.closeDoc', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-close') . '</a>';
// Delete record
if ($this->deleteButton) {
$buttons['deletedok'] = '<a href="#" onclick="' . htmlspecialchars('return deleteRecord(' . GeneralUtility::quoteJSvalue($this->eRParts[0]) . ',' . GeneralUtility::quoteJSvalue($this->eRParts[1]) . ',' . GeneralUtility::quoteJSvalue(GeneralUtility::getIndpEnv('SCRIPT_NAME') . '?id=' . $this->id) . ');') . '" title="' . $lang->getLL('deleteItem', TRUE) . '">' . IconUtility::getSpriteIcon('actions-edit-delete') . '</a>';
}
if ($this->undoButton) {
// Undo button
$buttons['undo'] = '<a href="#"
onclick="' . htmlspecialchars('window.location.href=' . GeneralUtility::quoteJSvalue($GLOBALS['BACK_PATH'] . BackendUtility::getModuleUrl('record_history', array('element' => $this->eRParts[0] . ':' . $this->eRParts[1], 'revert' => 'ALL_FIELDS', 'sumUp' => -1, 'returnUrl' => $this->R_URI))) . '; return false;') . '"
title="' . htmlspecialchars(sprintf($lang->getLL('undoLastChange'), BackendUtility::calcAge($GLOBALS['EXEC_TIME'] - $this->undoButtonR['tstamp'], $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears')))) . '">' . IconUtility::getSpriteIcon('actions-edit-undo') . '</a>';
// History button
$buttons['history_record'] = '<a href="#"
onclick="' . htmlspecialchars('jumpToUrl(' . GeneralUtility::quoteJSvalue($GLOBALS['BACK_PATH'] . BackendUtility::getModuleUrl('record_history', array('element' => $this->eRParts[0] . ':' . $this->eRParts[1], 'returnUrl' => $this->R_URI)) . '#latest') . ');return false;') . '"
title="' . $lang->getLL('recordHistory', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-history-open') . '</a>';
}
}
}
return $buttons;
}
示例12: viewOnClick
/**
* Returns a JavaScript string for viewing the page id, $id
* It will detect the correct domain name if needed and provide the link with the right back path.
* Also it will re-use any window already open.
*
* @param int $pageUid Page UID
* @param string $backPath Must point back to TYPO3_mainDir (where the site is assumed to be one level above)
* @param array|NULL $rootLine If root line is supplied the function will look for the first found domain record and use that URL instead (if found)
* @param string $anchorSection Optional anchor to the URL
* @param string $alternativeUrl An alternative URL that, if set, will ignore other parameters except $switchFocus: It will return the window.open command wrapped around this URL!
* @param string $additionalGetVars Additional GET variables.
* @param bool $switchFocus If TRUE, then the preview window will gain the focus.
* @return string
*/
public function viewOnClick($pageUid, $backPath = '', $rootLine = NULL, $anchorSection = '', $alternativeUrl = '', $additionalGetVars = '', $switchFocus = TRUE)
{
return BackendUtility::viewOnClick($pageUid, $backPath, $rootLine, $anchorSection, $alternativeUrl, $additionalGetVars, $switchFocus);
}
示例13: getTable_tt_content
//.........这里部分代码省略.........
} elseif (isset($columnConfig['name']) && strlen($columnConfig['name']) > 0) {
$grid .= $this->tt_content_drawColHeader($this->getLanguageService()->sL($columnConfig['name']) . ' (' . $this->getLanguageService()->getLL('notAssigned') . ')', '', '');
} else {
$grid .= $this->tt_content_drawColHeader($this->getLanguageService()->getLL('notAssigned'), '', '');
}
$grid .= '</td>';
}
$grid .= '</tr>';
}
$out .= $grid . '</table></div>';
}
// CSH:
$out .= BackendUtility::cshItem($this->descrTable, 'columns_multi', $GLOBALS['BACK_PATH']);
}
// If language mode, then make another presentation:
// Notice that THIS presentation will override the value of $out!
// But it needs the code above to execute since $languageColumn is filled with content we need!
if ($this->tt_contentConfig['languageMode']) {
// Get language selector:
$languageSelector = $this->languageSelector($id);
// Reset out - we will make new content here:
$out = '';
// Traverse languages found on the page and build up the table displaying them side by side:
$cCont = array();
$sCont = array();
foreach ($langListArr as $lP) {
// Header:
$lP = (int) $lP;
$cCont[$lP] = '
<td valign="top" class="t3-page-lang-column">
<h3>' . htmlspecialchars($this->tt_contentConfig['languageCols'][$lP]) . '</h3>
</td>';
// "View page" icon is added:
$onClick = BackendUtility::viewOnClick($this->id, $this->backPath, BackendUtility::BEgetRootLine($this->id), '', '', '&L=' . $lP);
$viewLink = '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
// Language overlay page header:
if ($lP) {
list($lpRecord) = BackendUtility::getRecordsByField('pages_language_overlay', 'pid', $id, 'AND sys_language_uid=' . $lP);
BackendUtility::workspaceOL('pages_language_overlay', $lpRecord);
$params = '&edit[pages_language_overlay][' . $lpRecord['uid'] . ']=edit&overrideVals[pages_language_overlay][sys_language_uid]=' . $lP;
$lPLabel = $this->getPageLayoutController()->doc->wrapClickMenuOnIcon(IconUtility::getSpriteIconForRecord('pages_language_overlay', $lpRecord), 'pages_language_overlay', $lpRecord['uid']) . $viewLink . ($this->getBackendUser()->check('tables_modify', 'pages_language_overlay') ? '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, $this->backPath)) . '" title="' . $this->getLanguageService()->getLL('edit', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-open') . '</a>' : '') . htmlspecialchars(GeneralUtility::fixed_lgd_cs($lpRecord['title'], 20));
} else {
$lPLabel = $viewLink;
}
$sCont[$lP] = '
<td nowrap="nowrap" class="t3-page-lang-column t3-page-lang-label">' . $lPLabel . '</td>';
}
// Add headers:
$out .= '<tr>' . implode($cCont) . '</tr>';
$out .= '<tr>' . implode($sCont) . '</tr>';
// Traverse previously built content for the columns:
foreach ($languageColumn as $cKey => $cCont) {
$out .= '
<tr>
<td valign="top" class="t3-gridCell t3-page-column t3-page-lang-column">' . implode('</td>' . '
<td valign="top" class="t3-gridCell t3-page-column t3-page-lang-column">', $cCont) . '</td>
</tr>';
if ($this->defLangBinding) {
// "defLangBinding" mode
foreach ($defLanguageCount[$cKey] as $defUid) {
$cCont = array();
foreach ($langListArr as $lP) {
$cCont[] = $defLangBinding[$cKey][$lP][$defUid] . $this->newLanguageButton($this->getNonTranslatedTTcontentUids(array($defUid), $id, $lP), $lP);
}
$out .= '
<tr>
示例14: generatePreviewCode
/**
* @return string
*/
protected function generatePreviewCode()
{
$currentPageId = MathUtility::convertToPositiveInteger($this->popViewId);
$table = $this->previewData['table'];
$recordId = $this->previewData['id'];
$pageTsConfig = BackendUtility::getPagesTSconfig($currentPageId);
$previewConfiguration = isset($pageTsConfig['TCEMAIN.']['preview.'][$table . '.']) ? $pageTsConfig['TCEMAIN.']['preview.'][$table . '.'] : array();
$recordArray = BackendUtility::getRecord($table, $recordId);
// find the right preview page id
$previewPageId = 0;
if (isset($previewConfiguration['previewPageId'])) {
$previewPageId = $previewConfiguration['previewPageId'];
}
// if no preview page was configured
if (!$previewPageId) {
$rootPageData = null;
$rootLine = BackendUtility::BEgetRootLine($currentPageId);
$currentPage = reset($rootLine);
if ((int) $currentPage['doktype'] === PageRepository::DOKTYPE_DEFAULT) {
// try the current page
$previewPageId = $currentPageId;
} else {
// or search for the root page
foreach ($rootLine as $page) {
if ($page['is_siteroot']) {
$rootPageData = $page;
break;
}
}
$previewPageId = isset($rootPageData) ? (int) $rootPageData['uid'] : $currentPageId;
}
}
$linkParameters = ['no_cache' => 1];
// language handling
$languageField = isset($GLOBALS['TCA'][$table]['ctrl']['languageField']) ? $GLOBALS['TCA'][$table]['ctrl']['languageField'] : '';
if ($languageField && !empty($recordArray[$languageField])) {
$l18nPointer = isset($GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']) ? $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] : '';
if ($l18nPointer && !empty($recordArray[$l18nPointer]) && isset($previewConfiguration['useDefaultLanguageRecord']) && !$previewConfiguration['useDefaultLanguageRecord']) {
// use parent record
$recordId = $recordArray[$l18nPointer];
}
$linkParameters['L'] = $recordArray[$languageField];
}
// map record data to GET parameters
if (isset($previewConfiguration['fieldToParameterMap.'])) {
foreach ($previewConfiguration['fieldToParameterMap.'] as $field => $parameterName) {
$value = $recordArray[$field];
if ($field === 'uid') {
$value = $recordId;
}
$linkParameters[$parameterName] = $value;
}
}
// add/override parameters by configuration
if (isset($previewConfiguration['additionalGetParameters.'])) {
$additionalGetParameters = [];
$this->parseAdditionalGetParameters($additionalGetParameters, $previewConfiguration['additionalGetParameters.']);
$linkParameters = array_replace($linkParameters, $additionalGetParameters);
}
$this->popViewId = $previewPageId;
$this->popViewId_addParams = GeneralUtility::implodeArrayForUrl('', $linkParameters, '', false, true);
$previewPageRootline = BackendUtility::BEgetRootLine($this->popViewId);
return '
if (window.opener) {
' . BackendUtility::viewOnClick($this->popViewId, '', $previewPageRootline, '', $this->viewUrl, $this->popViewId_addParams, false) . '
} else {
' . BackendUtility::viewOnClick($this->popViewId, '', $previewPageRootline, '', $this->viewUrl, $this->popViewId_addParams) . '
}';
}
示例15: getButtons
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*/
protected function getButtons()
{
$lang = $this->getLanguageService();
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar();
// Regular new element:
if (!$this->pagesOnly) {
// New page
if ($this->showNewRecLink('pages')) {
$newPageButton = $buttonBar->makeLinkButton()->setHref(GeneralUtility::linkThisScript(array('pagesOnly' => '1')))->setTitle($lang->sL('LLL:EXT:backend/Resources/Private/Language/locallang_layout.xlf:newPage'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-page-new', Icon::SIZE_SMALL));
$buttonBar->addButton($newPageButton, ButtonBar::BUTTON_POSITION_LEFT, 20);
}
// CSH
$cshButton = $buttonBar->makeHelpButton()->setModuleName('xMOD_csh_corebe')->setFieldName('new_regular');
$buttonBar->addButton($cshButton);
} elseif ($this->showNewRecLink('pages')) {
// Pages only wizard
// CSH
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'new_pages');
$cshButton = $buttonBar->makeHelpButton()->setModuleName('xMOD_csh_corebe')->setFieldName('new_pages');
$buttonBar->addButton($cshButton);
}
// Back
if ($this->returnUrl) {
$returnButton = $buttonBar->makeLinkButton()->setHref($this->returnUrl)->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-view-go-back', Icon::SIZE_SMALL));
$buttonBar->addButton($returnButton, ButtonBar::BUTTON_POSITION_LEFT, 10);
}
if (is_array($this->pageinfo) && $this->pageinfo['uid']) {
// View
$pagesTSconfig = BackendUtility::getPagesTSconfig($this->pageinfo['uid']);
if (isset($pagesTSconfig['TCEMAIN.']['preview.']['disableButtonForDokType'])) {
$excludeDokTypes = GeneralUtility::intExplode(',', $pagesTSconfig['TCEMAIN.']['preview.']['disableButtonForDokType'], true);
} else {
// exclude sysfolders and recycler by default
$excludeDokTypes = array(PageRepository::DOKTYPE_RECYCLER, PageRepository::DOKTYPE_SYSFOLDER, PageRepository::DOKTYPE_SPACER);
}
if (!in_array((int) $this->pageinfo['doktype'], $excludeDokTypes, true)) {
$viewButton = $buttonBar->makeLinkButton()->setHref('#')->setOnClick(BackendUtility::viewOnClick($this->pageinfo['uid'], '', BackendUtility::BEgetRootLine($this->pageinfo['uid'])))->setTitle($lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage'))->setIcon($this->moduleTemplate->getIconFactory()->getIcon('actions-document-view', Icon::SIZE_SMALL));
$buttonBar->addButton($viewButton, ButtonBar::BUTTON_POSITION_LEFT, 30);
}
}
}