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