protected static function prepareDir($dir) { return seo42::getUrlStart() . trim($dir, './') . '/'; }
<link rel="stylesheet" href="<?php echo seo42::getCSSFile("http://fonts.googleapis.com/css?family=Fjalla+One"); ?>" type="text/css" media="screen" /> <link rel="stylesheet" href="<?php echo seo42::getResourceFile("resources/mediaelement/mediaelementplayer.css"); ?>" type="text/css" media="screen" /> <link rel="shortcut icon" href="<?php echo seo42::getFavIconFile("favicon.ico"); ?>" /> <script type="text/javascript" src="<?php echo seo42::getCombinedJSFile("combined.js", array("jquery.magnific-popup.min.js", "jquery.nivo-slider.min.js")); ?>"></script> <script type="text/javascript" src="<?php echo seo42::getJSFile("http://codeorigin.jquery.com/jquery-2.0.3.min.js"); ?>"></script> <script type="text/javascript" src="<?php echo seo42::getResourceFile("resources/mediaelement/mediaelement-and-player.min.js"); ?>"></script> <script type="text/javascript" src="<?php echo seo42::getJSFile("init.js"); ?>"></script> <script type="text/javascript"><?php echo seo42::getJSCodeFromTemplate(5); ?></script> <img src="<?php echo seo42::getImageFile("logo.png"); ?>" /> '; $codeExample3 = '<?php echo seo42::getImageManagerFile("image.png", "rex_mediapool_detail"); // --> ' . seo42::getUrlStart() . seo42::imageTypesDir . '/rex_mediapool_detail/image.png ?>'; $codeExample4 = '<!DOCTYPE html> <html lang="<?php echo seo42::getLangCode(); ?>">'; $codeExample5 = '<title><?php echo seo42::getTitle(rex_string_table::getString("website_name")); ?></title>'; $codeExample5a = '<?php echo seo42::getUrlString("The Hitchhiker\'s Guide to the Galaxy!"); // --> the-hitchhikers-guide-to-the-galaxy ?>'; $codeExample7 = '<?php // --> ' . strtoupper($I18N->msg('seo42_help_codeexamples_ex7_comment1')) . ' class seo42_ex extends seo42 { public static function getTitle($websiteName = "") { if ($websiteName == "") { // use default website name if user did not set different one $websiteName = self::getWebsiteName();
/** * REWRITE() * * rewrite URL * @param $params from EP URL_REWRITE */ function rewrite($params) { // URL ALREADY SET BY OTHER EXTENSION if ($params['subject'] != '') { return $params['subject']; } // EP "SEO42_PRE_REWRITE" $url = rex_register_extension_point('SEO42_PRE_REWRITE', false, $params); if ($url !== false) { return $url; } global $REX, $SEO42_IDS; $id = $params['id']; $name = $params['name']; $clang = $params['clang']; $subdir = ''; // 42 | $REX['ADDON']['seo42']['settings']['install_subdir'] $notfound_id = $REX['NOTFOUND_ARTICLE_ID']; // GET PARAMS STRING $urlparams = self::makeUrlParams($params); // GET URL FROM PATHLIST AND APPEND PARAMS if (isset($SEO42_IDS[$id]) && isset($SEO42_IDS[$id][$clang])) { $base_url = $SEO42_IDS[$id][$clang]['url']; $url = $base_url . $urlparams; $notfound = false; } else { // RexDude $url = ''; $base_url = ''; if (!empty($SEO42_IDS)) { if (!isset($SEO42_IDS[$notfound_id][$clang]['url'])) { $clang = $REX['START_CLANG_ID']; } $url = $base_url = $SEO42_IDS[$notfound_id][$clang]['url']; } $notfound = true; } // URL START // 42 if ($REX['REDAXO'] && !(rex_request('page', 'string') == 'seo42' && rex_request('subpage', 'string') == 'help')) { // for seo42 debug page urls should look like in frontend $subdir = ''; } else { $subdir = seo42::getUrlStart() . $subdir; } // HACK: EP URL_REWRITE WON'T ACCEPT EMPTY STRING AS RETURN if ($subdir == '' && $url == '') { $url = ' '; } // str_replace fixes a caching bug that appears while updating specific // modules/slices in the redaxo backend $url = str_replace('/redaxo/', '/', $subdir . $url); // retrieve trimmend url $trimmedUrl = seo42::trimUrl($url); // external urls / javascript urls etc. so we have to remove the url start string if (!seo42_utils::isInternalCustomUrl($trimmedUrl)) { $url = $trimmedUrl; } // EP "SEO42_POST_REWRITE" $ep_params = array('article_id' => $id, 'clang' => $clang, 'notfound' => $notfound, 'base_url' => $base_url, 'subdir' => $subdir, 'urlparams' => $urlparams, 'params' => $params['params'], 'divider' => $params['divider']); $url = rex_register_extension_point('SEO42_POST_REWRITE', $url, $ep_params); return $url; }