[TASK] Fix CGL "InlineCommentWrongStyle" in sysext "version"
[Packages/TYPO3.CMS.git] / typo3 / sysext / version / ws / index.php
index 43a87dd..7334922 100755 (executable)
  * @author     Kasper Skårhøj <kasperYYYY@typo3.com>
  * @author     Dmitry Dulepov <typo3@accio.lv>
  */
+/**
+ * [CLASS/FUNCTION INDEX of SCRIPT]
+ *
+ *
+ *
+ *  101: class SC_mod_user_ws_index extends t3lib_SCbase
+ *
+ *              SECTION: Standard module initialization
+ *  128:     function menuConfig()
+ *  175:     function init()
+ *  233:     function main()
+ *  280:     function printContent()
+ *
+ *              SECTION: Module content: Publish
+ *  310:     function moduleContent_publish()
+ *  411:     function displayVersionDetails($details)
+ *  420:     function displayWorkspaceOverview()
+ *
+ *              SECTION: Module content: Workspace list
+ *  461:     function moduleContent_workspaceList()
+ *  476:     function workspaceList_displayUserWorkspaceList()
+ *  553:     function workspaceList_getUserWorkspaceList()
+ *  592:     function workspaceList_formatWorkspaceData(&$wksp)
+ *  634:     function workspaceList_getWebMountPoints(&$wksp)
+ *  683:     function workspaceList_getFileMountPoints(&$wksp)
+ *  736:     function workspaceList_displayUserWorkspaceListHeader()
+ *  756:     function workspaceList_getUserList(&$wksp)
+ *  783:     function workspaceList_getUserListForSysWorkspace(&$wksp)
+ *  810:     function workspaceList_getUserListWithAccess(&$list, $access)
+ *  883:     function workspaceList_displayIcons($currentWorkspace, &$wksp)
+ *  931:     function workspaceList_hasEditAccess(&$wksp)
+ *  943:     function workspaceList_createFakeWorkspaceRecord($uid)
+ *
+ * TOTAL FUNCTIONS: 20
+ * (This index is automatically created/updated by the extension "extdeveval")
+ *
+ */
 
        // Initialize module:
 unset($MCONF);
@@ -94,7 +131,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                        // 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']) {
+               if ($versionExtconf['showDraftWorkspace']) {
                        $this->showDraftWorkspace = TRUE;
                }
 
@@ -130,7 +167,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                        // 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');
-                       foreach($workspaces as $rec)    {
+                       foreach ($workspaces as $rec) {
                                if ($GLOBALS['BE_USER']->checkWorkspace($rec))  {
                                        $this->MOD_MENU['display'][$rec['uid']] = '[' . $rec['uid'] . '] ' . htmlspecialchars($rec['title']);
                                }
@@ -147,17 +184,15 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
        function execute()      {
                $post = t3lib_div::_POST();
 
-#              debug($post);
-
                if ($post['_with_selected_do']) {
                        if (is_array($post['items']) && count($post['items']))  {
                                $cmdArray = array();
 
-                               foreach($post['items'] as $item => $v)  {
+                               foreach ($post['items'] as $item => $v) {
                                        list($table,$uid) = explode(':',$item,2);
 
-                                       if ($GLOBALS['TCA'][$table] && t3lib_div::testInt($uid))        {
-                                               switch($post['_with_selected_do'])      {
+                                       if ($GLOBALS['TCA'][$table] && t3lib_utility_Math::canBeInterpretedAsInteger($uid)) {
+                                               switch ($post['_with_selected_do']) {
                                                        case "stage_-1":
                                                                $cmdArray[$table][$uid]['version']['action'] = 'setStage';
                                                                $cmdArray[$table][$uid]['version']['stageId'] = -1;
@@ -381,7 +416,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                        // Create header:
                $title = '';
                $description = '';
-               switch($GLOBALS['BE_USER']->workspace)  {
+               switch ($GLOBALS['BE_USER']->workspace) {
                        case 0:
                                $title = t3lib_iconWorks::getIconImage('sys_workspace', array(), $this->doc->backPath, ' align="top"') . '[' . $GLOBALS['LANG']->getLL('shortcut_onlineWS') . ']';
                                $description = $GLOBALS['LANG']->getLL('workspace_description_live');
@@ -626,7 +661,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                }
 
                        // Custom
-               foreach($workspaces as $rec)    {
+               foreach ($workspaces as $rec) {
                                // see if user can access this workspace in any way
                        if (FALSE !== ($result = $GLOBALS['BE_USER']->checkWorkspace($rec)))    {
                                $availableWorkspaces[] = $result;       // `$result` contains `$rec` plus access type through '_ACCESS' key