Commit e9aa6422 authored by webchick's avatar webchick

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
......@@ -354,9 +354,14 @@ Drupal.overlay.isAdminLink = function (url) {
// Turn the list of administrative paths into a regular expression.
if (!this.adminPathRegExp) {
var regExpPrefix = '' + Drupal.settings.pathPrefix + '(';
var adminPaths = regExpPrefix + Drupal.settings.overlay.paths.admin.replace(/\s+/g, ')$|' + regExpPrefix) + ')$';
var nonAdminPaths = regExpPrefix + Drupal.settings.overlay.paths.non_admin.replace(/\s+/g, ')$|'+ regExpPrefix) + ')$';
var prefix = '';
if (Drupal.settings.overlay.pathPrefixes.length) {
// 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, '.*');
nonAdminPaths = nonAdminPaths.replace(/\*/g, '.*');
this.adminPathRegExp = new RegExp(adminPaths);
......
......@@ -638,6 +638,13 @@ function overlay_overlay_parent_initialize() {
$type = str_replace('<front>', variable_get('site_frontpage', 'user'), $type);
}
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.
drupal_add_js(array('overlay' => array('ajaxCallback' => 'overlay-ajax')), 'setting');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment