Index: typo3/sysext/fe_edit/view/class.tx_feedit_adminpanel.php
===================================================================
--- typo3/sysext/fe_edit/view/class.tx_feedit_adminpanel.php (revision 5226)
+++ typo3/sysext/fe_edit/view/class.tx_feedit_adminpanel.php (working copy)
@@ -50,7 +50,8 @@
* @return string HTML for the Admin Panel
*/
public function display() {
- $out='';
+ $out = '';
+
if ($GLOBALS['BE_USER']->uc['TSFE_adminConfig']['display_top']) {
if ($GLOBALS['BE_USER']->frontendEdit->isAdminModuleEnabled('preview')) {
$out .= $this->getPreviewModule();
@@ -78,7 +79,7 @@
$row .= $this->extFw(': ' . $GLOBALS['BE_USER']->user['username']);
$header = '
-
+
' .
$this->extItemLink('top',$row) . '
@@ -143,7 +144,17 @@
';
}
- return "\n\n\n\n" . $out . ' ';
+
+ $out = '
+
+ ' . $out . '
+
+';
+
+ return $out;
}
/**
Index: t3lib/js/adminpanel_dnd.js
===================================================================
--- t3lib/js/adminpanel_dnd.js (revision 0)
+++ t3lib/js/adminpanel_dnd.js (revision 0)
@@ -0,0 +1,113 @@
+/***************************************************************
+* Admin Panel drag and drop
+*
+* $Id$
+*
+* Copyright notice
+*
+* (c) 2009 Ingo Renner
+* 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.
+*
+* 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!
+***************************************************************/
+
+var positionRestored = false;
+var dragObject = null;
+var dragx = 0;
+var dragy = 0;
+var posx = 0;
+var posy = 0;
+
+function admPanel_saveposition(panel) {
+ var admPanelPosX = panel.offsetLeft;
+ var admPanelPosY = panel.offsetTop;
+
+ admPanel_setCookie('admPanelPosX', admPanelPosX, '', '/');
+ admPanel_setCookie('admPanelPosY', admPanelPosY, '', '/');
+}
+
+function admPanel_restorePosition() {
+ if (positionRestored == false) {
+
+ var admPanelPosX = admPanel_getCookie('admPanelPosX');
+ if (admPanelPosX > 0) {
+ document.getElementById('admPanel').style.left = admPanelPosX + 'px';
+ }
+
+ var admPanelPosY = admPanel_getCookie('admPanelPosY');
+ if (admPanelPosY > 0) {
+ document.getElementById('admPanel').style.top = admPanelPosY + 'px';
+ }
+
+ positionRestored = true;
+ }
+}
+
+function admPanel_setCookie(name, value, expires, path, domain, secure) {
+ document.cookie = name + '=' + escape(value)
+ + ((expires) ? '; expires=' + expires.toGMTString() : '')
+ + ((path) ? '; path=' + path : '')
+ + ((domain) ? '; domain=' + domain : '')
+ + ((secure) ? '; secure' : '');
+}
+
+function admPanel_getCookie(name) {
+ var dc = document.cookie;
+ var prefix = name + '=';
+ var begin = dc.indexOf('; ' + prefix);
+
+ if (begin == -1) {
+ begin = dc.indexOf(prefix);
+ if (begin != 0)
+ return null;
+ } else {
+ begin += 2;
+ }
+
+ var end = dc.indexOf(';', begin);
+ if (end == -1) {
+ end = dc.length;
+ }
+
+ return unescape(dc.substring(begin + prefix.length, end));
+};
+
+function admPanel_draginit() {
+ document.getElementById('admPanel').onmousemove = admPanel_drag;
+ document.getElementById('admPanel').onmouseup = admPanel_dragstop;
+};
+
+function admPanel_dragstart(element) {
+ dragObject = element;
+ dragx = posx - dragObject.offsetLeft;
+ dragy = posy - dragObject.offsetTop;
+};
+
+function admPanel_dragstop() {
+ dragObject = null;
+};
+
+function admPanel_drag(dragEvent) {
+ posx = document.all ? window.event.clientX : dragEvent.pageX;
+ posy = document.all ? window.event.clientY : dragEvent.pageY;
+
+ if (dragObject != null) {
+ dragObject.style.left = (posx - dragx) + 'px';
+ dragObject.style.top = (posy - dragy) + 'px';
+ }
+}
+
|