Index: Classes/Controller/PreviewController.php
===================================================================
--- Classes/Controller/PreviewController.php (revision 4175)
+++ Classes/Controller/PreviewController.php (working copy)
@@ -93,12 +93,15 @@
$viewDomain = t3lib_BEfunc::getViewDomain($this->pageId);
$wsBaseUrl = $viewDomain . '/index.php?id=' . $this->pageId . '&L=' . $language;
- // @todo - handle new pages here
- // branchpoints are not handled anymore because this feature is not supposed anymore
+ // branchpoints are not handled anymore because this feature is not supposed anymore
if (tx_Workspaces_Service_Workspaces::isNewPage($this->pageId)) {
$wsNewPageUri = $uriBuilder->uriFor('newPage', array(), 'Tx_Workspaces_Controller_PreviewController', 'workspaces', 'web_workspacesworkspaces');
$wsNewPageParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Preview';
$this->view->assign('liveUrl', $wsSettingsPath . $wsNewPageUri . $wsNewPageParams);
+ } elseif (tx_Workspaces_Service_Workspaces::isMoveTarget($this->pageId)) {
+ $wsNewPageUri = $uriBuilder->uriFor('moveTarget', array(), 'Tx_Workspaces_Controller_PreviewController', 'workspaces', 'web_workspacesworkspaces');
+ $wsNewPageParams = '&tx_workspaces_web_workspacesworkspaces[controller]=Preview';
+ $this->view->assign('liveUrl', $wsSettingsPath . $wsNewPageUri . $wsNewPageParams);
} else {
$this->view->assign('liveUrl', $wsBaseUrl . '&ADMCMD_noBeUser=1');
}
@@ -133,6 +136,19 @@
}
/**
+ * @return void
+ */
+ public function moveTargetAction() {
+ $message = t3lib_div::makeInstance(
+ 't3lib_FlashMessage',
+ $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:info.movetarget.detail'),
+ $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xml:info.movetarget'),
+ t3lib_FlashMessage::INFO
+ );
+ t3lib_FlashMessageQueue::addMessage($message);
+ }
+
+ /**
* Generates the JavaScript code for the backend,
* and since we're loading a backend module outside of the actual backend
* this copies parts of the backend.php
Index: Classes/Service/Workspaces.php
===================================================================
--- Classes/Service/Workspaces.php (revision 4172)
+++ Classes/Service/Workspaces.php (working copy)
@@ -479,6 +479,25 @@
}
/**
+ * Determine whether a certain page was moved in the current workspace
+ *
+ * @static
+ * @param $id Primary key of the page to check
+ * @return bool
+ */
+ public static function isMoveTarget($id) {
+ $isMoveTarget = FALSE;
+ $whereClause = 't3ver_move_id = ' . intval($id);
+ $whereClause .= ' AND t3ver_wsid = ' . $GLOBALS['BE_USER']->workspace;
+ $whereClause .= t3lib_BEfunc::deleteClause('pages');
+ $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', $whereClause);
+ if (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
+ $isMoveTarget = (int) $row['t3ver_state'] === 3;
+ }
+ return $isMoveTarget;
+ }
+
+ /**
* Generates a view link for a page.
*
* @static
Index: ext_tables.php
===================================================================
--- ext_tables.php (revision 4171)
+++ ext_tables.php (working copy)
@@ -15,7 +15,7 @@
array(
// An array holding the controller-action-combinations that are accessible
'Review' => 'index,fullIndex,singleIndex',
- 'Preview' => 'index,newPage'
+ 'Preview' => 'index,newPage,moveTarget'
),
array(
'access' => 'user,group',
Index: Resources/Private/Language/locallang.xml
===================================================================
--- Resources/Private/Language/locallang.xml (revision 4171)
+++ Resources/Private/Language/locallang.xml (working copy)
@@ -71,6 +71,8 @@
+
+