Follow-up to bug #17719: Removed unused files
authorohader <ohader@709f56b5-9817-0410-a4d7-c38de5d9e867>
Wed, 23 Feb 2011 13:27:21 +0000 (13:27 +0000)
committerohader <ohader@709f56b5-9817-0410-a4d7-c38de5d9e867>
Wed, 23 Feb 2011 13:27:21 +0000 (13:27 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10598 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/classes/class.donatewindow.php [deleted file]
typo3/js/donate.js [deleted file]

index 3c7304b..1f1e57c 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2011-02-23  Oliver Hader  <oliver.hader@typo3.org>
 
        * Fixed bug #17719: Move donation popup to about module (thanks to Steffen Kamper)
+       * Follow-up to bug #17719: Removed unused files
 
 2011-02-23  Steffen Kamper  <steffen@typo3.org>
 
diff --git a/typo3/classes/class.donatewindow.php b/typo3/classes/class.donatewindow.php
deleted file mode 100644 (file)
index 74102bf..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-<?php
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2010-2011 Oliver Hader <oliver@typo3.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!
-***************************************************************/
-/**
- * AJAX handler for the donate window shown in the TYPO3 backend.
- *
- * @author Oliver Hader <oliver@typo3.org>
- */
-class DonateWindow implements t3lib_Singleton {
-       const FLAG_DonateWindowDisabled = 'DonateWindowDisabled';
-       const FLAG_DonateWindowPostponed = 'DonateWindowPostponed';
-       const VALUE_DonateWindowAppearsAfterDays = 90;
-       const VALUE_DonateWindowPostponeDays = 14;
-
-       /**
-        * @var t3lib_beUserAuth
-        */
-       protected $backendUser;
-
-       /**
-        * Constructs this object.
-        */
-       public function __construct() {
-               $this->setBackendUser($GLOBALS['BE_USER']);
-       }
-
-       /**
-        * Sets the backend user.
-        *
-        * @param t3lib_beUserAuth $backendUser
-        * @return void
-        */
-       public function setBackendUser(t3lib_beUserAuth $backendUser) {
-               $this->backendUser = $backendUser;
-       }
-
-       /**
-        * Disables the donate window - thus it won't be shown again for this user.
-        *
-        * @param       array           $parameters: Parameters (not used)
-        * @param       TYPO3AJAX       $ajaxObj: The calling parent AJAX object
-        * @return      void
-        */
-       public function disable(array $parameters, TYPO3AJAX $ajaxObj) {
-               $this->backendUser->uc[self::FLAG_DonateWindowDisabled] = TYPO3_version;
-               $this->backendUser->writeUC();
-       }
-
-       /**
-        * Postpones the donate window - thus it will be shown again at a later time.
-        *
-        * @param       array           $parameters: Parameters (not used)
-        * @param       TYPO3AJAX       $ajaxObj: The calling parent AJAX object
-        * @return      void
-        */
-       public function postpone(array $parameters, TYPO3AJAX $ajaxObj) {
-               $this->backendUser->uc[self::FLAG_DonateWindowPostponed] = $GLOBALS['EXEC_TIME'];
-               $this->backendUser->writeUC();
-       }
-
-
-       /**
-        * Determines whether the donate window is allowed to be displayed.
-        *
-        * @return boolean Whether the donate window is allowed to be displayed.
-        */
-       public function isDonateWindowAllowed() {
-               $uc = $this->backendUser->uc;
-               $isAdmin = $this->backendUser->isAdmin();
-               $firstLogin = $this->getFirstLoginTimeStamp();
-               $isTriggered = ($firstLogin && $GLOBALS['EXEC_TIME'] - $firstLogin > self::VALUE_DonateWindowAppearsAfterDays * 86400);
-               $isAllowed = (bool) $GLOBALS['TYPO3_CONF_VARS']['BE']['allowDonateWindow'];
-               $isCancelled = (isset($uc[self::FLAG_DonateWindowDisabled]) && !empty($uc[self::FLAG_DonateWindowDisabled]));
-               $isPostponed = (isset($uc[self::FLAG_DonateWindowPostponed]) && $uc[self::FLAG_DonateWindowPostponed] > $GLOBALS['EXEC_TIME'] - self::VALUE_DonateWindowPostponeDays * 86400);
-
-               return ($isAdmin && $isAllowed && $isTriggered && !$isCancelled && !$isPostponed);
-       }
-
-       /**
-        * Gets the timestamp of the first login of the current backend user.
-        *
-        * @return integer Timestamp of the first login
-        */
-       public function getFirstLoginTimeStamp() {
-               $firstLogin = NULL;
-
-               if (isset($this->backendUser->uc['firstLoginTimeStamp'])) {
-                       $firstLogin = $this->backendUser->uc['firstLoginTimeStamp'];
-               }
-
-               return $firstLogin;
-       }
-}
-
-if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/classes/class.donatewindow.php'])) {
-       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['typo3/classes/class.donatewindow.php']);
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/js/donate.js b/typo3/js/donate.js
deleted file mode 100644 (file)
index a32a1f1..0000000
+++ /dev/null
@@ -1,162 +0,0 @@
-/***************************************************************
-*  Copyright notice
-*
-*  (c) 2010 Oliver Hader <oliver@typo3.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!
-***************************************************************/
-
-/**
- * Donate window appearing in the backend
- */
-Ext.namespace('Ext.ux.TYPO3');
-
-Ext.ux.TYPO3.donate = Ext.extend(Ext.util.Observable, {
-       isUnloading: false,
-       logoutButton: null,
-       ajaxRequestDefault: null,
-       donateUrl: TYPO3.configuration.donateUrl,
-
-       constructor: function(config) {
-               this.ajaxRequestDefault = {
-                       url: TYPO3.configuration.PATH_typo3 + 'ajax.php',
-                       success: Ext.emptyFn,
-                       failure: Ext.emptyFn
-               };
-
-               config = config || {};
-               Ext.apply(this, config);
-
-               this.initComponents();
-               this.execute.defer(3000, this);
-               this.logoutButton = Ext.DomQuery.selectNode('#logout-button input');
-
-               Ext.ux.TYPO3.donate.superclass.constructor.call(this, config);
-       },
-
-       execute: function() {
-               this.donateWindow.show();
-       },
-
-       initComponents: function() {
-               this.donateWindow = new Ext.Window({
-                       width: 450,
-                       autoHeight: true,
-                       closable: false,
-                       resizable: false,
-                       plain: true,
-                       border: false,
-                       modal: true,
-                       draggable: false,
-                       closeAction: 'hide',
-                       id: 'donateWindow',
-                       cls: 't3-window',
-                       title: TYPO3.LLL.core.donateWindow_title,
-                       html: TYPO3.LLL.core.donateWindow_message,
-                       buttons: [{
-                               scope: this,
-                               icon: this.getDonateIcon(),
-                               text: TYPO3.LLL.core.donateWindow_button_donate,
-                               handler: this.donateAction
-                       }, {
-                               scope: this,
-                               text: TYPO3.LLL.core.donateWindow_button_disable,
-                               handler: this.disableAction
-                       }, {
-                               scope: this,
-                               text: TYPO3.LLL.core.donateWindow_button_postpone,
-                               handler: this.postponeAction
-                       }]
-               });
-       },
-
-       unloadEventHandler: function(event) {
-               event.stopEvent();
-               this.isUnloading = true;
-               this.donateWindow.show();
-               this.removeUnloadEventListener();
-       },
-
-       donateAction: function() {
-               this.submitDisableAction();
-               this.donateWindow.hide();
-               window.open(this.donateUrl).focus();
-               this.continueUnloading();
-       },
-
-       disableAction: function() {
-               this.submitDisableAction();
-               this.donateWindow.hide();
-               this.continueUnloading();
-       },
-
-       postponeAction: function() {
-               this.submitPostponeAction();
-               this.donateWindow.hide();
-               this.addUnloadEventListener();
-               this.continueUnloading();
-       },
-
-       submitDisableAction: function() {
-               Ext.Ajax.request(Ext.apply(
-                       this.ajaxRequestDefault, {
-                               params: { 'ajaxID': 'DonateWindow::disable' }
-                       }
-               ));
-       },
-
-       submitPostponeAction: function() {
-               Ext.Ajax.request(Ext.apply(
-                       this.ajaxRequestDefault, {
-                               params: { 'ajaxID': 'DonateWindow::postpone' }
-                       }
-               ));
-       },
-
-       getDonateIcon: function() {
-               return TYPO3.configuration.PATH_typo3 + 'sysext/t3skin/images/icons/status/dialog-ok.png';
-       },
-
-       addUnloadEventListener: function() {
-               if (!this.isUnloading) {
-                       Ext.EventManager.addListener(this.logoutButton, 'click', this.unloadEventHandler, this);
-               }
-       },
-
-       removeUnloadEventListener: function() {
-               Ext.EventManager.removeListener(this.logoutButton, 'click', this.unloadEventHandler, this);
-       },
-
-       continueUnloading: function() {
-               if (this.isUnloading && this.logoutButton) {
-                       this.logoutButton.click();
-               }
-       }
-});
-
-
-
-/**
- * Initialize the donate widget
- */
-Ext.onReady(function() {
-       TYPO3.donate = new Ext.ux.TYPO3.donate();
-});