+2010-06-10 Susanne Moog <typo3@susanne-moog.de>
+
+ * Added feature #8778: Add possibility to disable TYPO3 draft workspace by localconf.php configuration (Thanks to Sonja Scholz)
+
2010-06-10 Francois Suter <francois@typo3.org>
* Fixed bug #14685: Some status reports classes have wrong XCLASS inclusion (thanks to Peter Niederlag)
*/
function checkWorkspace($wsRec,$fields='uid,title,adminusers,members,reviewers,publish_access,stagechg_notification') {
$retVal = FALSE;
-
+
+ // Show draft workspace only if it's enabled in version extension
+ if (t3lib_extMgm::isLoaded('version')) {
+ $versionExtConf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['version']);
+ if (!$versionExtConf['showDraftWorkspace']) {
+ if (!is_array($wsRec)) {
+ if ((string) $wsRec === '-1') {
+ return FALSE;
+ }
+ } else {
+ if ((string) $wsRec['uid'] === '-1') {
+ return FALSE;
+ }
+ }
+ }
+ }
+
// If not array, look up workspace record:
if (!is_array($wsRec)) {
switch((string)$wsRec) {
var $publishAccess = FALSE;
var $be_user_Array = array();
var $be_user_Array_full = array(); // not blinded, used by workspace listing
+ protected $showDraftWorkspace = FALSE; // Determines whether the draft workspace is shown
/*********************************
function menuConfig() {
global $LANG;
+ // fetches the configuration of the version extension
+ $versionExtconf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['version']);
+ // show draft workspace only if enabled in the version extensions config
+ if($versionExtconf['showDraftWorkspace']) {
+ $this->showDraftWorkspace = TRUE;
+ }
+
// Menu items:
$this->MOD_MENU = array(
'function' => array(
'display' => array(
0 => '['.$LANG->getLL('shortcut_onlineWS').']',
-98 => $LANG->getLL('label_offlineWSes'),
- -99 => $LANG->getLL('label_allWSes'),
- -1 => '['.$LANG->getLL('shortcut_offlineWS').']'
+ -99 => $LANG->getLL('label_allWSes')
),
'diff' => array(
0 => $LANG->getLL('diff_no_diff'),
),
'expandSubElements' => '',
);
-
+
+ if($this->showDraftWorkspace === TRUE) {
+ $this->MOD_MENU['display'][-1] = '[' . $LANG->getLL('shortcut_offlineWS') . ']';
+ }
// Add workspaces:
if ($GLOBALS['BE_USER']->workspace===0) { // Spend time on this only in online workspace because it might take time:
$workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title,adminusers,members,reviewers','sys_workspace','pid=0'.t3lib_BEfunc::deleteClause('sys_workspace'),'','title');
var $be_user_Array = array();
var $stageIndex = array();
var $recIndex = array();
+ protected $showDraftWorkspace = FALSE; // Determines whether to show the dummy draft workspace
*/
function menuConfig() {
+ // fetches the configuration of the version extension
+ $versionExtconf = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['version']);
+ // show draft workspace only if enabled in the version extensions config
+ if($versionExtconf['showDraftWorkspace']) {
+ $this->showDraftWorkspace = TRUE;
+ }
+
// Menu items:
$this->MOD_MENU = array(
'filter' => array(
0 => $GLOBALS['LANG']->getLL('liveWorkspace'),
-98 => $GLOBALS['LANG']->getLL('draftWorkspaces'),
-99 => $GLOBALS['LANG']->getLL('filter_all'),
- -1 => $GLOBALS['LANG']->getLL('defaultDraft')
),
'diff' => ''
);
+
+ if($this->showDraftWorkspace === TRUE) {
+ $this->MOD_MENU['display'][-1] = $GLOBALS['LANG']->getLL('defaultDraft');
+ }
// Add workspaces:
if ($GLOBALS['BE_USER']->workspace===0) { // Spend time on this only in online workspace because it might take time:
*/
function main() {
global $BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
-
+
// Template markers
$markers = array(
'CSH' => '',