0) { $pageUid = $this->getLivePageUid($pageUid); } if ($GLOBALS['BE_USER']->workspace !== 0) { $ctrl = t3lib_div::makeInstance('Tx_Workspaces_Controller_PreviewController', FALSE); $uriBuilder = t3lib_div::makeInstance('Tx_Extbase_MVC_Web_Routing_UriBuilder'); /** * This seems to be very harsh to set this directly to "/typo3 but the viewOnClick also * has /index.php as fixed value here and dealing with the backPath is very error-prone * * @todo make sure this would work in local extension installation too */ $backPath = '/' . TYPO3_mainDir; // @todo why do we need these additional params? the URIBuilder should add the controller, but he doesn't :( $additionalParams = '&tx_workspaces_web_workspacesworkspaces%5Bcontroller%5D=Preview&M=web_WorkspacesWorkspaces&id='; $viewScript = $backPath . $uriBuilder->uriFor('index', array(), $ctrl, 'workspaces', 'web_workspacesworkspaces') . $additionalParams; } } /** * Find the Live-Uid for a given page, * the results are cached at run-time to avoid too many database-queries * * @throws InvalidArgumentException * @param $uid * @return void */ protected function getLivePageUid($uid) { if (!isset(self::$pageCache[$uid])) { $rec = t3lib_beFunc::getRecord('pages', $uid); if (is_array($rec)) { self::$pageCache[$uid] = $rec['t3ver_oid'] ? $rec['t3ver_oid'] : $uid; } else { throw new InvalidArgumentException('uid is supposed to point to an existing page - given value was:' . $uid, 1290628113); } } return self::$pageCache[$uid]; } } if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/workspaces/Classes/Service/Befunc.php'])) { include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/workspaces/Classes/Service/Befunc.php']); } ?>