|
Lines 236-242
our $mapping = {
Link Here
|
| 236 |
'plugins/plugins-upload' => '/plugins.html', |
236 |
'plugins/plugins-upload' => '/plugins.html', |
| 237 |
'preservation/home' => '/preservation.html', |
237 |
'preservation/home' => '/preservation.html', |
| 238 |
'preservation/settings/processings/add' => '/preservation.html#add-a-new-processing', |
238 |
'preservation/settings/processings/add' => '/preservation.html#add-a-new-processing', |
| 239 |
'preservation/settings/processings/edit/' => '/preservation.html#add-a-new-processing', |
239 |
'preservation/settings/processings/edit/' => '/preservation.html#add-a-new-processing', |
| 240 |
'preservation/settings' => '/preservation.html#settings', |
240 |
'preservation/settings' => '/preservation.html#settings', |
| 241 |
'preservation/settings/' => '/preservation.html#settings', |
241 |
'preservation/settings/' => '/preservation.html#settings', |
| 242 |
'preservation/trains' => '/preservation.html#trains', |
242 |
'preservation/trains' => '/preservation.html#trains', |
|
Lines 308-330
our $mapping = {
Link Here
|
| 308 |
sub get_url { |
308 |
sub get_url { |
| 309 |
my ( $url, $preferred_language ) = @_; |
309 |
my ( $url, $preferred_language ) = @_; |
| 310 |
my $file; |
310 |
my $file; |
| 311 |
if ($url =~ /koha\/(.*)\.pl/ || $url =~ '/koha/(erm.*)' || $url =~ '/koha/(preservation.*)') { |
311 |
if ( $url =~ /koha\/(.*)\.pl/ || $url =~ '/koha/(erm.*)' || $url =~ '/koha/(preservation.*)' ) { |
| 312 |
$file = $1; |
312 |
$file = $1; |
| 313 |
} else { |
313 |
} else { |
| 314 |
$file = 'mainpage'; |
314 |
$file = 'mainpage'; |
| 315 |
} |
315 |
} |
| 316 |
$file =~ s/[^a-zA-Z0-9_\-\/]*//g; |
316 |
$file =~ s/[^a-zA-Z0-9_\-\/]*//g; |
| 317 |
|
317 |
|
| 318 |
if ( $file =~ m|^erm| || $file =~ m|^preservation|) { |
318 |
if ( $file =~ m|^erm| || $file =~ m|^preservation| ) { |
| 319 |
$file =~ s|\d*+||g; |
319 |
$file =~ s|\d*+||g; |
| 320 |
} |
320 |
} |
| 321 |
|
321 |
|
| 322 |
my $view; |
322 |
my $view; |
| 323 |
if ($url =~ /(?:\?|\&)tab=(?<value>[\w+,.-]*)/) { |
323 |
if ( $url =~ /(?:\?|\&)tab=(?<value>[\w+,.-]*)/ ) { |
| 324 |
$view = $file . '#' . $+{value}; |
324 |
$view = $file . '#' . $+{value}; |
| 325 |
} |
325 |
} |
| 326 |
|
326 |
|
| 327 |
my $base_url = _get_base_url( $preferred_language ); |
327 |
my $base_url = _get_base_url($preferred_language); |
| 328 |
return $base_url |
328 |
return $base_url |
| 329 |
. ( |
329 |
. ( |
| 330 |
exists $mapping->{$view} ? $mapping->{$view} |
330 |
exists $mapping->{$view} ? $mapping->{$view} |
| 331 |
- |
|
|