Skip to content
Snippets Groups Projects
Commit e9aa6422 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1431076 by c960657, nod_, purencool, Nor4a: Fixed Overlay does not work...

Issue #1431076 by c960657, nod_, purencool, Nor4a: Fixed Overlay does not work with prefixed URL paths .
parent f9c539aa
No related branches found
No related tags found
No related merge requests found
...@@ -354,9 +354,14 @@ Drupal.overlay.isAdminLink = function (url) { ...@@ -354,9 +354,14 @@ Drupal.overlay.isAdminLink = function (url) {
// Turn the list of administrative paths into a regular expression. // Turn the list of administrative paths into a regular expression.
if (!this.adminPathRegExp) { if (!this.adminPathRegExp) {
var regExpPrefix = '' + Drupal.settings.pathPrefix + '('; var prefix = '';
var adminPaths = regExpPrefix + Drupal.settings.overlay.paths.admin.replace(/\s+/g, ')$|' + regExpPrefix) + ')$'; if (Drupal.settings.overlay.pathPrefixes.length) {
var nonAdminPaths = regExpPrefix + Drupal.settings.overlay.paths.non_admin.replace(/\s+/g, ')$|'+ regExpPrefix) + ')$'; // Allow path prefixes used for language negatiation followed by slash,
// and the empty string.
prefix = '(' + Drupal.settings.overlay.pathPrefixes.join('/|') + '/|)';
}
var adminPaths = '^' + prefix + '(' + Drupal.settings.overlay.paths.admin.replace(/\s+/g, '|') + ')$';
var nonAdminPaths = '^' + prefix + '(' + Drupal.settings.overlay.paths.non_admin.replace(/\s+/g, '|') + ')$';
adminPaths = adminPaths.replace(/\*/g, '.*'); adminPaths = adminPaths.replace(/\*/g, '.*');
nonAdminPaths = nonAdminPaths.replace(/\*/g, '.*'); nonAdminPaths = nonAdminPaths.replace(/\*/g, '.*');
this.adminPathRegExp = new RegExp(adminPaths); this.adminPathRegExp = new RegExp(adminPaths);
......
...@@ -638,6 +638,13 @@ function overlay_overlay_parent_initialize() { ...@@ -638,6 +638,13 @@ function overlay_overlay_parent_initialize() {
$type = str_replace('<front>', variable_get('site_frontpage', 'user'), $type); $type = str_replace('<front>', variable_get('site_frontpage', 'user'), $type);
} }
drupal_add_js(array('overlay' => array('paths' => $paths)), 'setting'); drupal_add_js(array('overlay' => array('paths' => $paths)), 'setting');
$path_prefixes = array();
if (module_exists('locale') && variable_get('locale_language_negotiation_url_part', LANGUAGE_NEGOTIATION_URL_PREFIX) == LANGUAGE_NEGOTIATION_URL_PREFIX) {
// Skip the empty string indicating the default language. We always accept
// paths without a prefix.
$path_prefixes = array_values(array_filter(locale_language_negotiation_url_prefixes()));
}
drupal_add_js(array('overlay' => array('pathPrefixes' => $path_prefixes)), 'setting');
// Pass along the Ajax callback for rerendering sections of the parent window. // Pass along the Ajax callback for rerendering sections of the parent window.
drupal_add_js(array('overlay' => array('ajaxCallback' => 'overlay-ajax')), 'setting'); drupal_add_js(array('overlay' => array('ajaxCallback' => 'overlay-ajax')), 'setting');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment