Follow-up to #15644: Replace magic numbers for shortcut_mode with class constants...
authorSteffen Gebert <steffen.gebert@typo3.org>
Sun, 28 Nov 2010 22:18:46 +0000 (22:18 +0000)
committerSteffen Gebert <steffen.gebert@typo3.org>
Sun, 28 Nov 2010 22:18:46 +0000 (22:18 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9664 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/class.tslib_fe.php

index 5f220aa..d746e94 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-11-28  Steffen Gebert  <steffen@steffen-gebert.de>
+
+       * Follow-up to #15644: Replace magic numbers for shortcut_mode with class constants in tslib_fe
+
 2010-11-28  Steffen Ritter  <typo3@steffen-ritter.net>
 
        * Fixed bug #16342: TCA tree throws Fatal error on displaying deleted records
index 712cc26..e773f37 100644 (file)
 
                        // Find $page record depending on shortcut mode:
                switch($mode)   {
-                       case 1:
-                       case 2:
+                       case t3lib_pageSelect::SHORTCUT_MODE_FIRST_SUBPAGE:
+                       case t3lib_pageSelect::SHORTCUT_MODE_RANDOM_SUBPAGE:
                                $pageArray = $this->sys_page->getMenu(($idArray[0] ? $idArray[0] : $thisUid), '*', 'sorting', 'AND pages.doktype<199 AND pages.doktype!=' . t3lib_pageSelect::DOKTYPE_BE_USER_SECTION);
                                $pO = 0;
-                               if ($mode==2 && count($pageArray))      {       // random
+                               if ($mode == t3lib_pageSelect::SHORTCUT_MODE_RANDOM_SUBPAGE && count($pageArray)) {
                                        $randval = intval(rand(0,count($pageArray)-1));
                                        $pO = $randval;
                                }
                                        $c++;
                                }
                        break;
-                       case 3:
+                       case t3lib_pageSelect::SHORTCUT_MODE_PARENT_PAGE:
                                $parent = $this->sys_page->getPage($thisUid);
                                $page = $this->sys_page->getPage($parent['pid']);
                        break;