Skip to content
Snippets Groups Projects
Commit 2c1f931c authored by Tim Steiner's avatar Tim Steiner
Browse files

[gh-298] Merging trunk into testing -c 1471,1472

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/testing@1473 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 83f150ee
No related branches found
No related tags found
No related merge requests found
......@@ -1052,6 +1052,7 @@ function unl_get_alternate_base_uris() {
* Implementation of hook_init().
*/
function unl_init() {
// Redirect to desired URL if needed
$primary_base_url = variable_get('unl_primary_base_url');
if ($primary_base_url) {
if (substr($primary_base_url, -1) != '/') {
......@@ -1067,20 +1068,30 @@ function unl_init() {
}
}
drupal_add_js('sites/all/modules/unl/unl.js');
// Insert <base> tag
if (variable_get('unl_use_base_tag', TRUE)) {
$base_href = url('<front>', array('absolute' => TRUE));
if (substr($base_href, -1) != '/') {
$base_href .= '/';
}
if ($GLOBALS['is_https']) {
$base_href = str_replace('http://', 'https://', $base_href);
}
$base_tag = array(
'#type' => 'html_tag',
'#tag' => 'base',
'#attributes' => array(
'href' => '//' . $_SERVER['HTTP_HOST'] . base_path(),
'href' => $base_href
),
);
drupal_add_html_head($base_tag, 'base');
}
drupal_add_js(array('unl' => array('use_base_tag' => variable_get('unl_use_base_tag', TRUE))), 'setting');
// Add JS
drupal_add_js('sites/all/modules/unl/unl.js');
// Handle unneeded index.html references
_unl_handle_directory_index();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment