diff --git a/app/controllers/massmail/message.php b/app/controllers/massmail/message.php index 62778db8cf89a5b070b5c6dbfc5dc32c4364e2dd..031072e685089d2c6ce9402114b823ba7dace913 100644 --- a/app/controllers/massmail/message.php +++ b/app/controllers/massmail/message.php @@ -19,7 +19,7 @@ class Massmail_MessageController extends \AuthenticatedController $message = new \MassMail\MassMailMessage($id); - $temp_id = $id ?: uniqid(md5(time())); + $temp_id = $id ?: md5(uniqid(time())); $folder = $message->findFolder($temp_id); // SearchType needed for course selection diff --git a/lib/classes/forms/Form.php b/lib/classes/forms/Form.php index f9b27cd3cee882748aa82e5032df793a9bbed13f..58fe47a2a3baa0c535960c02526c3c3a60c19898 100644 --- a/lib/classes/forms/Form.php +++ b/lib/classes/forms/Form.php @@ -143,14 +143,14 @@ class Form extends Part foreach ((array) $params['types'] as $fieldname => $type) { $params['fields'][$fieldname]['type'] = $type; } - //respect the without param: + // respect the without param: foreach ((array) $params['without'] as $fieldname) { unset($params['fields'][$fieldname]); } $fields = $params['fields']; - //Now initializing the fieldset: - $fieldset = new Fieldset($params['legend'] ?: _("Daten")); + // Now initializing the fieldset: + $fieldset = new Fieldset($params['legend'] ?? _('Daten')); $fieldset->setContextObject($object) ->setCollapsable($params['collapsable'] ?? false) ->setCollapsed($params['collapsed'] ?? false); diff --git a/lib/classes/forms/RadioInput.php b/lib/classes/forms/RadioInput.php index 1945d87cbb868f9fd139bde12750ff9552247833..b02cb6717ada5f60c2fcd6399e0f926a33620ae4 100644 --- a/lib/classes/forms/RadioInput.php +++ b/lib/classes/forms/RadioInput.php @@ -15,7 +15,7 @@ class RadioInput extends Input $template->required = $this->required; $template->options = $options; $template->attributes = arrayToHtmlAttributes($this->attributes); - $template->orientation = $this->attributes['orientation']; + $template->orientation = $this->attributes['orientation'] ?? null; return $template->render(); } diff --git a/templates/forms/radio_input.php b/templates/forms/radio_input.php index f7636d19cf65894d818c34377478a89b711d6e96..df911b2eda932b0499e9fa0273d1659c3659336f 100644 --- a/templates/forms/radio_input.php +++ b/templates/forms/radio_input.php @@ -1,5 +1,16 @@ +<?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"> - <section <?= $this->orientation == 'horizontal' ? 'class="hgroup"' : '' ?> id="<?= htmlReady($id) ?>"> + <section <?= $orientation == 'horizontal' ? 'class="hgroup"' : '' ?> id="<?= htmlReady($id) ?>"> <span class="textlabel<?= $required ? ' studiprequired' : '' ?> "> <?= htmlReady($this->title) ?> <? if ($required) : ?>