Skip to content
Snippets Groups Projects
Commit 0f68501a authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

prevent error in strict mode and php warnings, fixes #4902

Closes #4902

Merge request studip/studip!3676
parent a313f025
No related branches found
No related tags found
No related merge requests found
...@@ -19,7 +19,7 @@ class Massmail_MessageController extends \AuthenticatedController ...@@ -19,7 +19,7 @@ class Massmail_MessageController extends \AuthenticatedController
$message = new \MassMail\MassMailMessage($id); $message = new \MassMail\MassMailMessage($id);
$temp_id = $id ?: uniqid(md5(time())); $temp_id = $id ?: md5(uniqid(time()));
$folder = $message->findFolder($temp_id); $folder = $message->findFolder($temp_id);
// SearchType needed for course selection // SearchType needed for course selection
......
...@@ -143,14 +143,14 @@ class Form extends Part ...@@ -143,14 +143,14 @@ class Form extends Part
foreach ((array) $params['types'] as $fieldname => $type) { foreach ((array) $params['types'] as $fieldname => $type) {
$params['fields'][$fieldname]['type'] = $type; $params['fields'][$fieldname]['type'] = $type;
} }
//respect the without param: // respect the without param:
foreach ((array) $params['without'] as $fieldname) { foreach ((array) $params['without'] as $fieldname) {
unset($params['fields'][$fieldname]); unset($params['fields'][$fieldname]);
} }
$fields = $params['fields']; $fields = $params['fields'];
//Now initializing the fieldset: // Now initializing the fieldset:
$fieldset = new Fieldset($params['legend'] ?: _("Daten")); $fieldset = new Fieldset($params['legend'] ?? _('Daten'));
$fieldset->setContextObject($object) $fieldset->setContextObject($object)
->setCollapsable($params['collapsable'] ?? false) ->setCollapsable($params['collapsable'] ?? false)
->setCollapsed($params['collapsed'] ?? false); ->setCollapsed($params['collapsed'] ?? false);
......
...@@ -15,7 +15,7 @@ class RadioInput extends Input ...@@ -15,7 +15,7 @@ class RadioInput extends Input
$template->required = $this->required; $template->required = $this->required;
$template->options = $options; $template->options = $options;
$template->attributes = arrayToHtmlAttributes($this->attributes); $template->attributes = arrayToHtmlAttributes($this->attributes);
$template->orientation = $this->attributes['orientation']; $template->orientation = $this->attributes['orientation'] ?? null;
return $template->render(); return $template->render();
} }
......
<?php
/**
* @var string $id
* @var string $name
* @var string $value
* @var string|null $orientation
* @var bool $required
* @var array $options
* @var string $attributes
*/
?>
<div class="formpart"> <div class="formpart">
<section <?= $this->orientation == 'horizontal' ? 'class="hgroup"' : '' ?> id="<?= htmlReady($id) ?>"> <section <?= $orientation == 'horizontal' ? 'class="hgroup"' : '' ?> id="<?= htmlReady($id) ?>">
<span class="textlabel<?= $required ? ' studiprequired' : '' ?> "> <span class="textlabel<?= $required ? ' studiprequired' : '' ?> ">
<?= htmlReady($this->title) ?> <?= htmlReady($this->title) ?>
<? if ($required) : ?> <? if ($required) : ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment