fix empty context on public widget

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

View File

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