public function getHreflangTags() { $return = ''; $current_mount_id = $this->domain->getMountId(); $lang_domains = []; foreach (rex_yrewrite::getDomains() as $domain) { if ($current_mount_id == $domain->getMountId()) { foreach ($domain->getClangs() as $clang) { if ($lang = rex_clang::get($clang)) { $lang_domains[$lang->getCode()] = rex_yrewrite::getFullUrlByArticleId($domain->getStartId(), $lang->getId()); } } } } foreach ($lang_domains as $code => $url) { $return .= '<link rel="alternate" hreflang="' . $code . '" href="' . $url . '" />'; } return $return; }
<p>' . rex_i18n::rawMsg('yrewrite_info_seo_text') . ' <br /><br />' . highlight_string('<?php $seo = new rex_yrewrite_seo(); echo $seo->getTitleTag(); echo $seo->getDescriptionTag(); echo $seo->getRobotsTag(); echo $seo->getHreflangTags(); ?>', true) . ' </p> '; $fragment = new rex_fragment(); $fragment->setVar('title', $this->i18n('setup')); $fragment->setVar('body', $content, false); echo $fragment->parse('core/page/section.php'); $domains = []; foreach (rex_yrewrite::getDomains() as $name => $domain) { if ($name != 'default') { $domains[] = '<tr><td><a href="' . $domain->getUrl() . '">' . htmlspecialchars($name) . '</a></td><td><a href="' . $domain->getUrl() . 'sitemap.xml">sitemap.xml</a></td><td><a href="' . $domain->getUrl() . 'robots.txt">robots.txt</a></td></tr>'; } } $tables = '<table class="table table-hover"> <tr> <th>Domain</th><th>Sitemap</th><th>robots.txt</th></tr> ' . implode('', $domains) . ' </table>'; $fragment = new rex_fragment(); $fragment->setVar('title', $this->i18n('info_sitemaprobots')); $fragment->setVar('content', $tables, false); echo $fragment->parse('core/page/section.php');