Add support for groupping options.

This commit is contained in:
Michal Čihař
2006-04-26 14:42:19 +00:00
parent bdf65efd3c
commit a750f1eade
2 changed files with 18 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ $Source$
- Display information that there are no settings. - Display information that there are no settings.
- Be more verbose on error. - Be more verbose on error.
- Drop tables used for layout. - Drop tables used for layout.
- Add support for groupping options.
* css/phpmyadmin.css.php, themes/darkblue_orange/css/theme_right.css.php, * css/phpmyadmin.css.php, themes/darkblue_orange/css/theme_right.css.php,
themes/original/css/theme_right.css.php: New style for non table forms themes/original/css/theme_right.css.php: New style for non table forms
used in plugins. used in plugins.

View File

@@ -171,14 +171,16 @@ function PMA_pluginGetChoice($section, $name, &$list)
function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
{ {
$ret = "\n"; $ret = "\n";
$ret .= '<div class="formelementrow">' . "\n";
if ($opt['type'] == 'bool') { if ($opt['type'] == 'bool') {
$ret .= '<div class="formelementrow">' . "\n";
$ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $opt['name'] . '"' $ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $opt['name'] . '"'
. ' value="something" id="checkbox_' . $plugin_name . '_' . $opt['name'] . '"' . ' value="something" id="checkbox_' . $plugin_name . '_' . $opt['name'] . '"'
. ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $opt['name']) .' />'; . ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $opt['name']) .' />';
$ret .= '<label for="checkbox_' . $plugin_name . '_' . $opt['name'] . '">' $ret .= '<label for="checkbox_' . $plugin_name . '_' . $opt['name'] . '">'
. PMA_getString($opt['text']) . '</label>'; . PMA_getString($opt['text']) . '</label>';
$ret .= '</div>' . "\n";
} elseif ($opt['type'] == 'text') { } elseif ($opt['type'] == 'text') {
$ret .= '<div class="formelementrow">' . "\n";
$ret .= '<label for="text_' . $plugin_name . '_' . $opt['name'] . '" class="desc">' $ret .= '<label for="text_' . $plugin_name . '_' . $opt['name'] . '" class="desc">'
. PMA_getString($opt['text']) . '</label>'; . PMA_getString($opt['text']) . '</label>';
$ret .= '<input type="text" name="' . $plugin_name . '_' . $opt['name'] . '"' $ret .= '<input type="text" name="' . $plugin_name . '_' . $opt['name'] . '"'
@@ -186,7 +188,9 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
. ' id="text_' . $plugin_name . '_' . $opt['name'] . '"' . ' id="text_' . $plugin_name . '_' . $opt['name'] . '"'
. (isset($opt['size']) ? ' size="' . $opt['size'] . '"' : '' ) . (isset($opt['size']) ? ' size="' . $opt['size'] . '"' : '' )
. (isset($opt['len']) ? ' maxlength="' . $opt['len'] . '"' : '' ) . ' />'; . (isset($opt['len']) ? ' maxlength="' . $opt['len'] . '"' : '' ) . ' />';
$ret .= '</div>' . "\n";
} elseif ($opt['type'] == 'select') { } elseif ($opt['type'] == 'select') {
$ret .= '<div class="formelementrow">' . "\n";
$ret .= '<label for="select_' . $plugin_name . '_' . $opt['name'] . '" class="desc">' $ret .= '<label for="select_' . $plugin_name . '_' . $opt['name'] . '" class="desc">'
. PMA_getString($opt['text']) . '</label>'; . PMA_getString($opt['text']) . '</label>';
$ret .= '<select name="' . $plugin_name . '_' . $opt['name'] . '"' $ret .= '<select name="' . $plugin_name . '_' . $opt['name'] . '"'
@@ -200,9 +204,20 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
$ret .= '>' . PMA_getString($val) . '</option>'; $ret .= '>' . PMA_getString($val) . '</option>';
} }
$ret .= '</select>'; $ret .= '</select>';
$ret .= '</div>' . "\n";
} elseif ($opt['type'] == 'hidden') { } elseif ($opt['type'] == 'hidden') {
$ret .= '<input type="hidden" name="' . $plugin_name . '_' . $opt['name'] . '"' $ret .= '<input type="hidden" name="' . $plugin_name . '_' . $opt['name'] . '"'
. ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']) . '"' . ' />'; . ' value="' . PMA_pluginGetDefault($section, $plugin_name . '_' . $opt['name']) . '"' . ' />';
} elseif ($opt['type'] == 'bgroup') {
$ret .= '<fieldset><legend>';
$ret .= '<input type="checkbox" name="' . $plugin_name . '_' . $opt['name'] . '"'
. ' value="something" id="checkbox_' . $plugin_name . '_' . $opt['name'] . '"'
. ' ' . PMA_pluginCheckboxCheck($section, $plugin_name . '_' . $opt['name']) .' />';
$ret .= '<label for="checkbox_' . $plugin_name . '_' . $opt['name'] . '">'
. PMA_getString($opt['text']) . '</label>';
$ret .= '</legend>';
} elseif ($opt['type'] == 'egroup') {
$ret .= '</fieldset>';
} else { } else {
/* This should be seen only by plugin writers, so I do not thing this /* This should be seen only by plugin writers, so I do not thing this
* needs translation. */ * needs translation. */
@@ -211,7 +226,7 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt)
if (isset($opt['doc'])) { if (isset($opt['doc'])) {
$ret .= PMA_showMySQLDocu($opt['doc'][0], $opt['doc'][1]); $ret .= PMA_showMySQLDocu($opt['doc'][0], $opt['doc'][1]);
} }
$ret .= '</div>' . "\n"; $ret .= "\n";
return $ret; return $ret;
} }