当前位置: 首页>>代码示例>>PHP>>正文


PHP BackendUtility::getRecord方法代码示例

本文整理汇总了PHP中TYPO3\CMS\Backend\Utility\BackendUtility::getRecord方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendUtility::getRecord方法的具体用法?PHP BackendUtility::getRecord怎么用?PHP BackendUtility::getRecord使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TYPO3\CMS\Backend\Utility\BackendUtility的用法示例。


在下文中一共展示了BackendUtility::getRecord方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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);
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:33,代码来源:ListController.php

示例2: exportGroupFileAndFileReferenceItem

 /**
  * @test
  */
 public function exportGroupFileAndFileReferenceItem()
 {
     $this->export->setRecordTypesIncludeFields(array('pages' => array('title', 'deleted', 'doktype', 'hidden', 'perms_everybody'), 'sys_file' => array('storage', 'type', 'metadata', 'extension', 'identifier', 'identifier_hash', 'folder_hash', 'mime_type', 'name', 'sha1', 'size', 'creation_date', 'modification_date'), 'sys_file_storage' => array('name', 'description', 'driver', 'configuration', 'is_default', 'is_browsable', 'is_public', 'is_writable', 'is_online'), 'tx_impexpgroupfiles_item' => array('title', 'deleted', 'hidden', 'images', 'image_references', 'flexform')));
     $this->export->relOnlyTables = array('sys_file', 'sys_file_storage');
     $this->export->export_addRecord('pages', BackendUtility::getRecord('pages', 2));
     $this->export->export_addRecord('tx_impexpgroupfiles_item', BackendUtility::getRecord('tx_impexpgroupfiles_item', 2));
     $this->setPageTree(2, 0);
     // After adding ALL records we set relations:
     for ($a = 0; $a < 10; $a++) {
         $addR = $this->export->export_addDBRelations($a);
         if (!count($addR)) {
             break;
         }
     }
     // hacky, but the timestamp will change on every clone, so set the file
     // modification timestamp to the asserted value
     $success = @touch(PATH_site . 'uploads/tx_impexpgroupfiles/typo3_image4.jpg', 1393866824);
     if (!$success) {
         $this->markTestSkipped('Could not set file modification timestamp for a fixture binary file. This is required for running the test successful.');
     }
     $this->export->export_addFilesFromRelations();
     $this->export->export_addFilesFromSysFilesRecords();
     $out = $this->export->compileMemoryToFileContent('xml');
     $this->assertXmlStringEqualsXmlFile(__DIR__ . '/../../Fixtures/ImportExportXml/impexp-group-file-and-file_reference-item-in-ff.xml', $out);
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:28,代码来源:ExportTest.php

示例3: setWorkspace

 /**
  * Sets the TYPO3 Backend context to a certain workspace,
  * called by the Backend toolbar menu
  *
  * @param array $parameters
  * @param \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxRequestHandler
  * @return void
  */
 public function setWorkspace($parameters, \TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxRequestHandler)
 {
     $workspaceId = (int) GeneralUtility::_GP('workspaceId');
     $pageId = (int) GeneralUtility::_GP('pageId');
     $finalPageUid = 0;
     $originalPageId = $pageId;
     $this->getBackendUser()->setWorkspace($workspaceId);
     while ($pageId) {
         $page = BackendUtility::getRecordWSOL('pages', $pageId, '*', ' AND pages.t3ver_wsid IN (0, ' . $workspaceId . ')');
         if ($page) {
             if ($this->getBackendUser()->doesUserHaveAccess($page, 1)) {
                 break;
             }
         } else {
             $page = BackendUtility::getRecord('pages', $pageId);
         }
         $pageId = $page['pid'];
     }
     if (isset($page['uid'])) {
         $finalPageUid = (int) $page['uid'];
     }
     $response = array('title' => \TYPO3\CMS\Workspaces\Service\WorkspaceService::getWorkspaceTitle($workspaceId), 'workspaceId' => $workspaceId, 'pageId' => $finalPageUid && $originalPageId == $finalPageUid ? NULL : $finalPageUid);
     $ajaxRequestHandler->setContent($response);
     $ajaxRequestHandler->setContentFormat('json');
 }
开发者ID:plan2net,项目名称:TYPO3.CMS,代码行数:33,代码来源:AjaxController.php

示例4: checkAccess

 /**
  * Checks the page access rights (Code for access check mostly taken from FormEngine)
  * as well as the table access rights of the user.
  *
  * @param string $table The table to check access for
  * @param string $row Record array
  * @return bool Returns TRUE is the user has access, or FALSE if not
  */
 public static function checkAccess($table, $row)
 {
     $backendUser = static::getBackendUser();
     // Checking if the user has permissions? (Only working as a precaution, because the final permission check is always down in TCE. But it's good to notify the user on beforehand...)
     // First, resetting flags.
     $hasAccess = false;
     $calcPRec = $row;
     BackendUtility::fixVersioningPid($table, $calcPRec);
     if (is_array($calcPRec)) {
         if ($table === 'pages') {
             // If pages:
             // @todo: find a decent way for non-admins to get deleted pages respecting the permissions WITHOUT some isInWebMount stuff.
             $calculatedPermissions = $backendUser->calcPerms($calcPRec);
             $hasAccess = (bool) ($calculatedPermissions & Permission::PAGE_EDIT);
         } else {
             $calculatedPermissions = $backendUser->calcPerms(BackendUtility::getRecord('pages', $calcPRec['pid']));
             // Fetching pid-record first.
             $hasAccess = (bool) ($calculatedPermissions & Permission::CONTENT_EDIT);
         }
         // Check internals regarding access:
         if ($hasAccess) {
             $hasAccess = $backendUser->recordEditAccessInternals($table, $calcPRec);
         }
     }
     if (!$backendUser->check('tables_modify', $table)) {
         $hasAccess = false;
     }
     return $hasAccess;
 }
开发者ID:amazingh,项目名称:TYPO3.CMS,代码行数:37,代码来源:RecyclerUtility.php

示例5: getSystemLanguages

 /**
  * Returns array of system languages
  *
  * Since TYPO3 4.5 the flagIcon is not returned as a filename in "gfx/flags/*" anymore,
  * but as a string <flags-xx>. The calling party should call
  * t3lib_iconWorks::getSpriteIcon(<flags-xx>) to get an HTML which will represent
  * the flag of this language.
  *
  * @param integer $page_id Page id (only used to get TSconfig configuration setting flag and label for default language)
  * @param string $backPath Backpath for flags
  * @return array Array with languages (title, uid, flagIcon)
  * @todo Define visibility
  */
 public function getSystemLanguages($page_id = 0, $backPath = '')
 {
     $modSharedTSconfig = \TYPO3\CMS\Backend\Utility\BackendUtility::getModTSconfig($page_id, 'mod.SHARED');
     $languageIconTitles = array();
     // fallback "old iconstyles"
     if (preg_match('/\\.gif$/', $modSharedTSconfig['properties']['defaultLanguageFlag'])) {
         $modSharedTSconfig['properties']['defaultLanguageFlag'] = str_replace('.gif', '', $modSharedTSconfig['properties']['defaultLanguageFlag']);
     }
     $languageIconTitles[0] = array('uid' => 0, 'title' => strlen($modSharedTSconfig['properties']['defaultLanguageLabel']) ? $modSharedTSconfig['properties']['defaultLanguageLabel'] . ' (' . $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_mod_web_list.xml:defaultLanguage') . ')' : $GLOBALS['LANG']->sl('LLL:EXT:lang/locallang_mod_web_list.xml:defaultLanguage'), 'ISOcode' => 'DEF', 'flagIcon' => strlen($modSharedTSconfig['properties']['defaultLanguageFlag']) ? 'flags-' . $modSharedTSconfig['properties']['defaultLanguageFlag'] : 'empty-empty');
     // Set "All" language:
     $languageIconTitles[-1] = array('uid' => -1, 'title' => $GLOBALS['LANG']->getLL('multipleLanguages'), 'ISOcode' => 'DEF', 'flagIcon' => 'flags-multiple');
     // Find all system languages:
     $sys_languages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', 'sys_language', '');
     foreach ($sys_languages as $row) {
         $languageIconTitles[$row['uid']] = $row;
         if ($row['static_lang_isocode'] && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('static_info_tables')) {
             $staticLangRow = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('static_languages', $row['static_lang_isocode'], 'lg_iso_2');
             if ($staticLangRow['lg_iso_2']) {
                 $languageIconTitles[$row['uid']]['ISOcode'] = $staticLangRow['lg_iso_2'];
             }
         }
         if (strlen($row['flag'])) {
             $languageIconTitles[$row['uid']]['flagIcon'] = \TYPO3\CMS\Backend\Utility\IconUtility::mapRecordTypeToSpriteIconName('sys_language', $row);
         }
     }
     return $languageIconTitles;
 }
开发者ID:nicksergio,项目名称:TYPO3v4-Core,代码行数:40,代码来源:TranslationConfigurationProvider.php

示例6: main

 function main(&$backRef, $menuItems, $tableID, $srcId)
 {
     $this->backRef = $backRef;
     $this->beUser = $GLOBALS['BE_USER'];
     $this->LANG = $GLOBALS['LANG'];
     $this->includeLocalLang();
     if (($tableID == 'dragDrop_tt_news_cat' || $tableID == 'tt_news_cat_CM') && $srcId) {
         $table = 'tt_news_cat';
         $rec = BackendUtility::getRecordWSOL($table, $srcId);
         // fetch page record to get editing permissions
         $lCP = $this->beUser->calcPerms(BackendUtility::getRecord('pages', $rec['pid']));
         $doEdit = $lCP & 16;
         //			if ($doEdit && $tableID == 'dragDrop_tt_news_cat') {
         //				$dstId = intval(GeneralUtility::_GP('dstId'));
         //				$menuItems['moveinto'] = $this->dragDrop_moveCategory($srcId,$dstId);
         //				$menuItems['copyinto'] = $this->dragDrop_copyCategory($srcId,$dstId);
         //			}
         if ($tableID == 'tt_news_cat_CM') {
             $menuItems = array();
             if ($doEdit) {
                 $menuItems['edit'] = $this->DB_edit($table, $srcId);
                 $menuItems['new'] = $this->DB_new($table, $rec);
                 $menuItems['newsub'] = $this->DB_new($table, $rec, true);
             }
             $menuItems['info'] = $this->backRef->DB_info($table, $srcId);
             if ($doEdit) {
                 $menuItems['hide'] = $this->DB_hideUnhide($table, $rec, 'hidden');
                 $elInfo = array(GeneralUtility::fixed_lgd_cs(BackendUtility::getRecordTitle('tt_news_cat', $rec), $this->beUser->uc['titleLen']));
                 $menuItems['spacer2'] = 'spacer';
                 $menuItems['delete'] = $this->DB_delete($table, $srcId, $elInfo);
             }
         }
     }
     return $menuItems;
 }
开发者ID:mrmoree,项目名称:vkmh_typo3,代码行数:35,代码来源:class.tx_ttnewscatmanager_cm1.php

示例7: 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;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:34,代码来源:ContentRepository.php

示例8: checkAccess

 /**
  * Checks the page access rights (Code for access check mostly taken from FormEngine)
  * as well as the table access rights of the user.
  *
  * @param string $table The table to check access for
  * @param string $row Record array
  * @return bool Returns TRUE is the user has access, or FALSE if not
  */
 public static function checkAccess($table, $row)
 {
     $backendUser = static::getBackendUser();
     // Checking if the user has permissions? (Only working as a precaution, because the final permission check is always down in TCE. But it's good to notify the user on beforehand...)
     // First, resetting flags.
     $hasAccess = FALSE;
     $calcPRec = $row;
     BackendUtility::fixVersioningPid($table, $calcPRec);
     if (is_array($calcPRec)) {
         if ($table === 'pages') {
             // If pages:
             $calculatedPermissions = $backendUser->calcPerms($calcPRec);
             $hasAccess = $calculatedPermissions & Permission::PAGE_EDIT ? TRUE : FALSE;
         } else {
             $calculatedPermissions = $backendUser->calcPerms(BackendUtility::getRecord('pages', $calcPRec['pid']));
             // Fetching pid-record first.
             $hasAccess = $calculatedPermissions & Permission::CONTENT_EDIT ? TRUE : FALSE;
         }
         // Check internals regarding access:
         if ($hasAccess) {
             $hasAccess = $backendUser->recordEditAccessInternals($table, $calcPRec);
         }
     }
     if (!$backendUser->check('tables_modify', $table)) {
         $hasAccess = FALSE;
     }
     return $hasAccess;
 }
开发者ID:adrolli,项目名称:TYPO3.CMS,代码行数:36,代码来源:RecyclerUtility.php

示例9: getCmdArrayForPublishWS

 /**
  * Building tcemain CMD-array for swapping all versions in a workspace.
  *
  * @param integer $wsid Real workspace ID, cannot be ONLINE (zero).
  * @param boolean $doSwap If set, then the currently online versions are swapped into the workspace in exchange for the offline versions. Otherwise the workspace is emptied.
  * @param int $pageId
  * @return array Command array for tcemain
  * @todo Define visibility
  */
 public function getCmdArrayForPublishWS($wsid, $doSwap, $pageId = 0)
 {
     $wsid = (int) $wsid;
     $cmd = array();
     if ($wsid >= -1 && $wsid !== 0) {
         // Define stage to select:
         $stage = -99;
         if ($wsid > 0) {
             $workspaceRec = BackendUtility::getRecord('sys_workspace', $wsid);
             if ($workspaceRec['publish_access'] & 1) {
                 $stage = 10;
             }
         }
         // Select all versions to swap:
         $versions = $this->selectVersionsInWorkspace($wsid, 0, $stage, $pageId ? $pageId : -1);
         // Traverse the selection to build CMD array:
         foreach ($versions as $table => $records) {
             foreach ($records as $rec) {
                 // Build the cmd Array:
                 $cmd[$table][$rec['t3ver_oid']]['version'] = array('action' => 'swap', 'swapWith' => $rec['uid'], 'swapIntoWS' => $doSwap ? 1 : 0);
             }
         }
     }
     return $cmd;
 }
开发者ID:khanhdeux,项目名称:typo3test,代码行数:34,代码来源:WorkspacesUtility.php

示例10: checkAccess

 /**
  * Checks the page access rights (Code for access check mostly taken from alt_doc.php)
  * as well as the table access rights of the user.
  *
  * @param 	string		$cmd: The command that sould be performed ('new' or 'edit')
  * @param 	string		$table: The table to check access for
  * @param 	string		$theUid: The record uid of the table
  * @return 	boolean		Returns TRUE is the user has access, or FALSE if not
  */
 public static function checkAccess($table, $row)
 {
     // Checking if the user has permissions? (Only working as a precaution, because the final permission check is always down in TCE. But it's good to notify the user on beforehand...)
     // First, resetting flags.
     $hasAccess = 0;
     $calcPRec = $row;
     \TYPO3\CMS\Backend\Utility\BackendUtility::fixVersioningPid($table, $calcPRec);
     if (is_array($calcPRec)) {
         if ($table == 'pages') {
             // If pages:
             $CALC_PERMS = $GLOBALS['BE_USER']->calcPerms($calcPRec);
             $hasAccess = $CALC_PERMS & 2 ? 1 : 0;
         } else {
             $CALC_PERMS = $GLOBALS['BE_USER']->calcPerms(\TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $calcPRec['pid']));
             // Fetching pid-record first.
             $hasAccess = $CALC_PERMS & 16 ? 1 : 0;
         }
         // Check internals regarding access:
         if ($hasAccess) {
             $hasAccess = $GLOBALS['BE_USER']->recordEditAccessInternals($table, $calcPRec);
         }
     }
     if (!$GLOBALS['BE_USER']->check('tables_modify', $table)) {
         $hasAccess = 0;
     }
     return $hasAccess ? TRUE : FALSE;
 }
