49 $template =
new ilTemplate(
'tpl.workingtime.js',
true,
true,
'components/ILIAS/Test');
50 $template->setVariable(
'STRING_MINUTE', $this->
lng->txt(
'minute'));
51 $template->setVariable(
'STRING_MINUTES', $this->
lng->txt(
'minutes'));
52 $template->setVariable(
'STRING_SECOND', $this->
lng->txt(
'second'));
53 $template->setVariable(
'STRING_SECONDS', $this->
lng->txt(
'seconds'));
54 $template->setVariable(
'STRING_TIMELEFT', $this->
lng->txt(
'tst_time_already_spent_left'));
55 $template->setVariable(
'AND', strtolower($this->
lng->txt(
'and')));
56 $template->setVariable('YEAR', $date['year']);
57 $template->setVariable('MONTH', $date['mon'] - 1);
58 $template->setVariable('DAY', $date['mday']);
59 $template->setVariable('HOUR', $date['hours']);
60 $template->setVariable('MINUTE', $date['minutes']);
61 $template->setVariable('SECOND', $date['seconds']);
64 preg_match(
'/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/', $date_time->get(
IL_CAL_TIMESTAMP), $matches);
65 if ($matches !== []) {
66 $template->setVariable('ENDYEAR', $matches[1]);
67 $template->setVariable('ENDMONTH', $matches[2] - 1);
68 $template->setVariable('ENDDAY', $matches[3]);
69 $template->setVariable('ENDHOUR', $matches[4]);
70 $template->setVariable('ENDMINUTE', $matches[5]);
71 $template->setVariable('ENDSECOND', $matches[6]);
72 }
73 }
74
75 $datenow = getdate();
76 $template->setVariable('YEARNOW', $datenow['year']);
77 $template->setVariable('MONTHNOW', $datenow['mon'] - 1);
78 $template->setVariable('DAYNOW', $datenow['mday']);
79 $template->setVariable('HOURNOW', $datenow['hours']);
80 $template->setVariable('MINUTENOW', $datenow['minutes']);
81 $template->setVariable('SECONDNOW', $datenow['seconds']);
82 $template->setVariable('PTIME_M', $processing_time_minutes);
83 $template->setVariable('PTIME_S', $processing_time_seconds);
84 $template->setVariable('REDIRECT_URL', $redirect_url);
85 $template->setVariable('CHECK_URL', $check_url);
86
87 return $template;
88 }
special template class to simplify handling of ITX/PEAR