Project

General

Profile

Bug #12855 ยป v1.patch

Tolleiv Nietsch, 2011-02-12 18:58

View differences:

Classes/Controller/ReviewController.php (working copy)
$this->view->assign('workspaceList', $wsList);
$this->view->assign('activeWorkspaceUid', $activeWorkspace);
$this->view->assign('activeWorkspaceTitle', tx_Workspaces_Service_Workspaces::getWorkspaceTitle($activeWorkspace));
$this->view->assign('showPreviewLink', $wsService->canCreatePreviewLink( t3lib_div::_GP('id'), $activeWorkspace));
$GLOBALS['BE_USER']->setAndSaveSessionData('tx_workspace_activeWorkspace', $activeWorkspace);
}
......
$this->view->assign('showAllWorkspaceTab', $GLOBALS['BE_USER']->isAdmin());
$this->view->assign('workspaceList', $wsService->getAvailableWorkspaces());
$this->view->assign('activeWorkspaceUid', tx_Workspaces_Service_Workspaces::SELECT_ALL_WORKSPACES);
$this->view->assign('showPreviewLink', FALSE);
$GLOBALS['BE_USER']->setAndSaveSessionData('tx_workspace_activeWorkspace', tx_Workspaces_Service_Workspaces::SELECT_ALL_WORKSPACES);
// set flag for javascript
$this->pageRenderer->addInlineSetting('Workspaces', 'allView', '1');
Classes/Service/Workspaces.php (working copy)
}
return $viewUrl;
}
/**
* Determine whether this page for the current
*
* @param $pageUid
* @param $workspaceUid
* @return void
*/
public function canCreatePreviewLink($pageUid, $workspaceUid) {
$result = TRUE;
if ($pageUid > 0 && $workspaceUid > 0) {
$pageRecord = t3lib_BEfunc::getRecord('pages', $pageUid);
t3lib_BEfunc::workspaceOL('pages', $pageRecord, $workspaceUid);
if (!t3lib_div::inList($GLOBALS['TYPO3_CONF_VARS']['FE']['content_doktypes'], $pageRecord['doktype'])) {
$result = FALSE;
}
} else {
$result = FALSE;
}
return $result;
}
}
Resources/Private/Layouts/module.html (working copy)
<div id="typo3-docheader">
<div id="typo3-docheader-row1">
<div class="buttonsleft">
<f:if condition="{pageUid} > 0">
<f:if condition="{showPreviewLink}">
<a href="#" onclick="TYPO3.Workspaces.Actions.generateWorkspacePreviewLink();return false;" title="Generate page preview" id="goPreviewLinkButton"><span class="t3-icon t3-icon-extensions t3-icon-extensions-workspaces t3-icon-workspaces-generatepreviewlink">&nbsp;</span>Generate Workspace Preview Link</a>
</f:if>
</div>
    (1-1/1)