public static function init() { global $REX; /** * seit REX 4.5.0 wird GENERATED_PATH gesetzt * */ if (isset($REX['GENERATED_PATH'])) { self::$path_file = $REX['GENERATED_PATH'] . '/files/url_control_generate_path_file.php'; } else { self::$path_file = $REX['INCLUDE_PATH'] . '/generated/files/url_control_generate_path_file.php'; } self::$paths = self::getPaths(); }
public static function extension_sitemap_seo42($sitemap) { global $REX; $myself = 'url_control'; $addon = $REX['ADDON'][$myself]['addon']; $rewriter = $REX['ADDON'][$myself]['rewriter']; $query = ' SELECT `article_id`, `clang`, `table`, `table_parameters` FROM ' . $REX['TABLE_PREFIX'] . 'url_control_generate '; $sql = rex_sql::factory(); $sql->setQuery($query); $paths = array(); if ($sql->getRows() >= 1) { $results = $sql->getArray(); foreach ($results as $result) { $article_id = $result['article_id']; $clang = $result['clang']; $a = OOArticle::getArticleById($article_id, $clang); if ($a instanceof OOArticle) { if (isset($rewriter[$addon]['get_url'])) { $func = $rewriter[$addon]['get_url']; $path = call_user_func($func, $article_id, $clang); } else { $path = $a->getUrl(); } $table = $result['table']; $table_params = unserialize($result['table_parameters']); if (isset($table_params[$table][$table . '_sitemap_settings'])) { $sitemapSetting = $table_params[$table][$table . '_sitemap_settings']; } else { $sitemapSetting = 'Artikel ohne dynamische Seiten'; } switch ($sitemapSetting) { case 'Artikel ohne dynamische Seiten': break; case 'Artikel mit dynamische Seiten': $sitemapNode = $sitemap['subject'][$a->getId()][0]; $tableUrls = url_generate::getUrlsByTable($table); foreach ($tableUrls as $tableUrl) { $sitemapNode['loc'] = $tableUrl; $sitemap['subject'][][] = $sitemapNode; } break; case 'Nur dynamische Seiten': $sitemapNode = $sitemap['subject'][$a->getId()][0]; unset($sitemap['subject'][$a->getId()]); $tableUrls = url_generate::getUrlsByTable($table); foreach ($tableUrls as $tableUrl) { $sitemapNode['loc'] = $tableUrl; $sitemap['subject'][][] = $sitemapNode; } break; } } } } return $sitemap['subject']; }
/** * Deprecated * rexseo42 - umbenannt in seo42 */ public static function extension_rewriter_rexseo42() { $params = url_generate::getArticleParams(); return $params; }
$f3 =& $fieldContainer->addGroupedField($group, $type, $name, $value, $attributes = array()); $f3->setHeader('<div class="url-control-grid3col">'); $f3->setLabel($I18N->msg('b_url_control_generate_restriction')); $f3->setAttribute('style', 'width: 200px;'); $select =& $f3->getSelect(); $select->setSize(1); $select->addOption($I18N->msg('b_url_control_generate_no_filter'), ''); $select->addOptions($options, true); $type = 'select'; $name = $table . '_restriction_operator'; $f4 =& $fieldContainer->addGroupedField($group, $type, $name, $value, $attributes = array()); //$f4->setLabel(); $f4->setAttribute('style', 'width: auto;'); $select =& $f4->getSelect(); $select->setSize(1); $select->addOptions(url_generate::getRestrictionOperators()); $type = 'text'; $name = $table . '_restriction_value'; $value = ''; $f5 =& $fieldContainer->addGroupedField($group, $type, $name, $value, $attributes = array()); //$f5->setLabel(); $f5->setFooter('<div class="rex-form-row"><p><span class="rex-form-notice">' . $I18N->msg('b_url_control_generate_notice_restriction') . '</span></p></div></div>'); $type = 'select'; $name = $table . '_sitemap_settings'; $sitemapOptions = array(0 => 'Artikel ohne dynamische Seiten', 1 => 'Artikel mit dynamische Seiten', 2 => 'Nur dynamische Seiten'); $f2 =& $fieldContainer->addGroupedField($group, $type, $name, $value, $attributes = array()); $f2->setLabel($I18N->msg('b_sitemap')); $f2->setAttribute('style', 'width: 200px;'); $f2->setNotice($I18N->msg('b_url_control_generate_notice_sitemap')); $select =& $f2->getSelect(); $select->setSize(1);
/** * get the news ID for the Frontend * @return int|null */ public static function getNewsId() { $id = null; if (rex_asd_news_config::isControlPlugin()) { $id = url_generate::getId(rex_asd_news_config::getTable()); } if ($id == null) { $id = (int) rex_request('news-id'); } return $id; }
$modul->setTable($REX['TABLE_PREFIX'] . 'module'); $modul->setValue('name', $name); $modul->setValue('eingabe', $modul->escape($eingabe)); $modul->setValue('ausgabe', $modul->escape($ausgabe)); $modul->addGlobalCreateFields(); if ($modul->insert()) { echo rex_info($I18N->msg('asd_news_modul_added')); } else { echo rex_warning($modul->getError()); } } $func = ''; } if ($func == 'update-url-control' && rex_asd_news_config::isControlPlugin()) { rex_asd_news_url_control::updateArticleId(rex_asd_news_config::getConfig('article')); url_generate::generatePathFile(''); echo rex_info($I18N->msg('asd_news_settings_saved_url_control')); } $sql = new rex_sql(); $sql->setQuery('SELECT id FROM `' . $REX['TABLE_PREFIX'] . 'module` WHERE `name` = "' . ASD_NEWS_MODUL_1 . '"'); $disabledModul_1 = $sql->getRows() ? ' disabled="disabled"' : ''; $sql = new rex_sql(); $sql->setQuery('SELECT id FROM `' . $REX['TABLE_PREFIX'] . 'module` WHERE `name` = "' . ASD_NEWS_MODUL_2 . '"'); $disabledModul_2 = $sql->getRows() ? ' disabled="disabled"' : ''; $sql = new rex_sql(); $sql->setQuery('SELECT id FROM `' . $REX['TABLE_PREFIX'] . 'module` WHERE `name` = "' . ASD_NEWS_MODUL_3 . '"'); $disabledModul_3 = $sql->getRows() ? ' disabled="disabled"' : ''; ?> <style> .asd-modul-buttons input { margin: 4px 0;