3 declare(strict_types=0);
27 public const ID =
'crs_context_tutor_manual';
42 $lng->loadLanguageModule(
'crs');
44 return $lng->txt(
'crs_mail_context_tutor_title');
53 $lng->loadLanguageModule(
'crs');
55 return $lng->txt(
'crs_mail_context_tutor_info');
70 $lng->loadLanguageModule(
'crs');
71 $lng->loadLanguageModule(
'trac');
76 $placeholders = array();
78 $placeholders[
'crs_title'] = array(
79 'placeholder' =>
'COURSE_TITLE',
80 'label' =>
$lng->txt(
'crs_title')
83 $placeholders[
'crs_period_start'] = array(
84 'placeholder' =>
'COURSE_PERIOD_START',
85 'label' =>
$lng->txt(
'crs_period_start_mail_placeholder')
88 $placeholders[
'crs_period_end'] = array(
89 'placeholder' =>
'COURSE_PERIOD_END',
90 'label' =>
$lng->txt(
'crs_period_end_mail_placeholder')
93 $placeholders[
'crs_status'] = array(
94 'placeholder' =>
'COURSE_STATUS',
95 'label' =>
$lng->txt(
'trac_status')
98 $placeholders[
'crs_mark'] = array(
99 'placeholder' =>
'COURSE_MARK',
100 'label' =>
$lng->txt(
'trac_mark')
104 $placeholders[
'crs_time_spent'] = array(
105 'placeholder' =>
'COURSE_TIME_SPENT',
106 'label' =>
$lng->txt(
'trac_spent_seconds')
111 $placeholders[
'crs_first_access'] = array(
112 'placeholder' =>
'COURSE_FIRST_ACCESS',
113 'label' =>
$lng->txt(
'trac_first_access')
116 $placeholders[
'crs_last_access'] = array(
117 'placeholder' =>
'COURSE_LAST_ACCESS',
118 'label' =>
$lng->txt(
'trac_last_access')
122 $placeholders[
'crs_link'] = array(
123 'placeholder' =>
'COURSE_LINK',
124 'label' =>
$lng->txt(
'crs_mail_permanent_link')
127 return $placeholders;
132 if (!array_key_exists($objId, self::$periodInfoByObjIdCache)) {
136 return self::$periodInfoByObjIdCache[
$objId];
143 string $placeholder_id,
144 array $context_parameters,
146 bool $html_markup =
false 153 $ilObjDataCache = $DIC[
'ilObjDataCache'];
155 if (!in_array($placeholder_id, array(
169 $obj_id = $ilObjDataCache->lookupObjId((
int) $context_parameters[
'ref_id']);
176 switch ($placeholder_id) {
178 return $ilObjDataCache->lookupTitle($obj_id);
180 case 'crs_period_start':
181 $periodInfo = $this->
getCachedPeriodByObjId((
int) $ilObjDataCache->lookupObjId((
int) $context_parameters[
'ref_id']));
188 return $formattedDate;
193 case 'crs_period_end':
194 $periodInfo = $this->
getCachedPeriodByObjId($ilObjDataCache->lookupObjId((
int) $context_parameters[
'ref_id']));
201 return $formattedDate;
210 if ($recipient === null) {
221 if ($recipient === null) {
226 return (is_string($mark) && strlen(trim($mark))) ? $mark :
'-';
228 case 'crs_time_spent':
229 if ($recipient === null) {
235 if (isset($progress[
'spent_seconds'])) {
237 $progress[
'spent_seconds'],
245 case 'crs_first_access':
246 if ($recipient === null) {
252 if (isset($progress[
'access_time_min'])) {
254 $progress[
'access_time_min'],
261 case 'crs_last_access':
262 if ($recipient === null) {
268 if (isset($progress[
'access_time'])) {
const EXTENDED_DATA_LAST_ACCESS
static _getProgress(int $a_user_id, int $a_obj_id)
getCachedPeriodByObjId(int $objId)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
resolveSpecificPlaceholder(string $placeholder_id, array $context_parameters, ilObjUser $recipient=null, bool $html_markup=false)
getSpecificPlaceholders()
static secondsToString(int $seconds, bool $force_with_seconds=false, ?ilLanguage $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
static useRelativeDates()
static array $periodInfoByObjIdCache
Class ilMailTemplateContext.
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
static _getLink(?int $a_ref_id, string $a_type='', array $a_params=array(), string $append="")
static _lookupStatus(int $a_obj_id, int $a_user_id, bool $a_create=true)
Lookup status.
const EXTENDED_DATA_SPENT_SECONDS
const LP_STATUS_NOT_ATTEMPTED_NUM
static _lookupMark(int $a_usr_id, int $a_obj_id)
static lookupPeriodInfo(int $a_obj_id)
static setUseRelativeDates(bool $a_status)
set use relative dates