ONO::Apps::Admin::Screen

package ONO::Apps::Admin::Screen;
################################################################################
# COPYRIGHT / LICENSE #
################################################################################
#
# This file is part of the ONO Software Project.
#
# Copyright (C) 2000-2025 Jos KIRPS [ www.kirps.com | jos_AT_kirps_DOT_com ]
# and The Joopita Project [ www.joopita.org | contact_AT_joopita_DOT_com ]
#
# This file, as well as 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 strict;

use ONO::Apps::Admin::Menu;

use ONO::Apps::Admin::Screen::Info;
use ONO::Apps::Admin::Screen::Web;
use ONO::Apps::Admin::Screen::Users;
use ONO::Apps::Admin::Screen::DB;
use ONO::Apps::Admin::Screen::Network;
use ONO::Apps::Admin::Screen::Tools;
use ONO::Apps::Admin::Screen::Setup;

use ONO::ToolBox::Screen;

###############################################################################
# ONO
###############################################################################

#: This module generates the front end application screen - it loads the screen
#: submodules and glues everything using some additional HTML code.

use lib "../../ono/sys";

sub screen {

my (
$self,
$db,
$community,
$lang,
$BLK_ref,
$vars_ref,
$sql_ref,
$ono_ref,
) = @_;

my %BLK = %$BLK_ref;
my %vars = %$vars_ref;
my %ono = %$ono_ref;

my ($MENU,$SUB);
if ($db) {
($MENU,$SUB) = ONO::Apps::Admin::Menu->menu($lang,$BLK_ref,$vars_ref);
}

my ($WEB,$TITLE,$SUBTITLE,$SCREEN,$LEFT,$RIGHT,$TOOLS);

if (!$vars{'mode'} || $vars{'mode'} =~ /^info/) {
($TITLE,$SUBTITLE,$SCREEN,$LEFT,$RIGHT,$TOOLS) = ONO::Apps::Admin::Screen::Info -> screen($db,$community,$lang,$BLK_ref,$vars_ref,$sql_ref,$ono_ref);
}
if ($vars{'mode'} =~ /^web/) {
($TITLE,$SUBTITLE,$SCREEN,$LEFT,$RIGHT,$TOOLS) = ONO::Apps::Admin::Screen::Web -> screen($db,$community,$lang,$BLK_ref,$vars_ref,$sql_ref,$ono_ref);
}
if ($vars{'mode'} =~ /^users/) {
($TITLE,$SUBTITLE,$SCREEN,$LEFT,$RIGHT,$TOOLS) = ONO::Apps::Admin::Screen::Users -> screen($db,$community,$lang,$BLK_ref,$vars_ref,$sql_ref,$ono_ref);
}
if ($vars{'mode'} =~ /^db/) {
($TITLE,$SUBTITLE,$SCREEN,$LEFT,$RIGHT,$TOOLS) = ONO::Apps::Admin::Screen::DB -> screen($db,$community,$lang,$BLK_ref,$vars_ref,$sql_ref,$ono_ref);
}
if ($vars{'mode'} =~ /^network/) {
($TITLE,$SUBTITLE,$SCREEN,$LEFT,$RIGHT,$TOOLS) = ONO::Apps::Admin::Screen::Network -> screen($db,$community,$lang,$BLK_ref,$vars_ref,$sql_ref,$ono_ref);
}
if ($vars{'mode'} =~ /^tools/) {
($TITLE,$SUBTITLE,$SCREEN,$LEFT,$RIGHT,$TOOLS) = ONO::Apps::Admin::Screen::Tools -> screen($db,$community,$lang,$BLK_ref,$vars_ref,$sql_ref,$ono_ref);
}
if ($vars{'mode'} =~ /^setup/) {
($TITLE,$SUBTITLE,$SCREEN,$LEFT,$RIGHT,$TOOLS) = ONO::Apps::Admin::Screen::Setup -> screen($db,$community,$lang,$BLK_ref,$vars_ref,$sql_ref,$ono_ref);
}

$WEB = ONO::ToolBox::Screen->build($TITLE,$SUBTITLE,$TOOLS,$SCREEN,$LEFT,$RIGHT,$vars{'mode'});

my $USER = ONO::ToolBox::Screen->user(
$db,
$community,
"/ono/admin/?/users/",
"/ono/admin/?/logout/",
$vars{'username'},
$BLK{'Logout'},
);

my $COPYRIGHT = ONO::ToolBox::Screen->copyright($vars{'username'},"$ono{'mday'}/$ono{'mon'}/$ono{'year'} \@ $ono{'hour'}:$ono{'min'}:$ono{'sec'}",$ono{'year'});

my $SITE;
if ($ono{'site'}) {
$SITE = ucfirst $ono{'site'}." ";
}

return qq~<table class="wide_table" style="background-color:#993333">
<tr>
<td style="background-color:#333333">
<a href="/ono/admin/">
<div class="trans90"><img class="block" src="/ono/osr/images/ono/logo_126_38_white.png" style="width:126px;height:38px;margin:3px 6px 3px 6px" alt=""></div>
</a>
</td>
<td class="w100" style="background-color:#993333"><div class="bold xlarge italic ml10 colf trans40 hide720">${SITE}Administration</div></td>
</tr>
</table>
<div style="background-color:#e3e3e3;padding-top:5px">
<table class="wide_table">
<tr>
<td style="padding:2px 0px 2px 10px"></td>
$MENU
$USER
</tr>
</table>
</div>
$SUB
<div class="bg_white bb" style="padding:2px 20px 20px 20px">$WEB</div>
$COPYRIGHT
~;

}

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

1;

__END__