Put $pluginName . '_' . $this->getName() on same line

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2026-02-14 21:16:26 +00:00
parent 71ac9f7143
commit 112f02b1fa
6 changed files with 19 additions and 32 deletions

View File

@ -18,10 +18,9 @@ class BoolPropertyItem extends OptionsPropertyOneItem
{
$ret = '<li class="list-group-item">';
$ret .= '<div class="form-check form-switch">';
$ret .= '<input class="form-check-input" type="checkbox" role="switch" name="' . $pluginName . '_'
. $this->getName() . '"'
. ' value="y" id="checkbox_' . $pluginName . '_'
. $this->getName() . '"'
$ret .= '<input class="form-check-input" type="checkbox" role="switch" name="'
. $pluginName . '_' . $this->getName() . '"'
. ' value="y" id="checkbox_' . $pluginName . '_' . $this->getName() . '"'
. ' '
. Plugins::checkboxCheck(
$pluginType,
@ -39,8 +38,7 @@ class BoolPropertyItem extends OptionsPropertyOneItem
}
$ret .= '>';
$ret .= '<label class="form-check-label" for="checkbox_' . $pluginName . '_'
. $this->getName() . '">'
$ret .= '<label class="form-check-label" for="checkbox_' . $pluginName . '_' . $this->getName() . '">'
. $plugin->getTranslatedText($this->getText() ?? '') . '</label></div>';
$ret .= Plugins::getDocumentationLinkHtml($this);

View File

@ -18,8 +18,7 @@ class HiddenPropertyItem extends OptionsPropertyOneItem
{
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
{
return '<li class="list-group-item"><input type="hidden" name="' . $pluginName . '_'
. $this->getName() . '"'
return '<li class="list-group-item"><input type="hidden" name="' . $pluginName . '_' . $this->getName() . '"'
. ' value="'
. htmlspecialchars($plugin->getTranslatedText(Plugins::getDefault(
$pluginType,

View File

@ -19,18 +19,15 @@ class NumberPropertyItem extends OptionsPropertyOneItem
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
{
$ret = '<li class="list-group-item">';
$ret .= '<label for="number_' . $pluginName . '_'
. $this->getName() . '" class="form-label">'
$ret .= '<label for="number_' . $pluginName . '_' . $this->getName() . '" class="form-label">'
. $plugin->getTranslatedText($this->getText() ?? '') . '</label>';
$ret .= '<input class="form-control" type="number" name="' . $pluginName . '_'
. $this->getName() . '"'
$ret .= '<input class="form-control" type="number" name="' . $pluginName . '_' . $this->getName() . '"'
. ' value="'
. htmlspecialchars($plugin->getTranslatedText(Plugins::getDefault(
$pluginType,
$pluginName . '_' . $this->getName(),
))) . '"'
. ' id="number_' . $pluginName . '_'
. $this->getName() . '"'
. ' id="number_' . $pluginName . '_' . $this->getName() . '"'
. ' min="0"'
. '>';

View File

@ -26,16 +26,15 @@ class RadioPropertyItem extends OptionsPropertyOneItem
$ret = '<li class="list-group-item">';
foreach ($this->getValues() as $key => $val) {
$ret .= '<div class="form-check"><input type="radio" name="' . $pluginName
. '_' . $this->getName() . '" class="form-check-input" value="' . $key
. '" id="radio_' . $pluginName . '_'
. $this->getName() . '_' . $key . '"';
$ret .= '<div class="form-check"><input type="radio" name="' . $pluginName . '_' . $this->getName()
. '" class="form-check-input" value="' . $key
. '" id="radio_' . $pluginName . '_' . $this->getName() . '_' . $key . '"';
if ($key == $default) {
$ret .= ' checked';
}
$ret .= '><label class="form-check-label" for="radio_' . $pluginName . '_'
. $this->getName() . '_' . $key . '">'
$ret .= '><label class="form-check-label" for="radio_'
. $pluginName . '_' . $this->getName() . '_' . $key . '">'
. $plugin->getTranslatedText($val) . '</label></div>';
}

View File

@ -19,13 +19,10 @@ class SelectPropertyItem extends OptionsPropertyOneItem
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
{
$ret = '<li class="list-group-item">';
$ret .= '<label for="select_' . $pluginName . '_'
. $this->getName() . '" class="form-label">'
$ret .= '<label for="select_' . $pluginName . '_' . $this->getName() . '" class="form-label">'
. $plugin->getTranslatedText($this->getText() ?? '') . '</label>';
$ret .= '<select class="form-select" name="' . $pluginName . '_'
. $this->getName() . '"'
. ' id="select_' . $pluginName . '_'
. $this->getName() . '">';
$ret .= '<select class="form-select" name="' . $pluginName . '_' . $this->getName() . '"'
. ' id="select_' . $pluginName . '_' . $this->getName() . '">';
$default = htmlspecialchars($plugin->getTranslatedText(Plugins::getDefault(
$pluginType,
$pluginName . '_' . $this->getName(),

View File

@ -19,18 +19,15 @@ class TextPropertyItem extends OptionsPropertyOneItem
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
{
$ret = '<li class="list-group-item">';
$ret .= '<label for="text_' . $pluginName . '_'
. $this->getName() . '" class="form-label">'
$ret .= '<label for="text_' . $pluginName . '_' . $this->getName() . '" class="form-label">'
. $plugin->getTranslatedText($this->getText() ?? '') . '</label>';
$ret .= '<input class="form-control" type="text" name="' . $pluginName . '_'
. $this->getName() . '"'
$ret .= '<input class="form-control" type="text" name="' . $pluginName . '_' . $this->getName() . '"'
. ' value="'
. htmlspecialchars($plugin->getTranslatedText(Plugins::getDefault(
$pluginType,
$pluginName . '_' . $this->getName(),
))) . '"'
. ' id="text_' . $pluginName . '_'
. $this->getName() . '"'
. ' id="text_' . $pluginName . '_' . $this->getName() . '"'
. ($this->getSize() !== 0
? ' size="' . $this->getSize() . '"'
: '')