diff --git a/libraries/plugin_interface.lib.php b/libraries/plugin_interface.lib.php index dd98bcbd88..b7e9d39290 100644 --- a/libraries/plugin_interface.lib.php +++ b/libraries/plugin_interface.lib.php @@ -199,7 +199,7 @@ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = null) $plugin_name = strtolower(substr(get_class($plugin), strlen($section))); $ret .= ''. "\n"; } - + return $ret; } @@ -245,137 +245,141 @@ function PMA_pluginGetOneOption( } } - if (! isset($properties)) { $not_subgroup_header = true; - $properties = $propertyGroup->getProperties(); + if (method_exists($propertyGroup, 'getProperties')) { + $properties = $propertyGroup->getProperties(); + } } - foreach ($properties as $propertyItem) { - $property_class = get_class($propertyItem); - // if the property is a subgroup, we deal with it recursively - if (strpos($property_class, "Subgroup")) { - // for subgroups - // each subgroup can have a header, which may also be a form element - $subgroup_header = $propertyItem->getSubgroupHeader(); - if (isset($subgroup_header)) { - $ret .= PMA_pluginGetOneOption( + + if (isset($properties)) { + foreach ($properties as $propertyItem) { + $property_class = get_class($propertyItem); + // if the property is a subgroup, we deal with it recursively + if (strpos($property_class, "Subgroup")) { + // for subgroups + // each subgroup can have a header, which may also be a form element + $subgroup_header = $propertyItem->getSubgroupHeader(); + if (isset($subgroup_header)) { + $ret .= PMA_pluginGetOneOption( + $section, + $plugin_name, + $subgroup_header + ); + } + + $ret .= '
  • getName() . '">'; + } else { + $ret .= '>'; + } + + $ret .= PMA_pluginGetOneOption( $section, $plugin_name, - $subgroup_header + $propertyItem, + true ); - } - - $ret .= '
  • getName() . '">'; } else { - $ret .= '>'; - } + // single property item + switch ($property_class) { + case "BoolPropertyItem": + $ret .= '
  • ' . "\n"; + $ret .= 'getName()); - $ret .= PMA_pluginGetOneOption( - $section, - $plugin_name, - $propertyItem, - true - ); - } else { - // single property item - switch ($property_class) { - case "BoolPropertyItem": - $ret .= '
  • ' . "\n"; - $ret .= 'getName()); - - if ($propertyItem->getForce() != null) { - // Same code is also few lines lower, update both if needed - $ret .= ' onclick="if (!this.checked && ' - . '(!document.getElementById(\'checkbox_' . $plugin_name - . '_' . $propertyItem->getForce() . '\') ' - . '|| !document.getElementById(\'checkbox_' - . $plugin_name . '_' . $propertyItem->getForce() - . '\').checked)) ' - . 'return false; else return true;"'; - } - $ret .= ' />'; - $ret .= ''; - break; - case "DocPropertyItem": - echo "DocPropertyItem"; - break; - case "HiddenPropertyItem": - $ret .= '
  • '; - break; - case "MessageOnlyPropertyItem": - $ret .= '
  • ' . "\n"; - $ret .= '

    ' . PMA_getString($propertyItem->getText()) . '

    '; - break; - case "RadioPropertyItem": - $default = PMA_pluginGetDefault($section, $plugin_name . '_' - . $propertyItem->getName()); - foreach ($propertyItem->getValues() as $key => $val) { - $ret .= '
  • getForce() != null) { + // Same code is also few lines lower, update both if needed + $ret .= ' onclick="if (!this.checked && ' + . '(!document.getElementById(\'checkbox_' . $plugin_name + . '_' . $propertyItem->getForce() . '\') ' + . '|| !document.getElementById(\'checkbox_' + . $plugin_name . '_' . $propertyItem->getForce() + . '\').checked)) ' + . 'return false; else return true;"'; } - $ret .= ' />' . '
  • '; - } - break; - case "SelectPropertyItem": - $ret .= '
  • ' . "\n"; - $ret .= ''; - $ret .= '
  • '; + break; + case "MessageOnlyPropertyItem": + $ret .= '
  • ' . "\n"; + $ret .= '

    ' . PMA_getString($propertyItem->getText()) . '

    '; + break; + case "RadioPropertyItem": + $default = PMA_pluginGetDefault($section, $plugin_name . '_' + . $propertyItem->getName()); + foreach ($propertyItem->getValues() as $key => $val) { + $ret .= '
  • ' + . PMA_getString($val) . '
  • '; } - $ret .= '>' . PMA_getString($val) . ''; - } - $ret .= ''; - break; - case "TextPropertyItem": - $ret .= '
  • ' . "\n"; - $ret .= ''; - $ret .= 'getSize() != null - ? ' size="' . $propertyItem->getSize() . '"' - : '') - . ($propertyItem->getLen() != null - ? ' maxlength="' . $propertyItem->getLen() . '"' - : '') - . ' />'; - break; - default:; + break; + case "SelectPropertyItem": + $ret .= '
  • ' . "\n"; + $ret .= ''; + $ret .= ''; + break; + case "TextPropertyItem": + $ret .= '
  • ' . "\n"; + $ret .= ''; + $ret .= 'getSize() != null + ? ' size="' . $propertyItem->getSize() . '"' + : '') + . ($propertyItem->getLen() != null + ? ' maxlength="' . $propertyItem->getLen() . '"' + : '') + . ' />'; + break; + default:; + } } } }