Removes the Module Menu item for OpenDocs on the left.
Also moves Css/JavaScript/Images and Icons to default folders.
Change-Id: I90c3f04f5981c6b0e02b036c8b604ce03b3d7b66
Fixes: #41240
Releases: 6.0
Reviewed-on: http://review.typo3.org/15107
Reviewed-by: Helmut Hummel
Reviewed-by: Mattias Nilsson
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
/**
* reference back to the backend object
*
- * @var TYPO3backend
+ * @var TYPO3backend
*/
protected $backendReference;
$numDocs = count($this->openDocs);
$opendocsMenu = array();
$title = $GLOBALS['LANG']->getLL('toolbaritem', TRUE);
+
// Toolbar item icon
$opendocsMenu[] = '<a href="#" class="toolbar-item">';
$opendocsMenu[] = '<input type="text" id="tx-opendocs-counter" disabled="disabled" value="' . $numDocs . '" />';
$opendocsMenu[] = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('apps-toolbar-menu-opendocs', array('title' => $title)) . '</a>';
+
// Toolbar item menu and initial content
$opendocsMenu[] = '<div class="toolbar-item-menu" style="display: none;">';
$opendocsMenu[] = $this->renderMenu();
$entries[] = $this->renderMenuEntry($openDocument, $md5sum, FALSE, $i == 1);
}
}
- // if there are "recent documents" in the list, add them
+ // If there are "recent documents" in the list, add them
if (count($recentDocuments)) {
$entries[] = '<tr><th colspan="3">' . $GLOBALS['LANG']->getLL('recent_docs', TRUE) . '</th></tr>';
$i = 0;
* @return void
*/
protected function addJavascriptToBackend() {
- $this->backendReference->addJavascriptFile(\TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath($this->EXTKEY) . 'opendocs.js');
+ $this->backendReference->addJavascriptFile(
+ \TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath($this->EXTKEY) . 'Resources/Public/JavaScript/opendocs.js'
+ );
}
/**
* @return void
*/
protected function addCssToBackend() {
- $this->backendReference->addCssFile('opendocs', \TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath($this->EXTKEY) . 'opendocs.css');
+ $this->backendReference->addCssFile(
+ 'opendocs',
+ \TYPO3\CMS\Core\Extension\ExtensionManager::extRelPath($this->EXTKEY) . '/Resources/Public/Css/opendocs.css'
+ );
}
/*******************
}
-
?>
\ No newline at end of file
--- /dev/null
+/* - - - - - - - - - - - - - - - - - - - - -
+
+Title : Open Documents toolbar item menu styles
+Author : Banejamin Mack <benni@typo3.org>
+URL : http://typo3.org
+
+Description : styles the Open Documents toolbar item
+
+
+- - - - - - - - - - - - - - - - - - - - - */
+
+#tx-opendocs-menu .toolbar-item {
+ padding-left: 8px;
+ padding-right: 7px;
+}
+
+#tx-opendocs-menu .toolbar-item-active {
+ background-image: url('../Images/toolbar_item_active_bg.png');
+}
+
+#tx-opendocs-menu input {
+ font-size: 9px;
+ height: 12px;
+ line-height: 12px;
+ width: 14px;
+ text-align: right;
+ border: 1px solid #999;
+ margin-top: 1px;
+ margin-right: 3px;
+ padding: 1px 2px;
+ float: left;
+}
+
+#tx-opendocs-menu span.t3-icon {
+
+}
+
+#tx-opendocs-menu .toolbar-item-menu {
+ position: absolute;
+ list-style: none;
+ padding: 2px 0px 0px;
+ margin: 0px;
+ background-color: #f9f9f9;
+ border: 1px solid #abb2bc;
+ border-top: none;
+ width: 200px;
+}
+
+#tx-opendocs-menu .toolbar-item-menu .list {
+ width: 100%;
+}
+
+#tx-opendocs-menu .toolbar-item-menu .list th {
+ border-top: 1px solid #a5a5a5;
+ border-bottom: 1px solid #a5a5a5;
+ background-color: #dbdbdb;
+
+ text-align: left;
+ font-weight: normal;
+ line-height: 16px;
+ padding-left: 7px;
+}
+
+#tx-opendocs-menu .toolbar-item-menu .list td {
+ padding: 2px 1px;
+ line-height: 16px;
+}
+
+#tx-opendocs-menu .toolbar-item-menu .list tr.opendoc.first-row td,
+#tx-opendocs-menu .toolbar-item-menu .list tr.recentdoc.first-row td {
+ background-image: url('../../../../../gfx/shortcutgroups-bg.png');
+ background-repeat: repeat-x;
+ padding-top: 4px;
+}
+
+#tx-opendocs-menu .toolbar-item-menu .list .opendoc .icon,
+#tx-opendocs-menu .toolbar-item-menu .list .recentdoc .icon {
+ padding-left: 7px;
+ vertical-align: top;
+ width: 16px;
+}
+
+#tx-opendocs-menu .toolbar-item-menu .list .opendoc .close {
+ width: 20px;
+ text-align: center;
+ vertical-align: top;
+}
+
+#tx-opendocs-menu .toolbar-item-menu .list .opendoc .close span {
+ cursor: pointer;
+}
+
--- /dev/null
+/***************************************************************
+* Copyright notice
+*
+* (c) 2008-2010 Benjamin Mack <mack@xnos.org>
+* 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!
+***************************************************************/
+
+/**
+ * class to handle the open documents menu, loads the open documents dynamically
+ *
+ */
+var OpenDocs = Class.create({
+ ajaxScript: 'ajax.php',
+ menu: null,
+ toolbarItemIcon: null,
+
+ /**
+ * registers for resize event listener and executes on DOM ready
+ */
+ initialize: function() {
+
+ Ext.onReady(function() {
+ Event.observe(
+ window, 'resize',
+ function() { TYPO3BackendToolbarManager.positionMenu('tx-opendocs-menu'); }
+ );
+ TYPO3BackendToolbarManager.positionMenu('tx-opendocs-menu');
+ this.toolbarItemIcon = $$('#tx-opendocs-menu .toolbar-item span.t3-icon')[0];
+ this.ajaxScript = top.TS.PATH_typo3 + this.ajaxScript; // can't be initialized earlier
+
+ Event.observe($$('#tx-opendocs-menu .toolbar-item')[0], 'click', this.toggleMenu);
+ this.menu = $$('#tx-opendocs-menu .toolbar-item-menu')[0];
+ }, this);
+ },
+
+ /**
+ * toggles the visibility of the menu and places it under the toolbar icon
+ */
+ toggleMenu: function(event) {
+ var toolbarItem = $$('#tx-opendocs-menu > a')[0];
+ var menu = $$('#tx-opendocs-menu .toolbar-item-menu')[0];
+ toolbarItem.blur();
+
+ if(!toolbarItem.hasClassName('toolbar-item-active')) {
+ toolbarItem.addClassName('toolbar-item-active');
+ Effect.Appear(menu, {duration: 0.2});
+ TYPO3BackendToolbarManager.hideOthers(toolbarItem);
+ } else {
+ toolbarItem.removeClassName('toolbar-item-active');
+ Effect.Fade(menu, {duration: 0.1});
+ }
+
+ if(event) {
+ Event.stop(event);
+ }
+ },
+
+ /**
+ * displays the menu and does the AJAX call to the TYPO3 backend
+ */
+ updateMenu: function() {
+ var origToolbarItemIcon = this.toolbarItemIcon.src;
+ this.toolbarItemIcon.src = 'gfx/spinner.gif';
+
+ new Ajax.Updater(
+ this.menu,
+ this.ajaxScript, {
+ parameters: {
+ ajaxID: 'OpendocsController::renderMenu'
+ },
+ onComplete: function(xhr) {
+ this.toolbarItemIcon.src = origToolbarItemIcon;
+ }.bind(this)
+ }
+ );
+ },
+
+ /**
+ * updates the number of open documents in the toolbar according to the
+ * first parameter. If "num" is smaller than "0", the number of opendocs
+ * is counted from the open menu
+ *
+ * @param integer number of open documents
+ * @param boolean flag to explicitly update the menu
+ */
+ updateNumberOfDocs: function(num, explicitlyUpdateMenu) {
+ if (explicitlyUpdateMenu) {
+ // re-render the menu e.g. if a document was closed inside the menu
+ this.updateMenu();
+ }
+
+ if (num < 0) {
+ num = $$('#tx-opendocs-menu tr.opendoc').length;
+ }
+
+ $('tx-opendocs-counter').writeAttribute('value', num);
+ },
+
+ /**
+ * closes an open document
+ */
+ closeDocument: function(md5sum) {
+ new Ajax.Updater(
+ this.menu,
+ this.ajaxScript, {
+ parameters: {
+ ajaxID: 'OpendocsController::closeDocument',
+ md5sum: md5sum
+ },
+ onComplete: function() {
+ this.updateNumberOfDocs(-1, false);
+ }.bind(this)
+ }
+ );
+
+ this.updateNumberOfDocs(-1, true);
+ }
+
+});
+
+var TYPO3BackendOpenDocs = new OpenDocs();
+++ /dev/null
- # cat=basic/enable; type=boolean; label=Enable Open Documents module: Enables, additionally to the menu in the top bar the old module "Open Documents" / "Doc" in the module menu as a submodule of User.
-enableModule = 0
$GLOBALS['TYPO3_CONF_VARS']['BE']['AJAX']['OpendocsController::closeDocument'] = $opendocsPath . 'class.tx_opendocs.php:TYPO3\\CMS\\Opendocs\\Controller\\OpendocsController->closeDocument';
// Register update signal to update the number of open documents
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_befunc.php']['updateSignalHook']['OpendocsController::updateNumber'] = $opendocsPath . 'class.tx_opendocs.php:TYPO3\\CMS\\Opendocs\\Controller\\OpendocsController->updateNumberOfOpenDocsHook';
- // Register menu module if option is wanted
- $_EXTCONF = unserialize($_EXTCONF);
- if ($_EXTCONF['enableModule']) {
- \TYPO3\CMS\Core\Extension\ExtensionManager::addModule('user', 'doc', 'after:ws', $opendocsPath . 'mod/');
- }
}
?>
\ No newline at end of file
+++ /dev/null
-<?php
-$MCONF['script'] = '_DISPATCH';
-$MLANG['default']['tabs_images']['tab'] = 'document.gif';
-$MLANG['default']['ll_ref'] = 'LLL:EXT:opendocs/mod/locallang_mod.xml';
-$MCONF['access'] = 'group,user';
-$MCONF['name'] = 'opendocs';
-?>
\ No newline at end of file
+++ /dev/null
-<?php
-/***************************************************************
- * Copyright notice
- *
- * (c) 1999-2012 Kasper Skårhøj (kasperYYYY@typo3.com)
- * 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!
- ***************************************************************/
-\TYPO3\CMS\Core\Utility\HttpUtility::redirect('alt_doc.php');
-?>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<xliff version="1.0">
- <file source-language="en" datatype="plaintext" original="messages" date="2011-10-17T20:22:35Z" product-name="opendocs">
- <header/>
- <body>
- <trans-unit id="mlang_labels_tablabel" xml:space="preserve">
- <source>Editing of records and documents</source>
- </trans-unit>
- <trans-unit id="mlang_tabs_tab" xml:space="preserve">
- <source>Open Documents</source>
- </trans-unit>
- </body>
- </file>
-</xliff>
+++ /dev/null
-/* - - - - - - - - - - - - - - - - - - - - -
-
-Title : Open Documents toolbar item menu styles
-Author : Banejamin Mack <benni@typo3.org>
-URL : http://typo3.org
-
-Description : styles the Open Documents toolbar item
-
-
-- - - - - - - - - - - - - - - - - - - - - */
-
-#tx-opendocs-menu .toolbar-item {
- padding-left: 8px;
- padding-right: 7px;
-}
-
-#tx-opendocs-menu .toolbar-item-active {
- background-image: url('toolbar_item_active_bg.png');
-}
-
-#tx-opendocs-menu input {
- font-size: 9px;
- height: 12px;
- line-height: 12px;
- width: 14px;
- text-align: right;
- border: 1px solid #999;
- margin-top: 1px;
- margin-right: 3px;
- padding: 1px 2px;
- float: left;
-}
-
-#tx-opendocs-menu span.t3-icon {
-
-}
-
-#tx-opendocs-menu .toolbar-item-menu {
- position: absolute;
- list-style: none;
- padding: 2px 0px 0px;
- margin: 0px;
- background-color: #f9f9f9;
- border: 1px solid #abb2bc;
- border-top: none;
- width: 200px;
-}
-
-#tx-opendocs-menu .toolbar-item-menu .list {
- width: 100%;
-}
-
-#tx-opendocs-menu .toolbar-item-menu .list th {
- border-top: 1px solid #a5a5a5;
- border-bottom: 1px solid #a5a5a5;
- background-color: #dbdbdb;
-
- text-align: left;
- font-weight: normal;
- line-height: 16px;
- padding-left: 7px;
-}
-
-#tx-opendocs-menu .toolbar-item-menu .list td {
- padding: 2px 1px;
- line-height: 16px;
-}
-
-#tx-opendocs-menu .toolbar-item-menu .list tr.opendoc.first-row td,
-#tx-opendocs-menu .toolbar-item-menu .list tr.recentdoc.first-row td {
- background-image: url('../../gfx/shortcutgroups-bg.png');
- background-repeat: repeat-x;
- padding-top: 4px;
-}
-
-#tx-opendocs-menu .toolbar-item-menu .list .opendoc .icon,
-#tx-opendocs-menu .toolbar-item-menu .list .recentdoc .icon {
- padding-left: 7px;
- vertical-align: top;
- width: 16px;
-}
-
-#tx-opendocs-menu .toolbar-item-menu .list .opendoc .close {
- width: 20px;
- text-align: center;
- vertical-align: top;
-}
-
-#tx-opendocs-menu .toolbar-item-menu .list .opendoc .close span {
- cursor: pointer;
-}
-
+++ /dev/null
-/***************************************************************
-* Copyright notice
-*
-* (c) 2008-2010 Benjamin Mack <mack@xnos.org>
-* 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!
-***************************************************************/
-
-/**
- * class to handle the open documents menu, loads the open documents dynamically
- *
- */
-var OpenDocs = Class.create({
- ajaxScript: 'ajax.php',
- menu: null,
- toolbarItemIcon: null,
-
- /**
- * registers for resize event listener and executes on DOM ready
- */
- initialize: function() {
-
- Ext.onReady(function() {
- Event.observe(
- window, 'resize',
- function() { TYPO3BackendToolbarManager.positionMenu('tx-opendocs-menu'); }
- );
- TYPO3BackendToolbarManager.positionMenu('tx-opendocs-menu');
- this.toolbarItemIcon = $$('#tx-opendocs-menu .toolbar-item span.t3-icon')[0];
- this.ajaxScript = top.TS.PATH_typo3 + this.ajaxScript; // can't be initialized earlier
-
- Event.observe($$('#tx-opendocs-menu .toolbar-item')[0], 'click', this.toggleMenu);
- this.menu = $$('#tx-opendocs-menu .toolbar-item-menu')[0];
- }, this);
- },
-
- /**
- * toggles the visibility of the menu and places it under the toolbar icon
- */
- toggleMenu: function(event) {
- var toolbarItem = $$('#tx-opendocs-menu > a')[0];
- var menu = $$('#tx-opendocs-menu .toolbar-item-menu')[0];
- toolbarItem.blur();
-
- if(!toolbarItem.hasClassName('toolbar-item-active')) {
- toolbarItem.addClassName('toolbar-item-active');
- Effect.Appear(menu, {duration: 0.2});
- TYPO3BackendToolbarManager.hideOthers(toolbarItem);
- } else {
- toolbarItem.removeClassName('toolbar-item-active');
- Effect.Fade(menu, {duration: 0.1});
- }
-
- if(event) {
- Event.stop(event);
- }
- },
-
- /**
- * displays the menu and does the AJAX call to the TYPO3 backend
- */
- updateMenu: function() {
- var origToolbarItemIcon = this.toolbarItemIcon.src;
- this.toolbarItemIcon.src = 'gfx/spinner.gif';
-
- new Ajax.Updater(
- this.menu,
- this.ajaxScript, {
- parameters: {
- ajaxID: 'OpendocsController::renderMenu'
- },
- onComplete: function(xhr) {
- this.toolbarItemIcon.src = origToolbarItemIcon;
- }.bind(this)
- }
- );
- },
-
- /**
- * updates the number of open documents in the toolbar according to the
- * first parameter. If "num" is smaller than "0", the number of opendocs
- * is counted from the open menu
- *
- * @param integer number of open documents
- * @param boolean flag to explicitly update the menu
- */
- updateNumberOfDocs: function(num, explicitlyUpdateMenu) {
- if (explicitlyUpdateMenu) {
- // re-render the menu e.g. if a document was closed inside the menu
- this.updateMenu();
- }
-
- if (num < 0) {
- num = $$('#tx-opendocs-menu tr.opendoc').length;
- }
-
- $('tx-opendocs-counter').writeAttribute('value', num);
- },
-
- /**
- * closes an open document
- */
- closeDocument: function(md5sum) {
- new Ajax.Updater(
- this.menu,
- this.ajaxScript, {
- parameters: {
- ajaxID: 'OpendocsController::closeDocument',
- md5sum: md5sum
- },
- onComplete: function() {
- this.updateNumberOfDocs(-1, false);
- }.bind(this)
- }
- );
-
- this.updateNumberOfDocs(-1, true);
- }
-
-});
-
-var TYPO3BackendOpenDocs = new OpenDocs();
die('Access denied.');
}
if (TYPO3_MODE == 'BE') {
- // First include the class file
+ // First include the class file
include_once \TYPO3\CMS\Core\Extension\ExtensionManager::extPath('opendocs') . 'class.tx_opendocs.php';
- // Now register the class as toolbar item
+
+ // Now register the class as toolbar item
$GLOBALS['TYPO3backend']->addToolbarItem('opendocs', 'TYPO3\\CMS\\Opendocs\\Controller\\OpendocsController');
}
?>
\ No newline at end of file