本文整理汇总了PHP中TYPO3\CMS\Backend\Utility\BackendUtility::workspaceOL方法的典型用法代码示例。如果您正苦于以下问题:PHP BackendUtility::workspaceOL方法的具体用法?PHP BackendUtility::workspaceOL怎么用?PHP BackendUtility::workspaceOL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Backend\Utility\BackendUtility
的用法示例。
在下文中一共展示了BackendUtility::workspaceOL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRecordPath
/**
* Returns the path (visually) of a page $uid, fx. "/First page/Second page/Another subpage"
* Each part of the path will be limited to $titleLimit characters
* Deleted pages are filtered out.
*
* @param integer Page uid for which to create record path
* @param string $clause is additional where clauses, eg.
* @param integer Title limit
* @param integer Title limit of Full title (typ. set to 1000 or so)
* @return mixed Path of record (string) OR array with short/long title if $fullTitleLimit is set.
*/
public static function getRecordPath($uid, $clause = '', $titleLimit = 1000, $fullTitleLimit = 0)
{
$loopCheck = 100;
$output = $fullOutput = '/';
while ($uid != 0 && $loopCheck > 0) {
$loopCheck--;
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,pid,title,deleted,t3ver_oid,t3ver_wsid', 'pages', 'uid=' . (int) $uid . (strlen(trim($clause)) ? ' AND ' . $clause : ''));
if (is_resource($res)) {
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$GLOBALS['TYPO3_DB']->sql_free_result($res);
BackendUtility::workspaceOL('pages', $row);
if (is_array($row)) {
BackendUtility::fixVersioningPid('pages', $row);
$uid = $row['pid'];
$output = '/' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($row['title'], $titleLimit)) . $output;
if ($row['deleted']) {
$output = '<span class="deletedPath">' . $output . '</span>';
}
if ($fullTitleLimit) {
$fullOutput = '/' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($row['title'], $fullTitleLimit)) . $fullOutput;
}
} else {
break;
}
} else {
break;
}
}
if ($fullTitleLimit) {
return array($output, $fullOutput);
} else {
return $output;
}
}
示例2: makeWorkspaceOverlay
/**
* Overlay the given record with its workspace-version, if any
*
* @param array The record to get the workspace version for
* @return void (passed by reference)
*/
protected function makeWorkspaceOverlay(&$row)
{
// Check for workspace-versions
if ($GLOBALS['BE_USER']->workspace != 0 && $GLOBALS['TCA'][$this->table]['ctrl']['versioningWS'] == TRUE) {
\TYPO3\CMS\Backend\Utility\BackendUtility::workspaceOL($this->mmForeignTable ? $this->mmForeignTable : $this->table, $row);
}
}
示例3: getResult
/**
* Traverse the result pointer given, adding each record to array and setting some internal values at the same time.
*
* @param bool|\mysqli_result|object $result MySQLi result object / DBAL object
* @param string $table Table name defaulting to tt_content
* @return array The selected rows returned in this array.
*/
public function getResult($result, $table = 'tt_content')
{
$output = array();
// Traverse the result:
while ($row = $this->getDatabase()->sql_fetch_assoc($result)) {
BackendUtility::workspaceOL($table, $row, -99, true);
if ($row) {
// Add the row to the array:
$output[] = $row;
}
}
$this->generateTtContentDataArray($output);
// Return selected records
return $output;
}
示例4: ext_getAllTemplates
/**
* [Describe function...]
*
* @param [type] $id: ...
* @return [type] ...
* @todo Define visibility
*/
public function ext_getAllTemplates($id)
{
// Query is taken from the runThroughTemplates($theRootLine) function in the parent class.
if ((int) $id) {
$outRes = array();
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_template', 'pid=' . (int) $id . ' ' . $this->whereClause, '', 'sorting');
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
BackendUtility::workspaceOL('sys_template', $row);
if (is_array($row)) {
$outRes[] = $row;
}
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
// Returns the template rows in an array.
return $outRes;
}
}
示例5: collectContentData
/**
* Collects tt_content data from a single tt_content element
* @param string $shortcutItem : The tt_content element to fetch the data from
* @param array $collectedItems : The collected item data row
* @param string $showHidden : query String containing enable fields
* @param string $deleteClause : query String to check for deleted items
* @param int $parentUid : uid of the referencing tt_content record
*/
public function collectContentData($shortcutItem, &$collectedItems, &$showHidden, &$deleteClause, $parentUid)
{
$shortcutItem = str_replace('tt_content_', '', $shortcutItem);
if ((int) $shortcutItem !== (int) $parentUid) {
$itemRow = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('*', 'tt_content', 'uid=' . $shortcutItem . $showHidden . $deleteClause);
if ($GLOBALS['BE_USER']->workspace > 0) {
BackendUtility::workspaceOL('tt_content', $itemRow, $GLOBALS['BE_USER']->workspace);
}
$collectedItems[] = $itemRow;
}
}
示例6: getRecordPath
/**
* Returns the path (visually) of a page $uid, fx. "/First page/Second page/Another subpage"
* Each part of the path will be limited to $titleLimit characters
* Deleted pages are filtered out.
*
* @param int $uid Page uid for which to create record path
* @param string $clause is additional where clauses, eg.
* @param int $titleLimit Title limit
* @param int $fullTitleLimit Title limit of Full title (typ. set to 1000 or so)
* @return mixed Path of record (string) OR array with short/long title if $fullTitleLimit is set.
*/
public static function getRecordPath($uid, $clause = '', $titleLimit = 1000, $fullTitleLimit = 0)
{
$uid = (int) $uid;
$output = $fullOutput = '/';
if ($uid === 0) {
return $output;
}
$databaseConnection = static::getDatabaseConnection();
$clause = trim($clause) !== '' ? ' AND ' . $clause : '';
$loopCheck = 100;
while ($loopCheck > 0) {
$loopCheck--;
$res = $databaseConnection->exec_SELECTquery('uid,pid,title,deleted,t3ver_oid,t3ver_wsid', 'pages', 'uid=' . $uid . $clause);
if ($res !== FALSE) {
$row = $databaseConnection->sql_fetch_assoc($res);
$databaseConnection->sql_free_result($res);
BackendUtility::workspaceOL('pages', $row);
if (is_array($row)) {
BackendUtility::fixVersioningPid('pages', $row);
$uid = (int) $row['pid'];
$output = '/' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['title'], $titleLimit)) . $output;
if ($row['deleted']) {
$output = '<span class="text-danger">' . $output . '</span>';
}
if ($fullTitleLimit) {
$fullOutput = '/' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($row['title'], $fullTitleLimit)) . $fullOutput;
}
} else {
break;
}
} else {
break;
}
}
if ($fullTitleLimit) {
return array($output, $fullOutput);
} else {
return $output;
}
}
示例7: getDataNext
/**
* Getting the tree data: next entry
*
* @param mixed $res Data handle
* @param string $subCSSclass CSS class for sub elements (workspace related)
* @return array item data array OR FALSE if end of elements.
* @access private
* @see getDataInit()
*/
public function getDataNext(&$res, $subCSSclass = '')
{
if (is_array($this->data)) {
if ($res < 0) {
$row = FALSE;
} else {
list(, $row) = each($this->dataLookup[$res][$this->subLevelID]);
// Passing on default <td> class for subelements:
if (is_array($row) && $subCSSclass !== '') {
$row['_CSSCLASS'] = $row['_SUBCSSCLASS'] = $subCSSclass;
}
}
return $row;
} else {
while ($row = @$GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
BackendUtility::workspaceOL($this->table, $row, $this->BE_USER->workspace, TRUE);
if (is_array($row)) {
break;
}
}
// Passing on default <td> class for subelements:
if (is_array($row) && $subCSSclass !== '') {
if ($this->table === 'pages' && $this->highlightPagesWithVersions && !isset($row['_CSSCLASS']) && count(BackendUtility::countVersionsOfRecordsOnPage($this->BE_USER->workspace, $row['uid']))) {
$row['_CSSCLASS'] = 'ver-versions';
}
if (!isset($row['_CSSCLASS'])) {
$row['_CSSCLASS'] = $subCSSclass;
}
if (!isset($row['_SUBCSSCLASS'])) {
$row['_SUBCSSCLASS'] = $subCSSclass;
}
}
return $row;
}
}
示例8: getPage
/**
* Gets a page record.
*
* @param int $pageId
* @return NULL|array
*/
protected function getPage($pageId)
{
$page = $this->getDatabaseConnection()->exec_SELECTgetSingleRow('uid, pid, backend_layout', 'pages', 'uid=' . (int) $pageId);
BackendUtility::workspaceOL('pages', $page);
return $page;
}
示例9: getRecordProperties
/**
* Returns an array with record properties, like header and pid
* No check for deleted or access is done!
* For versionized records, pid is resolved to its live versions pid.
* Used for logging
*
* @param string $table Table name
* @param int $id Uid of record
* @param bool $noWSOL If set, no workspace overlay is performed
* @return array Properties of record
*/
public function getRecordProperties($table, $id, $noWSOL = false)
{
$row = $table == 'pages' && !$id ? array('title' => '[root-level]', 'uid' => 0, 'pid' => 0) : $this->recordInfo($table, $id, '*');
if (!$noWSOL) {
BackendUtility::workspaceOL($table, $row);
}
return $this->getRecordPropertiesFromRow($table, $row);
}
示例10: editPageIdFunc
/**
* If "editPage" value is sent to script and it points to an accessible page, the internal var $this->theEditRec is set to the page record which should be loaded.
* Returns void
*
* @return void
* @todo Define visibility
*/
public function editPageIdFunc()
{
if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms')) {
return;
}
// EDIT page:
$this->editPage = trim($GLOBALS['LANG']->csConvObj->conv_case($GLOBALS['LANG']->charSet, $this->editPage, 'toLower'));
$this->editError = '';
$this->theEditRec = '';
$this->searchFor = '';
if ($this->editPage) {
// First, test alternative value consisting of [table]:[uid] and if not found, proceed with traditional page ID resolve:
$this->alternativeTableUid = explode(':', $this->editPage);
// We restrict it to admins only just because I'm not really sure if alt_doc.php properly
// checks permissions of passed records for editing. If alt_doc.php does that, then we can remove this.
if (!(count($this->alternativeTableUid) == 2 && $GLOBALS['BE_USER']->isAdmin())) {
$where = ' AND (' . $GLOBALS['BE_USER']->getPagePermsClause(2) . ' OR ' . $GLOBALS['BE_USER']->getPagePermsClause(16) . ')';
if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->editPage)) {
$this->theEditRec = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordWSOL('pages', $this->editPage, '*', $where);
} else {
$records = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordsByField('pages', 'alias', $this->editPage, $where);
if (is_array($records)) {
$this->theEditRec = reset($records);
\TYPO3\CMS\Backend\Utility\BackendUtility::workspaceOL('pages', $this->theEditRec);
}
}
if (!is_array($this->theEditRec)) {
unset($this->theEditRec);
$this->searchFor = $this->editPage;
} elseif (!$GLOBALS['BE_USER']->isInWebMount($this->theEditRec['uid'])) {
unset($this->theEditRec);
$this->editError = $GLOBALS['LANG']->getLL('bookmark_notEditable');
} else {
// Visual path set:
$perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
$this->editPath = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordPath($this->theEditRec['pid'], $perms_clause, 30);
if (!$GLOBALS['BE_USER']->getTSConfigVal('options.bookmark_onEditId_dontSetPageTree')) {
$bookmarkKeepExpanded = $GLOBALS['BE_USER']->getTSConfigVal('options.bookmark_onEditId_keepExistingExpanded');
// Expanding page tree:
\TYPO3\CMS\Backend\Utility\BackendUtility::openPageTree($this->theEditRec['pid'], !$bookmarkKeepExpanded);
}
}
}
}
}
示例11: renderQuickEdit
/**
* Rendering the quick-edit view.
*
* @return string
*/
public function renderQuickEdit()
{
$databaseConnection = $this->getDatabaseConnection();
$beUser = $this->getBackendUser();
$lang = $this->getLanguageService();
// Alternative template
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/db_layout_quickedit.html');
// Alternative form tag; Quick Edit submits its content to tce_db.php.
$this->doc->form = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_db', ['prErr' => 1, 'uPT' => 1])) . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
// Setting up the context sensitive menu:
$this->doc->getContextMenuCode();
// Set the edit_record value for internal use in this function:
$edit_record = $this->edit_record;
// If a command to edit all records in a column is issue, then select all those elements, and redirect to FormEngine
if (substr($edit_record, 0, 9) == '_EDIT_COL') {
$res = $databaseConnection->exec_SELECTquery('*', 'tt_content', 'pid=' . (int) $this->id . ' AND colPos=' . (int) substr($edit_record, 10) . ' AND sys_language_uid=' . (int) $this->current_sys_language . ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : BackendUtility::BEenableFields('tt_content')) . BackendUtility::deleteClause('tt_content') . BackendUtility::versioningPlaceholderClause('tt_content'), '', 'sorting');
$idListA = array();
while ($cRow = $databaseConnection->sql_fetch_assoc($res)) {
$idListA[] = $cRow['uid'];
}
$url = BackendUtility::getModuleUrl('record_edit', array('edit[tt_content][' . implode(',', $idListA) . ']' => 'edit', 'returnUrl' => $this->local_linkThisScript(array('edit_record' => ''))));
HttpUtility::redirect($url);
}
// If the former record edited was the creation of a NEW record, this will look up the created records uid:
if ($this->new_unique_uid) {
$res = $databaseConnection->exec_SELECTquery('*', 'sys_log', 'userid=' . (int) $beUser->user['uid'] . ' AND NEWid=' . $databaseConnection->fullQuoteStr($this->new_unique_uid, 'sys_log'));
$sys_log_row = $databaseConnection->sql_fetch_assoc($res);
if (is_array($sys_log_row)) {
$edit_record = $sys_log_row['tablename'] . ':' . $sys_log_row['recuid'];
}
}
// Creating the selector box, allowing the user to select which element to edit:
$opt = array();
$is_selected = 0;
$languageOverlayRecord = '';
if ($this->current_sys_language) {
list($languageOverlayRecord) = BackendUtility::getRecordsByField('pages_language_overlay', 'pid', $this->id, 'AND sys_language_uid=' . (int) $this->current_sys_language);
}
if (is_array($languageOverlayRecord)) {
$inValue = 'pages_language_overlay:' . $languageOverlayRecord['uid'];
$is_selected += (int) $edit_record == $inValue;
$opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $lang->getLL('editLanguageHeader', TRUE) . ' ]</option>';
} else {
$inValue = 'pages:' . $this->id;
$is_selected += (int) $edit_record == $inValue;
$opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $lang->getLL('editPageProperties', TRUE) . ' ]</option>';
}
// Selecting all content elements from this language and allowed colPos:
$res = $databaseConnection->exec_SELECTquery('*', 'tt_content', 'pid=' . (int) $this->id . ' AND sys_language_uid=' . (int) $this->current_sys_language . ' AND colPos IN (' . $this->colPosList . ')' . ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : BackendUtility::BEenableFields('tt_content')) . BackendUtility::deleteClause('tt_content') . BackendUtility::versioningPlaceholderClause('tt_content'), '', 'colPos,sorting');
$colPos = NULL;
$first = 1;
// Page is the pid if no record to put this after.
$prev = $this->id;
while ($cRow = $databaseConnection->sql_fetch_assoc($res)) {
BackendUtility::workspaceOL('tt_content', $cRow);
if (is_array($cRow)) {
if ($first) {
if (!$edit_record) {
$edit_record = 'tt_content:' . $cRow['uid'];
}
$first = 0;
}
if (!isset($colPos) || $cRow['colPos'] !== $colPos) {
$colPos = $cRow['colPos'];
$opt[] = '<option value=""></option>';
$opt[] = '<option value="_EDIT_COL:' . $colPos . '">__' . $lang->sL(BackendUtility::getLabelFromItemlist('tt_content', 'colPos', $colPos), TRUE) . ':__</option>';
}
$inValue = 'tt_content:' . $cRow['uid'];
$is_selected += (int) $edit_record == $inValue;
$opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>' . htmlspecialchars(GeneralUtility::fixed_lgd_cs($cRow['header'] ? $cRow['header'] : '[' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title') . '] ' . strip_tags($cRow['bodytext']), $beUser->uc['titleLen'])) . '</option>';
$prev = -$cRow['uid'];
}
}
// If edit_record is not set (meaning, no content elements was found for this language) we simply set it to create a new element:
if (!$edit_record) {
$edit_record = 'tt_content:new/' . $prev . '/' . $colPos;
$inValue = 'tt_content:new/' . $prev . '/' . $colPos;
$is_selected += (int) $edit_record == $inValue;
$opt[] = '<option value="' . $inValue . '"' . ($edit_record == $inValue ? ' selected="selected"' : '') . '>[ ' . $lang->getLL('newLabel', 1) . ' ]</option>';
}
// If none is yet selected...
if (!$is_selected) {
$opt[] = '<option value=""></option>';
$opt[] = '<option value="' . $edit_record . '" selected="selected">[ ' . $lang->getLL('newLabel', TRUE) . ' ]</option>';
}
// Splitting the edit-record cmd value into table/uid:
$this->eRParts = explode(':', $edit_record);
// Delete-button flag?
$this->deleteButton = MathUtility::canBeInterpretedAsInteger($this->eRParts[1]) && $edit_record && ($this->eRParts[0] != 'pages' && $this->EDIT_CONTENT || $this->eRParts[0] == 'pages' && $this->CALC_PERMS & Permission::PAGE_DELETE);
// If undo-button should be rendered (depends on available items in sys_history)
$this->undoButton = FALSE;
$undoRes = $databaseConnection->exec_SELECTquery('tstamp', 'sys_history', 'tablename=' . $databaseConnection->fullQuoteStr($this->eRParts[0], 'sys_history') . ' AND recuid=' . (int) $this->eRParts[1], '', 'tstamp DESC', '1');
if ($this->undoButtonR = $databaseConnection->sql_fetch_assoc($undoRes)) {
$this->undoButton = TRUE;
}
//.........这里部分代码省略.........
示例12: workspaceOL
/**
* @param string $table Table name
* @param array $row Record array passed by reference. As minimum, the "uid" and "pid" fields must exist! Fake fields cannot exist since the fields in the array is used as field names in the SQL look up. It would be nice to have fields like "t3ver_state" and "t3ver_mode_id" as well to avoid a new lookup inside movePlhOL().
* @param int $wsid Workspace ID, if not specified will use static::getBackendUserAuthentication()->workspace
* @param bool $unsetMovePointers If TRUE the function does not return a "pointer" row for moved records in a workspace
* @return void
* @see fixVersioningPid()
*/
public function workspaceOL($table, &$row, $wsid = -99, $unsetMovePointers = FALSE)
{
BackendUtility::workspaceOL($table, $row, $wsid, $unsetMovePointers);
}
示例13: readPageAccess
public function readPageAccess($id, $perms_clause)
{
if ((string) $id != '') {
$id = intval($id);
if (!$id) {
if ($GLOBALS['BE_USER']->isAdmin()) {
$path = '/';
$pageinfo['_thePath'] = $path;
return $pageinfo;
}
} else {
$pageinfo = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord('pages', $id, '*', $perms_clause ? ' AND ' . $perms_clause : '');
if ($pageinfo['uid'] && $GLOBALS['BE_USER']->isInWebMount($id, $perms_clause)) {
\TYPO3\CMS\Backend\Utility\BackendUtility::workspaceOL('pages', $pageinfo);
\TYPO3\CMS\Backend\Utility\BackendUtility::fixVersioningPid('pages', $pageinfo);
list($pageinfo['_thePath'], $pageinfo['_thePathFull']) = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecordPath(intval($pageinfo['uid']), $perms_clause, 15, 1000);
return $pageinfo;
}
}
}
return false;
}
示例14: foreignTable
/**
* Adds records from a foreign table (for selector boxes)
*
* @param array $items The array of items (label,value,icon)
* @param array $fieldValue The 'columns' array for the field (from TCA)
* @param array $TSconfig TSconfig for the table/row
* @param string $field The fieldname
* @param boolean $pFFlag If set, then we are fetching the 'neg_' foreign tables.
* @return array The $items array modified.
* @see addSelectOptionsToItemArray(), BackendUtility::exec_foreign_table_where_query()
* @todo Define visibility
*/
public function foreignTable($items, $fieldValue, $TSconfig, $field, $pFFlag = FALSE)
{
// Init:
$pF = $pFFlag ? 'neg_' : '';
$f_table = $fieldValue['config'][$pF . 'foreign_table'];
$uidPre = $pFFlag ? '-' : '';
// Exec query:
$res = BackendUtility::exec_foreign_table_where_query($fieldValue, $field, $TSconfig, $pF);
// Perform error test
$db = $this->getDatabaseConnection();
if ($db->sql_error()) {
$msg = htmlspecialchars($db->sql_error());
$msg .= '<br />' . LF;
$msg .= $this->sL('LLL:EXT:lang/locallang_core.xlf:error.database_schema_mismatch');
$msgTitle = $this->sL('LLL:EXT:lang/locallang_core.xlf:error.database_schema_mismatch_title');
/** @var $flashMessage FlashMessage */
$flashMessage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage', $msg, $msgTitle, FlashMessage::ERROR, TRUE);
/** @var $flashMessageService FlashMessageService */
$flashMessageService = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessageService');
/** @var $defaultFlashMessageQueue FlashMessageQueue */
$defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
$defaultFlashMessageQueue->enqueue($flashMessage);
return array();
}
// Get label prefix.
$lPrefix = $this->sL($fieldValue['config'][$pF . 'foreign_table_prefix']);
// Get icon field + path if any:
$iField = $GLOBALS['TCA'][$f_table]['ctrl']['selicon_field'];
$iPath = trim($GLOBALS['TCA'][$f_table]['ctrl']['selicon_field_path']);
// Traverse the selected rows to add them:
while ($row = $db->sql_fetch_assoc($res)) {
BackendUtility::workspaceOL($f_table, $row);
if (is_array($row)) {
// Prepare the icon if available:
if ($iField && $iPath && $row[$iField]) {
$iParts = GeneralUtility::trimExplode(',', $row[$iField], TRUE);
$icon = '../' . $iPath . '/' . trim($iParts[0]);
} elseif (GeneralUtility::inList('singlebox,checkbox', $fieldValue['config']['renderMode'])) {
$icon = IconUtility::mapRecordTypeToSpriteIconName($f_table, $row);
} else {
$icon = '';
}
// Add the item:
$items[] = array($lPrefix . htmlspecialchars(BackendUtility::getRecordTitle($f_table, $row)), $uidPre . $row['uid'], $icon);
}
}
$db->sql_free_result($res);
return $items;
}
示例15: canCreatePreviewLink
/**
* Determine whether this page for the current
*
* @param int $pageUid
* @param int $workspaceUid
* @return bool
*/
public function canCreatePreviewLink($pageUid, $workspaceUid)
{
$result = true;
if ($pageUid > 0 && $workspaceUid > 0) {
$pageRecord = BackendUtility::getRecord('pages', $pageUid);
BackendUtility::workspaceOL('pages', $pageRecord, $workspaceUid);
if (!GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['FE']['content_doktypes'], $pageRecord['doktype']) || VersionState::cast($pageRecord['t3ver_state'])->equals(VersionState::DELETE_PLACEHOLDER)) {
$result = false;
}
} else {
$result = false;
}
return $result;
}