ONO::FW::Apps::Core::Views

package ONO::FW::Apps::Core::Views;
################################################################################
# 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::Lib::UI::Check;
use ONO::Lib::PDF::ToolBox;
use ONO::Lib::Data::Emojis::Basic;

use ONO::FW::Apps::Core;

###################################################################
#
###################################################################

#: This module contains ONO app views.

sub question_progress_done_msg {

my (
$self,
$form,
$action_url,
$switches,
$EXERCISE,
$questions,
$USER,
$MAIL,
$HINTS,
$MISTAKES,
$TIME,
$APP,
$SHARE_REPORT,
$SHARE_ICON,
$SHARE_BUTTON,
$PRINT_CERT,
$txts_ref,
$BLK_ref,
$vars_ref,
) = @_;

#: Exercise completed view.

my @txts = @$txts_ref;
my %BLK = %$BLK_ref;
my %vars = %$vars_ref;

# sharing results

my $INPUT = ONO::FW::Apps::Core->input_vars($vars_ref,"rRx");

my $Txts8 = ucfirst $txts[8];
my $SWITCH1 = ONO::Lib::UI::Check->switch("output_web_report_certificate",1,"r");
my $SWITCH2 = ONO::Lib::UI::Check->switch("output_web_report_report",0,"r");
my $REPEAT;
if ($switches !~ /R/) {
$REPEAT = qq~<input type="submit" name="output_web_repeat" value="$BLK{'repeat'}" class="button_green button_big mt10 mb10 ml10">~;
}

my $PRINT_FORMAT = ONO::Lib::PDF::ToolBox->format("app_input_paper_format",$BLK_ref,$vars_ref);

my $Txts10 = ucfirst $txts[10];

my $SMILIES = ONO::Lib::Data::Emojis::Basic->collection("output_web_share_comment_id",75);

my $SWITCH_SHARE_FRIENDS = ONO::Lib::UI::Check->switch("output_web_share_with_friends",1,"r");
my $SWITCH_SHARE_TEACHERS = ONO::Lib::UI::Check->switch("output_web_share_with_teachers",1,"r");
my $SWITCH_SHARE_STUDENTS = ONO::Lib::UI::Check->switch("output_web_share_with_students",1,"r");
my $SWITCH_SHARE_HP = ONO::Lib::UI::Check->switch("output_web_share_with_homepage",0,"r");

$SHARE_REPORT =~ s~, $~~;
$SHARE_REPORT =~ s~"~'~g;

return qq~</form>
<$form>
<input type="hidden" name="output_report_timer_end" value="$vars{'output_web_timer_end'}">
<input type="hidden" name="output_report_timer_elapsed" value="$vars{'output_web_timer_elapsed'}">
$INPUT
<div id="app_print_box" class="hide">
<div class="p10 xlarge bold green center mt10">$Txts8</div>
<div class="p10">
<table class="default_table auto">
<tr>
<td>$SWITCH1</td>
<td>$txts[9]</td>
</tr>
<tr>
<td>$SWITCH2</td>
<td>$BLK{'Results'} ($BLK{'if_available'})</td>
</tr>
<tr>
<td></td>
<td><div class="mt10">$PRINT_FORMAT</div></td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" name="output_web_report" value="$BLK{'print'}" class="button_green button_big mt20">
<a href="javascript:void(0);" class="button_yellow button_big mt20" onclick="onojs_block('app_results_box');onojs_hide('app_print_box');">$BLK{'cancel'}</a>
</td>
</tr>
</table>
</div>
</div>
<div id="app_share_box" class="hide">
<div class="p10 xlarge bold green center mt10">$Txts10</div>
<div class="inline auto w90">
<table class="default_table auto">
<tr class="vtop">
<td>$SHARE_ICON</td>
<td><div class="bold large">$APP</div><div>$SHARE_REPORT</div></td>
</tr>
</table>
<input type="hidden" name="output_web_share_data" value="$SHARE_REPORT">
</div>
<div class="p5"></div>
<div class="inline auto w90">
<textarea id="output_web_share_comment_id" name="output_web_share_comment" class="w98 h50" placeholder="$txts[11] ($BLK{'optional'})" maxlength="200">$txts[12]</textarea>
</div>
<div class="inline auto w90">
<div id="div_smile" class="box_paper mt10 mb10 small rel hide" style="padding:0px 10px 0px 10px">
<a href="javascript:void(0);" onclick="onojs_hide('div_smile');onojs_block('smile_icon');">
<img class="close abs" src="/ono/osr/images/icons/crystal/32x32/ono/close.png" style="top:-10px;right:-10px" alt="">
</a>
$SMILIES
</div>
</div>
<div id="smile_icon"><div class="inline auto"><a href="javascript:void(0);" onclick="onojs_block('div_smile');onojs_hide('smile_icon');" class="button">😀 $BLK{'show_emojis'}</a></div></div>

<div class="inline auto">
<table class="default_table mt20">
<tr>
<td>$BLK{'share_with'}...</td>
<td>$SWITCH_SHARE_FRIENDS</td>
<td>$BLK{'friends'}</td>
<td>$SWITCH_SHARE_TEACHERS</td>
<td>$BLK{'teachers'}</td>
<td>$SWITCH_SHARE_STUDENTS</td>
<td>$BLK{'students'}</td>
<td>$SWITCH_SHARE_HP</td>
<td>$BLK{'homepage'}</td>
</tr>
</table>
</div>
<div class="inline auto">
<table class="default_table mt20">
<tr>
<td></td>
<td class="w100">
<input type="submit" name="output_web_share" value="$BLK{'share'}" class="button_green button_big">
<a href="javascript:void(0);" onclick="onojs_hide('app_results_box');onojs_block('app_share_box');" class="button_yellow button_big">$BLK{'cancel'}</a>
</td>
<td></td>
</tr>
</table>
</div>

</div>
<div id="app_results_box">

<div class="abs w100 bg_white" style="top:0px">
<div class="inline w100">
<div class="w50 fl w100_800 fn_800">
<div class="mt10 mr10">
<div class="box_green">
<h3 class="green">$txts[0]!</h3>
<div class="box_paper">
<div class="mb10 bb">
<table class="wide_table mb10">
<tr class="vtop">
<td><img class="block48 mr5" src="/ono/osr/images/icons/crystal/64x64/actions/apply.png" alt=""></td>
<td class="p0 w100">
<div class="green large mt5">
$txts[1]
</div>
</td>
</tr>
</table>
</div>
<div class="inline">
<table class="default_table auto">
<tr class="vtop">
<td>$SHARE_ICON</td>
<td><div class="col6 bold large">$APP</div><div class="col9 large">$SHARE_REPORT</div></td>
</tr>
</table>
$SHARE_BUTTON
</div>
<div class="inline">
$REPEAT<a href="${action_url}output_web_newsid=1" class="button_yellow button_big mt10 mb10 ml10">$BLK{'done'}</a>
</div>
</div>
</div>
</div>
</div>
<div class="w50 fl w100_800 fn_800">
<div class="mt10 ml10">
<div class="box_black">
<h3 class="cole">$BLK{'Info'}</h3>
<div class="box_fabric">
<div class="box_paper large">
<table class="default_table auto">
<tr class="vtop">
<td class="pad5_2 tar">$txts[2]:</td>
<td class="pad5_2 tal bold green">$questions</td>
</tr>
$HINTS
$MISTAKES
$TIME
</table>
</div>
$MAIL
$USER
<div class="inline">$PRINT_CERT</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="abs" style="width:1px;height:1px;overflow:hidden">
<input type="text" id="output_web_autorepeat_id" name="output_web_autorepeat_key" value="1" style="width:1px">
</div>
<script>document.getElementById('output_web_autorepeat_id').focus();</script>
</form>
$EXERCISE
<script>
if (parent.document.getElementById('onofw_apps_exec_footer')) {
parent.document.getElementById('onofw_apps_exec_footer').style.display='block';
}
</script>
~;


}

###################################################################
# THAT'S IT :-D
###################################################################

1;

__END__