/** * GET SITEMAP ARTICLES FROM DB * * @return (array) sitemap articles */ private function get_db_articles() { global $REX, $SEO42_URLS; if ($REX['ADDON']['seo42']['settings']['rewriter']) { // use seo42 pathlist array_multisort($SEO42_URLS); foreach ($SEO42_URLS as $url) { $article = OOArticle::getArticleById($url['id'], $url['clang']); if (OOArticle::isValid($article)) { $hasPermission = true; // community addon if (class_exists('rex_com_auth') && !rex_com_auth::checkPerm($article)) { $hasPermission = false; } // add sitemap block if (($article->isOnline() || $article->getId() == $REX['START_ARTICLE_ID'] && $article->getClang() == $REX['START_CLANG_ID']) && !isset($url['status']) && $hasPermission) { $db_articles[$url['id']][$url['clang']] = array('loc' => rex_getUrl($url['id'], $url['clang']), 'lastmod' => date('c', $article->getValue('updatedate')), 'changefreq' => self::calc_article_changefreq($article->getValue('updatedate'), ''), 'priority' => self::calc_article_priority($url['id'], $url['clang'], $article->getValue('path'), ''), 'noindex' => $article->getValue('seo_noindex')); } } } } else { // at the moment: no sitemap urls if rewriter is turned off } // EXTENSIONPOINT SEO42_SITEMAP_ARRAY_CREATED $db_articles = rex_register_extension_point('SEO42_SITEMAP_ARRAY_CREATED', $db_articles); // EXTENSIONPOINT SEO42_SITEMAP_ARRAY_FINAL (READ ONLY) rex_register_extension_point('SEO42_SITEMAP_ARRAY_FINAL', $db_articles); $this->db_articles = $db_articles; }
protected function checkPerm($nav, $depth) { return rex_com_auth::checkPerm($nav); }
public static function checkArticlePerm($article) { $perm = true; if (class_exists('rex_com_auth')) { $perm = rex_com_auth::checkPerm($article); if ($perm == false) { return false; } } $perm = rex_extension::registerPoint(new rex_extension_point('YREWRITE_ARTICLE_PERM', $perm, ['article' => $article])); return $perm; }