Classes/Controller/Ajax/SitemapController.php
protected function executeIndex()
    {
        // Init
        $rootPid      = (int)$this->postVar['pid'];
        $offset       = (int)$this->postVar['start'];
        $itemsPerPage = (int)$this->postVar['pagingSize'];

        $searchFulltext      = trim((string)$this->postVar['criteriaFulltext']);
        $searchPageUid       = trim((int)$this->postVar['criteriaPageUid']);
        $searchPageLanguage  = trim((string)$this->postVar['criteriaPageLanguage']);
        $searchPageDepth     = trim((string)$this->postVar['criteriaPageDepth']);
        $searchIsBlacklisted = (bool)trim((string)$this->postVar['criteriaIsBlacklisted']);

        // ############################
        // Criteria
        // ############################
        $where = array();

        // Root pid limit
        $where[] = 's.page_rootpid = ' . (int)$rootPid;

        // Fulltext
        if (!empty($searchFulltext)) {
            $where[] = 's.page_url LIKE ' . DatabaseUtility::quote('%' . $searchFulltext . '%', 'tx_metaseo_sitemap');
        }

        // Page id
        if (!empty($searchPageUid)) {
            $where[] = 's.page_uid = ' . (int)$searchPageUid;
        }

        // Language
        if ($searchPageLanguage != -1 && strlen($searchPageLanguage) >= 1) {
            $where[] = 's.page_language = ' . (int)$searchPageLanguage;
        }

        // Depth
        if ($searchPageDepth != -1 && strlen($searchPageDepth) >= 1) {
            $where[] = 's.page_depth = ' . (int)$searchPageDepth;
        }

        if ($searchIsBlacklisted) {
            $where[] = 's.is_blacklisted = 1';
        }

        // Filter blacklisted page types
        $where[] = DatabaseUtility::conditionNotIn(
            'p.doktype',
            SitemapUtility::getDoktypeBlacklist()
        );

        // Build where
        $where = DatabaseUtility::buildCondition($where);

        // ############################
        // Pager
        // ############################

        // Fetch total count of items with this filter settings
        $query     = 'SELECT COUNT(*) AS count
                        FROM tx_metaseo_sitemap s
                             INNER JOIN pages p ON p.uid = s.page_uid
                       WHERE ' . $where;
        $itemCount = DatabaseUtility::getOne($query);

        // ############################
        // Sort
        // ############################
        // default sort
        $sort = 's.page_depth ASC, s.page_uid ASC';

        if (!empty($this->sortField) && !empty($this->sortDir)) {
            // already filtered
            $sort = $this->sortField . ' ' . $this->sortDir;
        }

        // ############################
        // Fetch sitemap
        // ############################
        $query = 'SELECT s.uid,
                        s.page_rootpid,
                        s.page_uid,
                        s.page_language,
                        s.page_url,
                        s.page_depth,
                        s.page_type,
                        s.is_blacklisted,
                        p.tx_metaseo_is_exclude,
                        FROM_UNIXTIME(s.tstamp) as tstamp,
                        FROM_UNIXTIME(s.crdate) as crdate
                   FROM tx_metaseo_sitemap s
                        INNER JOIN pages p ON p.uid = s.page_uid
                  WHERE ' . $where . '
               ORDER BY ' . $sort . '
                  LIMIT ' . (int)$offset . ', ' . (int)$itemsPerPage;
        $list  = DatabaseUtility::getAll($query);

        return array(
            'results' => $itemCount,
            'rows'    => $list,
        );
    }
protected function executeIndex()
    {
        // Init
        $rootPid      = (int)$this->postVar['pid'];
        $offset       = (int)$this->postVar['start'];
        $itemsPerPage = (int)$this->postVar['pagingSize'];

        $searchFulltext      = trim((string)$this->postVar['criteriaFulltext']);
        $searchPageUid       = trim((int)$this->postVar['criteriaPageUid']);
        $searchPageLanguage  = trim((string)$this->postVar['criteriaPageLanguage']);
        $searchPageDepth     = trim((string)$this->postVar['criteriaPageDepth']);
        $searchIsBlacklisted = (bool)trim((string)$this->postVar['criteriaIsBlacklisted']);

        // ############################
        // Criteria
        // ############################
        $where = array();

        // Root pid limit
        $where[] = 's.page_rootpid = ' . (int)$rootPid;

        // Fulltext
        if (!empty($searchFulltext)) {
            $where[] = 's.page_url LIKE ' . DatabaseUtility::quote('%' . $searchFulltext . '%', 'tx_metaseo_sitemap');
        }

        // Page id
        if (!empty($searchPageUid)) {
            $where[] = 's.page_uid = ' . (int)$searchPageUid;
        }

        // Language
        if ($searchPageLanguage != -1 && strlen($searchPageLanguage) >= 1) {
            $where[] = 's.page_language = ' . (int)$searchPageLanguage;
        }

        // Depth
        if ($searchPageDepth != -1 && strlen($searchPageDepth) >= 1) {
            $where[] = 's.page_depth = ' . (int)$searchPageDepth;
        }

        if ($searchIsBlacklisted) {
            $where[] = 's.is_blacklisted = 1';
        }

        // Filter blacklisted page types
        $where[] = DatabaseUtility::conditionNotIn(
            'p.doktype',
            SitemapUtility::getDoktypeBlacklist()
        );

        // Build where
        $where = DatabaseUtility::buildCondition($where);

        // ############################
        // Pager
        // ############################

        // Fetch total count of items with this filter settings
        $query     = 'SELECT COUNT(*) AS count
                        FROM tx_metaseo_sitemap s
                             INNER JOIN pages p ON p.uid = s.page_uid
                       WHERE ' . $where;
        $itemCount = DatabaseUtility::getOne($query);

        // ############################
        // Sort
        // ############################
        // default sort
        $sort = 's.page_depth ASC, s.page_uid ASC';

        if (!empty($this->sortField) && !empty($this->sortDir)) {
            // already filtered
            $sort = $this->sortField . ' ' . $this->sortDir;
        }

        // ############################
        // Fetch sitemap
        // ############################
        $query = 'SELECT s.uid,
                        s.page_rootpid,
                        s.page_uid,
                        s.page_language,
                        s.page_url,
                        s.page_depth,
                        s.page_type,
                        s.is_blacklisted,
                        p.tx_metaseo_is_exclude,
                        FROM_UNIXTIME(s.tstamp) as tstamp,
                        FROM_UNIXTIME(s.crdate) as crdate
                   FROM tx_metaseo_sitemap s
                        INNER JOIN pages p ON p.uid = s.page_uid
                  WHERE ' . $where . '
               ORDER BY ' . $sort . '
                  LIMIT ' . (int)$offset . ', ' . (int)$itemsPerPage;
        $list  = DatabaseUtility::getAll($query);

        return array(
            'results' => $itemCount,
            'rows'    => $list,
        );
    }