开发者ID:noxludo,项目名称:TYPO3v4-Core,代码行数:36,代码来源:RecyclerUtility.php

示例11: getRecords

 /**
  * Get the Records
  *
  * @param integer                                        $startPage
  * @param array                                          $basePages
  * @param Tx_GoogleServices_Controller_SitemapController $obj
  *
  * @return Tx_GoogleServices_Domain_Model_Node
  */
 public function getRecords($startPage, $basePages, Tx_GoogleServices_Controller_SitemapController $obj)
 {
     $nodes = array();
     $database = $this->getDatabaseConnection();
     $res = $database->exec_SELECTquery('*', 'tt_content', 'CType="list" AND list_type="googleservices_pisitemap" AND hidden=0 AND deleted=0');
     while ($row = $database->sql_fetch_assoc($res)) {
         $uid = $row['pid'];
         if ($uid == $GLOBALS['TSFE']->id) {
             continue;
         }
         // Build URL
         $url = $obj->getUriBuilder()->setTargetPageUid($uid)->build();
         // can't generate a valid url
         if (!strlen($url)) {
             continue;
         }
         // Get Record
         $record = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $uid);
         // Build Node
         $node = new Tx_GoogleServices_Domain_Model_Node();
         $node->setLoc($url);
         $node->setLastmod($this->getModifiedDate($record));
         $nodes[] = $node;
     }
     return $nodes;
 }
