當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BackendUtility::selectVersionsOfRecord方法代碼示例

本文整理匯總了PHP中TYPO3\CMS\Backend\Utility\BackendUtility::selectVersionsOfRecord方法的典型用法代碼示例。如果您正苦於以下問題:PHP BackendUtility::selectVersionsOfRecord方法的具體用法?PHP BackendUtility::selectVersionsOfRecord怎麽用?PHP BackendUtility::selectVersionsOfRecord使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TYPO3\CMS\Backend\Utility\BackendUtility的用法示例。


在下文中一共展示了BackendUtility::selectVersionsOfRecord方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getVersionSelector

    /**
     * Creates the version selector for the page id inputted.
     * Moved out of the core file \TYPO3\CMS\Backend\Template\DocumentTemplate
     *
     * @param int $id Page id to create selector for.
     * @param bool $noAction If set, there will be no button for swapping page.
     * @return void
     * @see \TYPO3\CMS\Backend\Template\DocumentTemplate
     */
    public function getVersionSelector($id, $noAction = FALSE)
    {
        if ($id <= 0) {
            return;
        }
        if ($GLOBALS['BE_USER']->workspace == 0) {
            // Get Current page record:
            $curPage = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $id);
            // If the selected page is not online, find the right ID
            $onlineId = $curPage['pid'] == -1 ? $curPage['t3ver_oid'] : $id;
            // Select all versions of online version:
            $versions = \TYPO3\CMS\Backend\Utility\BackendUtility::selectVersionsOfRecord('pages', $onlineId, 'uid,pid,t3ver_label,t3ver_oid,t3ver_wsid,t3ver_id');
            // If more than one was found...:
            if (count($versions) > 1) {
                $selectorLabel = '<strong>' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xlf:versionSelect.label', TRUE) . '</strong>';
                // Create selector box entries:
                $opt = array();
                foreach ($versions as $vRow) {
                    if ($vRow['uid'] == $onlineId) {
                        // Live version
                        $label = '[' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xlf:versionSelect.live', TRUE) . ']';
                    } else {
                        $label = $vRow['t3ver_label'] . ' (' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xlf:versionId', TRUE) . ' ' . $vRow['t3ver_id'] . ($vRow['t3ver_wsid'] != 0 ? ' ' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xlf:workspaceId', TRUE) . ' ' . $vRow['t3ver_wsid'] : '') . ')';
                    }
                    $opt[] = '<option value="' . htmlspecialchars(GeneralUtility::linkThisScript(array('id' => $vRow['uid']))) . '"' . ($id == $vRow['uid'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>';
                }
                // Add management link:
                $management = '<input type="button" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:ver.mgm', TRUE) . '" onclick="window.location.href=\'' . htmlspecialchars($GLOBALS['BACK_PATH'] . \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_txversionM1', array('table' => 'pages', 'uid' => $onlineId))) . '\';" />';
                // Create onchange handler:
                $onChange = 'window.location.href=this.options[this.selectedIndex].value;';
                // Controls:
                if ($id == $onlineId) {
                    $controls = '<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], 'gfx/blinkarrow_left.gif', 'width="5" height="9"') . ' class="absmiddle" alt="" /> <strong>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:ver.online', TRUE) . '</strong>';
                } elseif (!$noAction) {
                    $href = $GLOBALS['TBE_TEMPLATE']->issueCommand('&cmd[pages][' . $onlineId . '][version][swapWith]=' . $id . '&cmd[pages][' . $onlineId . '][version][action]=swap', GeneralUtility::linkThisScript(array('id' => $onlineId)));
                    $controls = '<a href="' . htmlspecialchars($href) . '" class="text-nowrap">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-version-swap-version', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:ver.swapPage', TRUE), 'style' => 'margin-left:5px;vertical-align:bottom;')) . '<strong>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:ver.swap', TRUE) . '</strong></a>';
                }
                // Write out HTML code:
                return '
					<!--
						Version selector:
					-->
					<table border="0" cellpadding="0" cellspacing="0" id="typo3-versionSelector">
						<tr>
							<td>' . $selectorLabel . '</td>
							<td>
								<select onchange="' . htmlspecialchars($onChange) . '">
									' . implode('', $opt) . '
								</select></td>
							<td>' . $controls . '</td>
							<td>' . $management . '</td>
						</tr>
					</table>
				';
            }
        }
    }
開發者ID:adrolli,項目名稱:TYPO3.CMS,代碼行數:66,代碼來源:VersionView.php

