ONO::FW::Edu::Apps::Variation

package ONO::FW::Edu::Apps::Variation;
################################################################################
# COPYRIGHT / LICENSE #
################################################################################
#
# This file is part of the ONO Software Project.
#
# Copyright (C) 2022-2026 Jos Kirps and The Joopita Project [ASBL]
# Copyright (C) 2011-2022 Jos Kirps and Joopita Research ASBL
# Copyright (C) 2006-2011 Jos Kirps and The Joopita Project
# Copyright (C) 2001-2006 Jos Kirps and The WobbleWolf Project
#
# This file, as well as many other parts of the ONO Software Project or
# related elements, are FREE SOFTWARE available under the ARTISTIC LICENSE 2.0.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# For the full license, see /ono/osr/license/LICENSE.txt, or write to
# jos_AT_kirps_DOT_com or contact_AT_joopita_DOT_com.
#
################################################################################
# END OF COPYRIGHT / LICENSE, HERE COMES THE CODE ... #
################################################################################

use CGI::Carp qw(fatalsToBrowser);
use strict;

use ONO::IO;
use ONO::DB;

use ONO::Lib::Web::Domain;

#: This module identifies the underlying platform, making sure that the correct content will be displayed to the correct visitors.

sub variation {

#: Detect the underlying platform.

my $VAR = "education.lu";

if ($ENV{'SERVER_NAME'} =~ /oli\.lu/i) {

$VAR = "oli";

}

if ($ENV{'SERVER_NAME'} =~ /morzino/i) {

$VAR = "morzino";

}

if ($ENV{'SERVER_NAME'} =~ /morzoo/i) {

$VAR = "morzoo";

}

if ($ENV{'SERVER_NAME'} =~ /(education|schoul)\.lu$/i || -e "/var/www/oli/cgi-bin/") {

$VAR = "education.lu";

}

if (ONO::IO->devstation) {

# $VAR = "morzoo";
$VAR = "oli";
$VAR = "morzino";
# $VAR = "education.lu";
}

return $VAR;

}

sub variation_base {

#: Return the correct software base variable, which is requied if the ONO software is not directly located in /cgi-bin

my $BASE;

if (!ONO::IO->devstation) {

if (&variation eq "education.lu") {

$BASE = "/oli/lu";

if ($ENV{'REQUEST_URI'} =~ m~^/oli/(.*?)/~) {
$BASE = "/oli/$1";
}

}

}

return $BASE;

}

sub variation_educationlu_cats {

#: Educational categories for Luxembourg's K12 education system.

return "10:C1;11:C1.1;12:C1.2;-;20:C2;21:C2.1;22:C2.2;-;30:C3;31:C3.1;32:C3.2;-;40:C4;41:C4.1;42:C4.2";

}

###############################################################################
# end of script
###############################################################################

1;

__END__