protected function executeIndex ( ) { // Init $ rootPid = ( int ) $ this -> postVar [ 'pid' ] ; $ offset = ( int ) $ this -> postVar [ 'start' ] ; $ itemsPerPage = ( int ) $ this -> postVar [ 'pagingSize' ] ; $ searchFulltext = trim ( ( string ) $ this -> postVar [ 'criteriaFulltext' ] ) ; $ searchPageUid = trim ( ( int ) $ this -> postVar [ 'criteriaPageUid' ] ) ; $ searchPageLanguage = trim ( ( string ) $ this -> postVar [ 'criteriaPageLanguage' ] ) ; $ searchPageDepth = trim ( ( string ) $ this -> postVar [ 'criteriaPageDepth' ] ) ; $ searchIsBlacklisted = ( bool ) trim ( ( string ) $ this -> postVar [ 'criteriaIsBlacklisted' ] ) ; // ############################ // Criteria // ############################ $ where = array ( ) ; // Root pid limit $ where [ ] = 's.page_rootpid = ' . ( int ) $ rootPid ; // Fulltext if ( ! empty ( $ searchFulltext ) ) { $ where [ ] = 's.page_url LIKE ' . DatabaseUtility :: quote ( '%' . $ searchFulltext . '%' , 'tx_metaseo_sitemap' ) ; } // Page id if ( ! empty ( $ searchPageUid ) ) { $ where [ ] = 's.page_uid = ' . ( int ) $ searchPageUid ; } // Language if ( $ searchPageLanguage != - 1 && strlen ( $ searchPageLanguage ) >= 1 ) { $ where [ ] = 's.page_language = ' . ( int ) $ searchPageLanguage ; } // Depth if ( $ searchPageDepth != - 1 && strlen ( $ searchPageDepth ) >= 1 ) { $ where [ ] = 's.page_depth = ' . ( int ) $ searchPageDepth ; } if ( $ searchIsBlacklisted ) { $ where [ ] = 's.is_blacklisted = 1' ; } // Filter blacklisted page types $ where [ ] = DatabaseUtility :: conditionNotIn ( 'p.doktype' , SitemapUtility :: getDoktypeBlacklist ( ) ) ; // Build where $ where = DatabaseUtility :: buildCondition ( $ where ) ; // ############################ // Pager // ############################ // Fetch total count of items with this filter settings $ query = 'SELECT COUNT(*) AS count
                        FROM tx_metaseo_sitemap s
                             INNER JOIN pages p ON p.uid = s.page_uid
                       WHERE ' . $ where ; $ itemCount = DatabaseUtility :: getOne ( $ query ) ; // ############################ // Sort // ############################ // default sort $ sort = 's.page_depth ASC, s.page_uid ASC' ; if ( ! empty ( $ this -> sortField ) && ! empty ( $ this -> sortDir ) ) { // already filtered $ sort = $ this -> sortField . ' ' . $ this -> sortDir ; } // ############################ // Fetch sitemap // ############################ $ query = 'SELECT s.uid,
                        s.page_rootpid,
                        s.page_uid,
                        s.page_language,
                        s.page_url,
                        s.page_depth,
                        s.page_type,
                        s.is_blacklisted,
                        p.tx_metaseo_is_exclude,
                        FROM_UNIXTIME(s.tstamp) as tstamp,
                        FROM_UNIXTIME(s.crdate) as crdate
                   FROM tx_metaseo_sitemap s
                        INNER JOIN pages p ON p.uid = s.page_uid
                  WHERE ' . $ where . '
               ORDER BY ' . $ sort . '
                  LIMIT ' . ( int ) $ offset . ', ' . ( int ) $ itemsPerPage ; $ list = DatabaseUtility :: getAll ( $ query ) ; return array ( 'results' => $ itemCount , 'rows' => $ list , ) ; }
Return sitemap entry list for root tree

@return    array
Return sitemap entry list for root tree