Added feature #11828: There's no possibility to hide versioning and workspaces.
authorRupert Germann <rupi@gmx.li>
Thu, 3 Sep 2009 17:20:03 +0000 (17:20 +0000)
committerRupert Germann <rupi@gmx.li>
Thu, 3 Sep 2009 17:20:03 +0000 (17:20 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5886 709f56b5-9817-0410-a4d7-c38de5d9e867

12 files changed:
ChangeLog
t3lib/class.t3lib_befunc.php
t3lib/class.t3lib_loadmodules.php
t3lib/config_default.php
t3lib/stddb/tables.php
t3lib/stddb/tbl_be.php
typo3/classes/class.workspaceselector.php
typo3/db_list.php
typo3/sysext/install/ext_localconf.php
typo3/sysext/install/mod/class.tx_install.php
typo3/sysext/install/updates/class.tx_coreupdates_installversioning.php [new file with mode: 0644]
typo3/sysext/version/ext_tables.php

index e8bff1d..c0ef3ec 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2009-09-03  Rupert Germann  <rupi@gmx.li>
 
-       * Added feature #0011773: Integrate an option to deactivate shortcuts completely  (thanks to Christopher Stelmaszyk)
+       * Added feature #11773: Integrate an option to deactivate shortcuts completely  (thanks to Christopher Stelmaszyk)
+       * Added feature #11828: There's no possibility to hide versioning and workspaces.
 
 2009-09-03  Stanislas Rolland  <typo3@sjbr.ca>
 
index 333daea..9e967cf 100644 (file)
@@ -3604,27 +3604,29 @@ final class t3lib_BEfunc {
        public static function fixVersioningPid($table, &$rr, $ignoreWorkspaceMatch = FALSE) {
                global $TCA;
 
-                       // Check that the input record is an offline version from a table that supports versioning:
-               if (is_array($rr) && $rr['pid']==-1 && $TCA[$table]['ctrl']['versioningWS'])    {
-
-                               // Check values for t3ver_oid and t3ver_wsid:
-                       if (isset($rr['t3ver_oid']) && isset($rr['t3ver_wsid']))        {       // If "t3ver_oid" is already a field, just set this:
-                               $oid = $rr['t3ver_oid'];
-                               $wsid = $rr['t3ver_wsid'];
-                       } else {        // Otherwise we have to expect "uid" to be in the record and look up based on this:
-                               $newPidRec = t3lib_BEfunc::getRecord($table, $rr['uid'], 't3ver_oid,t3ver_wsid');
-                               if (is_array($newPidRec)) {
-                                       $oid = $newPidRec['t3ver_oid'];
-                                       $wsid = $newPidRec['t3ver_wsid'];
+               if (t3lib_extMgm::isLoaded('version')) {
+                               // Check that the input record is an offline version from a table that supports versioning:
+                       if (is_array($rr) && $rr['pid'] == -1 && $TCA[$table]['ctrl']['versioningWS']) {
+
+                                       // Check values for t3ver_oid and t3ver_wsid:
+                               if (isset($rr['t3ver_oid']) && isset($rr['t3ver_wsid'])) {      // If "t3ver_oid" is already a field, just set this:
+                                       $oid = $rr['t3ver_oid'];
+                                       $wsid = $rr['t3ver_wsid'];
+                               } else {        // Otherwise we have to expect "uid" to be in the record and look up based on this:
+                                       $newPidRec = t3lib_BEfunc::getRecord($table, $rr['uid'], 't3ver_oid,t3ver_wsid');
+                                       if (is_array($newPidRec)) {
+                                               $oid = $newPidRec['t3ver_oid'];
+                                               $wsid = $newPidRec['t3ver_wsid'];
+                                       }
                                }
-                       }
 
-                               // If ID of current online version is found, look up the PID value of that:
-                       if ($oid && ($ignoreWorkspaceMatch || !strcmp((int)$wsid, $GLOBALS['BE_USER']->workspace))) {
-                               $oidRec = t3lib_BEfunc::getRecord($table, $oid, 'pid');
-                               if (is_array($oidRec)) {
-                                       $rr['_ORIG_pid'] = $rr['pid'];
-                                       $rr['pid'] = $oidRec['pid'];
+                                       // If ID of current online version is found, look up the PID value of that:
+                               if ($oid && ($ignoreWorkspaceMatch || !strcmp((int)$wsid, $GLOBALS['BE_USER']->workspace))) {
+                                       $oidRec = t3lib_BEfunc::getRecord($table, $oid, 'pid');
+                                       if (is_array($oidRec)) {
+                                               $rr['_ORIG_pid'] = $rr['pid'];
+                                               $rr['pid'] = $oidRec['pid'];
+                                       }
                                }
                        }
                }
@@ -3644,76 +3646,78 @@ final class t3lib_BEfunc {
         */
        public static function workspaceOL($table, &$row, $wsid = -99, $unsetMovePointers = FALSE) {
                global $TCA;
+               if (t3lib_extMgm::isLoaded('version')) {
 
-               $previewMovePlaceholders = TRUE;                // If this is false the placeholder is shown raw in the backend. I don't know if this move can be useful for users to toggle. Technically it can help debugging...
+                       $previewMovePlaceholders = TRUE;                // If this is false the placeholder is shown raw in the backend. I don't know if this move can be useful for users to toggle. Technically it can help debugging...
 
-                       // Initialize workspace ID:
-               if ($wsid == -99)       $wsid = $GLOBALS['BE_USER']->workspace;
+                               // Initialize workspace ID:
+                       if ($wsid == -99)       $wsid = $GLOBALS['BE_USER']->workspace;
 
-                       // Check if workspace is different from zero and record is set:
-               if ($wsid!==0 && is_array($row))        {
+                               // Check if workspace is different from zero and record is set:
+                       if ($wsid !== 0 && is_array($row)) {
 
-                               // Check if input record is a move-placeholder and if so, find the pointed-to live record:
-                       if ($previewMovePlaceholders) {
-                               $orig_uid = $row['uid'];
-                               $orig_pid = $row['pid'];
-                               $movePldSwap = t3lib_BEfunc::movePlhOL($table, $row);
-       #                       if (!is_array($row)) return;
-                       }
+                                       // Check if input record is a move-placeholder and if so, find the pointed-to live record:
+                               if ($previewMovePlaceholders) {
+                                       $orig_uid = $row['uid'];
+                                       $orig_pid = $row['pid'];
+                                       $movePldSwap = t3lib_BEfunc::movePlhOL($table, $row);
+               #                       if (!is_array($row)) return;
+                               }
 
-                       $wsAlt = t3lib_BEfunc::getWorkspaceVersionOfRecord($wsid, $table, $row['uid'], implode(',', array_keys($row)));
+                               $wsAlt = t3lib_BEfunc::getWorkspaceVersionOfRecord($wsid, $table, $row['uid'], implode(',', array_keys($row)));
 
-                               // If version was found, swap the default record with that one.
-                       if (is_array($wsAlt))   {
+                                       // If version was found, swap the default record with that one.
+                               if (is_array($wsAlt)) {
 
-                                       // Check if this is in move-state:
-                               if ($previewMovePlaceholders && !$movePldSwap && ($table=='pages' || (int)$TCA[$table]['ctrl']['versioningWS']>=2) && $unsetMovePointers)       {       // Only for WS ver 2... (moving)
+                                               // Check if this is in move-state:
+                                       if ($previewMovePlaceholders && !$movePldSwap && ($table=='pages' || (int)$TCA[$table]['ctrl']['versioningWS']>=2) && $unsetMovePointers) {     // Only for WS ver 2... (moving)
 
-                                               // If t3ver_state is not found, then find it... (but we like best if it is here...)
-                                       if (!isset($wsAlt['t3ver_state'])) {
-                                               $stateRec = t3lib_BEfunc::getRecord($table, $wsAlt['uid'], 't3ver_state');
-                                               $state = $stateRec['t3ver_state'];
-                                       } else {
-                                               $state = $wsAlt['t3ver_state'];
+                                                       // If t3ver_state is not found, then find it... (but we like best if it is here...)
+                                               if (!isset($wsAlt['t3ver_state'])) {
+                                                       $stateRec = t3lib_BEfunc::getRecord($table, $wsAlt['uid'], 't3ver_state');
+                                                       $state = $stateRec['t3ver_state'];
+                                               } else {
+                                                       $state = $wsAlt['t3ver_state'];
+                                               }
+                                               if ((int)$state===4) {
+                                                               // TODO: Same problem as frontend in versionOL(). See TODO point there.
+                                                       $row = FALSE;
+                                                       return;
+                                               }
                                        }
-                                       if ((int)$state===4) {
-                                                       // TODO: Same problem as frontend in versionOL(). See TODO point there.
-                                               $row = FALSE;
-                                               return;
+
+                                               // Always correct PID from -1 to what it should be:
+                                       if (isset($wsAlt['pid'])) {
+                                               $wsAlt['_ORIG_pid'] = $wsAlt['pid'];    // Keep the old (-1) - indicates it was a version...
+                                               $wsAlt['pid'] = $row['pid'];            // Set in the online versions PID.
                                        }
-                               }
 
-                                       // Always correct PID from -1 to what it should be:
-                               if (isset($wsAlt['pid'])) {
-                                       $wsAlt['_ORIG_pid'] = $wsAlt['pid'];    // Keep the old (-1) - indicates it was a version...
-                                       $wsAlt['pid'] = $row['pid'];            // Set in the online versions PID.
-                               }
+                                               // For versions of single elements or page+content, swap UID and PID:
+                                       if ($table!=='pages' || $wsAlt['t3ver_swapmode']<=0) {
+                                               $wsAlt['_ORIG_uid'] = $wsAlt['uid'];
+                                               $wsAlt['uid'] = $row['uid'];
 
-                                       // For versions of single elements or page+content, swap UID and PID:
-                               if ($table!=='pages' || $wsAlt['t3ver_swapmode']<=0) {
-                                       $wsAlt['_ORIG_uid'] = $wsAlt['uid'];
-                                       $wsAlt['uid'] = $row['uid'];
+                                                       // Backend css class:
+                                               $wsAlt['_CSSCLASS'] = $table==='pages' && $wsAlt['t3ver_swapmode']==0 ? 'ver-page' : 'ver-element';
+                                       } else {        // This is only for page-versions with BRANCH below!
+                                               $wsAlt['_ONLINE_uid'] = $row['uid'];
 
-                                               // Backend css class:
-                                       $wsAlt['_CSSCLASS'] = $table==='pages' && $wsAlt['t3ver_swapmode']==0 ? 'ver-page' : 'ver-element';
-                               } else {        // This is only for page-versions with BRANCH below!
-                                       $wsAlt['_ONLINE_uid'] = $row['uid'];
+                                                       // Backend css class:
+                                               $wsAlt['_CSSCLASS'] = 'ver-branchpoint';
+                                               $wsAlt['_SUBCSSCLASS'] = 'ver-branch';
+                                       }
 
-                                               // Backend css class:
-                                       $wsAlt['_CSSCLASS'] = 'ver-branchpoint';
-                                       $wsAlt['_SUBCSSCLASS'] = 'ver-branch';
+                                               // Changing input record to the workspace version alternative:
+                                       $row = $wsAlt;
                                }
 
-                                       // Changing input record to the workspace version alternative:
-                               $row = $wsAlt;
-                       }
-
-                               // If the original record was a move placeholder, the uid and pid of that is preserved here:
-                       if ($movePldSwap) {
-                               $row['_MOVE_PLH'] = TRUE;
-                               $row['_MOVE_PLH_uid'] = $orig_uid;
-                               $row['_MOVE_PLH_pid'] = $orig_pid;
-                               $row['t3ver_state'] = 3;        // For display; To make the icon right for the placeholder vs. the original
+                                       // If the original record was a move placeholder, the uid and pid of that is preserved here:
+                               if ($movePldSwap) {
+                                       $row['_MOVE_PLH'] = TRUE;
+                                       $row['_MOVE_PLH_uid'] = $orig_uid;
+                                       $row['_MOVE_PLH_pid'] = $orig_pid;
+                                       $row['t3ver_state'] = 3;        // For display; To make the icon right for the placeholder vs. the original
+                               }
                        }
                }
        }
@@ -3764,21 +3768,22 @@ final class t3lib_BEfunc {
        public static function getWorkspaceVersionOfRecord($workspace, $table, $uid, $fields = '*') {
                global $TCA;
 
-               if ($workspace!==0 && $TCA[$table] && $TCA[$table]['ctrl']['versioningWS'])     {
+               if (t3lib_extMgm::isLoaded('version')) {
+                       if ($workspace !== 0 && $TCA[$table] && $TCA[$table]['ctrl']['versioningWS']) {
 
-                               // Select workspace version of record:
-                       $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
-                               $fields,
-                               $table,
-                               'pid=-1 AND
-                                t3ver_oid='.intval($uid).' AND
-                                t3ver_wsid='.intval($workspace).
-                                       t3lib_BEfunc::deleteClause($table)
-                       );
+                                       // Select workspace version of record:
+                               $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                                       $fields,
+                                       $table,
+                                       'pid=-1 AND
+                                        t3ver_oid=' . intval($uid) . ' AND
+                                        t3ver_wsid=' . intval($workspace) .
+                                               t3lib_BEfunc::deleteClause($table)
+                               );
 
-                       if (is_array($rows[0])) return $rows[0];
+                               if (is_array($rows[0])) return $rows[0];
+                       }
                }
-
                return FALSE;
        }
 
index 032ad77..e45862c 100644 (file)
@@ -384,6 +384,10 @@ class t3lib_loadModules {
         * @return      mixed           See description of function
         */
        function checkMod($name, $fullpath)     {
+               if ($name == 'user_ws' && !t3lib_extMgm::isLoaded('version')) {
+                       return FALSE;
+               }
+
                        // Check for own way of configuring module
                if (is_array($GLOBALS['TBE_MODULES'][$name]['configureModuleFunction'])) {
                        $obj = $GLOBALS['TBE_MODULES'][$name]['configureModuleFunction'];
index 77f47da..e56e8eb 100644 (file)
@@ -161,10 +161,10 @@ $TYPO3_CONF_VARS = Array(
                'em_wsdlURL' => 'http://typo3.org/wsdl/tx_ter_wsdl.php',                                // The SOAP URL for uploading extensions to the TER2. Usually doesn't need to be changed.
                'em_mirrorListURL' => 'http://repositories.typo3.org/mirrors.xml.gz',                           // Allows to preset the URL for fetching the extension repository mirror list from. Used in the Extension Manager.
 
-               'requiredExt' => 'cms,version,lang,sv', // String list: List of extensions which are REQUIRED and cannot be unloaded by the Extension Manager!
+               'requiredExt' => 'cms,lang,sv', // String list: List of extensions which are REQUIRED and cannot be unloaded by the Extension Manager!
                'excludeForPackaging' => '(CVS|\..*|.*~|.*\.bak)',              // String list: List of directories and files which will not be packaged into extensions nor taken into account otherwise by the Extension Manager. Perl regular expression syntax!
                'extCache' => 1,                                                // Int. 0,1,2,3: 0: ext-scripts (ext_localconf.php and ext_tables.php) are NOT cached, but included every time. 1: scripts cached to typo3conf/temp_CACHED_[sitePathHash]* (saves some milliseconds even with PHP accelerators), 2: scripts cached and prefix includes a hash based on the 'extList' string, 3: scripts cached to typo3conf/temp_CACHED_* (no hash included at all...)
-               'extList' => 'tsconfig_help,context_help,extra_page_cm_options,impexp,belog,about,cshmanual,aboutmodules,setup,opendocs,install,t3editor,felogin,feedit,recycler',                                              // String list: List of extensions which are enabled for this install. Use the Extension Manager (EM) to manage this!
+               'extList' => 'version,tsconfig_help,context_help,extra_page_cm_options,impexp,belog,about,cshmanual,aboutmodules,setup,opendocs,install,t3editor,felogin,feedit,recycler',                                              // String list: List of extensions which are enabled for this install. Use the Extension Manager (EM) to manage this!
                'extConf' => array(                                             // Config-options for extensions, stored as serialized arrays by extension-keys. Handled automatically by the EM.
 //                     '--key--' => array()
                ),
index b372236..4d2d341 100644 (file)
@@ -346,25 +346,6 @@ $TCA['sys_filemounts'] = array(
        )
 );
 
-/**
- * Table "sys_filemounts":
- * Defines filepaths on the server which can be mounted for users so they can upload and manage files online by eg. the Filelist module
- * This is only the 'header' part (ctrl). The full configuration is found in t3lib/stddb/tbl_be.php
- */
-$TCA['sys_workspace'] = array(
-       'ctrl' => array(
-               'label' => 'title',
-               'tstamp' => 'tstamp',
-               'title' => 'LLL:EXT:lang/locallang_tca.php:sys_workspace',
-               'adminOnly' => 1,
-               'rootLevel' => 1,
-               'delete' => 'deleted',
-               'iconfile' => 'sys_workspace.png',
-               'dynamicConfigFile' => 'T3LIB:tbl_be.php',
-               'versioningWS_alwaysAllowLiveEdit' => true,
-               'dividers2tabs' => true
-       )
-);
 
 /**
  * Table "sys_languages":
index 9f9c04d..adc45bf 100644 (file)
@@ -745,200 +745,6 @@ $TCA['sys_filemounts'] = array(
 
 
 
-/**
- * System workspaces - Defines the offline workspaces available to users in TYPO3.
- */
-$TCA['sys_workspace'] = array(
-       'ctrl' => $TCA['sys_workspace']['ctrl'],
-       'columns' => array(
-               'title' => array(
-                       'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.title',
-                       'config' => array(
-                               'type' => 'input',
-                               'size' => '20',
-                               'max' => '30',
-                               'eval' => 'required,trim,unique'
-                       )
-               ),
-               'description' => array(
-                       'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.description',
-                       'config' => array(
-                               'type' => 'text',
-                               'rows' => 5,
-                               'cols' => 30
-                       )
-               ),
-               'adminusers' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.adminusers',
-                       'config' => array(
-                               'type' => 'group',
-                               'internal_type' => 'db',
-                               'allowed' => 'be_users',
-                               'size' => '3',
-                               'maxitems' => '10',
-                               'autoSizeMax' => 10,
-                               'show_thumbs' => '1'
-                       )
-               ),
-               'members' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.members',
-                       'config' => array(
-                               'type' => 'group',
-                               'internal_type' => 'db',
-                               'allowed' => 'be_users,be_groups',
-                               'prepend_tname' => 1,
-                               'size' => '3',
-                               'maxitems' => '100',
-                               'autoSizeMax' => 10,
-                               'show_thumbs' => '1'
-                       )
-               ),
-               'reviewers' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.reviewers',
-                       'config' => array(
-                               'type' => 'group',
-                               'internal_type' => 'db',
-                               'allowed' => 'be_users,be_groups',
-                               'prepend_tname' => 1,
-                               'size' => '3',
-                               'maxitems' => '100',
-                               'autoSizeMax' => 10,
-                               'show_thumbs' => '1'
-                       )
-               ),
-               'db_mountpoints' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:db_mountpoints',
-                       'config' => array(
-                               'type' => 'group',
-                               'internal_type' => 'db',
-                                       'allowed' => 'pages',
-                               'size' => '3',
-                               'maxitems' => '10',
-                               'autoSizeMax' => 10,
-                               'show_thumbs' => '1'
-                       )
-               ),
-               'file_mountpoints' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:file_mountpoints',
-                       'config' => array(
-                               'type' => 'select',
-                               'foreign_table' => 'sys_filemounts',
-                               'foreign_table_where' => ' AND sys_filemounts.pid=0 ORDER BY sys_filemounts.title',
-                               'size' => '3',
-                               'maxitems' => '10',
-                               'autoSizeMax' => 10,
-                               'renderMode' => $GLOBALS['TYPO3_CONF_VARS']['BE']['accessListRenderMode'],
-                               'iconsInOptionTags' => 1,
-                       )
-               ),
-               'publish_time' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.publish_time',
-                       'config' => array(
-                               'type' => 'input',
-                               'size' => '8',
-                               'max' => '20',
-                               'eval' => 'datetime',
-                               'default' => '0',
-                               'checkbox' => '0'
-                       )
-               ),
-               'unpublish_time' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.unpublish_time',
-                       'config' => array(
-                               'type' => 'input',
-                               'size' => '8',
-                               'max' => '20',
-                               'eval' => 'datetime',
-                               'checkbox' => '0',
-                               'default' => '0',
-                               'range' => array(
-                                       'upper' => mktime(0,0,0,12,31,2020),
-                               )
-                       )
-               ),
-               'freeze' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.freeze',
-                       'config' => array(
-                               'type' => 'check',
-                               'default' => '0'
-                       )
-               ),
-               'live_edit' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.live_edit',
-                       'config' => array(
-                               'type' => 'check',
-                               'default' => '0'
-                       )
-               ),
-               'review_stage_edit' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.review_stage_edit',
-                       'config' => array(
-                               'type' => 'check',
-                               'default' => '0'
-                       )
-               ),
-               'disable_autocreate' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.disable_autocreate',
-                       'config' => array(
-                               'type' => 'check',
-                               'default' => '0'
-                       )
-               ),
-               'swap_modes' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.swap_modes',
-                       'config' => array(
-                               'type' => 'select',
-                               'items' => array(
-                                       array('', 0),
-                                       array('Swap-Into-Workspace on Auto-publish', 1),
-                                       array('Disable Swap-Into-Workspace', 2)
-                               ),
-                       )
-               ),
-               'vtypes' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.vtypes',
-                       'config' => array(
-                               'type' => 'check',
-                               'items' => array(
-                                       array('Element', 0),
-                                       array('Page', 0),
-                                       array('Branch', 0)
-                               ),
-                       )
-               ),
-               'publish_access' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.publish_access',
-                       'config' => array(
-                               'type' => 'check',
-                               'items' => array(
-                                       array('Publish only content in publish stage', 0),
-                                       array('Only workspace owner can publish', 0),
-                               ),
-                       )
-               ),
-               'stagechg_notification' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.stagechg_notification',
-                       'config' => array(
-                               'type' => 'select',
-                               'items' => array(
-                                       array('', 0),
-                                       array('Notify users on next stage only', 1),
-                                       array('Notify all users on any change', 10)
-                               ),
-                       )
-               ),
-       ),
-       'types' => array(
-               '0' => array('showitem' => 'title,description,
-                       --div--;LLL:EXT:lang/locallang_tca.xml:sys_filemounts.tabs.users,adminusers,members,reviewers,stagechg_notification,
-                       --div--;LLL:EXT:lang/locallang_tca.xml:sys_filemounts.tabs.mountpoints,db_mountpoints,file_mountpoints,
-                       --div--;LLL:EXT:lang/locallang_tca.xml:sys_filemounts.tabs.publishing,publish_time,unpublish_time,
-                       --div--;LLL:EXT:lang/locallang_tca.xml:sys_filemounts.tabs.other,freeze,live_edit,review_stage_edit,disable_autocreate,swap_modes,vtypes,publish_access'
-               )
-       )
-);
-
-
 
 /**
  * System languages - Defines possible languages used for translation of records in the system
index 5952928..062fb8f 100644 (file)
@@ -68,10 +68,13 @@ class WorkspaceSelector implements backend_toolbarItem {
         * @return  boolean  true if user has access, false if not
         */
        public function checkAccess() {
-               $MCONF = array();
-               include('mod/user/ws/conf.php');
+               if (t3lib_extMgm::isLoaded('version')) {
+                       $MCONF = array();
+                       include('mod/user/ws/conf.php');
 
-               return ($GLOBALS['BE_USER']->modAccess(array('name' => 'user', 'access' => 'user,group'), false) && $GLOBALS['BE_USER']->modAccess($MCONF, false));
+                       return ($GLOBALS['BE_USER']->modAccess(array('name' => 'user', 'access' => 'user,group'), false) && $GLOBALS['BE_USER']->modAccess($MCONF, false));
+               }
+               return FALSE;
        }
 
        /**
index 04f3370..58282da 100644 (file)
@@ -285,7 +285,9 @@ class SC_db_list {
                        $dblist->setDispFields();
 
                                // Render versioning selector:
-                       $dblist->HTMLcode.= $this->doc->getVersionSelector($this->id);
+                       if (t3lib_extMgm::isLoaded('version')) {
+                               $dblist->HTMLcode .= $this->doc->getVersionSelector($this->id);
+                       }
 
                                // Render the list of tables:
                        $dblist->generateList();
index f9c9bc7..a5bd1b7 100644 (file)
@@ -22,4 +22,8 @@ $TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['changeImagecolsValue']
 
        // register eID script for install tool AJAX calls
 $TYPO3_CONF_VARS['FE']['eID_include']['tx_install_ajax'] = 'EXT:install/mod/class.tx_install_ajax.php';
+
+       // install versioning since TYPO3 4.3
+$TYPO3_CONF_VARS['SC_OPTIONS']['ext/install']['update']['installVersioning'] = 'tx_coreupdates_installversioning';
+
 ?>
index e71be22..a3c769a 100755 (executable)
@@ -149,6 +149,7 @@ require_once(t3lib_extMgm::extPath('install').'updates/class.tx_coreupdates_noti
 require_once(t3lib_extMgm::extPath('install').'updates/class.tx_coreupdates_mergeadvanced.php');
 require_once(t3lib_extMgm::extPath('install').'updates/class.tx_coreupdates_installsysexts.php');
 require_once(t3lib_extMgm::extPath('install').'updates/class.tx_coreupdates_imagescols.php');
+require_once(t3lib_extMgm::extPath('install').'updates/class.tx_coreupdates_installversioning.php');
 
 /**
  * Install Tool module
diff --git a/typo3/sysext/install/updates/class.tx_coreupdates_installversioning.php b/typo3/sysext/install/updates/class.tx_coreupdates_installversioning.php
new file mode 100644 (file)
index 0000000..c14eb83
--- /dev/null
@@ -0,0 +1,164 @@
+<?php
+/***************************************************************
+*  Copyright notice
+*
+*  (c) 2008-2009 Benjamin Mack <benni@typo3.org>
+*  (c) 2008-2009 Steffen Kamper <info@sk-typo3.de>
+*  All rights reserved
+*
+*  This script is part of the TYPO3 project. The TYPO3 project is
+*  free software; you can redistribute it and/or modify
+*  it under the terms of the GNU General Public License as published by
+*  the Free Software Foundation; either version 2 of the License, or
+*  (at your option) any later version.
+*
+*  The GNU General Public License can be found at
+*  http://www.gnu.org/copyleft/gpl.html.
+*  A copy is found in the textfile GPL.txt and important notices to the license
+*  from the author is found in LICENSE.txt distributed with these scripts.
+*
+*
+*  This script is distributed in the hope that it will be useful,
+*  but WITHOUT ANY WARRANTY; without even the implied warranty of
+*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+*  GNU General Public License for more details.
+*
+*  This copyright notice MUST APPEAR in all copies of the script!
+***************************************************************/
+
+/**
+ * Contains the update class for adding the system extension "simulate static".
+ *
+ * $Id$
+ *
+ * @author  Rupert Germann
+ */
+class tx_coreupdates_installversioning {
+       public $versionNumber;  // version number coming from t3lib_div::int_from_ver()
+       protected $newSystemExtensions = array('version');
+
+       /**
+        * parent object
+        *
+        * @var tx_install
+        */
+       public $pObj;
+       public $userInput;      // user input
+
+
+       /**
+        * Checks if an update is needed
+        *
+        * @param       string          &$description: The description for the update
+        * @return      boolean         whether an update is needed (true) or not (false)
+        */
+       public function checkForUpdate(&$description) {
+               $result = false;
+               $description = '<strong>The extension "version" is not loaded.</strong>
+               Since TYPO3 4.3 the extension "version" is no longer required. Therefore it is not enabled by default if you update an existing TYPO3 installation.
+               If you use versioning and workspaces in your installation you might install the extension "version" directly from here - in case you don\'t need versioning and workspaces leave "version" disabled because it needs quite a lot performance.
+
+               <strong>Enable versioning and workspaces</strong>
+               Install extension "version"';
+
+               foreach($this->newSystemExtensions as $ext) {
+                       if (!t3lib_extMgm::isLoaded($ext)) {
+                               $result = true;
+                       }
+               }
+               return $result;
+       }
+
+       /**
+        * second step: get user input for installing sysextensions
+        *
+        * @param       string          input prefix, all names of form fields have to start with this. Append custom name in [ ... ]
+        * @return      string          HTML output
+        */
+       public function getUserInput($inputPrefix) {
+               $content = '
+               Enable versioning and workspaces:
+
+               <input type="checkbox" id="version" name="' . $inputPrefix . '[sysext][version]" value="1" checked="checked" /><label for="version">Install versioning extension [version]</label><br />
+
+               ';
+
+               return $content;
+       }
+
+       /**
+        * Adds the extensions "about", "cshmanual" and "simulatestatic" to the extList in TYPO3_CONF_VARS
+        *
+        * @param       array           &$dbQueries: queries done in this update
+        * @param       mixed           &$customMessages: custom messages
+        * @return      boolean         whether it worked (true) or not (false)
+        */
+       public function performUpdate($dbQueries, $customMessages) {
+               $result = false;
+
+                       // Get extension keys that were submitted by the used to be installed and that are valid for this update wizard:
+               if (is_array($this->pObj->INSTALL['update']['installVersioning']['sysext'])) {
+                       $extArray = array_intersect(
+                               $this->newSystemExtensions,
+                               array_keys($this->pObj->INSTALL['update']['installVersioning']['sysext'])
+                       );
+
+                       $extList = $this->addExtToList($extArray);
+
+                       if ($extList) {
+                               $this->writeNewExtensionList($extList);
+                               $result = true;
+                       }
+               }
+
+               return $result;
+       }
+
+
+       /**
+        * Adds extension to extension list and returns new list. If -1 is returned, an error happend.
+        * Does NOT check dependencies yet.
+        *
+        * @param       array           Extension keys to add
+        * @return      string          New list of installed extensions or -1 if error
+        */
+       function addExtToList(array $extKeys) {
+                       // Get list of installed extensions and add this one.
+               $tmpLoadedExt = $GLOBALS['TYPO3_LOADED_EXT'];
+               if (isset($tmpLoadedExt['_CACHEFILE'])) {
+                       unset($tmpLoadedExt['_CACHEFILE']);
+               }
+
+               $listArr = array_keys($tmpLoadedExt);
+               $listArr = array_merge($listArr, $extKeys);
+
+                       // Implode unique list of extensions to load and return:
+               return implode(',', array_unique($listArr));
+       }
+
+
+       /**
+        * Writes the extension list to "localconf.php" file
+        * Removes the temp_CACHED* files before return.
+        *
+        * @param       string          List of extensions
+        * @return      void
+        */
+       protected function writeNewExtensionList($newExtList)   {
+
+
+                       // Instance of install tool
+               $instObj = new t3lib_install;
+               $instObj->allowUpdateLocalConf = 1;
+               $instObj->updateIdentity = 'TYPO3 Core Update Manager';
+
+                       // Get lines from localconf file
+               $lines = $instObj->writeToLocalconf_control();
+               $instObj->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'EXT\'][\'extList\']', $newExtList);
+               $instObj->writeToLocalconf_control($lines);
+
+               $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'] = $newExtList;
+               t3lib_extMgm::removeCacheFiles();
+       }
+}
+?>
\ No newline at end of file
index 82a6d21..6c30d27 100755 (executable)
@@ -9,4 +9,27 @@ if (TYPO3_MODE=='BE')  {
 
        t3lib_extMgm::addModule('web','txversionM1','',t3lib_extMgm::extPath($_EXTKEY).'cm1/');
 }
+
+
+
+
+/**
+ * Table "sys_workspace":
+ */
+$TCA['sys_workspace'] = array(
+       'ctrl' => array(
+               'label' => 'title',
+               'tstamp' => 'tstamp',
+               'title' => 'LLL:EXT:lang/locallang_tca.php:sys_workspace',
+               'adminOnly' => 1,
+               'rootLevel' => 1,
+               'delete' => 'deleted',
+               'iconfile' => 'sys_workspace.png',
+               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
+               'versioningWS_alwaysAllowLiveEdit' => true,
+               'dividers2tabs' => true
+       )
+);
+
+
 ?>
\ No newline at end of file