ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilCertificateGUIFactory Class Reference
+ Collaboration diagram for ilCertificateGUIFactory:

Public Member Functions

 __construct (?Container $dic=null)
 
 create (ilObject $object)
 

Private Attributes

readonly Container $dic
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCertificateGUIFactory::__construct ( ?Container  $dic = null)

Definition at line 43 of file class.ilCertificateGUIFactory.php.

44 {
45 if (null === $dic) {
46 global $DIC;
47 $dic = $DIC;
48 }
49 $this->dic = $dic;
50 }
global $DIC
Definition: shib_login.php:26

References $DIC, and $dic.

Member Function Documentation

◆ create()

ilCertificateGUIFactory::create ( ilObject  $object)
Exceptions
ilException

Definition at line 55 of file class.ilCertificateGUIFactory.php.

56 {
57 global $DIC;
58
59 $type = $object->getType();
60 $objectId = $object->getId();
61
62 $logger = $DIC->logger()->cert();
63
64 $templateRepository = new ilCertificateTemplateDatabaseRepository($this->dic->database(), $logger);
65 $deleteAction = new ilCertificateTemplateDeleteAction($templateRepository);
66 $pathFactory = new ilCertificatePathFactory();
67
68 $certificatePath = $pathFactory->create($object);
69
70 switch ($type) {
71 case 'tst':
72 $placeholderDescriptionObject = new TestPlaceholderDescription();
73 $placeholderValuesObject = new TestPlaceholderValues();
74
76 $objectId,
77 $certificatePath,
78 false,
79 $DIC->language(),
80 $DIC->ctrl(),
81 $DIC->access(),
82 $DIC->toolbar(),
83 $placeholderDescriptionObject
84 );
85
86 $deleteAction = new CertificateTestTemplateDeleteAction(
87 $deleteAction
88 );
89
90 break;
91 case 'crs':
92 $placeholderDescriptionObject = new CoursePlaceholderDescription($objectId);
93 $placeholderValuesObject = new CoursePlaceholderValues();
94
96 $object,
97 $certificatePath,
98 false,
99 $DIC->language(),
100 $DIC->ctrl(),
101 $DIC->access(),
102 $DIC->toolbar(),
103 $placeholderDescriptionObject
104 );
105
106 break;
107 case 'exc':
108 $placeholderDescriptionObject = new ExercisePlaceholderDescription();
109 $placeholderValuesObject = new ExercisePlaceholderValues();
110
111 $formFactory = new CertificateSettingsExerciseRepository(
112 $object,
113 $certificatePath,
114 false,
115 $DIC->language(),
116 $DIC->ctrl(),
117 $DIC->access(),
118 $DIC->toolbar(),
119 $placeholderDescriptionObject
120 );
121
122 break;
123 case 'sahs':
124 $placeholderDescriptionObject = new ilScormPlaceholderDescription($object);
125 $placeholderValuesObject = new ilScormPlaceholderValues();
126
128 $object,
129 $certificatePath,
130 true,
131 $DIC->language(),
132 $DIC->ctrl(),
133 $DIC->access(),
134 $DIC->toolbar(),
135 $placeholderDescriptionObject
136 );
137
138 break;
139 case 'lti':
140 $placeholderDescriptionObject = new ilLTIConsumerPlaceholderDescription();
141 $placeholderValuesObject = new ilLTIConsumerPlaceholderValues();
142
144 $object,
145 $certificatePath,
146 true,
147 $DIC->language(),
148 $DIC->ctrl(),
149 $DIC->access(),
150 $DIC->toolbar(),
151 $placeholderDescriptionObject
152 );
153
154 break;
155 case 'cmix':
156 $placeholderDescriptionObject = new ilCmiXapiPlaceholderDescription();
157 $placeholderValuesObject = new ilCmiXapiPlaceholderValues();
158
160 $object,
161 $certificatePath,
162 true,
163 $DIC->language(),
164 $DIC->ctrl(),
165 $DIC->access(),
166 $DIC->toolbar(),
167 $placeholderDescriptionObject
168 );
169
170 break;
171 case 'prg':
172 $placeholderDescriptionObject = new ilStudyProgrammePlaceholderDescription();
173 $placeholderValuesObject = new ilStudyProgrammePlaceholderValues();
175 $object,
176 $certificatePath,
177 true,
178 $DIC->language(),
179 $DIC->ctrl(),
180 $DIC->access(),
181 $DIC->toolbar(),
182 $placeholderDescriptionObject
183 );
184
185 break;
186 default:
187 throw new ilException(sprintf('The type "%s" is currently not defined for certificates', $type));
188 }
189
190 return new ilCertificateGUI(
191 $placeholderDescriptionObject,
192 $placeholderValuesObject,
193 $objectId,
194 $certificatePath,
195 $formFactory,
196 $deleteAction
197 );
198 }
GUI class to create PDF certificates.
Base class for ILIAS Exception handling.

References $DIC, ilObject\getId(), and ilObject\getType().

+ Here is the call graph for this function:

Field Documentation

◆ $dic

readonly Container ilCertificateGUIFactory::$dic
private

Definition at line 41 of file class.ilCertificateGUIFactory.php.

Referenced by __construct().


The documentation for this class was generated from the following file: