diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/functions.php | 3 | ||||
| -rwxr-xr-x | include/login_form.php | 22 |
2 files changed, 23 insertions, 2 deletions
diff --git a/include/functions.php b/include/functions.php index 82e08ddb3..a7b15c165 100644 --- a/include/functions.php +++ b/include/functions.php @@ -108,8 +108,7 @@ $valid_langs[$lang] = $t; $lang = substr($lang, 0, 2); - if (!isset($valid_langs[$lang])) - $valid_langs[$lang] = $t; + $valid_langs[$lang] ??= $t; } // break up string into pieces (languages and q factors) diff --git a/include/login_form.php b/include/login_form.php index 2e0eb077f..a26a58cc9 100755 --- a/include/login_form.php +++ b/include/login_form.php @@ -32,6 +32,27 @@ <script type="text/javascript"> require({cache:{}}); </script> + + <script type="text/javascript"> + /* exported Plugins */ + const Plugins = {}; + + <?php + foreach (PluginHost::getInstance()->get_plugins() as $n => $p) { + if (method_exists($p, "get_login_js")) { + $script = $p->get_login_js(); + + if ($script) { + echo "try { + $script + } catch (e) { + console.warn('failed to initialize plugin JS: $n', e); + }"; + } + } + } + ?> + </script> </head> <body class="flat ttrss_utility ttrss_login css_loading"> @@ -175,6 +196,7 @@ <fieldset class="align-right"> <label> </label> <?= \Controls\submit_tag(__('Log in')) ?> + <?php PluginHost::getInstance()->run_hooks(PluginHost::HOOK_LOGINFORM_ADDITIONAL_BUTTONS) ?> </fieldset> </form> |