';
// only admins will see this
if ($_SESSION['profile']['admin'] == 1) {
echo '
';
if ($action != 'showDetails' && $action != 'getQuestions') {
printf('%s
',
Button_01);
}
if ($action == 'new_topic' || $action == 'getQuestions' ||
$action == 'showDetails') {
printf('%s',
Button_02);
}
if ($action == 'showDetails') {
// get topic id from session, again? already done in line 12
$t_id = $_SESSION['values']['topic']['t_id'];
printf('
' .
'%s
', $t_id, Button_03);
}
if ($action == 'getQuestions') {
// write topic id to session, why is this done in a view function?
$_SESSION['values']['topic']['t_id']=$t_id ;
printf('
' .
'%s', $t_id, Button_04);
}
}
echo "\n";
break;
case "progress": // site value is progress
if (!$action && !$value) {
// unset topic if action and value are both not true
unset($t_id);
unset($SESSION['values']['topic']);
}
// get the topic?
include ("getTopic.php");
// store topic id in session
$_SESSION['values']['topic']['t_id'] = $t_id;
if (!$action && !$value) {
// unset topic again if action and value are both not true
unset ($_SESSION ['values']['topic']);
}
getTopicProgress($t_id); // Auswahlfenster anzeigen
if ($action == 'showProgress') {
echo "
\n"; // In der Mitte der Inhalt
printf('
' .
'%s', $t_id, Button_05);
printf('
' .
'%s', $t_id, Button_06);
printf('
' .
'%s', $t_id, Button_07);
echo "
\n";
} elseif ($action != null) {
echo "\n";
printf('
' .
'%s', ($action == 'showTable') ? ' active' : '',
$t_id, Button_05);
printf('
' .
'%s', ($action == 'showGraph') ? ' active' : '',
$t_id, Button_06);
printf('
' .
'%s', ($action == 'showBalken') ? ' active' : '',
$t_id, Button_07);
echo "
\n";
}
break;
case "start_test": // site value is start_test
if(!$action && !$value){
// unset topic id
unset($t_id);
unset($SESSION ['values']['topic']);
}
// get the topic?
include("getTopic.php");
getTopicStartTest($t_id);
break;
case "statistic": // site value is statistic
// only admins will see this
if ($_SESSION['profile']['admin'] == 1) {
if(!$action && !$value){
// unset topic id
unset($t_id);
unset($SESSION ['values']['topic']);
}
echo "\n"; // In der Mitte der Inhalt
printf('
%s', Button_18);
// get the topic?
include ("getTopic.php");
getTopicStatistic($t_id);
if ($t_id) {
if ($action == 'topTen' || $value=='topTen') {
$classpart = ' active';
$value = 'topTen';
} else {
$classpart = '';
}
printf('
%s',
$classpart, $t_id, Button_08);
if ($action == 'flopTen' || $value=='flopTen') {
$classpart = ' active';
$value = 'flopTen';
} else {
$classpart = '';
}
printf('
' .
'%s', $classpart, $t_id, Button_09);
printf('
' .
'%s', ($action == 'showPassed') ? ' active' : '',
$t_id, Button_17);
printf('
%s',
($action == 'showStatisticTest') ? ' active' : '',
$t_id, Button_19);
}
echo "
\n"; // end of div inner_box_top
// check condition again so that div inner_box_top is always closed
if ($t_id) {
if ($action && $action!= 'getStatisticQuestions' &&
$action!='showPassed' && $action !='showStatisticTest') {
echo "\n";
printf('
%s',
($action == 'showGraph') ? ' active' : '',
$value, $t_id, Button_06);
printf('
%s',
($action = 'showBar') ? ' active' : '',
$value, $t_id, Button_07);
echo "
\n";
}
}
}
break;
case "showCertificateInfo": // site value is showCertificateInfo
// do nothing for showCertificateInfo
break;
}
}
}