220 {
222
223 if (!$this->certificateSettings->get('active')) {
224 $this->controller->redirect($this);
225 return;
226 }
227
228 $this->template->setBodyClass('iosMyCertificates');
229
230 $showMigrationBox = $this->migrationVisibleValidator->isMigrationAvailable(
233 );
234 if (!$migrationWasStarted && true === $showMigrationBox) {
235 $migrationUiEl = new \ilCertificateMigrationUIElements();
236 $startMigrationCommand = $this->controller->getLinkTargetByClass(
237 ['ilCertificateMigrationGUI'],
238 'startMigrationAndReturnMessage',
239 false,
240 true,
241 false
242 );
243 $messageBoxHtml = $migrationUiEl->getMigrationMessageBox($startMigrationCommand);
244
245 $this->template->setCurrentBlock('mess');
246 $this->template->setVariable('MESSAGE', $messageBoxHtml);
247 $this->template->parseCurrentBlock('mess');
248 }
249
252 $this->certificateLogger,
253 $this->controller,
254 $this->language->txt('certificate_no_object_title')
255 );
256
259 $this->
user->getId(),
260 [
261 'order_field' => explode('_', $sorting)[0],
262 'order_direction' => explode('_', $sorting)[1]
263 ],
264 []
265 );
266
267 $uiComponents = [];
268
269 if (count(
$data[
'items']) > 0) {
271 $cards = [];
272
273 foreach ($this->sortationOptions as $fieldAndDirection => $lngVariable) {
275 }
276
277 $sortViewControl = $this->uiFactory
278 ->viewControl()
280 ->withLabel($this->language->txt($this->sortationOptions[$sorting]))
281 ->withTargetURL($this->controller->getLinkTarget($this, 'applySortation'), 'sort_by');
282 $uiComponents[] = $sortViewControl;
283
284 foreach (
$data[
'items'] as $certificateData) {
285 $thumbnailImagePath = $certificateData['thumbnail_image_path'];
287 if ($thumbnailImagePath === null
288 || $thumbnailImagePath === ''
289 || !$this->filesystem->has($thumbnailImagePath)
290 ) {
292 }
293
294 $cardImage = $this->uiFactory->image()->standard(
296 $certificateData['title']
297 );
298
299
300 $sections = [];
301
302 if (strlen($certificateData['description']) > 0) {
303 $sections[] = $this->uiFactory->listing()->descriptive([
304 $this->language->txt('cert_description_label') => $certificateData['description']
305 ]);
306 }
307
308
311 $sections[] = $this->uiFactory->listing()->descriptive([
314 )
315 ]);
317
318 $objectTypeIcon = $this->uiFactory
319 ->icon()
320 ->standard($certificateData['obj_type'], $certificateData['obj_type'], 'small');
321
322 $objectTitle = $certificateData['title'];
324 if (count($refIds) > 0) {
325 foreach ($refIds as $refId) {
326 if ($this->access->checkAccess('read', '', $refId)) {
327 $objectTitle = $this->uiRenderer->render(
329 );
330 break;
331 }
332 }
333 }
334
335 $sections[] = $this->uiFactory->listing()->descriptive([$this->language->txt('cert_object_label') => implode('', [
336 $this->uiRenderer->render($objectTypeIcon),
337 $objectTitle
338 ])]);
339
340 $this->controller->setParameter($this, 'certificate_id', $certificateData['id']);
341 $downloadHref = $this->controller->getLinkTarget($this, 'download');
342 $this->controller->clearParameters($this);
343 $sections[] = $this->uiFactory->button()->standard('Download', $downloadHref);
344
345 $card = $this->uiFactory
346 ->card()
347 ->standard($certificateData['title'], $cardImage)
348 ->withSections($sections);
349
350 $cards[] = $card;
351 }
352
353 $deck = $this->uiFactory->deck($cards);
354
355 $uiComponents[] = $this->uiFactory->divider()->horizontal();
356
357 $uiComponents[] = $deck;
358 } else {
360 }
361
362 $this->template->setContent($this->uiRenderer->render($uiComponents));
363 }
Class ilCertificateMigration.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
static useRelativeDates()
check if relative dates are used
@classDescription Date and time handling
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static _getAllReferences($a_id)
get all reference ids of object
static getWebspaceDir($mode="filesystem")
get webspace directory
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static signFile($path_to_file)