示例2: makeControl

    /**
     * Creates the control panel for a single record in the listing.
     *
     * @param string $table The table
     * @param array $row The record for which to make the control panel.
     *
     * @return string HTML table with the control panel (unless disabled)
     * @throws UnexpectedValueException If hook was of wrong interface
     */
    public function makeControl($table, array $row)
    {
        $backendUser = $this->getBackendUser();
        $language = $this->getLanguageService();
        if ($this->dontShowClipControlPanels) {
            return '';
        }
        $rowUid = $row['uid'];
        if (ExtensionManagementUtility::isLoaded('version') && isset($row['_ORIG_uid'])) {
            $rowUid = $row['_ORIG_uid'];
        }
        $cells = array();
        // If the listed table is 'pages' we have to request
        // the permission settings for each page:
        $localCalcPerms = 0;
        if ($table == 'tx_commerce_categories' || $table == 'tx_commerce_products') {
            /**
             * Utility
             *
             * @var \CommerceTeam\Commerce\Utility\BackendUserUtility $utility
             */
            $utility = GeneralUtility::makeInstance('CommerceTeam\\Commerce\\Utility\\BackendUserUtility');
            $localCalcPerms = $utility->calcPerms((array) BackendUtility::getRecord('tx_commerce_categories', $this->parentUid));
        }
        // This expresses the edit permissions for this particular element:
        $permsEdit = $table == 'tx_commerce_categories' && $localCalcPerms & 2 || $table != 'tx_commerce_categories' && $this->calcPerms & 16;
        // "Show" link (only tx_commerce_categories and tx_commerce_products elements)
        if ($table == 'tx_commerce_categories' || $table == 'tx_commerce_products') {
            $cells['view'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($table === 'tx_commerce_products' ? $this->id : $row['uid'], $this->backPath, '', $table === 'tx_commerce_products' ? '#' . $row['uid'] : '')) . '" title="' . $language->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
        } elseif (!$this->table) {
            $cells['view'] = $this->spaceIcon;
        }
        // "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';
            $cells['edit'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, $this->backPath, -1)) . '" title="' . $language->getLL('edit', TRUE) . '">' . ($GLOBALS['TCA'][$table]['ctrl']['readOnly'] ? IconUtility::getSpriteIcon('actions-document-open-read-only') : IconUtility::getSpriteIcon('actions-document-open')) . '</a>';
        } elseif (!$this->table) {
            $cells['edit'] = $this->spaceIcon;
        }
        // "Move" wizard link for tx_commerce_categories/tx_commerce_products elements:
        if ($table == 'tx_commerce_products' && $permsEdit || $table == 'tx_commerce_categories') {
            $options = array('title' => $language->getLL('move_' . ($table == 'tx_commerce_products' ? 'record' : 'page'), TRUE));
            $cells['move'] = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'' . $this->backPath . 'move_el.php?table=' . $table . '&uid=' . $row['uid'] . '\');') . '">' . ($table == 'tx_commerce_products' ? IconUtility::getSpriteIcon('actions-document-move', $options) : IconUtility::getSpriteIcon('actions-page-move', $options)) . '</a>';
        } elseif (!$this->table) {
            $cells['move'] = $this->spaceIcon;
        }
        // If the extended control panel is enabled OR if we are seeing a single table:
        if ($GLOBALS['SOBE']->MOD_SETTINGS['bigControlPanel'] || $this->table) {
            // "Info": (All records)
            $cells['viewBig'] = '<a href="#" onclick="' . htmlspecialchars('top.launchView(\'' . $table . '\', \'' . $row['uid'] . '\'); return false;') . '" title="' . $language->getLL('showInfo', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-info') . '</a>';
            // If the table is NOT a read-only table, then show these links:
            if (!$GLOBALS['TCA'][$table]['ctrl']['readOnly']) {
                // "Revert" link (history/undo)
                $cells['history'] = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'' . $this->backPath . 'show_rechis.php?element=' . rawurlencode($table . ':' . $row['uid']) . '\',\'#latest\');') . '" title="' . $language->getLL('history', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-history-open') . '</a>';
                // Versioning:
                if (ExtensionManagementUtility::isLoaded('version') && !ExtensionManagementUtility::isLoaded('workspaces')) {
                    $vers = BackendUtility::selectVersionsOfRecord($table, $row['uid'], 'uid', $this->getBackendUser()->workspace, FALSE, $row);
                    // If table can be versionized.
                    if (is_array($vers)) {
                        $versionIcon = 'no-version';
                        if (count($vers) > 1) {
                            $versionIcon = count($vers) - 1;
                        }
                        $cells['version'] = '<a href="' . htmlspecialchars($this->backPath . ExtensionManagementUtility::extRelPath('version') . 'cm1/index.php?table=' . rawurlencode($table) . '&uid=' . rawurlencode($row['uid'])) . '" title="' . $language->getLL('displayVersions', TRUE) . '">' . IconUtility::getSpriteIcon('status-version-' . $versionIcon) . '</a>';
                    } elseif (!$this->table) {
                        $cells['version'] = $this->spaceIcon;
                    }
                }
                // "Edit Perms" link:
                if ($table == 'tx_commerce_categories' && $backendUser->check('modules', 'txcommerceM1_permission')) {
                    $cells['perms'] = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('txcommerceM1_permission') . '&control[tx_commerce_categories][uid]=' . $row['uid'] . '&return_id=' . $row['uid'] . '&edit=1') . '">' . IconUtility::getSpriteIcon('status-status-locked', array('titel' => $language->getLL('permissions', TRUE))) . '</a>';
                } elseif (!$this->table && $backendUser->check('modules', 'web_perm')) {
                    $cells['perms'] = $this->spaceIcon;
                }
                // "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']) {
                    if ($table != 'tx_commerce_categories' && $this->calcPerms & 16 || $table == 'tx_commerce_categories' && $this->calcPerms & 8) {
                        if ($this->showNewRecLink($table) && $this->parentUid) {
                            $params = '&edit[' . $table . '][' . -($row['_MOVE_PLH'] ? $row['_MOVE_PLH_uid'] : $row['uid']) . ']=new';
                            $options = array('title' => $language->getLL('new' . ($table == 'tx_commerce_categories' ? 'Category' : 'Record'), TRUE));
                            $cells['new'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, $this->backPath, -1)) . '"' . ($table == 'tx_commerce_categories' ? IconUtility::getSpriteIcon('actions-page-new', $options) : IconUtility::getSpriteIcon('actions-document-new', $options)) . '</a>';
                        }
                    }
                } elseif (!$this->table) {
                    $cells['new'] = $this->spaceIcon;
                }
                // "Up/Down" links
                if ($permsEdit && $GLOBALS['TCA'][$table]['ctrl']['sortby'] && !$this->sortField && !$this->searchLevels) {
                    // Up
//.........這裏部分代碼省略.........
開發者ID:AndreasA,項目名稱:commerce,代碼行數:101,代碼來源:CategoryRecordList.php

示例3: lookForOwnVersions

 /**
  * Look for number of versions of a record
  *
  * @param string $table Table name
  * @param int $uid Record uid
  * @return int Number of versions for record, FALSE if none.
  */
 public function lookForOwnVersions($table, $uid)
 {
     $versions = BackendUtility::selectVersionsOfRecord($table, $uid, 'uid', null);
     if (is_array($versions)) {
         return count($versions);
     }
     return false;
 }
開發者ID:vip3out,項目名稱:TYPO3.CMS,代碼行數:15,代碼來源:VersionModuleController.php

示例4: 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 {
//.........這裏部分代碼省略.........
開發者ID:CDRO,項目名稱:TYPO3.CMS,代碼行數:101,代碼來源:DatabaseRecordList.php

示例5: deleteVersionsForRecord

 /**
  * Delete versions for element from any table
  *
  * @param string $table Table name
  * @param int $uid Record UID
  * @param bool $forceHardDelete If TRUE, the "deleted" flag is ignored if applicable for record and the record is deleted COMPLETELY!
  * @return void
  */
 public function deleteVersionsForRecord($table, $uid, $forceHardDelete)
 {
     $versions = BackendUtility::selectVersionsOfRecord($table, $uid, 'uid,pid,t3ver_wsid,t3ver_state', $this->BE_USER->workspace ?: null);
     if (is_array($versions)) {
         foreach ($versions as $verRec) {
             if (!$verRec['_CURRENT_VERSION']) {
                 if ($table == 'pages') {
                     $this->deletePages($verRec['uid'], true, $forceHardDelete);
                 } else {
                     $this->deleteRecord($table, $verRec['uid'], true, $forceHardDelete);
                 }
                 // Delete move-placeholder
                 $versionState = VersionState::cast($verRec['t3ver_state']);
                 if ($versionState->equals(VersionState::MOVE_POINTER)) {
                     $versionMovePlaceholder = BackendUtility::getMovePlaceholder($table, $uid, 'uid', $verRec['t3ver_wsid']);
                     $this->deleteEl($table, $versionMovePlaceholder['uid'], true, $forceHardDelete);
                 }
             }
         }
     }
 }
開發者ID:rickymathew,項目名稱:TYPO3.CMS,代碼行數:29,代碼來源:DataHandler.php

示例6: deleteVersionsForRecord

 /**
  * Delete versions for element from any table
  *
  * @param string $table Table name
  * @param int $uid Record UID
  * @param bool $forceHardDelete If TRUE, the "deleted" flag is ignored if applicable for record and the record is deleted COMPLETELY!
  * @return void
  */
 public function deleteVersionsForRecord($table, $uid, $forceHardDelete)
 {
     $versions = BackendUtility::selectVersionsOfRecord($table, $uid, 'uid,pid', $this->BE_USER->workspace);
     if (is_array($versions)) {
         foreach ($versions as $verRec) {
             if (!$verRec['_CURRENT_VERSION']) {
                 if ($table == 'pages') {
                     $this->deletePages($verRec['uid'], TRUE, $forceHardDelete);
                 } else {
                     $this->deleteRecord($table, $verRec['uid'], TRUE, $forceHardDelete);
                 }
             }
         }
     }
 }
開發者ID:plan2net,項目名稱:TYPO3.CMS,代碼行數:23,代碼來源:DataHandler.php

示例7: main

 /**
  * Find orphan records
  * VERY CPU and memory intensive since it will look up the whole page tree!
  *
  * @return array
  */
 public function main()
 {
     // Initialize result array:
     $resultArray = array('message' => $this->cli_help['name'] . LF . LF . $this->cli_help['description'], 'headers' => array('versions' => array('All versions', 'Showing all versions of records found', 0), 'versions_published' => array('All published versions', 'This is all records that has been published and can therefore be removed permanently', 1), 'versions_liveWS' => array('All versions in Live workspace', 'This is all records that are offline versions in the Live workspace. You may wish to flush these if you only use workspaces for versioning since then you might find lots of versions piling up in the live workspace which have simply been disconnected from the workspace before they were published.', 1), 'versions_lost_workspace' => array('Versions outside a workspace', 'Versions that has lost their connection to a workspace in TYPO3.', 3), 'versions_inside_versioned_page' => array('Versions in versions', 'Versions inside an already versioned page. Something that is confusing to users and therefore should not happen but is technically possible.', 2), 'versions_unused_placeholders' => array('Unused placeholder records', 'Placeholder records which are not used anymore by offline versions.', 2), 'versions_move_placeholders_ok' => array('Move placeholders', 'Move-to placeholder records which has good integrity', 0), 'versions_move_placeholders_bad' => array('Move placeholders with bad integrity', 'Move-to placeholder records which has bad integrity', 2), 'versions_move_id_check' => array('Checking if t3ver_move_id is correct', 't3ver_move_id must only be set with online records having t3ver_state=3.', 2)), 'versions' => array());
     $startingPoint = $this->cli_isArg('--pid') ? \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->cli_argValue('--pid'), 0) : 0;
     $depth = $this->cli_isArg('--depth') ? \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($this->cli_argValue('--depth'), 0) : 1000;
     $this->genTree($startingPoint, $depth, (int) $this->cli_argValue('--echotree'));
     $resultArray['versions'] = $this->recStats['versions'];
     $resultArray['versions_published'] = $this->recStats['versions_published'];
     $resultArray['versions_liveWS'] = $this->recStats['versions_liveWS'];
     $resultArray['versions_lost_workspace'] = $this->recStats['versions_lost_workspace'];
     $resultArray['versions_inside_versioned_page'] = $this->recStats['versions_inside_versioned_page'];
     // Finding all placeholders with no records attached!
     $resultArray['versions_unused_placeholders'] = array();
     foreach ($GLOBALS['TCA'] as $table => $cfg) {
         if ($cfg['ctrl']['versioningWS']) {
             $placeHolders = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,pid', $table, 't3ver_state=' . new VersionState(VersionState::NEW_PLACEHOLDER) . ' AND pid>=0' . BackendUtility::deleteClause($table));
             foreach ($placeHolders as $phrec) {
                 if (count(BackendUtility::selectVersionsOfRecord($table, $phrec['uid'], 'uid', '*', null)) <= 1) {
                     $resultArray['versions_unused_placeholders'][GeneralUtility::shortMD5($table . ':' . $phrec['uid'])] = $table . ':' . $phrec['uid'];
                 }
             }
         }
     }
     asort($resultArray['versions_unused_placeholders']);
     // Finding all move placeholders with inconsistencies:
     $resultArray['versions_move_placeholders_ok'] = array();
     $resultArray['versions_move_placeholders_bad'] = array();
     foreach ($GLOBALS['TCA'] as $table => $cfg) {
         if (BackendUtility::isTableWorkspaceEnabled($table)) {
             $placeHolders = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,pid,t3ver_move_id,t3ver_wsid,t3ver_state', $table, 't3ver_state=' . new VersionState(VersionState::MOVE_PLACEHOLDER) . ' AND pid>=0' . BackendUtility::deleteClause($table));
             foreach ($placeHolders as $phrec) {
                 $shortID = GeneralUtility::shortMD5($table . ':' . $phrec['uid']);
                 if ((int) $phrec['t3ver_wsid'] != 0) {
                     $phrecCopy = $phrec;
                     if (BackendUtility::movePlhOL($table, $phrec)) {
                         if ($wsAlt = BackendUtility::getWorkspaceVersionOfRecord($phrecCopy['t3ver_wsid'], $table, $phrec['uid'], 'uid,pid,t3ver_state')) {
                             if (!VersionState::cast($wsAlt['t3ver_state'])->equals(VersionState::MOVE_POINTER)) {
                                 $resultArray['versions_move_placeholders_bad'][$shortID] = array($table . ':' . $phrec['uid'], 'State for version was not "4" as it should be!', $phrecCopy);
                             } else {
                                 $resultArray['versions_move_placeholders_ok'][$shortID] = array($table . ':' . $phrec['uid'], 'PLH' => $phrecCopy, 'online' => $phrec, 'PNT' => $wsAlt);
                             }
                         } else {
                             $resultArray['versions_move_placeholders_bad'][$shortID] = array($table . ':' . $phrec['uid'], 'No version was found for online record to be moved. A version must exist.', $phrecCopy);
                         }
                     } else {
                         $resultArray['versions_move_placeholders_bad'][$shortID] = array($table . ':' . $phrec['uid'], 'Did not find online record for "t3ver_move_id" value ' . $phrec['t3ver_move_id'], $phrec);
                     }
                 } else {
                     $resultArray['versions_move_placeholders_bad'][$shortID] = array($table . ':' . $phrec['uid'], 'Placeholder was not assigned a workspace value in t3ver_wsid.', $phrec);
                 }
             }
         }
     }
     ksort($resultArray['versions_move_placeholders_ok']);
     ksort($resultArray['versions_move_placeholders_bad']);
     // Finding move_id_check inconsistencies:
     $resultArray['versions_move_id_check'] = array();
     foreach ($GLOBALS['TCA'] as $table => $cfg) {
         if (BackendUtility::isTableWorkspaceEnabled($table)) {
             $placeHolders = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,pid,t3ver_move_id,t3ver_wsid,t3ver_state', $table, 't3ver_move_id<>0' . BackendUtility::deleteClause($table));
             foreach ($placeHolders as $phrec) {
                 if (VersionState::cast($phrec['t3ver_state'])->equals(VersionState::MOVE_PLACEHOLDER)) {
                     if ($phrec['pid'] != -1) {
                     } else {
                         $resultArray['versions_move_id_check'][] = array($table . ':' . $phrec['uid'], 'Record was offline, must not be!', $phrec);
                     }
                 } else {
                     $resultArray['versions_move_id_check'][] = array($table . ':' . $phrec['uid'], 'Record had t3ver_move_id set to "' . $phrec['t3ver_move_id'] . '" while having t3ver_state=' . $phrec['t3ver_state'], $phrec);
                 }
             }
         }
     }
     return $resultArray;
 }
開發者ID:dachcom-digital,項目名稱:TYPO3.CMS,代碼行數:81,代碼來源:VersionsCommand.php

示例8: getVersionSelector

    /**
     * Creates the version selector for the page id inputted.
     * Moved out of the core file \TYPO3\CMS\Backend\Template\DocumentTemplate
     *
     * @param int $id Page id to create selector for.
     * @param bool $noAction If set, there will be no button for swapping page.
     * @return string
     * @see \TYPO3\CMS\Backend\Template\DocumentTemplate
     */
    public function getVersionSelector($id, $noAction = false)
    {
        if ($id <= 0) {
            return '';
        }
        if ($GLOBALS['BE_USER']->workspace == 0) {
            // Get Current page record:
            $curPage = BackendUtility::getRecord('pages', $id);
            // If the selected page is not online, find the right ID
            $onlineId = $curPage['pid'] == -1 ? $curPage['t3ver_oid'] : $id;
            // Select all versions of online version:
            $versions = BackendUtility::selectVersionsOfRecord('pages', $onlineId, 'uid,pid,t3ver_label,t3ver_oid,t3ver_wsid,t3ver_id', null);
            // If more than one was found...:
            if (count($versions) > 1) {
                // Create selector box entries:
                $opt = array();
                foreach ($versions as $vRow) {
                    if ($vRow['uid'] == $onlineId) {
                        // Live version
                        $label = '[' . $GLOBALS['LANG']->sL('LLL:EXT:version/Resources/Private/Language/locallang.xlf:versionSelect.live', true) . ']';
                    } else {
                        $label = $vRow['t3ver_label'] . ' (' . $GLOBALS['LANG']->sL('LLL:EXT:version/Resources/Private/Language/locallang.xlf:versionId', true) . ' ' . $vRow['t3ver_id'] . ($vRow['t3ver_wsid'] != 0 ? ' ' . $GLOBALS['LANG']->sL('LLL:EXT:version/Resources/Private/Language/locallang.xlf:workspaceId', true) . ' ' . $vRow['t3ver_wsid'] : '') . ')';
                    }
                    $opt[] = '<option value="' . htmlspecialchars(GeneralUtility::linkThisScript(array('id' => $vRow['uid']))) . '"' . ($id == $vRow['uid'] ? ' selected="selected"' : '') . '>' . htmlspecialchars($label) . '</option>';
                }
                /** @var $iconFactory \TYPO3\CMS\Core\Imaging\IconFactory */
                $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
                // Add management link:
                $management = '
					<a class="btn btn-default" href="' . htmlspecialchars(\TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('web_txversionM1', array('table' => 'pages', 'uid' => $onlineId))) . '">
						' . $iconFactory->getIcon('actions-version-open', Icon::SIZE_SMALL)->render() . '
						' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:ver.mgm', true) . '
					</a>';
                // Create onchange handler:
                $onChange = 'window.location.href=this.options[this.selectedIndex].value;';
                // Controls:
                if ($id == $onlineId) {
                    $controls = '<strong class="text-success">' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:ver.online', true) . '</strong>';
                } elseif (!$noAction) {
                    $href = $GLOBALS['TBE_TEMPLATE']->issueCommand('&cmd[pages][' . $onlineId . '][version][swapWith]=' . $id . '&cmd[pages][' . $onlineId . '][version][action]=swap', GeneralUtility::linkThisScript(array('id' => $onlineId)));
                    $controls = '
						<a href="' . htmlspecialchars($href) . '" class="btn btn-default" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:ver.swapPage', true) . '">
							' . $iconFactory->getIcon('actions-version-swap-version', Icon::SIZE_SMALL)->render() . '
							' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:ver.swap', true) . '
						</a>';
                }
                // Write out HTML code:
                return '
					<!--
						Version selector:
					-->
					<div id="typo3-version-selector" class="form-inline form-inline-spaced">
						<div class="form-group">
							<label for="version-selector">' . $GLOBALS['LANG']->sL('LLL:EXT:version/Resources/Private/Language/locallang.xlf:versionSelect.label', true) . '</label>
							<select id="version-selector" class="form-control" onchange="' . htmlspecialchars($onChange) . '">
								' . implode('', $opt) . '
							</select>
						</div>
						<div class="form-group">
							' . $controls . '
						</div>
						<div class="form-group">
							' . $management . '
						</div>
					</div>
				';
            }
        }
    }
