19 declare(strict_types=0);
    28     public const ID = 
'crs_context_tutor_manual';
    43         $lng->loadLanguageModule(
'crs');
    45         return $lng->txt(
'crs_mail_context_tutor_title');
    54         $lng->loadLanguageModule(
'crs');
    56         return $lng->txt(
'crs_mail_context_tutor_info');
    71         $lng->loadLanguageModule(
'crs');
    72         $lng->loadLanguageModule(
'trac');
    77         $placeholders = array();
    79         $placeholders[
'course_title'] = array(
    80             'placeholder' => 
'COURSE_TITLE',
    81             'label' => 
$lng->txt(
'crs_title')
    84         $placeholders[
'course_period_start'] = array(
    85             'placeholder' => 
'COURSE_PERIOD_START',
    86             'label' => 
$lng->txt(
'crs_period_start_mail_placeholder')
    89         $placeholders[
'course_period_end'] = array(
    90             'placeholder' => 
'COURSE_PERIOD_END',
    91             'label' => 
$lng->txt(
'crs_period_end_mail_placeholder')
    94         $placeholders[
'course_status'] = array(
    95             'placeholder' => 
'COURSE_STATUS',
    96             'label' => 
$lng->txt(
'trac_status')
    99         $placeholders[
'course_mark'] = array(
   100             'placeholder' => 
'COURSE_MARK',
   101             'label' => 
$lng->txt(
'trac_mark')
   105             $placeholders[
'course_time_spent'] = array(
   106                 'placeholder' => 
'COURSE_TIME_SPENT',
   107                 'label' => 
$lng->txt(
'trac_spent_seconds')
   112             $placeholders[
'course_first_access'] = array(
   113                 'placeholder' => 
'COURSE_FIRST_ACCESS',
   114                 'label' => 
$lng->txt(
'trac_first_access')
   117             $placeholders[
'course_last_access'] = array(
   118                 'placeholder' => 
'COURSE_LAST_ACCESS',
   119                 'label' => 
$lng->txt(
'trac_last_access')
   123         $placeholders[
'course_link'] = array(
   124             'placeholder' => 
'COURSE_LINK',
   125             'label' => 
$lng->txt(
'crs_mail_permanent_link')
   128         return $placeholders;
   133         if (!array_key_exists($objId, self::$periodInfoByObjIdCache)) {
   137         return self::$periodInfoByObjIdCache[
$objId];
   144         string $placeholder_id,
   145         array $context_parameters,
   153         $ilObjDataCache = $DIC[
'ilObjDataCache'];
   155         if (!in_array($placeholder_id, array(
   157             'course_period_start',
   163             'course_first_access',
   169         $obj_id = $ilObjDataCache->lookupObjId((
int) $context_parameters[
'ref_id']);
   176         switch ($placeholder_id) {
   178                 return $ilObjDataCache->lookupTitle($obj_id);
   180             case 'course_period_start':
   181                 $periodInfo = $this->
getCachedPeriodByObjId((
int) $ilObjDataCache->lookupObjId((
int) $context_parameters[
'ref_id']));
   188                     return $formattedDate;
   193             case 'course_period_end':
   194                 $periodInfo = $this->
getCachedPeriodByObjId($ilObjDataCache->lookupObjId((
int) $context_parameters[
'ref_id']));
   201                     return $formattedDate;
   207                 return ilLink::_getLink($context_parameters[
'ref_id'], 
'crs');
   209             case 'course_status':
   210                 if ($recipient === null) {
   221                 if ($recipient === null) {
   226                 return (is_string($mark) && strlen(trim($mark))) ? $mark : 
'-';
   228             case 'course_time_spent':
   229                 if ($recipient === null) {
   235                     if (isset($progress[
'spent_seconds'])) {
   237                             $progress[
'spent_seconds'],
   245             case 'course_first_access':
   246                 if ($recipient === null) {
   252                     if (isset($progress[
'access_time_min'])) {
   254                             $progress[
'access_time_min'],
   261             case 'course_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)
 
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
 
resolveSpecificPlaceholder(string $placeholder_id, array $context_parameters, ilObjUser $recipient=null)
 
Class ilMailTemplateContext. 
 
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text. 
 
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