开发者ID:sirdiego,项目名称:google_services,代码行数:35,代码来源:Sitemap.php

示例12: analyseUserGroups

 /**
  * Analyses user groups
  *
  * @param array $reports
  * @return void
  */
 protected function analyseUserGroups(&$reports)
 {
     /** @var \AOE\AoeIpauth\Domain\Service\FeEntityService $service */
     $service = $this->objectManager->get('AOE\\AoeIpauth\\Domain\\Service\\FeEntityService');
     $userGroups = $service->findAllGroupsWithIpAuthentication();
     if (empty($userGroups)) {
         // Message that no user group has IP authentication
         $reports[] = $this->objectManager->get('TYPO3\\CMS\\Reports\\Status', 'IP Usergroup Authentication', 'No user groups with IP authentication found', 'No user groups were found anywhere that are active and have an automatic IP authentication enabled.' . 'Your current IP is: <strong>' . $this->myIp . '</strong>', \TYPO3\CMS\Reports\Status::INFO);
     } else {
         $thisUrl = urlencode(GeneralUtility::getIndpEnv('TYPO3_REQUEST_URL'));
         $userGroupInfo = '<br /><br /><table cellpadding="4" cellspacing="0" border="0">';
         $userGroupInfo .= '<thead><tr><th style="padding-bottom: 10px;">User Group</th><th>IP/Range</th></tr></thead>';
         $userGroupInfo .= '<tbody>';
         // Add user group strings
         foreach ($userGroups as $group) {
             $uid = $group['uid'];
             $ips = implode(', ', $group['tx_aoeipauth_ip']);
             $fullRecord = BackendUtility::getRecord('fe_groups', $uid);
             $title = $fullRecord['title'];
             $button = '<a title="Edit record" onclick="window.location.href=\'alt_doc.php?returnUrl=' . $thisUrl . '&amp;edit[fe_groups][' . $uid . ']=edit\'; return false;" href="#">' . '<span class="t3-icon t3-icon-actions t3-icon-actions-document t3-icon-document-open">&nbsp;</span>' . '</a>';
             $userGroupInfo .= '<tr><td style="padding: 0 20px 0 0;">' . $button . $title . '</td><td>' . $ips . '</td></tr>';
         }
         $userGroupInfo .= '</tbody>';
         $userGroupInfo .= '</table>';
         $userGroupInfo .= '<br /><br />Your current IP is: <strong>' . $this->myIp . '</strong>';
         // Inform about the groups
         $reports[] = $this->objectManager->get('tx_reports_reports_status_Status', 'IP Usergroup Authentication', 'Some groups with automatic IP authentication were found.', $userGroupInfo, \TYPO3\CMS\Reports\Status::OK);
     }
 }
