Correction of path to workspaces.js (minor bug, but prevented workspace selector...
[Packages/TYPO3.CMS.git] / typo3 / classes / class.workspaceselector.php
index 9fd1244..f9521cd 100644 (file)
@@ -33,7 +33,7 @@
  * @package TYPO3
  * @subpackage core
  */
  * @package TYPO3
  * @subpackage core
  */
-class WorkspaceSelector implements t3lib_backendToolbarItem {
+class WorkspaceSelector implements backend_toolbarItem {
 
        private $changeWorkspace;
        private $changeWorkspacePreview;
 
        private $changeWorkspace;
        private $changeWorkspacePreview;
@@ -45,6 +45,11 @@ class WorkspaceSelector implements t3lib_backendToolbarItem {
         */
        private $backendReference;
 
         */
        private $backendReference;
 
+       /**
+        * constructor
+        *
+        * @return      void
+        */
        public function __construct() {
                $this->changeWorkspace        = t3lib_div::_GP('changeWorkspace');
                $this->changeWorkspacePreview = t3lib_div::_GP('changeWorkspacePreview');
        public function __construct() {
                $this->changeWorkspace        = t3lib_div::_GP('changeWorkspace');
                $this->changeWorkspacePreview = t3lib_div::_GP('changeWorkspacePreview');
@@ -132,7 +137,7 @@ class WorkspaceSelector implements t3lib_backendToolbarItem {
                $this->changeWorkspace();
 
                $options             = array();
                $this->changeWorkspace();
 
                $options             = array();
-               $workspaceSelector   = '';
+               $workspaceSelector   = '<span class="toolbar-item">';
                $availableWorkspaces = $this->getAvailableWorkspaces();
 
                        // build selector box options
                $availableWorkspaces = $this->getAvailableWorkspaces();
 
                        // build selector box options
@@ -171,7 +176,7 @@ class WorkspaceSelector implements t3lib_backendToolbarItem {
                                                'align="top"'
                                        ).'</a>';
 
                                                'align="top"'
                                        ).'</a>';
 
-               return $workspaceSelector;
+               return $workspaceSelector.'</span>';
        }
 
        /**
        }
 
        /**
@@ -179,7 +184,16 @@ class WorkspaceSelector implements t3lib_backendToolbarItem {
         *
         */
        private function addJavascriptToBackend() {
         *
         */
        private function addJavascriptToBackend() {
-               $this->backendReference->addJavascriptFile('typo3/js/workspaces.js');
+               $this->backendReference->addJavascriptFile('js/workspaces.js');
+       }
+
+       /**
+        * returns additional attributes for the list item in the toolbar
+        *
+        * @return      string          list item HTML attibutes
+        */
+       public function getAdditionalAttributes() {
+               return ' id="workspace-selector"';
        }
 }
 
        }
 }