ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCertificateMigrationUIElements Class Reference

Class ilCertificateMigrationUIElements. More...

+ Collaboration diagram for ilCertificateMigrationUIElements:

Public Member Functions

 __construct (\ilObjUser $user=null, \ILIAS\DI\UIServices $ui=null, \ilLanguage $lng=null, \ilCertificateMigration $migrationHelper=null)
 ilCertificateMigrationUIElements constructor. More...
 
 getMigrationMessageBox (string $link)
 Get confirmation messagebox for manual migration start. More...
 

Protected Attributes

 $user
 
 $ui
 
 $lng
 

Private Attributes

 $migrationHelper
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCertificateMigrationUIElements::__construct ( \ilObjUser  $user = null,
\ILIAS\DI\UIServices  $ui = null,
\ilLanguage  $lng = null,
\ilCertificateMigration  $migrationHelper = null 
)

ilCertificateMigrationUIElements constructor.

Parameters
\ilObjUser$user
\ILIAS\DI\UIServices$ui
\ilLanguage$lng
ilCertificateMigration | null$certificateMigration

Definition at line 29 of file class.ilCertificateMigrationUIElements.php.

References $DIC, $lng, $migrationHelper, $ui, $user, and user().

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  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
+ Here is the call graph for this function:

Member Function Documentation

◆ getMigrationMessageBox()

ilCertificateMigrationUIElements::getMigrationMessageBox ( string  $link)

Get confirmation messagebox for manual migration start.

Parameters
string$link
Returns
string

Definition at line 66 of file class.ilCertificateMigrationUIElements.php.

66  : 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  }

Field Documentation

◆ $lng

ilCertificateMigrationUIElements::$lng
protected

Definition at line 17 of file class.ilCertificateMigrationUIElements.php.

Referenced by __construct().

◆ $migrationHelper

ilCertificateMigrationUIElements::$migrationHelper
private

Definition at line 20 of file class.ilCertificateMigrationUIElements.php.

Referenced by __construct().

◆ $ui

ilCertificateMigrationUIElements::$ui
protected

Definition at line 14 of file class.ilCertificateMigrationUIElements.php.

Referenced by __construct().

◆ $user

ilCertificateMigrationUIElements::$user
protected

Definition at line 11 of file class.ilCertificateMigrationUIElements.php.

Referenced by __construct().


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