开发者ID:bernhardberger,项目名称:aoe_ipauth,代码行数:35,代码来源:IpGroupAuthenticationStatus.php

示例13: processDatamap_postProcessFieldArray

 static function processDatamap_postProcessFieldArray($status, $table, $id, &$fieldArray, &$reference)
 {
     global $TCA;
     $tca =& $TCA[$table]['ctrl']['EXT']['wec_map'];
     $isMappable = $tca['isMappable'];
     if ($isMappable) {
         if ($tca['addressFields']) {
             /* Get the names of the fields from the TCA */
             $streetField = tx_wecmap_shared::getAddressField($table, 'street');
             $cityField = tx_wecmap_shared::getAddressField($table, 'city');
             $stateField = tx_wecmap_shared::getAddressField($table, 'state');
             $zipField = tx_wecmap_shared::getAddressField($table, 'zip');
             $countryField = tx_wecmap_shared::getAddressField($table, 'country');
             /* Get the row that we're saving */
             $row = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($table, $id);
             /* @todo	Eliminate double save */
             self::drawGeocodeStatus($row[$streetField], $row[$cityField], $row[$stateField], $row[$zipField], $row[$countryField]);
         } else {
             if ($tca['latlongFields']) {
                 /* Get the names of the fields from the TCA */
                 $latField = tx_wecmap_shared::getLatLongField($table, 'lat');
                 $longField = tx_wecmap_shared::getLatLongField($table, 'long');
                 /* Get the row that we're saving */
                 $row = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($table, $id);
                 /* @todo	Eliminate double save */
                 self::drawLatlongStatus($row[$latField], $row[$longField]);
             }
         }
     }
 }
