|
30 | 30 |
|
31 | 31 | use Glpi\Application\View\TemplateRenderer; |
32 | 32 |
|
33 | | -/** |
34 | | - * ------------------------------------------------------------------------- |
35 | | - * DataInjection plugin for GLPI |
36 | | - * ------------------------------------------------------------------------- |
37 | | - * |
38 | | - * LICENSE |
39 | | - * |
40 | | - * This file is part of DataInjection. |
41 | | - * |
42 | | - * DataInjection is free software; you can redistribute it and/or modify |
43 | | - * it under the terms of the GNU General Public License as published by |
44 | | - * the Free Software Foundation; either version 2 of the License, or |
45 | | - * (at your option) any later version. |
46 | | - * |
47 | | - * DataInjection is distributed in the hope that it will be useful, |
48 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
49 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
50 | | - * GNU General Public License for more details. |
51 | | - * |
52 | | - * You should have received a copy of the GNU General Public License |
53 | | - * along with DataInjection. If not, see <http://www.gnu.org/licenses/>. |
54 | | - * ------------------------------------------------------------------------- |
55 | | - * @copyright Copyright (C) 2007-2023 by DataInjection plugin team. |
56 | | - * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html |
57 | | - * @link https://github.com/pluginsGLPI/datainjection |
58 | | - * ------------------------------------------------------------------------- |
59 | | - */ |
| 33 | +use function Safe\ob_start; |
| 34 | +use function Safe\ob_get_clean; |
60 | 35 |
|
61 | 36 | class PluginDatainjectionInfo extends CommonDBTM |
62 | 37 | { |
@@ -281,8 +256,19 @@ public static function showAdditionalInformationsForm(PluginDatainjectionModel $ |
281 | 256 | $modeltype = PluginDatainjectionModel::getInstance($model->getField('filetype')); |
282 | 257 | $modeltype->getFromDBByModelID($model->getField('id')); |
283 | 258 |
|
| 259 | + $rendered_infos = []; |
| 260 | + foreach ($infos as $info_data) { |
| 261 | + $info = new self(); |
| 262 | + $info->fields = $info_data; |
| 263 | + |
| 264 | + ob_start(); |
| 265 | + self::displayAdditionalInformation($info, $_SESSION['datainjection']['infos'] ?? []); |
| 266 | + $rendered_infos[] = ob_get_clean(); |
| 267 | + } |
| 268 | + |
284 | 269 | $data = [ |
285 | 270 | 'infos' => $infos, |
| 271 | + 'rendered_infos' => $rendered_infos, |
286 | 272 | 'model' => $model, |
287 | 273 | 'modeltype' => $modeltype, |
288 | 274 | 'has_sample' => $modeltype->haveSample(), |
|
0 commit comments