From d979bfc757bde99ec2ee51392a42c316df3cca3b Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 5 Dec 2024 08:43:53 -0800 Subject: [PATCH 1/2] Use JS to limit shortname length, but support emoji --- adm/style/event/acp_overall_footer_after.html | 14 ++++++++++++++ event/listener.php | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 adm/style/event/acp_overall_footer_after.html diff --git a/adm/style/event/acp_overall_footer_after.html b/adm/style/event/acp_overall_footer_after.html new file mode 100644 index 0000000..9a54f25 --- /dev/null +++ b/adm/style/event/acp_overall_footer_after.html @@ -0,0 +1,14 @@ + diff --git a/event/listener.php b/event/listener.php index 43e90a1..0052f56 100644 --- a/event/listener.php +++ b/event/listener.php @@ -213,7 +213,7 @@ public function pwa_short_sitename($value, $key) { $placeholder = $this->trim_shortname($this->config['sitename']); - return ''; + return ''; } /** From 60cca5bbb46ba22933806f5261bc199e648d55da Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 5 Dec 2024 08:56:23 -0800 Subject: [PATCH 2/2] Scope script to only the acp page needed --- adm/style/event/acp_overall_footer_after.html | 2 ++ event/listener.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/adm/style/event/acp_overall_footer_after.html b/adm/style/event/acp_overall_footer_after.html index 9a54f25..9fdd075 100644 --- a/adm/style/event/acp_overall_footer_after.html +++ b/adm/style/event/acp_overall_footer_after.html @@ -1,3 +1,4 @@ +{% if S_PWA_OPTIONS %} +{% endif %} diff --git a/event/listener.php b/event/listener.php index 0052f56..fe6b689 100644 --- a/event/listener.php +++ b/event/listener.php @@ -169,6 +169,8 @@ public function acp_pwa_options($event) ]; $event->update_subarray('display_vars', 'vars', phpbb_insert_config_array($event['display_vars']['vars'], $my_config_vars, ['before' => 'legend4'])); + + $this->template->assign_var('S_PWA_OPTIONS', true); } }