本文整理汇总了PHP中TYPO3\CMS\Backend\Utility\BackendUtility类的典型用法代码示例。如果您正苦于以下问题:PHP BackendUtility类的具体用法?PHP BackendUtility怎么用?PHP BackendUtility使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BackendUtility类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderStatic
/**
* @param array $arguments
* @param callable $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
*
* @return string
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$id = GeneralUtility::_GP('id');
$pageRecord = BackendUtility::readPageAccess($id, $GLOBALS['BE_USER']->getPagePermsClause(1));
// Add icon with clickmenu, etc:
/** @var IconFactory $iconFactory */
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
if ($pageRecord['uid']) {
// If there IS a real page
$altText = BackendUtility::getRecordIconAltText($pageRecord, 'pages');
$theIcon = '<span title="' . $altText . '">' . $iconFactory->getIconForRecord('pages', $pageRecord, Icon::SIZE_SMALL)->render() . '</span>';
// Make Icon:
$theIcon = BackendUtility::wrapClickMenuOnIcon($theIcon, 'pages', $pageRecord['uid']);
// Setting icon with clickmenu + uid
$theIcon .= ' <em>[PID: ' . $pageRecord['uid'] . ']</em>';
} else {
// On root-level of page tree
// Make Icon
$theIcon = '<span title="' . htmlspecialchars($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename']) . '">' . $iconFactory->getIcon('apps-pagetree-page-domain', Icon::SIZE_SMALL)->render() . '</span>';
if ($GLOBALS['BE_USER']->user['admin']) {
$theIcon = BackendUtility::wrapClickMenuOnIcon($theIcon, 'pages', 0);
}
}
return $theIcon;
}
示例2: parseTSconfig
/**
* Parses the passed TS-Config using conditions and caching
*
* @param string $TStext The TSConfig being parsed
* @param string $type The type of TSConfig (either "userTS" or "PAGES")
* @param integer $id The uid of the page being handled
* @param array $rootLine The rootline of the page being handled
* @return array Array containing the parsed TSConfig and a flag whether the content was retrieved from cache
*/
public function parseTSconfig($TStext, $type, $id = 0, array $rootLine = array())
{
$this->type = $type;
$this->id = $id;
$this->rootLine = $rootLine;
$hash = md5($type . ':' . $TStext);
$cachedContent = BackendUtility::getHash($hash);
if (is_array($cachedContent)) {
$storedData = $cachedContent[0];
$storedMD5 = $cachedContent[1];
$storedData['match'] = array();
$storedData = $this->matching($storedData);
$checkMD5 = md5(serialize($storedData));
if ($checkMD5 == $storedMD5) {
$res = array('TSconfig' => $storedData['TSconfig'], 'cached' => 1);
} else {
$shash = md5($checkMD5 . $hash);
$cachedSpec = BackendUtility::getHash($shash);
if (is_array($cachedSpec)) {
$storedData = $cachedSpec;
$res = array('TSconfig' => $storedData['TSconfig'], 'cached' => 1);
} else {
$storeData = $this->parseWithConditions($TStext);
BackendUtility::storeHash($shash, $storeData, $type . '_TSconfig');
$res = array('TSconfig' => $storeData['TSconfig'], 'cached' => 0);
}
}
} else {
$storeData = $this->parseWithConditions($TStext);
$md5 = md5(serialize($storeData));
BackendUtility::storeHash($hash, array($storeData, $md5), $type . '_TSconfig');
$res = array('TSconfig' => $storeData['TSconfig'], 'cached' => 0);
}
return $res;
}
示例3: wrapIcon
/**
* Wrapping icon in browse tree
*
* @param string $thePageIcon Icon IMG code
* @param array $row Data row for element.
* @return string Page icon
*/
public function wrapIcon($thePageIcon, &$row)
{
// If the record is locked, present a warning sign.
if ($lockInfo = \TYPO3\CMS\Backend\Utility\BackendUtility::isRecordLocked('pages', $row['uid'])) {
$aOnClick = 'alert(' . GeneralUtility::quoteJSvalue($lockInfo['msg']) . ');return false;';
$lockIcon = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . IconUtility::getSpriteIcon('status-warning-in-use', array('title' => $lockInfo['msg'])) . '</a>';
} else {
$lockIcon = '';
}
// Wrap icon in click-menu link.
if (!$this->ext_IconMode) {
$thePageIcon = $GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon($thePageIcon, 'pages', $row['uid'], 0, '&bank=' . $this->bank);
} elseif ($this->ext_IconMode === 'titlelink') {
$aOnClick = 'return jumpTo(' . GeneralUtility::quoteJSvalue($this->getJumpToParam($row)) . ',this,' . GeneralUtility::quoteJSvalue($this->treeName) . ');';
$thePageIcon = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $thePageIcon . '</a>';
}
// Wrap icon in a drag/drop span.
$dragDropIcon = '<span class="dragIcon" id="dragIconID_' . $row['uid'] . '">' . $thePageIcon . '</span>';
// Add Page ID:
$pageIdStr = '';
if ($this->ext_showPageId) {
$pageIdStr = '<span class="dragId">[' . $row['uid'] . ']</span> ';
}
// Call stats information hook
$stat = '';
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'])) {
$_params = array('pages', $row['uid']);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'] as $_funcRef) {
$stat .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
}
}
return $dragDropIcon . $lockIcon . $pageIdStr . $stat;
}
示例4: main
/**
* MAIN function for page information display
*
* @return string Output HTML for the module.
*/
public function main()
{
$theOutput = $this->pObj->doc->header($this->getLanguageService()->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_webinfo.xlf:page_title'));
$dblist = GeneralUtility::makeInstance(PageLayoutView::class);
$dblist->descrTable = '_MOD_web_info';
$dblist->thumbs = 0;
$dblist->script = BackendUtility::getModuleUrl('web_info');
$dblist->showIcon = 0;
$dblist->setLMargin = 0;
$dblist->agePrefixes = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.minutesHoursDaysYears');
$dblist->pI_showUser = 1;
// PAGES:
$this->pObj->MOD_SETTINGS['pages_levels'] = $this->pObj->MOD_SETTINGS['depth'];
// ONLY for the sake of dblist module which uses this value.
$h_func = BackendUtility::getDropdownMenu($this->pObj->id, 'SET[depth]', $this->pObj->MOD_SETTINGS['depth'], $this->pObj->MOD_MENU['depth']);
$h_func .= BackendUtility::getDropdownMenu($this->pObj->id, 'SET[pages]', $this->pObj->MOD_SETTINGS['pages'], $this->pObj->MOD_MENU['pages']);
$dblist->start($this->pObj->id, 'pages', 0);
$dblist->generateList();
// CSH
$theOutput .= $this->pObj->doc->section('', BackendUtility::cshItem($dblist->descrTable, 'pagetree_overview', null, '|<br />') . '<div class="form-inline form-inline-spaced">' . $h_func . '</div>' . $dblist->HTMLcode, 0, 1);
// Additional footer content
$footerContentHook = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/web_info/class.tx_cms_webinfo.php']['drawFooterHook'];
if (is_array($footerContentHook)) {
foreach ($footerContentHook as $hook) {
$params = array();
$theOutput .= GeneralUtility::callUserFunction($hook, $params, $this);
}
}
return $theOutput;
}
示例5: getEventList
/**
* Get event list
*
* @param $events
*
* @return string
*/
protected function getEventList($events)
{
$items = [];
foreach ($events as $event) {
$startDateStamp = $event['start_date'] instanceof \DateTime ? $event['start_date']->getTimestamp() : $event['start_date'];
$startDate = strftime('%a %d.%m.%G', $startDateStamp);
$endDateStamp = $event['end_date'] instanceof \DateTime ? $event['end_date']->getTimestamp() : $event['end_date'];
$endDate = strftime('%a %d.%m.%G', $endDateStamp);
$entry = $startDate . ' - ' . $endDate;
if (!$event['all_day']) {
$start = BackendUtility::time($event['start_time'], false);
if ((int) $event['end_time'] === AbstractTimeTable::DAY_END) {
$end = '"' . TranslateUtility::get('openEndTime') . '"';
} else {
$end = BackendUtility::time($event['end_time'], false);
}
$entry .= ' (' . $start . ' - ' . $end . ')';
}
$items[] = $entry;
}
if (!sizeof($items)) {
$items[] = TranslateUtility::get('noEvents');
}
return '<ul><li>' . implode('</li><li>', $items) . '</li></ul>';
}
示例6: main
/**
* Main function, adding the item to input menuItems array
*
* @param ClickMenu $backRef References to parent clickmenu objects.
* @param array $menuItems Array of existing menu items accumulated. New element added to this.
* @param string $table Table name of the element
* @param int $uid Record UID of the element
* @return array Modified menuItems array
*/
public function main(&$backRef, $menuItems, $table, $uid)
{
$localItems = array();
if (!$backRef->cmLevel && $uid > 0 && $GLOBALS['BE_USER']->check('modules', 'web_txversionM1')) {
// Returns directly, because the clicked item was not from the pages table
if (in_array('versioning', $backRef->disabledItems) || !$GLOBALS['TCA'][$table] || !$GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
return $menuItems;
}
// Adds the regular item
$LL = $this->includeLL();
// "Versioning" element added:
$url = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_txversionM1', array('table' => $table, 'uid' => $uid));
$localItems[] = $backRef->linkItem($GLOBALS['LANG']->getLLL('title', $LL), $backRef->excludeIcon($this->iconFactory->getIcon('actions-version-open', Icon::SIZE_SMALL)->render()), $backRef->urlRefForCM($url), true);
// Find position of "delete" element:
$c = 0;
foreach ($menuItems as $k => $value) {
$c++;
if ($k === 'delete') {
break;
}
}
// .. subtract two (delete item + divider line)
$c -= 2;
// ... and insert the items just before the delete element.
array_splice($menuItems, $c, 0, $localItems);
}
return $menuItems;
}
示例7: main
/**
* Main function
* Will issue a location-header, redirecting either BACK or to a new alt_doc.php instance...
*
* @return void
* @todo Define visibility
*/
public function main()
{
// Get this record
$origRow = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($this->P['table'], $this->P['uid']);
// Get TSconfig for it.
$TSconfig = \TYPO3\CMS\Backend\Utility\BackendUtility::getTCEFORM_TSconfig($this->table, is_array($origRow) ? $origRow : array('pid' => $this->P['pid']));
// Set [params][pid]
if (substr($this->P['params']['pid'], 0, 3) == '###' && substr($this->P['params']['pid'], -3) == '###') {
$this->pid = intval($TSconfig['_' . substr($this->P['params']['pid'], 3, -3)]);
} else {
$this->pid = intval($this->P['params']['pid']);
}
// Make redirect:
// If pid is blank OR if id is set, then return...
if (!strcmp($this->pid, '') || strcmp($this->id, '')) {
$redirectUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::sanitizeLocalUrl($this->P['returnUrl']);
} else {
// Otherwise, show the list:
$urlParameters = array();
$urlParameters['id'] = $this->pid;
$urlParameters['table'] = $this->P['params']['table'];
$urlParameters['returnUrl'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI');
$redirectUrl = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_list', $urlParameters);
}
\TYPO3\CMS\Core\Utility\HttpUtility::redirect($redirectUrl);
}
示例8: getRecord
/**
* Get the referenced record from the database
*
* Using the GET or POST variable 'P'
*
* @return boolean|\TYPO3\CMS\Form\Domain\Model\Content if found, FALSE if not
*/
public function getRecord()
{
$record = FALSE;
$getPostVariables = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('P');
$table = (string) $getPostVariables['table'];
$recordId = (int) $getPostVariables['uid'];
$row = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($table, $recordId);
if (is_array($row)) {
// strip off the leading "[Translate to XY]" text after localizing the original record
$languageField = $GLOBALS['TCA']['tt_content']['ctrl']['languageField'];
$transOrigPointerField = $GLOBALS['TCA']['tt_content']['ctrl']['transOrigPointerField'];
if ($row[$languageField] > 0 && $row[$transOrigPointerField] > 0) {
$bodytext = preg_replace('/^\\[.*?\\] /', '', $row['bodytext'], 1);
} else {
$bodytext = $row['bodytext'];
}
/** @var $typoScriptParser \TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser */
$typoScriptParser = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\Parser\\TypoScriptParser');
$typoScriptParser->parse($bodytext);
/** @var $record \TYPO3\CMS\Form\Domain\Model\Content */
$record = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Form\\Domain\\Model\\Content');
$record->setUid($row['uid']);
$record->setPageId($row['pid']);
$record->setTyposcript($typoScriptParser->setup);
}
return $record;
}
示例9: callModule
/**
* This method forwards the call to Bootstrap's run() method. This method is invoked by the mod.php
* function of TYPO3.
*
* @param string $moduleSignature
* @throws \RuntimeException
* @return boolean TRUE, if the request request could be dispatched
* @see run()
*/
public function callModule($moduleSignature)
{
if (!isset($GLOBALS['TBE_MODULES']['_configuration'][$moduleSignature])) {
return FALSE;
}
$moduleConfiguration = $GLOBALS['TBE_MODULES']['_configuration'][$moduleSignature];
// Check permissions and exit if the user has no permission for entry
$GLOBALS['BE_USER']->modAccess($moduleConfiguration, TRUE);
$id = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('id');
if ($id && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($id)) {
// Check page access
$permClause = $GLOBALS['BE_USER']->getPagePermsClause(TRUE);
$access = is_array(\TYPO3\CMS\Backend\Utility\BackendUtility::readPageAccess((int) $id, $permClause));
if (!$access) {
throw new \RuntimeException('You don\'t have access to this page', 1289917924);
}
}
// BACK_PATH is the path from the typo3/ directory from within the
// directory containing the controller file. We are using mod.php dispatcher
// and thus we are already within typo3/ because we call typo3/mod.php
$GLOBALS['BACK_PATH'] = '';
$configuration = array('extensionName' => $moduleConfiguration['extensionName'], 'pluginName' => $moduleSignature);
if (isset($moduleConfiguration['vendorName'])) {
$configuration['vendorName'] = $moduleConfiguration['vendorName'];
}
$bootstrap = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Core\\BootstrapInterface');
$content = $bootstrap->run('', $configuration);
print $content;
return TRUE;
}
示例10: getUri
/**
* @param File $file
* @return string
*/
protected function getUri(File $file)
{
$metadataProperties = $file->_getMetaData();
$parameterName = sprintf('edit[sys_file_metadata][%s]', $metadataProperties['uid']);
$uri = BackendUtility::getModuleUrl('record_edit', array($parameterName => 'edit', 'returnUrl' => BackendUtility::getModuleUrl(GeneralUtility::_GP('M'), $this->getAdditionalParameters())));
return $uri;
}
示例11: getLoginScripts
/**
* Provides form code and javascript for the user setup.
*
* @param array $parameters Parameters to the script
* @param \TYPO3\CMS\Setup\Controller\SetupModuleController $userSetupObject Calling object: user setup module
* @return string The code for the user setup
*/
public function getLoginScripts(array $parameters, \TYPO3\CMS\Setup\Controller\SetupModuleController $userSetupObject)
{
$content = '';
if ($this->isRsaAvailable()) {
// If we can get the backend, we can proceed
$backend = \TYPO3\CMS\Rsaauth\Backend\BackendFactory::getBackend();
$javascriptPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('rsaauth') . 'resources/';
$files = array('jsbn/jsbn.js', 'jsbn/prng4.js', 'jsbn/rng.js', 'jsbn/rsa.js', 'jsbn/base64.js', 'rsaauth_min.js');
$content = '';
foreach ($files as $file) {
$content .= '<script type="text/javascript" src="' . \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . $javascriptPath . $file . '"></script>';
}
// Generate a new key pair
$keyPair = $backend->createNewKeyPair();
// Save private key
$storage = \TYPO3\CMS\Rsaauth\Storage\StorageFactory::getStorage();
/** @var $storage \TYPO3\CMS\Rsaauth\Storage\AbstractStorage */
$storage->put($keyPair->getPrivateKey());
// Add form tag
$form = '<form action="' . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('user_setup') . '" method="post" name="usersetup" enctype="application/x-www-form-urlencoded" onsubmit="tx_rsaauth_encryptUserSetup();">';
// Add RSA hidden fields
$form .= '<input type="hidden" id="rsa_n" name="n" value="' . htmlspecialchars($keyPair->getPublicKeyModulus()) . '" />';
$form .= '<input type="hidden" id="rsa_e" name="e" value="' . sprintf('%x', $keyPair->getExponent()) . '" />';
$userSetupObject->doc->form = $form;
}
return $content;
}
示例12: buildJavascriptConfiguration
/**
* Return JS configuration of the htmlArea plugins registered by the extension
*
* @param string $rteNumberPlaceholder A dummy string for JS arrays
* @return string JS configuration for registered plugins, in this case, JS configuration of block elements
*/
public function buildJavascriptConfiguration($rteNumberPlaceholder)
{
$registerRTEinJavascriptString = '';
$button = 'link';
if (in_array($button, $this->toolbar)) {
if (!is_array($this->thisConfig['buttons.']) || !is_array($this->thisConfig['buttons.'][$button . '.'])) {
$registerRTEinJavascriptString .= '
RTEarea[' . $rteNumberPlaceholder . '].buttons.' . $button . ' = new Object();';
}
$registerRTEinJavascriptString .= '
RTEarea[' . $rteNumberPlaceholder . '].buttons.' . $button . '.pathLinkModule = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('rtehtmlarea_wizard_browse_links')) . ';';
if ($this->htmlAreaRTE->is_FE()) {
$RTEProperties = $this->htmlAreaRTE->RTEsetup;
} else {
$RTEProperties = $this->htmlAreaRTE->RTEsetup['properties'];
}
if (is_array($RTEProperties['classesAnchor.'])) {
$registerRTEinJavascriptString .= '
RTEarea[' . $rteNumberPlaceholder . '].buttons.' . $button . '.classesAnchorUrl = "' . $this->htmlAreaRTE->writeTemporaryFile('classesAnchor_' . $this->htmlAreaRTE->contentLanguageUid, 'js', $this->buildJSClassesAnchorArray()) . '";';
}
$registerRTEinJavascriptString .= '
RTEarea[' . $rteNumberPlaceholder . '].buttons.' . $button . '.additionalAttributes = "data-htmlarea-external' . ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extensionKey]['plugins'][$this->pluginName]['additionalAttributes'] ? ',' . $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extensionKey]['plugins'][$this->pluginName]['additionalAttributes'] : '') . '";';
}
return $registerRTEinJavascriptString;
}
示例13: main
/**
* Main function, adding the item to input menuItems array
*
* @param ClickMenu $backRef References to parent clickmenu objects.
* @param array $menuItems Array of existing menu items accumulated. New element added to this.
* @param string $table Table name of the element
* @param int $uid Record UID of the element
* @return array Modified menuItems array
*/
public function main(&$backRef, $menuItems, $table, $uid)
{
$localItems = array();
if (!$backRef->cmLevel && $uid > 0 && $GLOBALS['BE_USER']->check('modules', 'web_txversionM1')) {
// Returns directly, because the clicked item was not from the pages table
if (in_array('versioning', $backRef->disabledItems) || !$GLOBALS['TCA'][$table] || !$GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
return $menuItems;
}
// Adds the regular item
$LL = $this->includeLL();
// "Versioning" element added:
$url = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_txversionM1', array('table' => $table, 'uid' => $uid));
$localItems[] = $backRef->linkItem($GLOBALS['LANG']->getLLL('title', $LL), $backRef->excludeIcon('<img src="' . $backRef->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('version') . 'Resources/Public/Icons/module-version.png" width="15" height="12" border="0" align="top" alt="" />'), $backRef->urlRefForCM($url), TRUE);
// Find position of "delete" element:
$c = 0;
foreach ($menuItems as $k => $value) {
$c++;
if ($k === 'delete') {
break;
}
}
// .. subtract two (delete item + divider line)
$c -= 2;
// ... and insert the items just before the delete element.
array_splice($menuItems, $c, 0, $localItems);
}
return $menuItems;
}
示例14: processDatamap_afterDatabaseOperations
/**
* Generate a different preview link *
* @param string $status status
* @param string $table table name
* @param integer $recordUid id of the record
* @param array $fields fieldArray
* @param \TYPO3\CMS\Core\DataHandling\DataHandler $parentObject parent Object
* @return void
*/
public function processDatamap_afterDatabaseOperations($status, $table, $recordUid, array $fields, \TYPO3\CMS\Core\DataHandling\DataHandler $parentObject)
{
// Clear category cache
if ($table === 'sys_category') {
/** @var \TYPO3\CMS\Core\Cache\Frontend\FrontendInterface $cache */
$cache = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Cache\\CacheManager')->getCache('cache_news_category');
$cache->flush();
}
// Preview link
if ($table === 'tx_news_domain_model_news') {
// direct preview
if (!is_numeric($recordUid)) {
$recordUid = $parentObject->substNEWwithIDs[$recordUid];
}
if (isset($GLOBALS['_POST']['_savedokview_x']) && !$fields['type']) {
// If "savedokview" has been pressed and current article has "type" 0 (= normal news article)
$pagesTsConfig = \TYPO3\CMS\Backend\Utility\BackendUtility::getPagesTSconfig($GLOBALS['_POST']['popViewId']);
if ($pagesTsConfig['tx_news.']['singlePid']) {
$record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('tx_news_domain_model_news', $recordUid);
$parameters = array('no_cache' => 1, 'tx_news_pi1[controller]' => 'News', 'tx_news_pi1[action]' => 'detail', 'tx_news_pi1[news_preview]' => $record['uid']);
if ($record['sys_language_uid'] > 0) {
if ($record['l10n_parent'] > 0) {
$parameters['tx_news_pi1[news_preview]'] = $record['l10n_parent'];
}
$parameters['L'] = $record['sys_language_uid'];
}
$GLOBALS['_POST']['popViewId_addParams'] = \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', $parameters, '', FALSE, TRUE);
$GLOBALS['_POST']['popViewId'] = $pagesTsConfig['tx_news.']['singlePid'];
}
}
}
}
示例15: render
/**
* This will render a selector box element, or possibly a special construction with two selector boxes.
*
* @return array As defined in initializeResultArray() of AbstractNode
*/
public function render()
{
$table = $this->globalOptions['table'];
$field = $this->globalOptions['fieldName'];
$row = $this->globalOptions['databaseRow'];
$parameterArray = $this->globalOptions['parameterArray'];
// Field configuration from TCA:
$config = $parameterArray['fieldConf']['config'];
$disabled = '';
if ($this->isGlobalReadonly() || $config['readOnly']) {
$disabled = ' disabled="disabled"';
}
$this->resultArray = $this->initializeResultArray();
// "Extra" configuration; Returns configuration for the field based on settings found in the "types" fieldlist.
$specConf = BackendUtility::getSpecConfParts($parameterArray['fieldConf']['defaultExtras']);
$selItems = FormEngineUtility::getSelectItems($table, $field, $row, $parameterArray);
// Creating the label for the "No Matching Value" entry.
$noMatchingLabel = isset($parameterArray['fieldTSConfig']['noMatchingValue_label']) ? $this->getLanguageService()->sL($parameterArray['fieldTSConfig']['noMatchingValue_label']) : '[ ' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.noMatchingValue') . ' ]';
$html = $this->getSingleField_typeSelect_singlebox($table, $field, $row, $parameterArray, $config, $selItems, $noMatchingLabel);
// Wizards:
if (!$disabled) {
$html = $this->renderWizards(array($html), $config['wizards'], $table, $row, $field, $parameterArray, $parameterArray['itemFormElName'], $specConf);
}
$this->resultArray['html'] = $html;
return $this->resultArray;
}