ILIAS  trunk Revision v12.0_alpha-16-g3e876e53c80
class.ilObjServerInfoGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
24
30{
33
34 public function __construct(int $id = 0, int $id_type = self::REPOSITORY_NODE_ID, int $parent_node_id = 0)
35 {
36 parent::__construct($id, $id_type, $parent_node_id);
37
38 global $DIC;
39 $this->client_ini = $DIC->clientIni();
40 $this->agent_finder = $DIC['setup.agentfinder'];
41 }
42
43 public function getType(): string
44 {
46 }
47
48 private function getJavaServerGUI(): JavaServerGUI
49 {
50 return new JavaServerGUI(
51 $this->ctrl,
52 $this->tpl,
53 $this->lng,
54 $this->settings,
55 $this->checkPermissionBool('write')
56 );
57 }
58
59 public function executeCommand(): void
60 {
61 $this->checkPermission('read');
62
63 $this->lng->loadLanguageModule('administration');
64 $this->prepareOutput();
65
66 switch ($this->ctrl->getNextClass($this)) {
67 case strtolower(ilPermissionGUI::class):
68 $this->tabs_gui->activateTab('perm_settings');
69 $this->ctrl->forwardCommand(new ilPermissionGUI($this));
70 break;
71
72 case strtolower(JavaServerGUI::class):
73 $this->tabs_gui->activateTab('java_server');
74 $this->ctrl->forwardCommand($this->getJavaServerGUI());
75 break;
76
77 default:
78 $cmd = $this->ctrl->getCmd("view");
79 switch ($cmd) {
80 case 'view':
81 case 'viewVcs':
82 $this->tabs_gui->activateTab('server_data');
83 $this->$cmd();
84 break;
85 case 'status':
86 $this->tabs_gui->activateTab('installation_status');
87 $this->$cmd();
88 break;
89 case 'phpinfo':
90 phpinfo();
91 exit;
92 }
93 }
94 }
95
96 public function getAdminTabs(): void
97 {
98 $this->tabs_gui->addTab(
99 'installation_status',
100 $this->lng->txt('installation_status'),
101 $this->ctrl->getLinkTarget($this, 'status')
102 );
103
104 $this->tabs_gui->addTab(
105 'server_data',
106 $this->lng->txt('server_data'),
107 $this->ctrl->getLinkTarget($this, 'view')
108 );
109
110 $this->tabs_gui->addTab(
111 'java_server',
112 $this->lng->txt('java_server'),
113 $this->ctrl->getLinkTargetByClass([self::class, JavaServerGUI::class]),
114 );
115
116 if ($this->checkPermissionBool('edit_permission')) {
117 $this->tabs_gui->addTab(
118 'perm_settings',
119 $this->lng->txt('perm_settings'),
120 $this->ctrl->getLinkTargetByClass([self::class, ilPermissionGUI::class], 'perm')
121 );
122 }
123 }
124
125 public function view(): void
126 {
127 $this->toolbar->addComponent(
128 $this->ui_factory->button()->standard(
129 $this->lng->txt("vc_information"),
130 $this->ctrl->getLinkTarget($this, 'viewVcs')
131 )
132 );
133
134 $form = new ilPropertyFormGUI();
135
136 // installation name
137 $ne = new ilNonEditableValueGUI($this->lng->txt("inst_name"), "");
138 $ne->setValue($this->client_ini->readVariable("client", "name"));
139 $ne->setInfo($this->client_ini->readVariable("client", "description"));
140 $form->addItem($ne);
141
142 // client id
143 $ne = new ilNonEditableValueGUI($this->lng->txt("client_id"), "");
144 $ne->setValue(CLIENT_ID);
145 $form->addItem($ne);
146
147 // installation id
148 $ne = new ilNonEditableValueGUI($this->lng->txt("inst_id"), "");
149 $ne->setValue($this->settings->get("inst_id"));
150 $form->addItem($ne);
151
152 // database version
153 $ne = new ilNonEditableValueGUI($this->lng->txt("db_version"), "");
154 $ne->setValue($this->settings->get("db_version"));
155
156 $form->addItem($ne);
157
158 // ilias version
159 $ne = new ilNonEditableValueGUI($this->lng->txt("ilias_version"), "");
160 $ne->setValue(ILIAS_VERSION);
161 $form->addItem($ne);
162
163 // host
164 $ne = new ilNonEditableValueGUI($this->lng->txt("host"), "");
165 $ne->setValue($_SERVER["SERVER_NAME"]);
166 $form->addItem($ne);
167
168 // ip & port
169 $ne = new ilNonEditableValueGUI($this->lng->txt("ip_address") . " & " . $this->lng->txt("port"), "");
170 $ne->setValue($_SERVER["SERVER_ADDR"] . ":" . $_SERVER["SERVER_PORT"]);
171 $form->addItem($ne);
172
173 // server
174 $ne = new ilNonEditableValueGUI($this->lng->txt("server_software"), "");
175 $ne->setValue($_SERVER["SERVER_SOFTWARE"]);
176 $form->addItem($ne);
177
178 // http path
179 $ne = new ilNonEditableValueGUI($this->lng->txt("http_path"), "");
180 $ne->setValue(ILIAS_HTTP_PATH);
181 $form->addItem($ne);
182
183 // absolute path
184 $ne = new ilNonEditableValueGUI($this->lng->txt("absolute_path"), "");
185 $ne->setValue(ILIAS_ABSOLUTE_PATH);
186 $form->addItem($ne);
187
188 $not_set = $this->lng->txt("path_not_set");
189
190 // convert
191 $ne = new ilNonEditableValueGUI($this->lng->txt("path_to_convert"), "");
192 $ne->setValue(PATH_TO_CONVERT ?: $not_set);
193 $form->addItem($ne);
194
195 // zip
196 $ne = new ilNonEditableValueGUI($this->lng->txt("path_to_zip"), "");
197 $ne->setValue(PATH_TO_ZIP ?: $not_set);
198 $form->addItem($ne);
199
200 // unzip
201 $ne = new ilNonEditableValueGUI($this->lng->txt("path_to_unzip"), "");
202 $ne->setValue(PATH_TO_UNZIP ?: $not_set);
203 $form->addItem($ne);
204
205 // java
206 $ne = new ilNonEditableValueGUI($this->lng->txt("path_to_java"), "");
207 $ne->setValue(PATH_TO_JAVA ?: $not_set);
208 $form->addItem($ne);
209
210 // mkisofs
211 $ne = new ilNonEditableValueGUI($this->lng->txt("path_to_mkisofs"), "");
212 $ne->setValue(PATH_TO_MKISOFS ?: $not_set);
213 $form->addItem($ne);
214
215 $form->setTitle($this->lng->txt("server_data"));
216
217 $tpl = new ilTemplate("tpl.server_data.html", true, true, "components/ILIAS/Administration");
218 $tpl->setVariable("FORM", $form->getHTML());
219 $tpl->setVariable("PHP_INFO_TARGET", $this->ctrl->getLinkTarget($this, "phpinfo"));
220
221 $this->tpl->setContent($tpl->get());
222 }
223
224 public function status(): void
225 {
226 $st = new StatusCommand($this->agent_finder);
227 $metric = $st->getMetrics($this->agent_finder->getAgents());
228 $report = $metric->toUIReport($this->ui_factory, $this->lng->txt("installation_status"));
229 $this->tpl->setContent($this->ui_renderer->render($report));
230 }
231
232 public function viewVcs()
233 {
234 $vc = new ilGitInformation();
235 $html = $vc->getInformationAsHtml();
236
237 if ($html) {
238 $this->tpl->setOnScreenMessage('info', $html);
239 } else {
240 $this->tpl->setOnScreenMessage('info', $this->lng->txt('vc_information_not_determined'));
241 }
242
243 $this->view();
244 }
245}
GUI for Java Server Settings.
Command to output status information about the installation.
Class ilGitInformation.
INIFile Parser Early access in init proceess! Avoid further dependencies like logging or other servic...
This class represents a non editable value in a property form.
@ilCtrl_isCalledBy ilObjServerInfoGUI: ilAdministrationGUI @ilCtrl_Calls ilObjServerInfoGUI: ilPermis...
getAdminTabs()
administration tabs show only permissions and trash folder
__construct(int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
executeCommand()
execute command
view()
view object content (repository/workspace switch)
getType()
Functions that must be overwritten.
New implementation of ilObjectGUI.
ilGlobalTemplateInterface $tpl
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
prepareOutput(bool $show_sub_objects=true)
This class represents a property form user interface.
special template class to simplify handling of ITX/PEAR
const CLIENT_ID
Definition: constants.php:41
exit
const ILIAS_VERSION
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26
global $DIC
Definition: shib_login.php:26