开发者ID:subugoe,项目名称:typo3-wec_map,代码行数:30,代码来源:class.tx_wecmap_backend.php

示例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'];
             }
         }
     }
 }
开发者ID:raimundlandig,项目名称:winkel.de-DEV,代码行数:41,代码来源:Tcemain.php

示例15: main

 /**
  * Main function
  * Will issue a location-header, redirecting either BACK or to a new FormEngine instance...
  *
  * @return void
  */
 public function main()
 {
     // Get this record
     $origRow = BackendUtility::getRecord($this->P['table'], $this->P['uid']);
     // Get TSconfig for it.
     $TSconfig = 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) === '###') {
         $keyword = substr($this->P['params']['pid'], 3, -3);
         if (strpos($keyword, 'PAGE_TSCONFIG_') === 0) {
             $this->pid = (int) $TSconfig[$this->P['field']][$keyword];
         } else {
             $this->pid = (int) $TSconfig['_' . $keyword];
         }
     } else {
         $this->pid = (int) $this->P['params']['pid'];
     }
     // Make redirect:
     // If pid is blank OR if id is set, then return...
     if ((string) $this->id !== '') {
         $redirectUrl = GeneralUtility::sanitizeLocalUrl($this->P['returnUrl']);
     } else {
         // Otherwise, show the list:
         $urlParameters = array();
         $urlParameters['id'] = $this->pid;
         $urlParameters['table'] = $this->P['params']['table'];
         $urlParameters['returnUrl'] = GeneralUtility::getIndpEnv('REQUEST_URI');
         $redirectUrl = BackendUtility::getModuleUrl('web_list', $urlParameters);
     }
     HttpUtility::redirect($redirectUrl);
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:37,代码来源:ListController.php


注:本文中的TYPO3\CMS\Backend\Utility\BackendUtility::getRecord方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。