Added feature #11966: htmlArea RTE: Restrict access to "Clear RTE Cache" option in...
[Packages/TYPO3.CMS.git] / typo3 / sysext / rtehtmlarea / hooks / clearrtecache / class.tx_rtehtmlarea_clearcachemenu.php
index d374740..e4cf0cc 100644 (file)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 2007 Ingo Renner <ingo@typo3.org>
+*  (c) 2007-2009 Ingo Renner <ingo@typo3.org>
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -43,16 +43,18 @@ class tx_rtehtmlarea_clearcachemenu implements backend_cacheActionsHook {
         * @return      void
         */
         public function manipulateCacheActions(&$cacheActions, &$optionValues) {
         * @return      void
         */
         public function manipulateCacheActions(&$cacheActions, &$optionValues) {
-                       // Add new cache menu item
-               $title = $GLOBALS['LANG']->sL('LLL:EXT:rtehtmlarea/hooks/clearrtecache/locallang.xml:title');
-               $cacheActions[] = array(
-                       'id'    => 'clearRTECache',
-                       'title' => $title,
-                       'href'  => $GLOBALS['BACK_PATH'] . 'ajax.php?ajaxID=rtehtmlarea::clearTempDir',
-                       'icon'  => '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'sysext/rtehtmlarea/hooks/clearrtecache/clearrtecache.png', 'width="16" height="16"').' title="'.$title.'" alt="'.$title.'" />'
-                       //'icon'  => '<img src="' . t3lib_extMgm::extRelPath('rtehtmlarea') . 'hooks/clearrtecache/clearrtecache.png" width="16" height="16" title="'.htmlspecialchars($title).'" alt="" />'
-               );
-               $optionValues[] = 'clearRTECache';
+               if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->getTSConfigVal('options.clearCache.clearRTECache')) {
+                               // Add new cache menu item
+                       $title = $GLOBALS['LANG']->sL('LLL:EXT:rtehtmlarea/hooks/clearrtecache/locallang.xml:title');
+                       $cacheActions[] = array(
+                               'id'    => 'clearRTECache',
+                               'title' => $title,
+                               'href'  => $GLOBALS['BACK_PATH'] . 'ajax.php?ajaxID=rtehtmlarea::clearTempDir',
+                               'icon'  => '<img'.t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'sysext/rtehtmlarea/hooks/clearrtecache/clearrtecache.png', 'width="16" height="16"').' title="'.$title.'" alt="'.$title.'" />'
+                               //'icon'  => '<img src="' . t3lib_extMgm::extRelPath('rtehtmlarea') . 'hooks/clearrtecache/clearrtecache.png" width="16" height="16" title="'.htmlspecialchars($title).'" alt="" />'
+                       );
+                       $optionValues[] = 'clearRTECache';
+               }
         }
 }
 
         }
 }