Fixed bug #16246: Create class constants for pages.doktype
authorSteffen Gebert <steffen.gebert@typo3.org>
Sun, 7 Nov 2010 19:47:35 +0000 (19:47 +0000)
committerSteffen Gebert <steffen.gebert@typo3.org>
Sun, 7 Nov 2010 19:47:35 +0000 (19:47 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9302 709f56b5-9817-0410-a4d7-c38de5d9e867

18 files changed:
ChangeLog
t3lib/class.t3lib_befunc.php
t3lib/class.t3lib_iconworks.php
t3lib/class.t3lib_page.php
t3lib/class.t3lib_tstemplate.php
t3lib/stddb/tables.php
t3lib/stddb/tbl_pages.php
tests/t3lib/t3lib_pageselectTest.php
typo3/class.browse_links.php
typo3/class.db_list_extra.inc
typo3/class.webpagetree.php
typo3/sysext/cms/tbl_cms.php
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/class.tslib_menu.php
typo3/sysext/cms/tslib/media/scripts/wapversionLib.inc
typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php
typo3/sysext/statictemplates/media/scripts/wapversionLib.inc

index b540fd9..cd1b70e 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-11-07  Steffen Gebert  <steffen@steffen-gebert.de>
+
+       * Fixed bug #16246: Create class constants for pages.doktype
+
 2010-11-07  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Added feature #16293: htmlArea RTE: Add quick tips to insert emoticon dialogue
index 06379f4..0c12b2b 100644 (file)
@@ -1875,9 +1875,9 @@ final class t3lib_BEfunc {
                        break;
                }
 
-               if ($row['doktype']=='3') {
+               if ($row['doktype'] == t3lib_pageSelect::DOKTYPE_LINK) {
                        $parts[] = $LANG->sL($TCA['pages']['columns']['url']['label']).' '.$row['url'];
-               } elseif ($row['doktype']=='4') {
+               } elseif ($row['doktype'] == t3lib_pageSelect::DOKTYPE_SHORTCUT) {
                        if ($perms_clause) {
                                $label = self::getRecordPath(intval($row['shortcut']), $perms_clause, 20);
                        } else {
@@ -1889,7 +1889,7 @@ final class t3lib_BEfunc {
                                                        $LANG->sL(self::getLabelFromItemlist('pages', 'shortcut_mode', $row['shortcut_mode']));
                        }
                        $parts[] = $LANG->sL($TCA['pages']['columns']['shortcut']['label']).' '.$label;
-               } elseif ($row['doktype']=='7') {
+               } elseif ($row['doktype'] == t3lib_pageSelect::DOKTYPE_MOUNTPOINT) {
                        if ($perms_clause) {
                                $label = self::getRecordPath(intval($row['mount_pid']), $perms_clause, 20);
                        } else {
index ae6d166..f7f2d07 100644 (file)
@@ -200,7 +200,9 @@ final class t3lib_iconWorks {
                        // First, find the icon file name. This can depend on configuration in TCA, field values and more:
                if ($table=='pages') {
                                // @TODO: RFC #7370: doktype 2&5 are deprecated since TYPO3 4.2-beta1
-                       if ($row['nav_hide'] && ($row['doktype']==1||$row['doktype']==2))       $row['doktype'] = 5;    // Workaround to change the icon if "Hide in menu" was set
+                       if ($row['nav_hide'] && ($row['doktype'] == t3lib_pageSelect::DOKTYPE_DEFAULT || $row['doktype'] == t3lib_pageSelect::DOKTYPE_ADVANCED)) {
+                               $row['doktype'] = t3lib_pageSelect::DOKTYPE_HIDE_IN_MENU;
+                       }       // Workaround to change the icon if "Hide in menu" was set
 
                        if (!$iconfile = $PAGES_TYPES[$row['doktype']]['icon']) {
                                $iconfile = $PAGES_TYPES['default']['icon'];
index a0555b5..fdc29b0 100644 (file)
@@ -130,6 +130,21 @@ class t3lib_pageSelect {
        protected $cache_getMountPointInfo = array();
 
        /**
+        * Named constants for "magic numbers" of the field doktype
+        */
+       const DOKTYPE_DEFAULT = 1;
+       const DOKTYPE_ADVANCED = 2; // @deprecated since TYPO3 4.2
+       const DOKTYPE_LINK = 3;
+       const DOKTYPE_SHORTCUT = 4;
+       const DOKTYPE_HIDE_IN_MENU = 5;  // @deprecated since TYPO3 4.2
+       const DOKTYPE_BE_USER_SECTION = 6;
+       const DOKTYPE_MOUNTPOINT = 7;
+       const DOKTYPE_SPACER = 199;
+       const DOKTYPE_SYSFOLDER = 254;
+       const DOKTYPE_RECYCLER = 255;
+
+
+       /**
         * Named constants for "magic numbers" of the field shortcut_mode
         */
        const SHORTCUT_MODE_NONE = 0;
@@ -523,7 +538,7 @@ class t3lib_pageSelect {
                                }
 
                                        // if shortcut, look up if the target exists and is currently visible
-                               if ($row['doktype'] == 4 && ($row['shortcut'] || $row['shortcut_mode']) && $checkShortcuts)     {
+                               if ($row['doktype'] == t3lib_pageSelect::DOKTYPE_SHORTCUT && ($row['shortcut'] || $row['shortcut_mode']) && $checkShortcuts) {
                                        if ($row['shortcut_mode'] == self::SHORTCUT_MODE_NONE) {
                                                        // no shortcut_mode set, so target is directly set in $row['shortcut']
                                                $searchField = 'uid';
@@ -549,7 +564,7 @@ class t3lib_pageSelect {
                                        if (!$count) {
                                                unset($row);
                                        }
-                               } elseif ($row['doktype'] == 4 && $checkShortcuts)      {
+                               } elseif ($row['doktype'] == t3lib_pageSelect::DOKTYPE_SHORTCUT && $checkShortcuts) {
                                                // Neither shortcut target nor mode is set. Remove the page from the menu.
                                        unset($row);
                                }
@@ -665,7 +680,7 @@ class t3lib_pageSelect {
 
                                if (is_array($row))     {
                                                // Mount Point page types are allowed ONLY a) if they are the outermost record in rootline and b) if the overlay flag is not set:
-                                       if ($GLOBALS['TYPO3_CONF_VARS']['FE']['enable_mount_pids'] && $row['doktype']==7 && !$ignoreMPerrors)   {
+                                       if ($GLOBALS['TYPO3_CONF_VARS']['FE']['enable_mount_pids'] && $row['doktype'] == t3lib_pageSelect::DOKTYPE_MOUNTPOINT && !$ignoreMPerrors) {
                                                $mount_info = $this->getMountPointInfo($row['uid'], $row);
                                                if ($loopCheck>0 || $mount_info['overlay'])     {
                                                        $this->error_getRootLine = 'Illegal Mount Point found in rootline';
@@ -782,7 +797,7 @@ class t3lib_pageSelect {
         * @see tslib_fe::setExternalJumpUrl()
         */
        function getExtURL($pagerow,$disable=0) {
-               if ($pagerow['doktype']==3 && !$disable)        {
+               if ($pagerow['doktype'] == t3lib_pageSelect::DOKTYPE_LINK && !$disable) {
                        $redirectTo = $this->urltypes[$pagerow['urltype']].$pagerow['url'];
 
                                // If relative path, prefix Site URL:
@@ -829,7 +844,7 @@ class t3lib_pageSelect {
 
                                // Look for mount pid value plus other required circumstances:
                        $mount_pid = intval($pageRec['mount_pid']);
-                       if (is_array($pageRec) && $pageRec['doktype']==7 && $mount_pid>0 && !in_array($mount_pid, $prevMountPids))      {
+                       if (is_array($pageRec) && $pageRec['doktype']== t3lib_pageSelect::DOKTYPE_MOUNTPOINT && $mount_pid > 0 && !in_array($mount_pid, $prevMountPids)) {
 
                                        // Get the mount point record (to verify its general existence):
                                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,pid,doktype,mount_pid,mount_pid_ol,t3ver_state', 'pages', 'uid='.$mount_pid.' AND pages.deleted=0 AND pages.doktype!=255');
index a1bc981..71c24b3 100644 (file)
@@ -1620,7 +1620,8 @@ class t3lib_TStemplate    {
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
                                                'uid,pid,doktype,mount_pid,mount_pid_ol',
                                                'pages',
-                                               'pid='.intval($id).' AND deleted=0 AND doktype!=255 AND doktype!=6'     // 255 = Garbage bin, 6 = Backend User Section
+                                               'pid='.intval($id).' AND deleted=0 AND doktype!=' . t3lib_pageSelect::DOKTYPE_RECYCLER .
+                                                       ' AND doktype!=' . t3lib_pageSelect::DOKTYPE_BE_USER_SECTION
                                        );
                        while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))      {
 
index 309b7cd..6502d52 100644 (file)
  * NOTE: usage of 'icon' is deprecated since TYPO3 4.4, use t3lib_SpriteManager::addTcaTypeIcon() instead
  */
 $PAGES_TYPES = array(
-       '3' => array(
+       (string)t3lib_pageSelect::DOKTYPE_LINK => array(
        ),
-       '4' => array(
+       (string)t3lib_pageSelect::DOKTYPE_SHORTCUT => array(
        ),
-       '5' => array(
+       (string)t3lib_pageSelect::DOKTYPE_HIDE_IN_MENU => array(
        ),
-       '6' => array(
+       (string)t3lib_pageSelect::DOKTYPE_BE_USER_SECTION  => array(
                'type' => 'web',
                'allowedTables' => '*'
        ),
-       '7' => array(
+       (string)t3lib_pageSelect::DOKTYPE_MOUNTPOINT => array(
        ),
-       '199' => array(         // TypoScript: Limit is 200. When the doktype is 200 or above, the page WILL NOT be regarded as a 'page' by TypoScript. Rather is it a system-type page
+       (string)t3lib_pageSelect::DOKTYPE_SPACER => array(              // TypoScript: Limit is 200. When the doktype is 200 or above, the page WILL NOT be regarded as a 'page' by TypoScript. Rather is it a system-type page
                'type' => 'sys',
        ),
-       '254' => array(         //  Doktype 254 is a 'sysFolder' - a general purpose storage folder for whatever you like. In CMS context it's NOT a viewable page. Can contain any element.
+       (string)t3lib_pageSelect::DOKTYPE_SYSFOLDER => array(           //  Doktype 254 is a 'sysFolder' - a general purpose storage folder for whatever you like. In CMS context it's NOT a viewable page. Can contain any element.
                'type' => 'sys',
                'allowedTables' => '*'
        ),
-       '255' => array(         // Doktype 255 is a recycle-bin.
+       (string)t3lib_pageSelect::DOKTYPE_RECYCLER => array(            // Doktype 255 is a recycle-bin.
                'type' => 'sys',
                'allowedTables' => '*'
        ),
index b1d1335..d8be8d8 100644 (file)
@@ -23,12 +23,12 @@ $TCA['pages'] = array(
                                        ),
                                        array(
                                                'LLL:EXT:lang/locallang_tca.php:doktype.I.0',
-                                               '1',
+                                               (string)t3lib_pageSelect::DOKTYPE_DEFAULT,
                                                'i/pages.gif',
                                        ),
                                        array(
                                                'LLL:EXT:cms/locallang_tca.xml:pages.doktype.I.4',
-                                               '6',
+                                               (string)t3lib_pageSelect::DOKTYPE_BE_USER_SECTION,
                                                'i/be_users_section.gif',
                                        ),
                                        array(
@@ -37,17 +37,17 @@ $TCA['pages'] = array(
                                        ),
                                        array(
                                                'LLL:EXT:cms/locallang_tca.xml:pages.doktype.I.2',
-                                               '4',
+                                               (string)t3lib_pageSelect::DOKTYPE_SHORTCUT,
                                                'i/pages_shortcut.gif',
                                        ),
                                        array(
                                                'LLL:EXT:cms/locallang_tca.xml:pages.doktype.I.5',
-                                               '7',
+                                               (string)t3lib_pageSelect::DOKTYPE_MOUNTPOINT,
                                                'i/pages_mountpoint.gif',
                                        ),
                                        array(
                                                'LLL:EXT:cms/locallang_tca.xml:pages.doktype.I.8',
-                                               '3',
+                                               (string)t3lib_pageSelect::DOKTYPE_LINK,
                                                'i/pages_link.gif',
                                        ),
                                        array(
@@ -56,21 +56,21 @@ $TCA['pages'] = array(
                                        ),
                                        array(
                                                'LLL:EXT:lang/locallang_tca.php:doktype.I.1',
-                                               '254',
+                                               (string)t3lib_pageSelect::DOKTYPE_SYSFOLDER,
                                                'i/sysf.gif',
                                        ),
                                        array(
                                                'LLL:EXT:lang/locallang_tca.php:doktype.I.2',
-                                               '255',
+                                               (string)t3lib_pageSelect::DOKTYPE_RECYCLER,
                                                'i/recycler.gif',
                                        ),
                                        array(
                                                'LLL:EXT:cms/locallang_tca.xml:pages.doktype.I.7',
-                                               '199',
+                                               (string)t3lib_pageSelect::DOKTYPE_SPACER,
                                                'i/spacer_icon.gif',
                                        ),
                                ),
-                               'default' => '1',
+                               'default' => (string)t3lib_pageSelect::DOKTYPE_DEFAULT,
                                'iconsInOptionTags' => 1,
                                'noIconsBelowSelect' => 1,
                        ),
index 68a78a9..5b16df5 100644 (file)
@@ -124,7 +124,7 @@ class t3lib_pageselectTest extends tx_phpunit_testcase {
        public function getExtUrlForDokType2ReturnsFalse() {
                $this->assertEquals(
                        FALSE,
-                       $this->pageSelectObject->getExtURL(array('doktype' => 2))
+                       $this->pageSelectObject->getExtURL(array('doktype' => t3lib_pageSelect::DOKTYPE_ADVANCED))
                );
        }
 
@@ -136,7 +136,7 @@ class t3lib_pageselectTest extends tx_phpunit_testcase {
                        'http://www.example.com',
                        $this->pageSelectObject->getExtURL(
                                array(
-                                       'doktype' => 3,
+                                       'doktype' => t3lib_pageSelect::DOKTYPE_LINK,
                                        'urltype' => 1,
                                        'url' => 'www.example.com',
                                )
@@ -152,7 +152,7 @@ class t3lib_pageselectTest extends tx_phpunit_testcase {
                        t3lib_div::getIndpEnv('TYPO3_SITE_URL') . 'hello/world/',
                        $this->pageSelectObject->getExtURL(
                                array(
-                                       'doktype' => 3,
+                                       'doktype' => t3lib_pageSelect::DOKTYPE_LINK,
                                        'urltype' => 0,
                                        'url' => 'hello/world/',
                                )
index d8c12f0..fce0dec 100644 (file)
@@ -253,7 +253,7 @@ class localPageTree extends t3lib_browseTree {
 
                $this->init();
 
-               $this->clause = ' AND doktype!=255'.$this->clause;
+               $this->clause = ' AND doktype!=' . t3lib_pageSelect::DOKTYPE_RECYCLER . $this->clause;
        }
 
        /**
index 91a8a65..2bec6de 100644 (file)
@@ -186,8 +186,8 @@ class localRecordList extends recordList {
                        if (isset($GLOBALS['SOBE']->modTSconfig['properties']['noViewWithDokTypes'])) {
                                $noViewDokTypes = t3lib_div::trimExplode(',', $GLOBALS['SOBE']->modTSconfig['properties']['noViewWithDokTypes'], true);
                        } else {
-                                       //default exclusion: doktype 254, 255
-                               $noViewDokTypes = array('254', '255');
+                                       //default exclusion: doktype 254 (sysfolder), 255 (recycler)
+                               $noViewDokTypes = array(t3lib_pageSelect::DOKTYPE_SYSFOLDER, t3lib_pageSelect::DOKTYPE_RECYCLER);
                        }
 
                        if (!in_array($this->pageRow['doktype'], $noViewDokTypes)) {
index d996f84..df2b03c 100644 (file)
@@ -423,7 +423,9 @@ class webPageTree extends t3lib_browseTree {
 
                                // Not in menu:
                                // @TODO: RFC #7370: doktype 2&5 are deprecated since TYPO3 4.2-beta1
-                       if ($this->ext_separateNotinmenuPages && (t3lib_div::inList('5,6',$row['doktype']) || $row['doktype']>=200 || $row['nav_hide']))        {
+                       if ($this->ext_separateNotinmenuPages &&
+                               ($row['doktype'] == t3lib_pageSelect::DOKTYPE_HIDE_IN_MENU || $row['doktype'] == t3lib_pageSelect::DOKTYPE_BE_USER_SECTION ||
+                                       $row['doktype'] >= 200 || $row['nav_hide'])) {
                                $outOfMenuPages[] = $row;
                                $outOfMenuPagesTextIndex[] = ($row['doktype']>=200 ? 'zzz'.$row['doktype'].'_' : '').$row['title'];
                        } else {
index 50bd5f2..fe0ce14 100755 (executable)
@@ -717,25 +717,25 @@ $TCA['pages_language_overlay'] = array(
        ),
        'types' => array(
                        // Standard
-               '1'   => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2, subtitle, nav_title,                                                                                              --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.metadata, --palette--;LLL:EXT:lang/locallang_general.xml:LGL.author;5;;3-3-3, abstract, keywords, description, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.files, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime'),
+               (string)t3lib_pageSelect::DOKTYPE_DEFAULT => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2, subtitle, nav_title,                                                                                              --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.metadata, --palette--;LLL:EXT:lang/locallang_general.xml:LGL.author;5;;3-3-3, abstract, keywords, description, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.files, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime'),
 
                        // External URL - URL and URL type can be different for the translated page
-               '3'   => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2, subtitle,            --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.url, url;;;;3-3-3, urltype,                                                                                                                                                                                 --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.files, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime'),
+               (string)t3lib_pageSelect::DOKTYPE_LINK => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2, subtitle,            --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.url, url;;;;3-3-3, urltype,                                                                                                                                                                                 --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.files, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime'),
 
                        // Shortcut - shortcut and shortcut mode can be different for the translated page
-               '4'   => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2, subtitle,            --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.shortcut, shortcut;;;;3-3-3, shortcut_mode,                                                                                                                                                                 --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.files, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime'),
+               (string)t3lib_pageSelect::DOKTYPE_SHORTCUT => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2, subtitle,            --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.shortcut, shortcut;;;;3-3-3, shortcut_mode,                                                                                                                                                                 --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.files, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime'),
 
                        // Mount Point - mount point options can _NOT_ be different for the translated page
-               '7'   => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2, subtitle, nav_title,                                                                                                                                                                                                                                                              --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.files, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime'),
+               (string)t3lib_pageSelect::DOKTYPE_MOUNTPOINT => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2, subtitle, nav_title,                                                                                                                                                                                                                                                              --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.files, media;;;;4-4-4, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime'),
 
                        // Separator
-               '199' => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2'),
+               (string)t3lib_pageSelect::DOKTYPE_SPACER => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2'),
 
                        // Sysfolder
-               '254' => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;LLL:EXT:lang/locallang_general.xml:LGL.title;;;2-2-2'),
+               (string)t3lib_pageSelect::DOKTYPE_SYSFOLDER => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;LLL:EXT:lang/locallang_general.xml:LGL.title;;;2-2-2'),
 
                        // Recycler
-               '255' => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2')
+               (string)t3lib_pageSelect::DOKTYPE_RECYCLER => array('showitem' => 'doktype;;;;1-1-1, hidden, sys_language_uid, title;;;;2-2-2')
        ),
        'palettes' => array(
                '5' => array('showitem' => 'author,author_email', 'canNotCollapse' => true)
index 49f8ec0..098d96d 100644 (file)
@@ -5497,10 +5497,10 @@ class tslib_cObj {
                                                                // If we link across domains and page is free type shortcut, we must resolve the shortcut first!
                                                                // If we do not do it, TYPO3 will fail to (1) link proper page in RealURL/CoolURI because
                                                                // they return relative links and (2) show proper page if no RealURL/CoolURI exists when link is clicked
-                                                       if ($enableLinksAcrossDomains && $page['doktype'] == 4 && $page['shortcut_mode'] == 0) {
+                                                       if ($enableLinksAcrossDomains && $page['doktype'] == t3lib_pageSelect::DOKTYPE_SHORTCUT && $page['shortcut_mode'] == t3lib_pageSelect::SHORTCUT_MODE_NONE) {
                                                                $page2 = $page; // Save in case of broken destination or endless loop
                                                                $maxLoopCount = 20; // Same as in RealURL, seems enough
-                                                               while ($maxLoopCount && is_array($page) && $page['doktype'] == 4 && $page['shortcut_mode'] == 0) {
+                                                               while ($maxLoopCount && is_array($page) && $page['doktype'] == t3lib_pageSelect::DOKTYPE_SHORTCUT && $page['shortcut_mode'] == t3lib_pageSelect::SHORTCUT_MODE_NONE) {
                                                                        $page = $GLOBALS['TSFE']->sys_page->getPage($page['shortcut'], $disableGroupAccessCheck);
                                                                        $maxLoopCount--;
                                                                }
@@ -6949,7 +6949,7 @@ class tslib_cObj {
                                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                                        $GLOBALS['TSFE']->sys_page->versionOL('pages', $row);
 
-                                       if ($row['doktype'] == 255 || $row['doktype'] == 6 || $row['t3ver_state'] > 0) {
+                                       if ($row['doktype'] == t3lib_pageSelect::DOKTYPE_RECYCLER || $row['doktype'] == t3lib_pageSelect::DOKTYPE_BE_USER_SECTION || $row['t3ver_state'] > 0) {
                                                        // Doing this after the overlay to make sure changes
                                                        // in the overlay are respected.
                                                        // However, we do not process pages below of and
@@ -6977,7 +6977,7 @@ class tslib_cObj {
 
                                                $GLOBALS['TSFE']->sys_page->versionOL('pages', $row);
 
-                                               if ($row['doktype'] == 255 || $row['doktype'] == 6 || $row['t3ver_state'] > 0) {
+                                               if ($row['doktype'] == t3lib_pageSelect::DOKTYPE_RECYCLER || $row['doktype'] == t3lib_pageSelect::DOKTYPE_BE_USER_SECTION || $row['t3ver_state'] > 0) {
                                                                // Doing this after the overlay to make sure
                                                                // changes in the overlay are respected.
 
index a416143..c6eb01c 100644 (file)
                }
 
                        // Spacer is not accessible in frontend
-               if ($this->page['doktype'] == 199)      {
+               if ($this->page['doktype'] == t3lib_pageSelect::DOKTYPE_SPACER) {
                        if ($this->TYPO3_CONF_VARS['FE']['pageNotFound_handling'])      {
                                $this->pageNotFoundAndExit('The requested page does not exist!');
                        } else {
                }
 
                        // Is the ID a link to another page??
-               if ($this->page['doktype']==4)  {
+               if ($this->page['doktype'] == t3lib_pageSelect::DOKTYPE_SHORTCUT) {
                        $this->MP = '';         // We need to clear MP if the page is a shortcut. Reason is if the short cut goes to another page, then we LEAVE the rootline which the MP expects.
 
                                // saving the page so that we can check later - when we know
                switch($mode)   {
                        case 1:
                        case 2:
-                               $pageArray = $this->sys_page->getMenu($idArray[0]?$idArray[0]:$thisUid,'*','sorting','AND pages.doktype<199 AND pages.doktype!=6');
+                               $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
                                        $randval = intval(rand(0,count($pageArray)-1));
                }
 
                        // Check if short cut page was a shortcut itself, if so look up recursively:
-               if ($page['doktype']==4)        {
+               if ($page['doktype'] == t3lib_pageSelect::DOKTYPE_SHORTCUT) {
                        if (!in_array($page['uid'],$pageLog) && $itera>0)       {
                                $pageLog[] = $page['uid'];
                                $page = $this->getPageShortcut($page['shortcut'],$page['shortcut_mode'],$page['uid'],$itera-1,$pageLog);
                                $this->pageAccessFailureHistory['sub_section'][] = $this->rootLine[$a];
                                $removeTheRestFlag=1;
                        }
-                       if ($this->rootLine[$a]['doktype']==6)  {
+                       if ($this->rootLine[$a]['doktype'] == t3lib_pageSelect::DOKTYPE_BE_USER_SECTION) {
                                if ($this->beUserLogin) {       // If there is a backend user logged in, check if he has read access to the page:
                                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'pages', 'uid='.intval($this->id).' AND '.$GLOBALS['BE_USER']->getPagePermsClause(1));     // versionOL()?
                                        list($isPage) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
index 26e3dd7..d990951 100644 (file)
@@ -1253,7 +1253,7 @@ class tslib_menu {
                }
 
                        // Override URL if using "External URL" as doktype with a valid e-mail address:
-               if ($this->menuArr[$key]['doktype'] == 3 && $this->menuArr[$key]['urltype'] == 3 && t3lib_div::validEmail($this->menuArr[$key]['url'])) {
+               if ($this->menuArr[$key]['doktype'] == t3lib_pageSelect::DOKTYPE_LINK && $this->menuArr[$key]['urltype'] == 3 && t3lib_div::validEmail($this->menuArr[$key]['url'])) {
                                // Create mailto-link using tslib_cObj::typolink (concerning spamProtectEmailAddresses):
                        $LD['totalURL'] = $this->parent_cObj->typoLink_URL(array('parameter' => $this->menuArr[$key]['url']));
                        $LD['target'] = '';
index 2916bd5..2ecec3a 100755 (executable)
@@ -393,7 +393,7 @@ class user_wapversion {
                reset($menu);
                $newMenu=array();
                while(list(,$data)=each($menu)) {
-                       if ($data['doktype']!=5 && !$data['nav_hide'])  {
+                       if ($data['doktype'] != t3lib_pageSelect::DOKTYPE_HIDE_IN_MENU && !$data['nav_hide']) {
                                $newMenu[]=$data;
                        }
                }
index d3efb4d..72c2afd 100755 (executable)
@@ -346,13 +346,13 @@ class tx_indexedsearch extends tslib_pibase {
                        $firstLevelMenu = $this->getMenu($this->wholeSiteIdList);
                        foreach ($firstLevelMenu as $kk => $mR) {
                                        // @TODO: RFC #7370: doktype 2&5 are deprecated since TYPO3 4.2-beta1
-                               if ($mR['doktype']!=5 && !$mR['nav_hide']) {
+                               if ($mR['doktype'] != t3lib_pageSelect::DOKTYPE_HIDE_IN_MENU && !$mR['nav_hide']) {
                                        $this->optValues['sections']['rl1_'.$mR['uid']] = trim($this->pi_getLL('opt_RL1').' '.$mR['title']);
                                        if ($this->conf['show.']['L2sections']) {
                                                $secondLevelMenu = $this->getMenu($mR['uid']);
                                                foreach ($secondLevelMenu as $kk2 => $mR2) {
                                                                // @TODO: RFC #7370: doktype 2&5 are deprecated since TYPO3 4.2-beta1
-                                                       if ($mR2['doktype']!=5 && !$mR2['nav_hide']) {
+                                                       if ($mR2['doktype'] != t3lib_pageSelect::DOKTYPE_HIDE_IN_MENU && !$mR2['nav_hide']) {
                                                                $this->optValues['sections']['rl2_'.$mR2['uid']] = trim($this->pi_getLL('opt_RL2').' '.$mR2['title']);
                                                        } else unset($secondLevelMenu[$kk2]);
                                                }
index 7c4a4a0..045d8b7 100644 (file)
@@ -392,7 +392,7 @@ class user_wapversion {
        function cleanMenuArray($menu)  {
                $newMenu=array();
                foreach ($menu as $data) {
-                       if ($data['doktype']!=5 && !$data['nav_hide'])  {
+                       if ($data['doktype'] != t3lib_pageSelect::DOKTYPE_HIDE_IN_MENU && !$data['nav_hide']) {
                                $newMenu[]=$data;
                        }
                }