ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilCertificateMigrationUIElements.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3
9{
11 protected $user;
12
14 protected $ui;
15
17 protected $lng;
18
21
29 public function __construct(
30 \ilObjUser $user = null,
31 \ILIAS\DI\UIServices $ui = null,
32 \ilLanguage $lng = null,
34 ) {
35 global $DIC;
36
37 if (null === $user) {
38 $user = $DIC->user();
39 }
40
41 if (null === $ui) {
42 $ui = $DIC->ui();
43 }
44
45 if (null === $lng) {
46 $lng = $DIC->language();
47 }
48
49 $lng->loadLanguageModule('cert');
50 $this->user = $user;
51 $this->ui = $ui;
52 $this->lng = $lng;
53
54 if (null === $migrationHelper) {
55 $migrationHelper = new \ilCertificateMigration($this->user->getId());
56 }
57 $this->migrationHelper = $migrationHelper;
58 }
59
66 public function getMigrationMessageBox(string $link) : string
67 {
68 $ui_factory = $this->ui->factory();
69 $ui_renderer = $this->ui->renderer();
70
71 $message_buttons = [
72 $ui_factory->button()->standard($this->lng->txt("certificate_migration_go"), $link),
73 ];
74
75 if ($this->migrationHelper->isTaskFailed()) {
76 $messageBox = $ui_factory->messageBox()
77 ->failure($this->lng->txt('certificate_migration_lastrun_failed'))
78 ->withButtons($message_buttons);
79 } else {
80 $messageBox = $ui_factory->messageBox()
81 ->confirmation($this->lng->txt('certificate_migration_confirm_start'))
82 ->withButtons($message_buttons);
83 }
84
85 return $ui_renderer->render($messageBox);
86 }
87}
user()
Definition: user.php:4
An exception for terminatinating execution or to throw for unit testing.
Class ilCertificateMigrationUIElements.
__construct(\ilObjUser $user=null, \ILIAS\DI\UIServices $ui=null, \ilLanguage $lng=null, \ilCertificateMigration $migrationHelper=null)
ilCertificateMigrationUIElements constructor.
getMigrationMessageBox(string $link)
Get confirmation messagebox for manual migration start.
Class ilCertificateMigration.
language handling
Class HTTPServicesTest.
Class BaseForm.
global $DIC
Definition: saml.php:7