|
Lines 52-57
use Koha::Context::Preferences;
Link Here
|
| 52 |
use Koha::Config; |
52 |
use Koha::Config; |
| 53 |
use Koha::Database; |
53 |
use Koha::Database; |
| 54 |
use Koha::Context::UserEnv; |
54 |
use Koha::Context::UserEnv; |
|
|
55 |
use Koha::Context::Interface; |
| 55 |
|
56 |
|
| 56 |
=head1 NAME |
57 |
=head1 NAME |
| 57 |
|
58 |
|
|
Lines 816-836
sub interface {
Link Here
|
| 816 |
my ( $class, $interface ) = @_; |
817 |
my ( $class, $interface ) = @_; |
| 817 |
|
818 |
|
| 818 |
if ( defined $interface ) { |
819 |
if ( defined $interface ) { |
| 819 |
$interface = lc $interface; |
820 |
return Koha::Context::Interface::set_interface($interface); |
| 820 |
if ( $interface eq 'api' |
821 |
} else { |
| 821 |
|| $interface eq 'opac' |
822 |
return Koha::Context::Interface::get_interface(); |
| 822 |
|| $interface eq 'intranet' |
|
|
| 823 |
|| $interface eq 'sip' |
| 824 |
|| $interface eq 'cron' |
| 825 |
|| $interface eq 'commandline' ) |
| 826 |
{ |
| 827 |
$context->{interface} = $interface; |
| 828 |
} else { |
| 829 |
warn "invalid interface : '$interface'"; |
| 830 |
} |
| 831 |
} |
823 |
} |
| 832 |
|
|
|
| 833 |
return $context->{interface} // 'opac'; |
| 834 |
} |
824 |
} |
| 835 |
|
825 |
|
| 836 |
# always returns a string for OK comparison via "eq" or "ne" |
826 |
# always returns a string for OK comparison via "eq" or "ne" |