Revision 6c1a6712
Added by Andreas Kohlbecker almost 4 years ago
modules/cdm_dataportal/cdm_dataportal.module | ||
---|---|---|
396 | 396 |
// dependencies and they won't load." |
397 | 397 |
// |
398 | 398 |
// universalviewerPath will be used to build the root config variable. |
399 |
$folders_up = preg_replace('/[^\/]+/', '..', $_GET['q']); |
|
400 |
$folders_up = preg_replace('/\.\.$/', '', $folders_up); |
|
399 |
$iCleanUrlRequest = strpos($_SERVER['REQUEST_URI'], 'q=cdm_dataportal/') === false; |
|
400 |
if($iCleanUrlRequest){ |
|
401 |
$folders_up = preg_replace('/[^\/]+/', '..', $_GET['q']); |
|
402 |
$folders_up = preg_replace('/\.\.$/', '', $folders_up); |
|
403 |
} else { |
|
404 |
$folders_up = ''; |
|
405 |
} |
|
406 |
$basePath = base_path(); |
|
401 | 407 |
$config_file = 'uv-config.json'; |
402 | 408 |
drupal_add_js(' |
403 | 409 |
console.log(\'jQuery inline: \' + jQuery.fn.jquery); |
... | ... | |
405 | 411 |
jQuery( "' . $jquery_selector . '" ).jqUniversalviewer( |
406 | 412 |
{ |
407 | 413 |
root: \'' . $folders_up . $universalviewer_path . '/uv\', |
408 |
configUri: \'' . base_path() . $universalviewer_path . '/'. $config_file . '\',
|
|
414 |
configUri: \'' . $basePath . $universalviewer_path . '/'. $config_file . '\',
|
|
409 | 415 |
manifestUri: \'' . $manifest_uri . '\' |
410 | 416 |
} |
411 | 417 |
); |
Also available in: Unified diff
fix #8994 adapting universalviewer_path according to clean urls usage