-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moving several important warnings to templates #8422
Moving several important warnings to templates #8422
Conversation
$position = array_search('body', Utils::$context['template_layers']); | ||
|
||
if ($position !== false) { | ||
array_splice(Utils::$context['template_layers'], $position + 1, 0, ['maint_warning']); | ||
array_splice(Utils::$context['template_layers'], $position + 1, 0, $layers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this code be better suited for Theme:::loadTemplatesAndLangFiles()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would fit better there in an abstract, conceptual sense, yes. But then it would be called during Theme::load()
, which would be problematic for a number of reasons.
be33569
to
c3ff515
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, except for two minor requests.
$position = array_search('body', Utils::$context['template_layers']); | ||
|
||
if ($position !== false) { | ||
array_splice(Utils::$context['template_layers'], $position + 1, 0, ['maint_warning']); | ||
array_splice(Utils::$context['template_layers'], $position + 1, 0, $layers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would fit better there in an abstract, conceptual sense, yes. But then it would be called during Theme::load()
, which would be problematic for a number of reasons.
Co-authored-by: Jon Stovell <jonstovell@gmail.com>
New Templates for Warnings (
Themes/default/index.template.php
):template_maint_warning_*
).template_security_warning_above/below
).template_banned_warning_above/below
).ins about potential security risks.