本文整理匯總了PHP中t3lib_BEfunc::isPidInVersionizedBranch方法的典型用法代碼示例。如果您正苦於以下問題:PHP t3lib_BEfunc::isPidInVersionizedBranch方法的具體用法?PHP t3lib_BEfunc::isPidInVersionizedBranch怎麽用?PHP t3lib_BEfunc::isPidInVersionizedBranch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類t3lib_BEfunc
的用法示例。
在下文中一共展示了t3lib_BEfunc::isPidInVersionizedBranch方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: workspaceAllowAutoCreation
/**
* Evaluates if auto creation of a version of a record is allowed.
*
* @param string Table of the record
* @param integer UID of record
* @param integer PID of record
* @return boolean TRUE if ok.
*/
function workspaceAllowAutoCreation($table, $id, $recpid)
{
// Auto-creation of version: In offline workspace, test if versioning is enabled and look for workspace version of input record. If there is no versionized record found we will create one and save to that.
if ($this->workspace !== 0 && !$this->workspaceRec['disable_autocreate'] && $GLOBALS['TCA'][$table]['ctrl']['versioningWS'] && $recpid >= 0 && !t3lib_BEfunc::getWorkspaceVersionOfRecord($this->workspace, $table, $id, 'uid') && !t3lib_BEfunc::isPidInVersionizedBranch($recpid, $table)) {
// PID must NOT be in a versionized branch either
return TRUE;
}
}
示例2: getVersionSelector
/**
* Creates the version selector for the page id inputted.
* Requires the core version management extension, "version" to be loaded.
*
* @param integer Page id to create selector for.
* @param boolean If set, there will be no button for swapping page.
* @return void
*/
function getVersionSelector($id, $noAction = FALSE)
{
if ($id > 0) {
if (t3lib_extMgm::isLoaded('version') && $GLOBALS['BE_USER']->workspace == 0) {
// Get Current page record:
$curPage = t3lib_BEfunc::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 = t3lib_BEfunc::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.xml: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.xml:versionSelect.live', TRUE) . ']';
} else {
$label = $vRow['t3ver_label'] . ' (' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xml:versionId', TRUE) . ' ' . $vRow['t3ver_id'] . ($vRow['t3ver_wsid'] != 0 ? ' ' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xml:workspaceId', TRUE) . ' ' . $vRow['t3ver_wsid'] : '') . ')';
}
$opt[] = '<option value="' . htmlspecialchars(t3lib_div::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.php:ver.mgm', TRUE) . '" onclick="window.location.href=\'' . htmlspecialchars($this->backPath . t3lib_extMgm::extRelPath('version') . 'cm1/index.php?table=pages&uid=' . $onlineId) . '\';" />';
// Create onchange handler:
$onChange = "window.location.href=this.options[this.selectedIndex].value;";
// Controls:
if ($id == $onlineId) {
$controls .= '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/blinkarrow_left.gif', 'width="5" height="9"') . ' class="absmiddle" alt="" /> <strong>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:ver.online', TRUE) . '</strong>';
} elseif (!$noAction) {
$controls .= '<a href="' . $this->issueCommand('&cmd[pages][' . $onlineId . '][version][swapWith]=' . $id . '&cmd[pages][' . $onlineId . '][version][action]=swap', t3lib_div::linkThisScript(array('id' => $onlineId))) . '" class="nobr">' . t3lib_iconWorks::getSpriteIcon('actions-version-swap-version', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:ver.swapPage', TRUE), 'style' => 'margin-left:5px;vertical-align:bottom;')) . '<strong>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php: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>
';
}
} elseif ($GLOBALS['BE_USER']->workspace !== 0) {
// Write out HTML code:
switch ($GLOBALS['BE_USER']->workspace) {
case 0:
$wsTitle = $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xml:live', TRUE);
break;
case -1:
$wsTitle = $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xml:draft', TRUE);
break;
default:
$wsTitle = $GLOBALS['BE_USER']->workspaceRec['title'];
break;
}
if (t3lib_BEfunc::isPidInVersionizedBranch($id) == 'branchpoint') {
return '
<!--
Version selector:
-->
<table border="0" cellpadding="0" cellspacing="0" id="typo3-versionSelector">
<tr>
<td>' . $selectorLabel . '</td>
<td>Workspace: "' . htmlspecialchars($wsTitle) . '"</td>
<td><em>' . $GLOBALS['LANG']->sL('LLL:EXT:version/locallang.xml:versionSelect.inBranch', TRUE) . '</em></td>
</tr>
</table>
';
} else {
// Get Current page record:
$curPage = t3lib_BEfunc::getRecord('pages', $id);
// If the selected page is not online, find the right ID
$onlineId = $curPage['pid'] == -1 ? $curPage['t3ver_oid'] : $id;
// The version of page:
$verPage = t3lib_BEfunc::getWorkspaceVersionOfRecord($GLOBALS['BE_USER']->workspace, 'pages', $onlineId);
if (!$verPage) {
if (!count(t3lib_BEfunc::countVersionsOfRecordsOnPage($GLOBALS['BE_USER']->workspace, $onlineId))) {
if ($GLOBALS['BE_USER']->workspaceVersioningTypeAccess(0)) {
$onClick = $this->issueCommand('&cmd[pages][' . $onlineId . '][version][action]=new&cmd[pages][' . $onlineId . '][version][treeLevels]=0', t3lib_div::linkThisScript(array('id' => $onlineId)));
$onClick = 'window.location.href=\'' . $onClick . '\'; return false;';
//.........這裏部分代碼省略.........
示例3: generateUrls
/**
* URLs generated in $this->URL array
*
* @return void
*/
function generateUrls()
{
// Live URL:
$pageId = intval(t3lib_div::_GP('id'));
$language = intval(t3lib_div::_GP('L'));
$this->URL = array('liveHeader' => 'wsol_preview.php?header=live', 'draftHeader' => 'wsol_preview.php?header=draft', 'live' => t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'index.php?id=' . $pageId . '&L=' . $language . '&ADMCMD_noBeUser=1', 'draft' => t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'index.php?id=' . $pageId . '&L=' . $language . '&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS=' . $this->workspace, 'versionMod' => '../../../sysext/version/cm1/index.php?id=' . intval(t3lib_div::_GP('id')) . '&diffOnly=1');
if ($this->isBeLogin()) {
// Branchpoint; display error message then:
if (t3lib_BEfunc::isPidInVersionizedBranch($pageId) == 'branchpoint') {
$this->URL['live'] = 'wsol_preview.php?msg=branchpoint';
}
$rec = t3lib_BEfunc::getRecord('pages', $pageId, 't3ver_state');
if ((int) $rec['t3ver_state'] === 1) {
$this->URL['live'] = 'wsol_preview.php?msg=newpage';
}
}
}