|
Lines 1-9
Link Here
|
| 1 |
package Koha::Manual; |
1 |
package Koha::Manual; |
| 2 |
|
2 |
|
|
|
3 |
# This file is part of Koha. |
| 4 |
# |
| 5 |
# Koha is free software; you can redistribute it and/or modify it |
| 6 |
# under the terms of the GNU General Public License as published by |
| 7 |
# the Free Software Foundation; either version 3 of the License, or |
| 8 |
# (at your option) any later version. |
| 9 |
# |
| 10 |
# Koha is distributed in the hope that it will be useful, but |
| 11 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
# GNU General Public License for more details. |
| 14 |
# |
| 15 |
# You should have received a copy of the GNU General Public License |
| 16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
| 17 |
|
| 3 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 4 |
|
19 |
|
| 5 |
use C4::Context; |
20 |
use C4::Context; |
| 6 |
|
21 |
|
|
|
22 |
=head1 NAME |
| 23 |
|
| 24 |
Koha::Manual - Build links to the documentation |
| 25 |
|
| 26 |
=head1 API |
| 27 |
|
| 28 |
=head2 Class Methods |
| 29 |
|
| 30 |
=head3 _get_help_version |
| 31 |
|
| 32 |
Return the version to use. |
| 33 |
Either the system preference "Version", or the last version.major value if using unstable. |
| 34 |
|
| 35 |
=cut |
| 36 |
|
| 7 |
sub _get_help_version { |
37 |
sub _get_help_version { |
| 8 |
my $help_version = C4::Context->preference("Version"); |
38 |
my $help_version = C4::Context->preference("Version"); |
| 9 |
if ( $help_version =~ m|^(\d+)\.(\d{2}).*$| ) { |
39 |
if ( $help_version =~ m|^(\d+)\.(\d{2}).*$| ) { |
|
Lines 16-21
sub _get_help_version {
Link Here
|
| 16 |
return $help_version; |
46 |
return $help_version; |
| 17 |
} |
47 |
} |
| 18 |
|
48 |
|
|
|
49 |
=head3 _get_base_url |
| 50 |
|
| 51 |
Return the base URL to use. |
| 52 |
|
| 53 |
Use system preferences 'KohaManualLanguage' and 'KohaManualBaseURL' to properly build the URL. |
| 54 |
|
| 55 |
=cut |
| 56 |
|
| 19 |
sub _get_base_url { |
57 |
sub _get_base_url { |
| 20 |
my ($preferred_language) = @_; |
58 |
my ($preferred_language) = @_; |
| 21 |
|
59 |
|
|
Lines 314-319
our $mapping = {
Link Here
|
| 314 |
'virtualshelves/shelves' => '/lists.html#lists', |
352 |
'virtualshelves/shelves' => '/lists.html#lists', |
| 315 |
}; |
353 |
}; |
| 316 |
|
354 |
|
|
|
355 |
=head3 get_url |
| 356 |
|
| 357 |
my $koha_manual_url = Koha::Manual::get_url($referer, $lang); |
| 358 |
|
| 359 |
Return the external URL to the manual for the I<$url> passed in parameter |
| 360 |
|
| 361 |
=cut |
| 362 |
|
| 317 |
sub get_url { |
363 |
sub get_url { |
| 318 |
my ( $url, $preferred_language ) = @_; |
364 |
my ( $url, $preferred_language ) = @_; |
| 319 |
my $file; |
365 |
my $file; |
| 320 |
- |
|
|