Follow-up to bugfix #12324: Renamed sanitizeBackEndUrl() to sanitizeLocalUrl() in...
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_tsfebeuserauth.php
index 881f547..c2b91a2 100644 (file)
@@ -190,8 +190,6 @@ class t3lib_tsfeBeUserAuth extends t3lib_beUserAuth {
                if (isset($this->extAdminConfig['enable.'])) {
                        foreach($this->extAdminConfig['enable.'] as $key => $value) {
                                if ($value) {
-                                       $GLOBALS['TSFE']->includeTCA();
-
                                        $this->adminPanel = t3lib_div::makeInstance('tslib_AdminPanel');
                                        $this->extAdmEnabled = true;
 
@@ -207,7 +205,7 @@ class t3lib_tsfeBeUserAuth extends t3lib_beUserAuth {
         * @return      void
         */
        public function initializeFrontendEdit() {
-               if (isset($this->extAdminConfig['enable.']) && t3lib_extMgm::isLoaded('fe_edit')) {
+               if (isset($this->extAdminConfig['enable.']) && $this->isFrontendEditingActive()) {
                        foreach($this->extAdminConfig['enable.'] as $key => $value) {
                                if ($value) {
                                        if ($GLOBALS['TSFE'] instanceof tslib_fe) {
@@ -247,13 +245,20 @@ class t3lib_tsfeBeUserAuth extends t3lib_beUserAuth {
         * @return      string.
         */
        public function displayAdminPanel() {
-               if (!$this->extAdminConfig['hide'] && $GLOBALS['TSFE']->config['config']['admPanel']) {
-                       $content =  $this->adminPanel->display();
-               }
+               $content =  $this->adminPanel->display();
 
                return $content;
        }
 
+       /**
+        * Determines whether the admin panel is enabled and visible.
+        *
+        * @return      boolean         Whether the admin panel is enabled and visible
+        */
+       public function isAdminPanelVisible() {
+               return ($this->extAdmEnabled && !$this->extAdminConfig['hide'] && $GLOBALS['TSFE']->config['config']['admPanel']);
+       }
+
        /*****************************************************
         *
         * TSFE BE user Access Functions
@@ -366,10 +371,15 @@ class t3lib_tsfeBeUserAuth extends t3lib_beUserAuth {
         * @return      integer         The number of pages for this page in the table "cache_pages"
         */
        public function extGetNumberOfCachedPages($pageId) {
-               $pageCache = $GLOBALS['typo3CacheManager']->getCache('cache_pages');
-               $pageCacheEntries = $pageCache->getByTag('pageId_' . (int) $pageId);
-
-               return count($pageCacheEntries);
+               if (TYPO3_UseCachingFramework) {
+                       $pageCache = $GLOBALS['typo3CacheManager']->getCache('cache_pages');
+                       $pageCacheEntries = $pageCache->getByTag('pageId_' . (int) $pageId);
+                       $count = count($pageCacheEntries);
+               } else {
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('count(*)', 'cache_pages', 'page_id='.intval($pageId));
+                       list($count) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
+               }
+               return $count;
        }