開發者ID:hlop,項目名稱:TYPO3.CMS,代碼行數:78,代碼來源:VersionView.php

示例9: genTree_traverse


//.........這裏部分代碼省略.........
                     // This is illegal records under a versioned page - therefore not registered in $this->recStats['all'] so they should be orphaned:
                     $this->recStats['illegal_record_under_versioned_page'][$tableName][$rowSub['uid']] = $rowSub['uid'];
                     if ($echoLevel > 1) {
                         echo LF . '		ERROR! Illegal record (' . $tableName . ':' . $rowSub['uid'] . ') under versioned page!';
                     }
                 } else {
                     $this->recStats['all'][$tableName][$rowSub['uid']] = $rowSub['uid'];
                     // Register deleted:
                     if ($GLOBALS['TCA'][$tableName]['ctrl']['delete'] && $rowSub[$GLOBALS['TCA'][$tableName]['ctrl']['delete']]) {
                         $this->recStats['deleted'][$tableName][$rowSub['uid']] = $rowSub['uid'];
                         if ($echoLevel == 3) {
                             echo ' (DELETED)';
                         }
                     }
                     // Check location of records regarding tree root:
                     if (!$GLOBALS['TCA'][$tableName]['ctrl']['rootLevel'] && $rootID == 0) {
                         $this->recStats['misplaced_at_rootlevel'][$tableName][$rowSub['uid']] = $rowSub['uid'];
                         if ($echoLevel > 1) {
                             echo LF . '		ERROR! Misplaced record (' . $tableName . ':' . $rowSub['uid'] . ') on rootlevel!';
                         }
                     }
                     if ($GLOBALS['TCA'][$tableName]['ctrl']['rootLevel'] == 1 && $rootID > 0) {
                         $this->recStats['misplaced_inside_tree'][$tableName][$rowSub['uid']] = $rowSub['uid'];
                         if ($echoLevel > 1) {
                             echo LF . '		ERROR! Misplaced record (' . $tableName . ':' . $rowSub['uid'] . ') inside page tree!';
                         }
                     }
                     // Traverse plugins:
                     if ($callBack) {
                         $this->{$callBack}($tableName, $rowSub['uid'], $echoLevel, $versionSwapmode, $rootIsVersion);
                     }
                     // Add any versions of those records:
                     if ($this->genTree_traverseVersions) {
                         $versions = \TYPO3\CMS\Backend\Utility\BackendUtility::selectVersionsOfRecord($tableName, $rowSub['uid'], 'uid,t3ver_wsid,t3ver_count' . ($GLOBALS['TCA'][$tableName]['ctrl']['delete'] ? ',' . $GLOBALS['TCA'][$tableName]['ctrl']['delete'] : ''), 0, TRUE);
                         if (is_array($versions)) {
                             foreach ($versions as $verRec) {
                                 if (!$verRec['_CURRENT_VERSION']) {
                                     if ($echoLevel == 3) {
                                         echo LF . '		\\-[#OFFLINE VERSION: WS#' . $verRec['t3ver_wsid'] . '/Cnt:' . $verRec['t3ver_count'] . '] ' . $tableName . ':' . $verRec['uid'] . ')';
                                     }
                                     $this->recStats['all'][$tableName][$verRec['uid']] = $verRec['uid'];
                                     // Register deleted:
                                     if ($GLOBALS['TCA'][$tableName]['ctrl']['delete'] && $verRec[$GLOBALS['TCA'][$tableName]['ctrl']['delete']]) {
                                         $this->recStats['deleted'][$tableName][$verRec['uid']] = $verRec['uid'];
                                         if ($echoLevel == 3) {
                                             echo ' (DELETED)';
                                         }
                                     }
                                     // Register version:
                                     $this->recStats['versions'][$tableName][$verRec['uid']] = $verRec['uid'];
                                     if ($verRec['t3ver_count'] >= 1 && $verRec['t3ver_wsid'] == 0) {
                                         // Only register published versions in LIVE workspace (published versions in draft workspaces are allowed)
                                         $this->recStats['versions_published'][$tableName][$verRec['uid']] = $verRec['uid'];
                                         if ($echoLevel == 3) {
                                             echo ' (PUBLISHED)';
                                         }
                                     }
                                     if ($verRec['t3ver_wsid'] == 0) {
                                         $this->recStats['versions_liveWS'][$tableName][$verRec['uid']] = $verRec['uid'];
                                     }
                                     if (!isset($this->workspaceIndex[$verRec['t3ver_wsid']])) {
                                         $this->recStats['versions_lost_workspace'][$tableName][$verRec['uid']] = $verRec['uid'];
                                         if ($echoLevel > 1) {
                                             echo LF . '		ERROR! Version (' . $tableName . ':' . $verRec['uid'] . ') belongs to non-existing workspace (' . $verRec['t3ver_wsid'] . ')!';
                                         }
                                     }
開發者ID:nicksergio,項目名稱:TYPO3v4-Core,代碼行數:67,代碼來源:CleanerCommand.php

示例10: makeControl

    /**
     * Creates the control panel for a single record in the listing.
     *
     * @param string $table The table
     * @param array $row The record for which to make the control panel.
     * @param string $level
     * @return string HTML table with the control panel (unless disabled)
     */
    public function makeControl($table, $row, $level)
    {
        if ($this->dontShowClipControlPanels) {
            return '';
        }
        $rowUid = $row['uid'];
        if (ExtensionManagementUtility::isLoaded('version') && isset($row['_ORIG_uid'])) {
            $rowUid = $row['_ORIG_uid'];
        }
        $cells = array();
        // If the listed table is 'pages' we have to request the permission settings for each page:
        if ($table == 'pages') {
            $localCalcPerms = $GLOBALS['BE_USER']->calcPerms(BackendUtility::getRecord('pages', $row['uid']));
        }
        // This expresses the edit permissions for this particular element:
        $permsEdit = $table == 'pages' && $localCalcPerms & 2 || $table != 'pages' && $this->calcPerms & 16;
        // "Show" link (only pages and tt_content elements)
        if ($table == 'pages' || $table == 'tt_content') {
            $cells['view'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::viewOnClick($table === 'tt_content' ? $this->id : $row['uid'], $this->backPath, '', $table === 'tt_content' ? '#' . $row['uid'] : '')) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.showPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-view') . '</a>';
        } elseif (!$this->table) {
            $cells['view'] = $this->spaceIcon;
        }
        // "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';
            $cells['edit'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, $this->backPath, -1)) . '" title="' . $GLOBALS['LANG']->getLL('edit', TRUE) . '">' . ($GLOBALS['TCA'][$table]['ctrl']['readOnly'] ? IconUtility::getSpriteIcon('actions-document-open-read-only') : IconUtility::getSpriteIcon('actions-document-open')) . '</a>';
        } elseif (!$this->table) {
            $cells['edit'] = $this->spaceIcon;
        }
        // "Move" wizard link for pages/tt_content elements:
        if (($table == 'tt_content' && $permsEdit || $table == 'pages') && $level == 0) {
            $cells['move'] = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'' . $this->backPath . 'move_el.php?table=' . $table . '&uid=' . $row['uid'] . '\');') . '" title="' . $GLOBALS['LANG']->getLL('move_' . ($table == 'tt_content' ? 'record' : 'page'), TRUE) . '">' . ($table == 'tt_content' ? IconUtility::getSpriteIcon('actions-document-move') : IconUtility::getSpriteIcon('actions-page-move')) . '</a>';
        } elseif (!$this->table || $level > 0) {
            $cells['move'] = $this->spaceIcon;
        }
        // If the extended control panel is enabled OR if we are seeing a single table:
        if ($GLOBALS['SOBE']->MOD_SETTINGS['bigControlPanel'] || $this->table) {
            // "Info": (All records)
            $cells['viewBig'] = '<a href="#" onclick="' . htmlspecialchars('top.launchView(\'' . $table . '\', \'' . $row['uid'] . '\'); return false;') . '" title="' . $GLOBALS['LANG']->getLL('showInfo', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-info') . '</a>';
            // If the table is NOT a read-only table, then show these links:
            if (!$GLOBALS['TCA'][$table]['ctrl']['readOnly']) {
                // "Revert" link (history/undo)
                $cells['history'] = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(' . GeneralUtility::quoteJSvalue($this->backPath . BackendUtility::getModuleUrl('record_history', array('element' => $table . ':' . $row['uid']))) . ',\'#latest\');') . '" title="' . $GLOBALS['LANG']->getLL('history', TRUE) . '">' . IconUtility::getSpriteIcon('actions-document-history-open') . '</a>';
                // Versioning:
                if (ExtensionManagementUtility::isLoaded('version') && !ExtensionManagementUtility::isLoaded('workspaces')) {
                    $vers = BackendUtility::selectVersionsOfRecord($table, $row['uid'], 'uid', $GLOBALS['BE_USER']->workspace, FALSE, $row);
                    // If table can be versionized.
                    if (is_array($vers)) {
                        $versionIcon = 'no-version';
                        if (count($vers) > 1) {
                            $versionIcon = count($vers) - 1;
                        }
                        $cells['version'] = '<a href="' . htmlspecialchars($this->backPath . BackendUtility::getModuleUrl('web_txversionM1', array('table' => $table, 'uid' => $row['uid']))) . '" title="' . $GLOBALS['LANG']->getLL('displayVersions', TRUE) . '">' . IconUtility::getSpriteIcon('status-version-' . $versionIcon) . '</a>';
                    } elseif (!$this->table) {
                        $cells['version'] = $this->spaceIcon;
                    }
                }
                // "Edit Perms" link:
                if ($table == 'pages' && $GLOBALS['BE_USER']->check('modules', 'web_perm') && ExtensionManagementUtility::isLoaded('perm')) {
                    $cells['perms'] = '<a href="' . htmlspecialchars(BackendUtility::getModuleUrl('web_perm') . '&id=' . $row['uid'] . '&return_id=' . $row['uid'] . '&edit=1') . '" title="' . $GLOBALS['LANG']->getLL('permissions', TRUE) . '">' . IconUtility::getSpriteIcon('status-status-locked') . '</a>';
                } elseif ((!$this->table || $level > 0) && $GLOBALS['BE_USER']->check('modules', 'web_perm')) {
                    $cells['perms'] = $this->spaceIcon;
                }
                // "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']) {
                    if ($table != 'pages' && $this->calcPerms & 16 || $table == 'pages' && $this->calcPerms & 8) {
                        if ($this->showNewRecLink($table)) {
                            $params = '&edit[' . $table . '][' . -($row['_MOVE_PLH'] ? $row['_MOVE_PLH_uid'] : $row['uid']) . ']=new';
                            $cells['new'] = '<a href="#" onclick="' . htmlspecialchars(BackendUtility::editOnClick($params, $this->backPath, -1)) . '" title="' . $GLOBALS['LANG']->getLL('new' . ($table == 'pages ' ? 'Page' : 'Record'), TRUE) . '">' . ($table == 'pages' ? IconUtility::getSpriteIcon('actions-page-new') : IconUtility::getSpriteIcon('actions-document-new')) . '</a>';
                        }
                    }
                } elseif (!$this->table) {
                    $cells['new'] = $this->spaceIcon;
                }
                // "Up/Down" links
                if ($permsEdit && $GLOBALS['TCA'][$table]['ctrl']['sortby'] && !$this->sortField && !$this->searchLevels) {
                    if (isset($this->currentTable['prev'][$row['uid']]) && $this->showMoveUp === TRUE) {
                        // Up
                        if ($this->lastMoveDownParams) {
                            $params = $this->lastMoveDownParams;
                        } else {
                            $params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . $this->currentTable['prev'][$row['uid']];
                        }
                        $cells['moveUp'] = '<a href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '" title="' . $GLOBALS['LANG']->getLL('moveUp', TRUE) . '">' . IconUtility::getSpriteIcon('actions-move-up') . '</a>';
                    } else {
                        $cells['moveUp'] = $this->spaceIcon;
                    }
                    if ($this->currentTable['next'][$row['uid']] && $this->showMoveDown === TRUE) {
                        // Down
                        $params = '&cmd[' . $table . '][' . $row['uid'] . '][move]=' . $this->currentTable['next'][$row['uid']];
                        $this->lastMoveDownParams = $params;
                        $cells['moveDown'] = '<a href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '" title="' . $GLOBALS['LANG']->getLL('moveDown', TRUE) . '">' . IconUtility::getSpriteIcon('actions-move-down') . '</a>';
//.........這裏部分代碼省略.........
開發者ID:blumenbach,項目名稱:bb-online.neu,代碼行數:101,代碼來源:DatabaseRecordList.php


注:本文中的TYPO3\CMS\Backend\Utility\BackendUtility::selectVersionsOfRecord方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。