From de5013ae7a8b8301501742eab30b70880bdbc809 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 10:57:31 -0400 Subject: [PATCH 01/32] The new export page --- libraries/display_export.lib.php | 349 +++++++++++++++---------------- 1 file changed, 164 insertions(+), 185 deletions(-) diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index 54867f503..cb7dc4b10 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -67,202 +67,181 @@ if (! empty($sql_query)) { } echo PMA_pluginGetJavascript($export_list); ?> -
- - -
- -
-
- - - -
- -
- - -
+
+

Format:

+
-
- -
- +
+ ' . __('Database(s):') . ''; + } else if($export_type == 'database') { + echo '

' . __('Table(s):') . '

'; + } + if (! empty($multi_values)) { + echo $multi_values; + } + ?>
-
- -
- '; - - echo sprintf(__('Dump %s row(s) starting at row # %s'), - '', - ' '); - - echo ''; - echo ''; - ?> -
+
+

+
    +
  • + '; + echo ''; ?> +
      +
    • ' ?>
    • +
    • '; ?>
    • +
    +
  • +
  • + '; + echo ' ';?> +
  • +
+
-
-
- - /> - - +
+

+
    +
  • + /> + +
      + +
    • + /> + +
    • +
    • + /> + +
    • + +
    • +
    • +
    • + ' + . __('Character set of the file:') . '' . "\n"; + reset($cfg['AvailableCharsets']); + echo ''; + } // end if + ?> +
    • +
    • + + + + + + +
    • +
    +
  • +
  • +
+
- $trans = new PMA_Message; - $trans->addMessage('__SERVER__/'); - $trans->addString(__('server name')); - if ($export_type == 'database' || $export_type == 'table') { - $trans->addMessage('__DB__/'); - $trans->addString(__('database name')); - if ($export_type == 'table') { - $trans->addMessage('__TABLE__/'); - $trans->addString(__('table name')); - } - } - - $message = new PMA_Message(__('This value is interpreted using %1$sstrftime%2$s, so you can use time formatting strings. Additionally the following transformations will happen: %3$s. Other text will be kept as is.')); - $message->addParam('', false); - $message->addParam('', false); - $message->addParam($trans); - - echo PMA_showHint($message); - ?> - : - - /> - - ( - /> - - ) - -
- ' - . __('Character set of the file:') . '' . "\n"; - - reset($cfg['AvailableCharsets']); - echo ''; - } // end if - ?> -
- - -
- : - /> - - - /> - - - /> - - - /> - - -
- - - -
+
+

+ +
From e3e21a20496516742404c741da457f65d7b6e491 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 22:22:41 -0400 Subject: [PATCH 02/32] Added styles for export --- themes/original/css/theme_right.css.php | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index b3c510154..3c671d68e 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -1228,3 +1228,48 @@ table#serverconnection_trg_local { */ .invalid_value {background:#F00;} + +/** + * Export styles + */ +select#db_select, select#table_select { + width: 400px; +} + +.exportoptions h3, .importoptions h3 { + border-bottom: 1px #999999 solid; +} + +.exportoptions ul, .importoptions ul, .format_specific_options ul { + list-style-type: none; + margin-bottom: 15px; +} + +.exportoptions li, .importoptions li { + margin: 7px; +} + +.exportoptions label, .importoptions label { + margin: 5px; + float: none; +} + +.exportoptions, .importoptions { + margin: 30px 0px 30px 10px +} + +.export_sub_options { + margin: 30px 0px 0px 0px; +} + +.export_sub_options h4 { + border-bottom: 1px #999999 solid; +} + +p.desc { + margin: 5px; +} + +.formelementrow { + margin: 5px 0px 5px 0px; +} From 7920cbc74668fe411821c98d32cddbfd95bd3649 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 22:28:40 -0400 Subject: [PATCH 03/32] Modified formatting for new export page --- server_export.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server_export.php b/server_export.php index e728465bc..183b784c4 100644 --- a/server_export.php +++ b/server_export.php @@ -12,6 +12,7 @@ require_once './libraries/common.inc.php'; $GLOBALS['js_include'][] = 'functions.js'; +$GLOBALS['js_include'][] = 'export.js'; /** * Displays the links @@ -23,12 +24,12 @@ $checkall_url = 'server_export.php?' . PMA_generate_common_url() . '&goto=db_export.php'; -$multi_values = '
'; +$multi_values = '
'; $multi_values .= '' . __('Select All') . ' / ' . __('Unselect All') . '
'; -$multi_values .= ''; $multi_values .= "\n"; foreach ($GLOBALS['pma']->databases as $current_db) { @@ -41,7 +42,7 @@ foreach ($GLOBALS['pma']->databases as $current_db) { $multi_values .= ' ' . "\n"; } // end while $multi_values .= "\n"; -$multi_values .= '

