concrete/src/Page/Page.php
public function rescanSystemPageStatus()
    {
        $systemPage = false;
        $db = Database::connection();
        $cID = $this->getCollectionID();
        if (!$this->isHomePage()) {
            if ($this->getSiteTreeID() == 0) {
                $systemPage = true;
            } else {
                $cID = ($this->getCollectionPointerOriginalID() > 0) ? $this->getCollectionPointerOriginalID() : $this->getCollectionID();
                $db = Database::connection();
                $path = $db->fetchColumn('select cPath from PagePaths where cID = ? and ppIsCanonical = 1', array($cID));
                if ($path) {
                    // Grab the top level parent
                    $fragments = explode('/', $path);
                    $topPath = '/' . $fragments[1];
                    $c = \Page::getByPath($topPath);
                    if (is_object($c) && !$c->isError()) {
                        if ($c->getCollectionParentID() == 0 && !$c->isHomePage()) {
                            $systemPage = true;
                        }
                    }
                }
            }
        }

        if ($systemPage) {
            $db->executeQuery('update Pages set cIsSystemPage = 1 where cID = ?', array($cID));
            $this->cIsSystemPage = true;
        } else {
            $db->executeQuery('update Pages set cIsSystemPage = 0 where cID = ?', array($cID));
            $this->cIsSystemPage = false;
        }
    }
public function rescanSystemPageStatus()
    {
        $systemPage = false;
        $db = Database::connection();
        $cID = $this->getCollectionID();
        if (!$this->isHomePage()) {
            if ($this->getSiteTreeID() == 0) {
                $systemPage = true;
            } else {
                $cID = ($this->getCollectionPointerOriginalID() > 0) ? $this->getCollectionPointerOriginalID() : $this->getCollectionID();
                $db = Database::connection();
                $path = $db->fetchColumn('select cPath from PagePaths where cID = ? and ppIsCanonical = 1', array($cID));
                if ($path) {
                    // Grab the top level parent
                    $fragments = explode('/', $path);
                    $topPath = '/' . $fragments[1];
                    $c = \Page::getByPath($topPath);
                    if (is_object($c) && !$c->isError()) {
                        if ($c->getCollectionParentID() == 0 && !$c->isHomePage()) {
                            $systemPage = true;
                        }
                    }
                }
            }
        }

        if ($systemPage) {
            $db->executeQuery('update Pages set cIsSystemPage = 1 where cID = ?', array($cID));
            $this->cIsSystemPage = true;
        } else {
            $db->executeQuery('update Pages set cIsSystemPage = 0 where cID = ?', array($cID));
            $this->cIsSystemPage = false;
        }
    }
public function rescanSystemPageStatus ( ) { $ systemPage = false ; $ db = Database :: connection ( ) ; $ cID = $ this -> getCollectionID ( ) ; if ( ! $ this -> isHomePage ( ) ) { if ( $ this -> getSiteTreeID ( ) == 0 ) { $ systemPage = true ; } else { $ cID = ( $ this -> getCollectionPointerOriginalID ( ) > 0 ) ? $ this -> getCollectionPointerOriginalID ( ) : $ this -> getCollectionID ( ) ; $ db = Database :: connection ( ) ; $ path = $ db -> fetchColumn ( 'select cPath from PagePaths where cID = ? and ppIsCanonical = 1' , array ( $ cID ) ) ; if ( $ path ) { // Grab the top level parent $ fragments = explode ( '/' , $ path ) ; $ topPath = '/' . $ fragments [ 1 ] ; $ c = \ Page :: getByPath ( $ topPath ) ; if ( is_object ( $ c ) && ! $ c -> isError ( ) ) { if ( $ c -> getCollectionParentID ( ) == 0 && ! $ c -> isHomePage ( ) ) { $ systemPage = true ; } } } } } if ( $ systemPage ) { $ db -> executeQuery ( 'update Pages set cIsSystemPage = 1 where cID = ?' , array ( $ cID ) ) ; $ this -> cIsSystemPage = true ; } else { $ db -> executeQuery ( 'update Pages set cIsSystemPage = 0 where cID = ?' , array ( $ cID ) ) ; $ this -> cIsSystemPage = false ; } }
Recalculate the "is a system page" state.
Looks at the current page. If the site tree ID is 0, sets system page to true.
If the site tree is not user, looks at where the page falls in the hierarchy. If it's inside a page
at the top level that has 0 as its parent, then it is considered a system page.
Recalculate the is a system page state . Looks at the current page . If the site tree ID is 0 sets system page to true . If the site tree is not user looks at where the page falls in the hierarchy . If it s inside a page at the top level that has 0 as its parent then it is considered a system page .