fix empty context on public widget

This commit is contained in:
Jean-Christian Denis 2021-09-02 22:51:20 +02:00
parent e57ec6adc4
commit 9158a6c9dd

View file

@ -95,12 +95,14 @@ class sabaWidget
return;
}
$q = $_ctx->saba_otpion ?? '';
# title and search
$res =
($w->title ? $w->renderTitle('<label for="q">' . html::escapeHTML($w->title) . '</label>') : '') .
'<form action="' . $core->blog->url . '" method="get" role="search">' .
'<p><input type="text" size="10" maxlength="255" id="q" name="q" value="' .
html::escapeHTML($_ctx->saba_options["q"]) . '" ' .
html::escapeHTML($q) . '" ' .
($w->placeholder ? 'placeholder="' . html::escapeHTML($w->placeholder) . '"' : '') .
' aria-label="' . __('Search') . '"/> ' .
'<input type="submit" class="submit" value="ok" title="' . __('Search') . '" /></p>' ;