';
$text = null;
if (method_exists($propertyGroup, 'getText')) {
$text = $propertyGroup->getText();
}
if ($text != null) {
$ret .= '
' . self::getString($text) . '
';
}
$ret .= '
';
}
}
$not_subgroup_header = false;
if (! isset($properties)) {
$not_subgroup_header = true;
if (method_exists($propertyGroup, 'getProperties')) {
$properties = $propertyGroup->getProperties();
}
}
$property_class = null;
if (isset($properties)) {
/** @var OptionsPropertySubgroup $propertyItem */
foreach ($properties as $propertyItem) {
$property_class = get_class($propertyItem);
// if the property is a subgroup, we deal with it recursively
if (mb_strpos($property_class, 'Subgroup')) {
// for subgroups
// each subgroup can have a header, which may also be a form element
/** @var OptionsPropertyItem|null $subgroup_header */
$subgroup_header = $propertyItem->getSubgroupHeader();
if ($subgroup_header !== null) {
$ret .= self::getOneOption($section, $plugin_name, $subgroup_header);
}
$ret .= 'getName() . '">';
} else {
$ret .= '>';
}
$ret .= self::getOneOption($section, $plugin_name, $propertyItem, true);
continue;
}
// single property item
$ret .= self::getHtmlForProperty($section, $plugin_name, $propertyItem);
}
}
if ($is_subgroup) {
// end subgroup
$ret .= '
';
} elseif ($not_subgroup_header) {
// end main group
$ret .= '
';
}
if (method_exists($propertyGroup, 'getDoc')) {
$doc = $propertyGroup->getDoc();
if ($doc != null) {
if (count($doc) === 3) {
$ret .= MySQLDocumentation::show($doc[1], false, null, null, $doc[2]);
} elseif (count($doc) === 1) {
$ret .= MySQLDocumentation::showDocumentation('faq', $doc[0]);
} else {
$ret .= MySQLDocumentation::show($doc[1]);
}
}
}
// Close the list element after $doc link is displayed
if ($property_class !== null) {
if (
$property_class == BoolPropertyItem::class
|| $property_class == MessageOnlyPropertyItem::class
|| $property_class == SelectPropertyItem::class
|| $property_class == TextPropertyItem::class
) {
$ret .= '';
}
}
return $ret . "\n";
}
/**
* Get HTML for properties items
*
* @param string $section name of config section in
* $GLOBALS['cfg'][$section] for plugin
* @param string $plugin_name unique plugin name
* @param OptionsPropertyItem $propertyItem Property item
* @psalm-param 'Export'|'Import'|'Schema' $section
*
* @return string
*/
public static function getHtmlForProperty(
$section,
$plugin_name,
$propertyItem
) {
$ret = '';
$property_class = get_class($propertyItem);
switch ($property_class) {
case BoolPropertyItem::class:
$ret .= '