Skip to content

[3.0] Theme split (wave 4, part 10) — make the report picker a list of labelled choices - #9404

Merged
live627 merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-report-type-form
Aug 9, 2026
Merged

[3.0] Theme split (wave 4, part 10) — make the report picker a list of labelled choices#9404
live627 merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/theme-report-type-form

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

template_report_type() built the list of reports as a dl.settings, which is the label-and-control pattern used for settings forms. It does not fit a list of choices, and it was assembled the wrong way round:

foreach (Utils::$context['report_types'] as $type) {
	if (isset($type['description'])) {
		echo '<dt>', $type['description'], '</dt>';   // the description is the term
	}

	echo '<dd>
		<input type="radio" id="rt_', $type['id'], '" …>
		<strong><label for="rt_', $type['id'], '">', $type['title'], '</label></strong>
	</dd>';                                            // the label is the definition
}

So the <dt> carried the description and the <dd> carried the radio together with the label that belongs to it. Read as a definition list, each report's description is the term for the report that follows, and the title — the thing that names the choice — sits inside the definition. A report with no description drops its <dt> and shifts everything after it.

Each report is now one <label> wrapping its radio, title and description:

<label>
	<input type="radio" name="rt" value="board_perms">
	<strong>Board Permissions</strong>
	<p>Generate reports showing permissions each membergroup has across the different boards in your forum.</p>
</label>

This is the shape template_maintain_options() already uses for the forum maintenance picker, landed in #9333, and the .option_form rules that came with it lay it out with no new CSS. A missing description now just leaves the <p> out of that one label.

The id="rt_…" / for="rt_…" pairing goes with it — the input is inside its label, so the association no longer needs an id, and nothing else referenced those ids.

What I did not change

The #7933 branch also turns this into a method="get" form with hidden action and area fields and drops the session token. That is a separate decision about the request, not about the markup, so this keeps the POST and the token exactly as they were.

Checked

Rendered on the running forum, then submitted: Admin → Reports still produces "Reports - Boards" with the board list in it.

Part of the #7933 split. Numbering restarts each wave.

Issues References (Fixes|Related|Closes)

Related to #7933

template_report_type() built its list of reports as a dl.settings, which is
the label-and-control pattern used for settings forms. It does not fit here:
the <dt> held the report's description rather than its label, and the <dd>
held the radio together with the label it belongs to. So the definition list
paired every report's description with the report after it, and the actual
label was inside the definition rather than the term.

Each report is now one <label> wrapping its radio, title and description,
which is the shape template_maintain_options() already uses for the forum
maintenance picker, and the .option_form rules that came with it lay this
out with no new CSS.

The form still posts, and still carries the session token.

Signed-off-by: Mathias Papenbrock <mathiaspapealbert@hotmail.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@albertlast albertlast mentioned this pull request Aug 8, 2026
@jdarwood007 jdarwood007 added this to the 3.0 Alpha 5 milestone Aug 8, 2026
@live627
live627 merged commit 608de80 into SimpleMachines:release-3.0 Aug 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants