Remove $pluginType param
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
4e9c41d624
commit
43ac9ef575
@ -264,7 +264,6 @@ class Plugins
|
||||
/**
|
||||
* Returns single option in a list element
|
||||
*
|
||||
* @param string $pluginName unique plugin name
|
||||
* @param OptionsPropertyItem $propertyGroup options property main group instance
|
||||
* @param bool $isSubgroup if this group is a subgroup
|
||||
*
|
||||
@ -273,7 +272,6 @@ class Plugins
|
||||
private static function getOneOption(
|
||||
Plugin $plugin,
|
||||
PluginType $pluginType,
|
||||
string $pluginName,
|
||||
OptionsPropertyItem $propertyGroup,
|
||||
bool $isSubgroup = false,
|
||||
): string {
|
||||
@ -317,7 +315,7 @@ class Plugins
|
||||
// each subgroup can have a header, which may also be a form element
|
||||
$subgroupHeader = $propertyItem->getSubgroupHeader();
|
||||
if ($subgroupHeader !== null) {
|
||||
$ret .= self::getOneOption($plugin, $pluginType, $pluginName, $subgroupHeader);
|
||||
$ret .= self::getOneOption($plugin, $pluginType, $subgroupHeader);
|
||||
}
|
||||
|
||||
$ret .= '<li class="list-group-item"><ul class="list-group"';
|
||||
@ -329,12 +327,12 @@ class Plugins
|
||||
|
||||
$ret .= "\n";
|
||||
|
||||
$ret .= self::getOneOption($plugin, $pluginType, $pluginName, $propertyItem, true);
|
||||
$ret .= self::getOneOption($plugin, $pluginType, $propertyItem, true);
|
||||
continue;
|
||||
}
|
||||
|
||||
// single property item
|
||||
$ret .= self::getHtmlForProperty($plugin, $pluginType, $pluginName, $propertyItem);
|
||||
$ret .= self::getHtmlForProperty($plugin, $pluginType, $propertyItem);
|
||||
}
|
||||
}
|
||||
|
||||
@ -352,11 +350,10 @@ class Plugins
|
||||
private static function getHtmlForProperty(
|
||||
Plugin $plugin,
|
||||
PluginType $pluginType,
|
||||
string $pluginName,
|
||||
OptionsPropertyItem $propertyItem,
|
||||
): string {
|
||||
if ($propertyItem instanceof OptionsPropertyOneItem) {
|
||||
return $propertyItem->getHtml($plugin, $pluginType, $pluginName) . "\n";
|
||||
return $propertyItem->getHtml($plugin, $pluginType) . "\n";
|
||||
}
|
||||
|
||||
return '';
|
||||
@ -378,9 +375,7 @@ class Plugins
|
||||
$text = $properties->getText();
|
||||
$options = $properties->getOptions();
|
||||
|
||||
$pluginName = $plugin->getName();
|
||||
|
||||
$ret .= '<div id="' . $pluginName
|
||||
$ret .= '<div id="' . $plugin->getName()
|
||||
. '_options" class="format_specific_options">';
|
||||
$ret .= '<h3>' . $plugin->getTranslatedText($text) . '</h3>';
|
||||
|
||||
@ -397,7 +392,7 @@ class Plugins
|
||||
}
|
||||
}
|
||||
|
||||
$ret .= self::getOneOption($plugin, $pluginType, $pluginName, $propertyMainGroup);
|
||||
$ret .= self::getOneOption($plugin, $pluginType, $propertyMainGroup);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
|
||||
*/
|
||||
class BoolPropertyItem extends OptionsPropertyOneItem
|
||||
{
|
||||
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
|
||||
public function getHtml(Plugin $plugin, PluginType $pluginType): string
|
||||
{
|
||||
$ret = '<li class="list-group-item">';
|
||||
$ret .= '<div class="form-check form-switch">';
|
||||
|
||||
@ -16,7 +16,7 @@ use function htmlspecialchars;
|
||||
*/
|
||||
class HiddenPropertyItem extends OptionsPropertyOneItem
|
||||
{
|
||||
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
|
||||
public function getHtml(Plugin $plugin, PluginType $pluginType): string
|
||||
{
|
||||
return '<li class="list-group-item"><input type="hidden" name="' . $this->getName() . '"'
|
||||
. ' value="'
|
||||
|
||||
@ -14,7 +14,7 @@ use PhpMyAdmin\Properties\Options\OptionsPropertyOneItem;
|
||||
*/
|
||||
class MessageOnlyPropertyItem extends OptionsPropertyOneItem
|
||||
{
|
||||
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
|
||||
public function getHtml(Plugin $plugin, PluginType $pluginType): string
|
||||
{
|
||||
$ret = '<li class="list-group-item">';
|
||||
$ret .= $plugin->getTranslatedText($this->getText() ?? '');
|
||||
|
||||
@ -16,7 +16,7 @@ use function htmlspecialchars;
|
||||
*/
|
||||
class NumberPropertyItem extends OptionsPropertyOneItem
|
||||
{
|
||||
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
|
||||
public function getHtml(Plugin $plugin, PluginType $pluginType): string
|
||||
{
|
||||
$ret = '<li class="list-group-item">';
|
||||
$ret .= '<label for="number_' . $this->getName() . '" class="form-label">'
|
||||
|
||||
@ -16,7 +16,7 @@ use function htmlspecialchars;
|
||||
*/
|
||||
class RadioPropertyItem extends OptionsPropertyOneItem
|
||||
{
|
||||
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
|
||||
public function getHtml(Plugin $plugin, PluginType $pluginType): string
|
||||
{
|
||||
$default = htmlspecialchars($plugin->getTranslatedText(Plugins::getDefault(
|
||||
$pluginType,
|
||||
|
||||
@ -16,7 +16,7 @@ use function htmlspecialchars;
|
||||
*/
|
||||
class SelectPropertyItem extends OptionsPropertyOneItem
|
||||
{
|
||||
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
|
||||
public function getHtml(Plugin $plugin, PluginType $pluginType): string
|
||||
{
|
||||
$ret = '<li class="list-group-item">';
|
||||
$ret .= '<label for="select_' . $this->getName() . '" class="form-label">'
|
||||
|
||||
@ -16,7 +16,7 @@ use function htmlspecialchars;
|
||||
*/
|
||||
class TextPropertyItem extends OptionsPropertyOneItem
|
||||
{
|
||||
public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string
|
||||
public function getHtml(Plugin $plugin, PluginType $pluginType): string
|
||||
{
|
||||
$ret = '<li class="list-group-item">';
|
||||
$ret .= '<label for="text_' . $this->getName() . '" class="form-label">'
|
||||
|
||||
@ -87,5 +87,5 @@ abstract class OptionsPropertyOneItem extends OptionsPropertyItem
|
||||
$this->size = $size;
|
||||
}
|
||||
|
||||
abstract public function getHtml(Plugin $plugin, PluginType $pluginType, string $pluginName): string;
|
||||
abstract public function getHtml(Plugin $plugin, PluginType $pluginType): string;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user