diff --git a/libraries/plugin_interface.lib.php b/libraries/plugin_interface.lib.php index b78d32f80..3883256a9 100644 --- a/libraries/plugin_interface.lib.php +++ b/libraries/plugin_interface.lib.php @@ -142,37 +142,44 @@ function PMA_pluginIsActive($section, $opt, $val) /** * string PMA_pluginGetChoice(string $section, string $name, array &$list, string $cfgname) * - * returns html radio form element for plugin choice + * returns html select form element for plugin choice + * and hidden fields denoting whether each plugin must be exported as a file * - * @uses PMA_pluginIsActive() + * @uses PMA_pluginGetDefault() * @uses PMA_getString() * @param string $section name of config section in * $GLOBALS['cfg'][$section] for plugin - * @param string $name name of radio element + * @param string $name name of select element * @param array &$list array with plugin configuration defined in plugin file * @param string $cfgname name of config value, if none same as $name - * @return string html input radio tag + * @return string html select tag */ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL) { if (!isset($cfgname)) { $cfgname = $name; } - $ret = ''; + $ret = '' . "\n"; - $ret .= '' . "\n"; - $ret .= '
' . "\n"; + $ret .= ' value="' . $plugin_name . '">' . PMA_getString($val['text']) . ' \n'; + } + $ret .= '' . "\n"; + + // Whether each plugin has to be saved as a file + foreach ($list as $plugin_name => $val) { + $ret .= ''. "\n"; } return $ret; } @@ -180,7 +187,7 @@ function PMA_pluginGetChoice($section, $name, &$list, $cfgname = NULL) /** * string PMA_pluginGetOneOption(string $section, string $plugin_name, string $id, array &$opt) * - * returns single option in a table row + * returns single option in a list element * * @uses PMA_getString() * @uses PMA_pluginCheckboxCheck() @@ -196,7 +203,7 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) { $ret = "\n"; if ($opt['type'] == 'bool') { - $ret .= '
' . "\n"; + $ret .= '
  • ' . "\n"; $ret .= '' . PMA_getString($opt['text']) . ''; - $ret .= '
  • ' . "\n"; } elseif ($opt['type'] == 'text') { - $ret .= '
    ' . "\n"; + $ret .= '
  • ' . "\n"; $ret .= ''; $ret .= ''; - $ret .= '
  • ' . "\n"; } elseif ($opt['type'] == 'message_only') { - $ret .= '
    ' . "\n"; + $ret .= '
  • ' . "\n"; $ret .= '

    ' . PMA_getString($opt['text']) . '

    '; - $ret .= '
  • ' . "\n"; } elseif ($opt['type'] == 'select') { - $ret .= '
    ' . "\n"; + $ret .= '
  • ' . "\n"; $ret .= ''; $ret .= ''; - $ret .= '
  • ' . "\n"; + } elseif ($opt['type'] == 'radio') { + $default = PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']); + foreach($opt['values'] as $key => $val) { + $ret .= '
  • ' + . PMA_getString($val) . ''; + } } elseif ($opt['type'] == 'hidden') { $ret .= ''; - } elseif ($opt['type'] == 'bgroup') { - $ret .= '
    '; - /* No checkbox without name */ - if (!empty($opt['name'])) { - $ret .= '' - . PMA_getString($opt['text']) . ''; - } else { - $ret .= PMA_getString($opt['text']); - } - $ret .= ''; - } elseif ($opt['type'] == 'egroup') { - $ret .= '
    '; + } elseif ($opt['type'] == 'begin_group') { + $ret .= '

    ' . PMA_getString($opt['text']) . '

    '; + } elseif ($opt['type'] == 'begin_subgroup') { + /* each subgroup can have a header, which may also be a form element */ + $ret .= PMA_pluginGetOneOption($section, $plugin_name, $id, $opt['subgroup_header']) . ''; } else { /* This should be seen only by plugin writers, so I do not thing this * needs translation. */ @@ -279,6 +279,7 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) $ret .= PMA_showMySQLDocu($opt['doc'][0], $opt['doc'][1]); } } + $ret .= "\n"; return $ret; } @@ -286,10 +287,11 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) /** * string PMA_pluginGetOptions(string $section, array &$list) * - * return html fieldset with editable options for plugin + * return html div with editable options for plugin * * @uses PMA_getString() * @uses PMA_pluginGetOneOption() + * @uses PMA_pluginGetDefault(); * @param string $section name of config section in $GLOBALS['cfg'][$section] * @param array &$list array with plugin configuration defined in plugin file * @return string html fieldset with plugin options @@ -297,10 +299,14 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) function PMA_pluginGetOptions($section, &$list) { $ret = ''; + $default = PMA_pluginGetDefault('Export', 'format'); // Options for plugins that support them foreach ($list as $plugin_name => $val) { - $ret .= '
    '; - $ret .= '' . PMA_getString($val['options_text']) . ''; + $ret .= '
    0) { foreach ($val['options'] as $id => $opt) { @@ -311,7 +317,7 @@ function PMA_pluginGetOptions($section, &$list) if ($count == 0) { $ret .= __('This format has no options'); } - $ret .= '
    '; + $ret .= ''; } return $ret; } @@ -324,36 +330,12 @@ function PMA_pluginGetOptions($section, &$list) * @param array &$list array with plugin configuration defined in plugin file * @return string html fieldset with plugin options */ + //TODO eliminate this eventually function PMA_pluginGetJavascript(&$list) { $ret = '