ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
class.ilStudyProgrammeMailTemplateContextPreview.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 public const ID = 'prg_context_manual_preview';
24
25 protected ilLanguage $lng;
26
27 public function getId(): string
28 {
29 return self::ID;
30 }
31
33 string $placeholder_id,
34 array $context_parameters,
35 ?ilObjUser $recipient = null
36 ): string {
37 switch ($placeholder_id) {
39 $string = 'programme title';
40 break;
42 $string = 'programme description';
43 break;
45 $string = 'prg subtype';
46 break;
48 $string = '<a href="#">Link</a>';
49 break;
51 $string = 'OrgUnit';
52 break;
54 $string = 'completed';
55 break;
57 $string = $this->date2String((new \DateTimeImmutable())->sub((new DateInterval('P1D'))));
58 break;
60 $string = '1,2,3';
61 break;
63 $string = '90';
64 break;
66 $string = '88';
67 break;
69 $string = $this->date2String((new \DateTimeImmutable())->add((new DateInterval('P3D'))));
70 break;
72 $string = $this->lng->txtlng('prg', 'prg_still_valid', 'de');
73 break;
75 $string = $this->date2String((new \DateTimeImmutable())->add((new DateInterval('P5D'))));
76 break;
77 default:
78 $string = '';
79 }
80
81 return $string;
82 }
83}
language handling
User class.
resolveSpecificPlaceholder(string $placeholder_id, array $context_parameters, ?ilObjUser $recipient=null)
date2String(?DateTimeImmutable $date_time=null, ?ilObjUser $user=null)