'; +$multi_values .= '
'; $export_type = 'server'; require_once './libraries/display_export.lib.php'; From 357ca0dbb8e6de2a72363b6b0346023f727d62ea Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 22:29:03 -0400 Subject: [PATCH 04/32] Modified formatting for new export page --- tbl_export.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tbl_export.php b/tbl_export.php index 086dd39f7..775650dc0 100644 --- a/tbl_export.php +++ b/tbl_export.php @@ -11,6 +11,8 @@ */ require_once './libraries/common.inc.php'; +$GLOBALS['js_include'][] = 'export.js'; + /** * Gets tables informations and displays top links */ From 1e4bba60d561b855204bd9add80a3aa72e0c16a8 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 22:30:02 -0400 Subject: [PATCH 05/32] Modified formatting for new export page --- db_export.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/db_export.php b/db_export.php index 718a489d8..32971ab5f 100644 --- a/db_export.php +++ b/db_export.php @@ -16,6 +16,8 @@ */ require_once './libraries/common.inc.php'; +$GLOBALS['js_include'][] = 'export.js'; + // $sub_part is also used in db_info.inc.php to see if we are coming from // db_export.php, in which case we don't obey $cfg['MaxTableList'] $sub_part = '_export'; @@ -39,12 +41,12 @@ $checkall_url = 'db_export.php?' . PMA_generate_common_url($db) . '&goto=db_export.php'; -$multi_values = '
'; +$multi_values = '
'; $multi_values .= '' . __('Select All') . ' / ' . __('Unselect All') . '
'; -$multi_values .= ''; $multi_values .= "\n"; if (!empty($selected_tbl) && empty($table_select)) { @@ -65,7 +67,7 @@ foreach ($tables as $each_table) { } // end for $multi_values .= "\n"; -$multi_values .= '

'; +$multi_values .= '
'; $export_type = 'database'; require_once './libraries/display_export.lib.php'; From 78375df6ba68c99c2848c5c1d98e4265e6089950 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 22:34:38 -0400 Subject: [PATCH 06/32] - radio buttons of plugins changed to a dropdown list - "formelement" divs changed to list elements - PMA_pluginGetOneOption() accepts radio buttons - fieldsets changed to divs - removed JavaScript code that toggles plugin-specific options (now in a separate file) --- libraries/plugin_interface.lib.php | 140 +++++++++++++---------------- 1 file changed, 61 insertions(+), 79 deletions(-) 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'] == 'end_group') { + $ret .= '
    '; + } 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']) . '
      '; + } elseif ($opt['type'] == 'end_subgroup') { + $ret .= '
    '; } 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 = ' - '; - return $ret; -} -?> From 2dd664b03557d2c0689f8181b43e17f68ede20ee Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 11 Jun 2010 01:18:18 -0400 Subject: [PATCH 32/32] Added styles for import/export Go button, select and input types alignment, and import notification --- themes/original/css/theme_right.css.php | 26 +++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index 3c671d68e..40189623a 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -1249,13 +1249,30 @@ select#db_select, select#table_select { margin: 7px; } -.exportoptions label, .importoptions label { +.exportoptions label, .importoptions label, .exportoptions p, .importoptions p { margin: 5px; float: none; } +#csv_options .desc, #latex_options .desc, #output .desc{ + float: left; + width: 15em; +} + .exportoptions, .importoptions { - margin: 30px 0px 30px 10px + margin: 30px 30px 30px 10px +} + +.exportoptions #buttonGo, .importoptions #buttonGo { + padding: 5px 30px; + -moz-border-radius: 11px; + -webkit-border-radius: + background: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#cccccc)); + background: -moz-linear-gradient(top, #ffffff, #cccccc); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#cccccc'); + border: 1px solid #444444; + background-color: #ffffff; + cursor: pointer; } .export_sub_options { @@ -1266,6 +1283,11 @@ select#db_select, select#table_select { border-bottom: 1px #999999 solid; } +.importoptions #import_notification { + margin: 10px 0px; + font-style: italic; +} + p.desc { margin: 5px; }