Ejemplo n.º 1
0
 /**
  * Fetch list of setting entries
  *
  * @return  array
  */
 public static function getRootPageSettingList()
 {
     static $cache = NULL;
     if ($cache === NULL) {
         $query = 'SELECT seosr.*
                     FROM tx_metaseo_setting_root seosr
                          INNER JOIN pages p
                             ON  p.uid = seosr.pid
                             AND p.is_siteroot = 1
                             AND p.deleted = 0
                     WHERE seosr.deleted = 0';
         $cache = DatabaseUtility::getAllWithIndex($query, 'pid');
     }
     return $cache;
 }
Ejemplo n.º 2
0
 /**
  * Return list of sitemap pages
  *
  * @param   integer $rootPid        Root page id of tree
  * @param   integer $languageId     Limit to language id
  * @return  boolean|array
  */
 public static function getList($rootPid, $languageId = NULL)
 {
     $sitemapList = array();
     $pageList = array();
     $typo3Pids = array();
     $query = 'SELECT ts.*
                 FROM tx_metaseo_sitemap ts
                         INNER JOIN pages p
                           ON	p.uid = ts.page_uid
                             AND	p.deleted = 0
                             AND	p.hidden = 0
                             AND	p.tx_metaseo_is_exclude = 0
                WHERE ts.page_rootpid = ' . (int) $rootPid . '
                  AND ts.is_blacklisted = 0';
     if ($languageId !== NULL) {
         $query .= ' AND ts.page_language = ' . (int) $languageId;
     }
     $query .= ' ORDER BY
                     ts.page_depth ASC,
                     p.pid ASC,
                     p.sorting ASC';
     $resultRows = DatabaseUtility::getAll($query);
     if (!$resultRows) {
         return FALSE;
     }
     foreach ($resultRows as $row) {
         $sitemapList[] = $row;
         $sitemapPageId = $row['page_uid'];
         $typo3Pids[$sitemapPageId] = (int) $sitemapPageId;
     }
     if (!empty($typo3Pids)) {
         $query = 'SELECT *
                     FROM pages
                    WHERE ' . DatabaseUtility::conditionIn('uid', $typo3Pids);
         $pageList = DatabaseUtility::getAllWithIndex($query, 'uid');
         if (empty($pageList)) {
             return FALSE;
         }
     }
     $ret = array('tx_metaseo_sitemap' => $sitemapList, 'pages' => $pageList);
     return $ret;
 }