Made Clear Cache buttons of backend.php AJAX based, showing a nice spinner image...
authorIngmar Schlecht <ingmar.schlecht@typo3.org>
Thu, 15 Nov 2007 20:30:38 +0000 (20:30 +0000)
committerIngmar Schlecht <ingmar.schlecht@typo3.org>
Thu, 15 Nov 2007 20:30:38 +0000 (20:30 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2725 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/classes/class.modulemenu.php
typo3/gfx/spinner.gif [new file with mode: 0644]

index f5dd5da..5bd200e 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
        * Bugfix #5683: processing of label field in backend (Thanks to Ralf Hettinger)
        * Set left-padding of options in selectorboxes to 22 if an icon is displayed that has a width between 14 and 20 pixels. This was necessary for a good visual impression even if page and content type icon sizes vary.
 
        * Bugfix #5683: processing of label field in backend (Thanks to Ralf Hettinger)
        * Set left-padding of options in selectorboxes to 22 if an icon is displayed that has a width between 14 and 20 pixels. This was necessary for a good visual impression even if page and content type icon sizes vary.
+       * Made Clear Cache buttons of backend.php AJAX based, showing a nice spinner image during cache clearing
 
 2007-11-15  Thomas Hempel <thomas@typo3-unleashed.net>
 
 
 2007-11-15  Thomas Hempel <thomas@typo3-unleashed.net>
 
index 6d41fe7..0a8cf1b 100644 (file)
@@ -490,8 +490,17 @@ class ModuleMenu {
        public function renderCacheActions() {
                $renderedCacheActions = array('<ul id="cache-actions">');
 
        public function renderCacheActions() {
                $renderedCacheActions = array('<ul id="cache-actions">');
 
-               foreach($this->cacheActions as $cacheAction) {
-                       $renderedCacheActions[] = '<li><a href="'.htmlspecialchars($cacheAction['href']).'">'.$cacheAction['icon'].' '.$cacheAction['title'].'</a></li>';
+               foreach($this->cacheActions as $actionKey => $cacheAction) {
+                       $js = 
+                               'top.origIcon = $$(\'#action-'.$actionKey.' img\')[0].src;'.
+                               '$$(\'#action-'.$actionKey.' img\')[0].src = \'gfx/spinner.gif\';'.
+                               'new Ajax.Request(\''.htmlspecialchars($cacheAction['href']).'\', { '.
+                                       'method: \'get\', '.
+                                       'onComplete: function() {$$(\'#action-'.$actionKey.' img\')[0].src = top.origIcon;}'.
+                               '}); '.
+                               'return false;';
+
+                       $renderedCacheActions[] = '<li id="action-'.$actionKey.'"><a onclick="'.$js.'" href="#'.htmlspecialchars($cacheAction['href']).'">'.$cacheAction['icon'].' '.$cacheAction['title'].'</a></li>';
                }
 
                $renderedCacheActions[] = '</ul>';
                }
 
                $renderedCacheActions[] = '</ul>';
@@ -512,7 +521,7 @@ class ModuleMenu {
                        $this->cacheActions[] = array(
                                'id'    => 'temp_CACHED',
                                'title' => $title,
                        $this->cacheActions[] = array(
                                'id'    => 'temp_CACHED',
                                'title' => $title,
-                               'href'  => $this->backPath.'tce_db.php?vC='.$GLOBALS['BE_USER']->veriCode().'&redirect='.rawurlencode(t3lib_div::getIndpEnv('TYPO3_REQUEST_SCRIPT')).'&cacheCmd=temp_CACHED',
+                               'href'  => $this->backPath.'tce_db.php?vC='.$GLOBALS['BE_USER']->veriCode().'&cacheCmd=temp_CACHED',
                                'icon'  => '<img'.t3lib_iconWorks::skinImg($this->backPath, 'gfx/clear_cache_files_in_typo3c.gif', 'width="21" height="18"').' title="'.htmlspecialchars($title).'" alt="" />'
                        );
                }
                                'icon'  => '<img'.t3lib_iconWorks::skinImg($this->backPath, 'gfx/clear_cache_files_in_typo3c.gif', 'width="21" height="18"').' title="'.htmlspecialchars($title).'" alt="" />'
                        );
                }
@@ -522,7 +531,7 @@ class ModuleMenu {
                $this->cacheActions[] = array(
                        'id'    => 'all',
                        'title' => $title,
                $this->cacheActions[] = array(
                        'id'    => 'all',
                        'title' => $title,
-                       'href'  => $this->backPath.'tce_db.php?vC='.$GLOBALS['BE_USER']->veriCode().'&redirect='.rawurlencode(t3lib_div::getIndpEnv('TYPO3_REQUEST_SCRIPT')).'&cacheCmd=all',
+                       'href'  => $this->backPath.'tce_db.php?vC='.$GLOBALS['BE_USER']->veriCode().'&cacheCmd=all',
                        'icon'  => '<img'.t3lib_iconWorks::skinImg($this->backPath, 'gfx/clear_all_cache.gif', 'width="21" height="18"').' title="'.htmlspecialchars($title).'" alt="" />'
                );
        }
                        'icon'  => '<img'.t3lib_iconWorks::skinImg($this->backPath, 'gfx/clear_all_cache.gif', 'width="21" height="18"').' title="'.htmlspecialchars($title).'" alt="" />'
                );
        }
diff --git a/typo3/gfx/spinner.gif b/typo3/gfx/spinner.gif
new file mode 100644 (file)
index 0000000..085ccae
Binary files /dev/null and b/typo3/gfx/spinner.gif differ