From f3dcd3502503147f18cfdf8eaceb37ac69f92b5a Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 10:52:38 -0400 Subject: [PATCH 001/206] 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 b32bba64df1070b426c65f17bce628f6da3b7e31 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 10:53:26 -0400 Subject: [PATCH 002/206] Revert "New export page" This reverts commit f3dcd3502503147f18cfdf8eaceb37ac69f92b5a. --- libraries/display_export.lib.php | 349 ++++++++++++++++--------------- 1 file changed, 185 insertions(+), 164 deletions(-) diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index cb7dc4b10..54867f503 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -67,181 +67,202 @@ 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 ''; ?> -
      -
    • ' ?>
    • -
    • '; ?>
    • -
    -
  • -
  • - '; - echo ' ';?> -
  • -
-
+
+ '; + + echo sprintf(__('Dump %s row(s) starting at row # %s'), + '', + ' '); + + echo ''; + echo ''; + ?> +
+
-
-

-
    -
  • - /> - -
      - -
    • - /> - -
    • -
    • - /> - -
    • - -
    • -
    • -
    • - ' - . __('Character set of the file:') . '' . "\n"; - reset($cfg['AvailableCharsets']); - echo ''; - } // end if - ?> -
    • -
    • - - - - - - -
    • -
    -
  • -
  • -
-
+ : + + /> + + ( + /> + + ) + +
+ ' + . __('Character set of the file:') . '' . "\n"; + + reset($cfg['AvailableCharsets']); + echo ''; + } // end if + ?> +
+ + +
+ : + /> + + + /> + + + /> + + + /> + + +
+ + + + From de5013ae7a8b8301501742eab30b70880bdbc809 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 10:57:31 -0400 Subject: [PATCH 003/206] 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 004/206] 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 005/206] 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 006/206] 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 007/206] 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 008/206] - 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 034/206] 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; } From b50c67724cf36bd967d9b154ee41e39bc1759d3b Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 10:52:38 -0400 Subject: [PATCH 035/206] 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 af801d08ad88b1c1dbddaa838115ff08c827814d Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 10:53:26 -0400 Subject: [PATCH 036/206] Revert "New export page" This reverts commit f3dcd3502503147f18cfdf8eaceb37ac69f92b5a. --- libraries/display_export.lib.php | 349 ++++++++++++++++--------------- 1 file changed, 185 insertions(+), 164 deletions(-) diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index cb7dc4b10..54867f503 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -67,181 +67,202 @@ 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 ''; ?> -
        -
      • ' ?>
      • -
      • '; ?>
      • -
      -
    • -
    • - '; - echo ' ';?> -
    • -
    -
    +
    + '; + + echo sprintf(__('Dump %s row(s) starting at row # %s'), + '', + ' '); + + echo ''; + echo ''; + ?> +
    +
    -
    -

    -
      -
    • - /> - -
        - -
      • - /> - -
      • -
      • - /> - -
      • - -
      • -
      • -
      • - ' - . __('Character set of the file:') . '' . "\n"; - reset($cfg['AvailableCharsets']); - echo ''; - } // end if - ?> -
      • -
      • - - - - - - -
      • -
      -
    • -
    • -
    -
    + : + + /> + + ( + /> + + ) + +
    + ' + . __('Character set of the file:') . '' . "\n"; + + reset($cfg['AvailableCharsets']); + echo ''; + } // end if + ?> +
    + + +
    + : + /> + + + /> + + + /> + + + /> + + +
    + + + + From 417c185d35d4e6e69500577eb3d5a68987691d5a Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 10:57:31 -0400 Subject: [PATCH 037/206] 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 9c486804802dcd88ba7ae82f9da0dd7a5e1fcf8d Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 22:22:41 -0400 Subject: [PATCH 038/206] 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 bef15c266d02d4cdd507fa860a17c2943799dd02 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 22:28:40 -0400 Subject: [PATCH 039/206] 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 101b14fef1afe6281054a7e9dd286fd0eda3bca1 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 22:29:03 -0400 Subject: [PATCH 040/206] 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 5339c712a622b939d603d004514cdfaf96d40b4d Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 22:30:02 -0400 Subject: [PATCH 041/206] 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 07b6618cef5a5e4ba44c10b07a027f4a5916c7d6 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 8 Jun 2010 22:34:38 -0400 Subject: [PATCH 042/206] - 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 9444aba181d399b0dac5d52146a13dbb7d3bbe98 Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 11 Jun 2010 01:18:18 -0400 Subject: [PATCH 068/206] 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; } From e3f4e4a776b7fd129f1227c54667c965861bb271 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 16:19:27 -0400 Subject: [PATCH 069/206] Quick export Fixes table export --- export.php | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/export.php b/export.php index ae7a5662a..9c82ed11a 100644 --- a/export.php +++ b/export.php @@ -42,6 +42,14 @@ $compression = false; $onserver = false; $save_on_server = false; $buffer_needed = false; + +// Is it a quick or custom export? +if($_REQUEST['quick_or_custom'] == 'quick') { + $quick_export = true; +} else { + $quick_export = false; +} + if ($_REQUEST['output_format'] == 'astext') { $asfile = false; } else { @@ -50,12 +58,17 @@ if ($_REQUEST['output_format'] == 'astext') { $compression = $_REQUEST['compression']; $buffer_needed = true; } - if (!empty($_REQUEST['onserver'])) { - $onserver = $_REQUEST['onserver']; + if (($quick_export && !empty($_REQUEST['quick_export_onserver'])) || (!$quick_export && !empty($_REQUEST['onserver']))) { + if($quick_export) { + $onserver = $_REQUEST['quick_export_onserver']; + } else { + $onserver = $_REQUEST['onserver']; + } // Will we save dump on server? $save_on_server = ! empty($cfg['SaveDir']) && $onserver; } } + // Does export require to be into file? if (isset($export_list[$type]['force_file']) && ! $asfile) { $message = PMA_Message::error(__('Selected export type has to be saved in file!')); @@ -289,7 +302,7 @@ if ($asfile) { if ($save_on_server) { $save_filename = PMA_userDir($cfg['SaveDir']) . preg_replace('@[/\\\\]@', '_', $filename); unset($message); - if (file_exists($save_filename) && empty($onserverover)) { + if (file_exists($save_filename) && ((!$quick_export && empty($onserverover)) || ($quick_export && $_REQUEST['quick_export_onserverover'] != 'saveitover'))) { $message = PMA_Message::error(__('File %s already exists on server, change filename or check overwrite option.')); $message->addParam($save_filename); } else { @@ -528,7 +541,7 @@ if ($export_type == 'server') { } $is_view = PMA_Table::isView($db, $table); - if (isset($GLOBALS[$what . '_structure'])) { + if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') { if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, $is_view ? 'create_view' : 'create_table', $export_type)) { break; } @@ -536,7 +549,7 @@ if ($export_type == 'server') { // If this is an export of a single view, we have to export data; // for example, a PDF report // if it is a merge table, no data is exported - if (isset($GLOBALS[$what . '_data']) && ! PMA_Table::isMerge($db, $table)) { + if (($GLOBALS[$what . '_structure_or_data'] == 'data' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') && ! PMA_Table::isMerge($db, $table)) { if (!empty($sql_query)) { // only preg_replace if needed if (!empty($add_query)) { @@ -554,7 +567,7 @@ if ($export_type == 'server') { } // now export the triggers (needs to be done after the data because // triggers can modify already imported tables) - if (isset($GLOBALS[$what . '_structure'])) { + if ($GLOBALS[$what . '_structure_or_data'] == 'structure' || $GLOBALS[$what . '_structure_or_data'] == 'structure_and_data') { if (!PMA_exportStructure($db, $table, $crlf, $err_url, $do_relation, $do_comments, $do_mime, $do_dates, 'triggers', $export_type)) { break 2; } From 33cd3de818873332dcf6ceae2b45c160bdfcc1cb Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 16:19:53 -0400 Subject: [PATCH 070/206] Quick export --- js/export.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/js/export.js b/js/export.js index 38419a058..0257f34bf 100644 --- a/js/export.js +++ b/js/export.js @@ -148,3 +148,27 @@ $(document).ready(function() { } }); }); + +/** + * Toggles display of options when quick and custom export are selected + */ +$(document).ready(function() { + $("input[type='radio'][name='quick_or_custom']").change(function() { + export_type = $("input[type='radio'][name='quick_or_custom']:checked").attr("value"); + if(export_type == "custom") { + $("#databases_and_tables").show(); + $("#rows").show(); + $("#output").show(); + $("#format_specific_opts").show(); + $("#output_quick_export").hide(); + var selected_plugin_name = $("#plugins option:selected").attr("value"); + $("#" + selected_plugin_name + "_options").show(); + } else { + $("#databases_and_tables").hide(); + $("#rows").hide(); + $("#output").hide(); + $("#format_specific_opts").hide(); + $("#output_quick_export").show(); + } + }); +}); From 0828cbf8032304e3a27742e0b1385aa0d1d8b357 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 16:20:11 -0400 Subject: [PATCH 071/206] Fixes bug that occurs when selecting a file from web server upload directory --- js/import.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/import.js b/js/import.js index 303405f29..0e3af7ce6 100644 --- a/js/import.js +++ b/js/import.js @@ -36,7 +36,7 @@ $(document).ready(function() { if (extension == "gz" || extension == "bz2" || extension == "zip") { len--; } - $("option:selected").removeAttr("selected"); + $("#plugins option:selected").removeAttr("selected"); switch (fname_array[len - 1]) { case "csv" : $("select[name='format'] option[value='csv']").attr('selected', 'selected'); break; case "docsql" : $("select[name='format'] option[value='docsql']").attr('selected', 'selected'); break; From fe90e236cd63ddfdc239cbc17cdefa02402757cc Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 16:21:44 -0400 Subject: [PATCH 072/206] Quick export --- libraries/display_export.lib.php | 50 +++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index fef74e062..28481efb5 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -67,7 +67,21 @@ if (! empty($sql_query)) { } ?> -
    +
    +

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

    +
      +
    • + /> + +
    • +
    • + /> + +
    • +
    +
    + + +
    -

    Format:

    +

    -
    + @@ -243,7 +280,6 @@ if (! empty($sql_query)) { -
    From a2dfd7170aa23fb4f33abcf4740ec5776da647bf Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 23:36:20 -0400 Subject: [PATCH 073/206] Added functions used to display file select forms in import --- libraries/common.lib.php | 44 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index d7333c7a9..a06c875b3 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2856,4 +2856,46 @@ function PMA_js($code, $print=true) return $out; } -?> + +/** + * Display the form used to browse anywhere on the server for the file to import + */ +function PMA_browseUploadFile($max_upload_size) { + $uid = uniqid(""); + echo ''; + echo ''; + echo ''; + echo ''; + echo PMA_displayMaximumUploadSize($max_upload_size) . "\n"; + // some browsers should respect this :) + echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n"; +} + +/** + * Display the form used to select a file to import from the server upload directory + */ +function PMA_selectUploadFile($import_list, $uploaddir) { + echo ''; + $extensions = ''; + foreach ($import_list as $key => $val) { + if (!empty($extensions)) { + $extensions .= '|'; + } + $extensions .= $val['extension']; + } + $matcher = '@\.(' . $extensions . ')(\.(' . PMA_supportedDecompressions() . '))?$@'; + + $files = PMA_getFileSelectOptions(PMA_userDir($uploaddir), $matcher, (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) ? $local_import_file : ''); + if ($files === FALSE) { + PMA_Message::error(__('The directory you set for upload work cannot be reached'))->display(); + } elseif (!empty($files)) { + echo "\n"; + echo ' ' . "\n"; + } elseif (empty ($files)) { + echo 'There are no files to upload'; + } +} +?> \ No newline at end of file From d5ba4231ec5206881ba3b31716411902142636ec Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 23:37:25 -0400 Subject: [PATCH 074/206] SQL export option "CREATE PROCEDURE / FUNCTION / EVENT" default set to true --- libraries/config.default.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/config.default.php b/libraries/config.default.php index 34af11161..fd95c6263 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -1536,7 +1536,7 @@ $cfg['Export']['sql_if_not_exists'] = true; * * @global boolean $cfg['Export']['sql_procedure_function'] */ -$cfg['Export']['sql_procedure_function'] = false; +$cfg['Export']['sql_procedure_function'] = true; /** * From 135868db800c477cbcd10a40a318a903d64e356b Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 23:38:28 -0400 Subject: [PATCH 075/206] Updated the formatting for selecting a file to import --- libraries/display_import.lib.php | 54 ++++++++++---------------------- 1 file changed, 17 insertions(+), 37 deletions(-) diff --git a/libraries/display_import.lib.php b/libraries/display_import.lib.php index ebeef87fa..10c65f47a 100644 --- a/libraries/display_import.lib.php +++ b/libraries/display_import.lib.php @@ -141,49 +141,29 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") { printf(__('

    File may be compressed (%s) or uncompressed.

    A compressed file\'s name must end in .[format].[compression]. Example: .sql.zip

    '), implode(", ", $compressions)); } - if ($GLOBALS['is_upload']) { + if($GLOBALS['is_upload'] && !empty($cfg['UploadDir'])) { ?> +
      +
    • + + +
    • +
    • + + +
    • +
    +
    - - -
    - - - -
    + +
    display(); - } - if (!empty($cfg['UploadDir'])) { - $extensions = ''; - foreach ($import_list as $key => $val) { - if (!empty($extensions)) { - $extensions .= '|'; - } - $extensions .= $val['extension']; - } - $matcher = '@\.(' . $extensions . ')(\.(' . PMA_supportedDecompressions() . '))?$@'; - - $files = PMA_getFileSelectOptions(PMA_userDir($cfg['UploadDir']), $matcher, (isset($timeout_passed) && $timeout_passed && isset($local_import_file)) ? $local_import_file : ''); - echo '
    ' . "\n"; - if ($files === FALSE) { - PMA_Message::error(__('The directory you set for upload work cannot be reached'))->display(); - } elseif (!empty($files)) { - echo "\n"; - echo ' ' . __('Or') . '
     : ' . "\n"; - echo ' ' . "\n"; - } - echo '
    ' . "\n"; + } else if (!empty($cfg['UploadDir'])) { + PMA_selectUploadFile($import_list, $cfg['UploadDir']); } // end if (web-server upload directory) // charset of file From 347cfc7eaa30c9a1b581b2e816d920ac118c855c Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 15 Jun 2010 23:39:42 -0400 Subject: [PATCH 076/206] The default plugin options should be displayed on the import form but not on the export form (because of quick export) --- libraries/plugin_interface.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/plugin_interface.lib.php b/libraries/plugin_interface.lib.php index ffaddec67..5a982cc43 100644 --- a/libraries/plugin_interface.lib.php +++ b/libraries/plugin_interface.lib.php @@ -303,7 +303,9 @@ function PMA_pluginGetOptions($section, &$list) // Options for plugins that support them foreach ($list as $plugin_name => $val) { $ret .= '
    Date: Tue, 15 Jun 2010 23:40:42 -0400 Subject: [PATCH 077/206] Added styles for "CSV using LOAD DATA" plugin options --- themes/original/css/theme_right.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index 40189623a..ddaf51385 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -1254,7 +1254,7 @@ select#db_select, select#table_select { float: none; } -#csv_options .desc, #latex_options .desc, #output .desc{ +#csv_options .desc, #ldi_options .desc, #latex_options .desc, #output .desc{ float: left; width: 15em; } From 3ba5c8e0f4b34dd8e618ac6854badf193c32f3d8 Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 18 Jun 2010 16:11:52 -0400 Subject: [PATCH 078/206] Fixed XHTML syntax problems --- libraries/export/codegen.php | 2 ++ libraries/export/csv.php | 2 ++ libraries/export/excel.php | 2 ++ libraries/export/htmlword.php | 4 ++-- libraries/export/latex.php | 6 ++++-- libraries/export/mediawiki.php | 2 ++ libraries/export/ods.php | 2 ++ libraries/export/odt.php | 4 ++-- libraries/export/pdf.php | 2 ++ libraries/export/php_array.php | 2 ++ libraries/export/sql.php | 12 ++++++++---- libraries/export/texytext.php | 4 ++-- libraries/export/xls.php | 2 ++ libraries/export/xlsx.php | 2 ++ libraries/export/xml.php | 13 ++++++++++--- libraries/export/yaml.php | 2 ++ 16 files changed, 48 insertions(+), 15 deletions(-) diff --git a/libraries/export/codegen.php b/libraries/export/codegen.php index 9c829c007..52f8577dd 100644 --- a/libraries/export/codegen.php +++ b/libraries/export/codegen.php @@ -33,8 +33,10 @@ if (isset($plugin_list)) { 'extension' => 'cs', 'mime_type' => 'text/cs', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'hidden', 'name' => 'structure_or_data'), array('type' => 'select', 'name' => 'format', 'text' => __('Format:'), 'values' => $CG_FORMATS), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/export/csv.php b/libraries/export/csv.php index dfe9885ad..39defdcb4 100644 --- a/libraries/export/csv.php +++ b/libraries/export/csv.php @@ -18,6 +18,7 @@ if (isset($plugin_list)) { 'extension' => 'csv', 'mime_type' => 'text/comma-separated-values', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'text', 'name' => 'separator', 'text' => __('Columns terminated with:')), array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed with:')), array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped with:')), @@ -26,6 +27,7 @@ if (isset($plugin_list)) { array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove carriage return/line field characters within columns')), array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')), array('type' => 'hidden', 'name' => 'structure_or_data'), + array('type' => 'end_group'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/excel.php b/libraries/export/excel.php index 68d2b5c8c..1e1ab2f55 100644 --- a/libraries/export/excel.php +++ b/libraries/export/excel.php @@ -19,6 +19,7 @@ if (isset($plugin_list)) { 'extension' => 'csv', 'mime_type' => 'text/comma-separated-values', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')), array('type' => 'bool', 'name' => 'removeCRLF', 'text' => __('Remove carriage return/line feed characters within columns')), array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')), @@ -31,6 +32,7 @@ if (isset($plugin_list)) { 'mac_excel2008' => 'Excel 2008 / Macintosh'), 'text' => __('Excel edition:')), array('type' => 'hidden', 'name' => 'structure_or_data'), + array('type' => 'end_group'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/htmlword.php b/libraries/export/htmlword.php index 7b8595bd6..3d534cdef 100644 --- a/libraries/export/htmlword.php +++ b/libraries/export/htmlword.php @@ -21,9 +21,9 @@ if (isset($plugin_list)) { 'force_file' => true, 'options' => array( /* what to dump (structure/data/both) */ - array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))), + array('type' => 'begin_group', 'name' => 'dump_what', 'text' => __('Dump table')), array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))), - array('type' => 'end_subgroup'), + array('type' => 'end_group'), /* data options */ array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'), array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')), diff --git a/libraries/export/latex.php b/libraries/export/latex.php index 4f8578858..61a933b64 100644 --- a/libraries/export/latex.php +++ b/libraries/export/latex.php @@ -23,17 +23,19 @@ if (isset($plugin_list)) { 'extension' => 'tex', 'mime_type' => 'application/x-tex', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'bool', 'name' => 'caption', 'text' => __('Include table caption')), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); /* what to dump (structure/data/both) */ $plugin_list['latex']['options'][] = - array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))); + array('type' => 'begin_group', 'name' => 'dump_what', 'text' => __('Dump table')); $plugin_list['latex']['options'][] = array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))); - $plugin_list['latex']['options'][] = array('type' => 'end_subgroup'); + $plugin_list['latex']['options'][] = array('type' => 'end_group'); /* Structure options */ if (!$hide_structure) { diff --git a/libraries/export/mediawiki.php b/libraries/export/mediawiki.php index bcbf22968..9fa1b483e 100644 --- a/libraries/export/mediawiki.php +++ b/libraries/export/mediawiki.php @@ -16,7 +16,9 @@ if (isset($plugin_list)) { 'extension' => 'txt', 'mime_type' => 'text/plain', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'hidden', 'name' => 'structure_or_data'), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/export/ods.php b/libraries/export/ods.php index 177019412..5b70944dd 100644 --- a/libraries/export/ods.php +++ b/libraries/export/ods.php @@ -20,9 +20,11 @@ if (isset($plugin_list)) { 'mime_type' => 'application/vnd.oasis.opendocument.spreadsheet', 'force_file' => true, 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')), array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')), array('type' => 'hidden', 'name' => 'structure_or_data'), + array('type' => 'end_group'), ), 'options_text' => __('Options'), ); diff --git a/libraries/export/odt.php b/libraries/export/odt.php index 2b2e5c43c..b5d500d30 100644 --- a/libraries/export/odt.php +++ b/libraries/export/odt.php @@ -29,10 +29,10 @@ if (isset($plugin_list)) { /* what to dump (structure/data/both) */ $plugin_list['odt']['options'][] = - array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))); + array('type' => 'begin_group', 'text' => __('Dump table') , 'name' => 'general_opts'); $plugin_list['odt']['options'][] = array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))); - $plugin_list['odt']['options'][] = array('type' => 'end_subgroup'); + $plugin_list['odt']['options'][] = array('type' => 'end_group'); /* Structure options */ if (!$hide_structure) { diff --git a/libraries/export/pdf.php b/libraries/export/pdf.php index ee33c3f3f..2f544b551 100644 --- a/libraries/export/pdf.php +++ b/libraries/export/pdf.php @@ -20,9 +20,11 @@ if (isset($plugin_list)) { 'mime_type' => 'application/pdf', 'force_file' => true, 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'message_only', 'name' => 'explanation', 'text' => __('(Generates a report containing the data of a single table)')), array('type' => 'text', 'name' => 'report_title', 'text' => __('Report title:')), array('type' => 'hidden', 'name' => 'structure_or_data'), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/export/php_array.php b/libraries/export/php_array.php index c3698cf12..5cf6fb760 100644 --- a/libraries/export/php_array.php +++ b/libraries/export/php_array.php @@ -17,10 +17,12 @@ if (isset($plugin_list)) { 'extension' => 'php', 'mime_type' => 'text/plain', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array( 'type' => 'hidden', 'name' => 'structure_or_data', ), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/export/sql.php b/libraries/export/sql.php index 354fac70a..aee3313d9 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -27,6 +27,8 @@ if (isset($plugin_list)) { 'mime_type' => 'text/x-sql', 'options' => array()); + $plugin_list['sql']['options'][] = array('type' => 'begin_group', 'name' => 'general_opts'); + /* comments */ $plugin_list['sql']['options'][] = array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'bool', 'name' => 'include_comments', 'text' => __('Display comments (includes info such as export timestamp, PHP version, and server version)'))); @@ -78,6 +80,8 @@ if (isset($plugin_list)) { array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))); $plugin_list['sql']['options'][] = array('type' => 'end_subgroup'); + $plugin_list['sql']['options'][] = array('type' => 'end_group'); + /* begin Structure options */ if (!$hide_structure) { $plugin_list['sql']['options'][] = @@ -148,10 +152,10 @@ if (isset($plugin_list)) { array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Syntax to use when inserting data:'))); $plugin_list['sql']['options'][] = array('type' => 'radio', 'name' => 'insert_syntax', 'values' => array( - 'complete' => __('include column names in every INSERT statement
          Example: INSERT INTO tbl_name (col_A,col_B,col_C) VALUES (1,2,3)'), - 'extended' => __('insert multiple rows in every INSERT statement
          Example: INSERT INTO tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)'), - 'both' => __('both of the above
          Example: INSERT INTO tbl_name (col_A,col_B) VALUES (1,2,3), (4,5,6), (7,8,9)'), - 'none' => __('neither of the above
          Example: INSERT INTO tbl_name VALUES (1,2,3)'))); + 'complete' => __('include column names in every INSERT statement
          Example: INSERT INTO tbl_name (col_A,col_B,col_C) VALUES (1,2,3)'), + 'extended' => __('insert multiple rows in every INSERT statement
          Example: INSERT INTO tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)'), + 'both' => __('both of the above
          Example: INSERT INTO tbl_name (col_A,col_B) VALUES (1,2,3), (4,5,6), (7,8,9)'), + 'none' => __('neither of the above
          Example: INSERT INTO tbl_name VALUES (1,2,3)'))); $plugin_list['sql']['options'][] = array('type' => 'end_subgroup'); diff --git a/libraries/export/texytext.php b/libraries/export/texytext.php index d07bb5afc..8ed6a742a 100644 --- a/libraries/export/texytext.php +++ b/libraries/export/texytext.php @@ -19,9 +19,9 @@ if (isset($plugin_list)) { 'mime_type' => 'text/plain', 'options' => array( /* what to dump (structure/data/both) */ - array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Dump table'))), + array('type' => 'begin_group', 'text' => __('Dump table'), 'name' => 'general_opts'), array('type' => 'radio', 'name' => 'structure_or_data', 'values' => array('structure' => __('structure'), 'data' => __('data'), 'structure_and_data' => __('structure and data'))), - array('type' => 'end_subgroup'), + array('type' => 'end_group'), array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options'), 'force' => 'structure'), array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL by')), array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')), diff --git a/libraries/export/xls.php b/libraries/export/xls.php index 68075b152..188667798 100644 --- a/libraries/export/xls.php +++ b/libraries/export/xls.php @@ -20,9 +20,11 @@ if (isset($plugin_list)) { 'mime_type' => 'application/vnd.ms-excel', 'force_file' => true, 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')), array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')), array('type' => 'hidden', 'name' => 'structure_or_data'), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/export/xlsx.php b/libraries/export/xlsx.php index 833e7e09b..a5459579b 100644 --- a/libraries/export/xlsx.php +++ b/libraries/export/xlsx.php @@ -20,9 +20,11 @@ if (isset($plugin_list)) { 'mime_type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'force_file' => true, 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'text', 'name' => 'null', 'text' => __('Replace NULL with:')), array('type' => 'bool', 'name' => 'columns', 'text' => __('Put columns names in the first row')), array('type' => 'hidden', 'name' => 'structure_or_data'), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/export/xml.php b/libraries/export/xml.php index b6da9c4d8..4f6f97813 100644 --- a/libraries/export/xml.php +++ b/libraries/export/xml.php @@ -19,14 +19,18 @@ if (isset($plugin_list)) { 'extension' => 'xml', 'mime_type' => 'text/xml', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'hidden', 'name' => 'structure_or_data'), + array('type' => 'end_group') ), 'options_text' => __('Options') ); /* Export structure */ $plugin_list['xml']['options'][] = - array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'name' => 'export_struc', 'text' => __('Structure schemas to export (all are recommended):'))); + array('type' => 'begin_group', 'name' => 'structure', 'text' => __('Object creation options')); + $plugin_list['xml']['options'][] = + array('type' => 'begin_subgroup', 'name' => 'export_struc', 'text' => __('Structure schemas to export (all are recommended):')); $plugin_list['xml']['options'][] = array('type' => 'bool', 'name' => 'export_functions', 'text' => __('Functions')); $plugin_list['xml']['options'][] = @@ -37,12 +41,15 @@ if (isset($plugin_list)) { array('type' => 'bool', 'name' => 'export_triggers', 'text' => __('Triggers')); $plugin_list['xml']['options'][] = array('type' => 'bool', 'name' => 'export_views', 'text' => __('Views')); - $plugin_list['xml']['options'][] = - array('type' => 'end_subgroup'); + $plugin_list['xml']['options'][] = array('type' => 'end_subgroup'); + $plugin_list['xml']['options'][] = array('type' => 'end_group'); /* Data */ + $plugin_list['xml']['options'][] = + array('type' => 'begin_group', 'name' => 'data', 'text' => __('Data dump options')); $plugin_list['xml']['options'][] = array('type' => 'bool', 'name' => 'export_contents', 'text' => __('Export contents')); + $plugin_list['xml']['options'][] = array('type' => 'end_group'); } else { /** diff --git a/libraries/export/yaml.php b/libraries/export/yaml.php index 29055f331..9fce67f83 100644 --- a/libraries/export/yaml.php +++ b/libraries/export/yaml.php @@ -20,10 +20,12 @@ if (isset($plugin_list)) { 'mime_type' => 'text/yaml', 'force_file' => true, 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array( 'type' => 'hidden', 'name' => 'structure_or_data', ), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); From 71ee3e6421432742c9a134e7d7fd61bcfea66393 Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 18 Jun 2010 16:12:41 -0400 Subject: [PATCH 079/206] Fixed XHTML syntax problems --- libraries/import/csv.php | 2 ++ libraries/import/docsql.php | 2 ++ libraries/import/ldi.php | 2 ++ libraries/import/ods.php | 2 ++ libraries/import/sql.php | 2 ++ libraries/import/xls.php | 2 ++ libraries/import/xlsx.php | 2 ++ 7 files changed, 14 insertions(+) diff --git a/libraries/import/csv.php b/libraries/import/csv.php index 80a3d79f0..a774371a8 100644 --- a/libraries/import/csv.php +++ b/libraries/import/csv.php @@ -22,6 +22,7 @@ if (isset($plugin_list)) { 'text' => __('CSV'), 'extension' => 'csv', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'bool', 'name' => 'replace', 'text' => __('Replace table data with file')), array('type' => 'bool', 'name' => 'ignore', 'text' => __('Ignore duplicate rows')), array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns terminated with:'), 'size' => 2, 'len' => 2), @@ -39,6 +40,7 @@ if (isset($plugin_list)) { $plugin_list['csv']['options'][] = array('type' => 'text', 'name' => 'columns', 'text' => __('Column names')); } + $plugin_list['csv']['options'][] = array('type' => 'end_group'); /* We do not define function when plugin is just queried for information above */ return; diff --git a/libraries/import/docsql.php b/libraries/import/docsql.php index fa458ac30..35119b457 100644 --- a/libraries/import/docsql.php +++ b/libraries/import/docsql.php @@ -29,7 +29,9 @@ if (isset($plugin_list)) { 'text' => __('DocSQL'), // text to be displayed as choice 'extension' => '', // extension this plugin can handle 'options' => array( // array of options for your plugin (optional) + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'text', 'name' => 'table', 'text' => __('Table name')), + array('type' => 'end_group') ), 'options_text' => __('Options'), // text to describe plugin options (must be set if options are used) ); diff --git a/libraries/import/ldi.php b/libraries/import/ldi.php index 2c8702af3..cf9502715 100644 --- a/libraries/import/ldi.php +++ b/libraries/import/ldi.php @@ -35,6 +35,7 @@ if (isset($plugin_list)) { 'text' => __('CSV using LOAD DATA'), 'extension' => 'ldi', // This is nonsense, however we want to default to our parser for csv 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'bool', 'name' => 'replace', 'text' => __('Replace table data with file')), array('type' => 'bool', 'name' => 'ignore', 'text' => __('Ignore duplicate rows')), array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns terminated by'), 'size' => 2, 'len' => 2), @@ -43,6 +44,7 @@ if (isset($plugin_list)) { array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated by'), 'size' => 2), array('type' => 'text', 'name' => 'columns', 'text' => __('Column names')), array('type' => 'bool', 'name' => 'local_option', 'text' => __('Use LOCAL keyword')), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/import/ods.php b/libraries/import/ods.php index 0a1393bb9..7df7edcbf 100644 --- a/libraries/import/ods.php +++ b/libraries/import/ods.php @@ -22,10 +22,12 @@ if (isset($plugin_list)) { 'text' => __('Open Document Spreadsheet'), 'extension' => 'ods', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names (if this is unchecked, the first line will become part of the data)')), array('type' => 'bool', 'name' => 'empty_rows', 'text' => __('Do not import empty rows')), array('type' => 'bool', 'name' => 'recognize_percentages', 'text' => __('Import percentages as proper decimals (ex. 12.00% to .12)')), array('type' => 'bool', 'name' => 'recognize_currency', 'text' => __('Import currencies (ex. $5.00 to 5.00)')), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/import/sql.php b/libraries/import/sql.php index eafe2c0c6..a73d8be20 100644 --- a/libraries/import/sql.php +++ b/libraries/import/sql.php @@ -26,6 +26,7 @@ if (isset($plugin_list)) { $values[$val] = $val; } $plugin_list['sql']['options'] = array( + array('type' => 'begin_group', 'name' => 'general_opts'), array( 'type' => 'select', 'name' => 'compatibility', @@ -47,6 +48,7 @@ if (isset($plugin_list)) { ), ), + array('type' => 'end_group'), ); } diff --git a/libraries/import/xls.php b/libraries/import/xls.php index 6b50cf7b0..503f7c900 100644 --- a/libraries/import/xls.php +++ b/libraries/import/xls.php @@ -21,7 +21,9 @@ if (isset($plugin_list)) { 'text' => __('Excel 97-2003 XLS Workbook'), 'extension' => 'xls', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names (if this is unchecked, the first line will become part of the data)')), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); diff --git a/libraries/import/xlsx.php b/libraries/import/xlsx.php index 309f8f9ad..82cd0917a 100644 --- a/libraries/import/xlsx.php +++ b/libraries/import/xlsx.php @@ -21,7 +21,9 @@ if (isset($plugin_list)) { 'text' => __('Excel 2007 XLSX Workbook'), 'extension' => 'xlsx', 'options' => array( + array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names (if this is unchecked, the first line will become part of the data)')), + array('type' => 'end_group') ), 'options_text' => __('Options'), ); From 92779ae9c0b73f82788f97a135fda069c80b2d5e Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 18 Jun 2010 16:14:09 -0400 Subject: [PATCH 080/206] Fixed XHTML syntax problemsloris-computer:/Library/WebServer/Documents/gsoc Lori$ git commit libraries/common.lib.php Fixed XHTML syntax problems --- libraries/common.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 0f1dc34a5..cb7e1afbf 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2865,7 +2865,7 @@ function PMA_browseUploadFile($max_upload_size) { echo ''; echo ''; echo ''; - echo ''; + echo ''; echo PMA_displayMaximumUploadSize($max_upload_size) . "\n"; // some browsers should respect this :) echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n"; From b967bd91690a5742368cc70e4a5fab6f164b08b5 Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 18 Jun 2010 16:14:48 -0400 Subject: [PATCH 081/206] Fixed XHTML syntax problems --- libraries/display_export.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index 28481efb5..b0fcf9dfd 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -81,7 +81,7 @@ if (! empty($sql_query)) {
    -
  • '; } } elseif ($opt['type'] == 'hidden') { - $ret .= ''; + $ret .= '
  • '; } elseif ($opt['type'] == 'begin_group') { - $ret .= '

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

      '; + $ret .= '
      '; + if (isset($opt['text'])) { + $ret .= '

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

      '; + } + $ret .= '
        '; } 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']) . '
        '; + $ret .= PMA_pluginGetOneOption($section, $plugin_name, $id, $opt['subgroup_header']) . '
      • '; + } else { + $ret .= '>'; + } } elseif ($opt['type'] == 'end_subgroup') { - $ret .= '
      '; + $ret .= '
    '; } else { /* This should be seen only by plugin writers, so I do not thing this * needs translation. */ @@ -280,6 +288,10 @@ function PMA_pluginGetOneOption($section, $plugin_name, $id, &$opt) } } + // Close the list element after $opt['doc'] link is displayed + if($opt['type'] == 'bool' || $opt['type'] == 'text' || $opt['type'] == 'message_only' || $opt['type'] == 'select') { + $ret .= ''; + } $ret .= "\n"; return $ret; } @@ -308,18 +320,19 @@ function PMA_pluginGetOptions($section, &$list) } else { $ret .= ' style="display: none;">'; } - $ret .= '
      '; $count = 0; if (isset($val['options']) && count($val['options']) > 0) { foreach ($val['options'] as $id => $opt) { - if ($opt['type'] != 'hidden') $count++; + if ($opt['type'] != 'hidden' && $opt['type'] != 'begin_group' && $opt['type'] != 'end_group' && $opt['type'] != 'begin_subgroup' && $opt['type'] != 'end_subgroup') { + $count++; + } $ret .= PMA_pluginGetOneOption($section, $plugin_name, $id, $opt); } } if ($count == 0) { $ret .= __('This format has no options'); } - $ret .= '
    '; + $ret .= ''; } return $ret; } From 9fd0613a515da64178cc05ebc98b2b747de6d7e3 Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 18 Jun 2010 16:23:33 -0400 Subject: [PATCH 084/206] Revert "Fixed XHTML syntax problemsloris-computer:/Library/WebServer/Documents/gsoc Lori$ git commit libraries/common.lib.php" This reverts commit 92779ae9c0b73f82788f97a135fda069c80b2d5e. --- libraries/common.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index cb7e1afbf..0f1dc34a5 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2865,7 +2865,7 @@ function PMA_browseUploadFile($max_upload_size) { echo ''; echo ''; echo ''; - echo ''; + echo ''; echo PMA_displayMaximumUploadSize($max_upload_size) . "\n"; // some browsers should respect this :) echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n"; From b1a6150a0096e6120629651ec67d031a21dee5d8 Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 18 Jun 2010 16:25:16 -0400 Subject: [PATCH 085/206] Revert "Fixed XHTML syntax problemsloris-computer:/Library/WebServer/Documents/gsoc Lori$ git commit libraries/common.lib.php" This reverts commit 92779ae9c0b73f82788f97a135fda069c80b2d5e. --- themes/original/css/theme_right.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index ddaf51385..d82f61282 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -1276,7 +1276,7 @@ select#db_select, select#table_select { } .export_sub_options { - margin: 30px 0px 0px 0px; + margin: 30px 0px 0px 30px; } .export_sub_options h4 { From 5d751f1fe28583a95c63589020ca712c385bdc04 Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 18 Jun 2010 16:34:10 -0400 Subject: [PATCH 086/206] Fixed XHTML syntax problems --- libraries/common.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 0f1dc34a5..cb7e1afbf 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2865,7 +2865,7 @@ function PMA_browseUploadFile($max_upload_size) { echo ''; echo ''; echo ''; - echo ''; + echo ''; echo PMA_displayMaximumUploadSize($max_upload_size) . "\n"; // some browsers should respect this :) echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n"; From 9e60f9f7ec2d6dc9ab0296e06d3d001440ea80f3 Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 18 Jun 2010 16:40:04 -0400 Subject: [PATCH 087/206] Revert "Revert "Fixed XHTML syntax problemsloris-computer:/Library/WebServer/Documents/gsoc Lori$ git commit libraries/common.lib.php"" This reverts commit b1a6150a0096e6120629651ec67d031a21dee5d8. --- themes/original/css/theme_right.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index d82f61282..ddaf51385 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -1276,7 +1276,7 @@ select#db_select, select#table_select { } .export_sub_options { - margin: 30px 0px 0px 30px; + margin: 30px 0px 0px 0px; } .export_sub_options h4 { From 7363cd380afc8ce49b63743ada752c52fafcbc97 Mon Sep 17 00:00:00 2001 From: lorilee Date: Fri, 18 Jun 2010 16:41:24 -0400 Subject: [PATCH 088/206] Adds a left indent to export/import options --- themes/original/css/theme_right.css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index ddaf51385..d82f61282 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -1276,7 +1276,7 @@ select#db_select, select#table_select { } .export_sub_options { - margin: 30px 0px 0px 0px; + margin: 30px 0px 0px 30px; } .export_sub_options h4 { From 991d461e06df89d48a2dcbdb6ec6dd48cc5c215b Mon Sep 17 00:00:00 2001 From: lorilee Date: Sat, 19 Jun 2010 11:38:28 -0400 Subject: [PATCH 089/206] Fixed code indentation, added back Kanji encoding feature that I accidentally removed, modified the formatting to match the rest of the export form --- libraries/display_export.lib.php | 46 +++++++++++++++++--------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index b0fcf9dfd..99a59734e 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -68,8 +68,8 @@ if (! empty($sql_query)) { ?>
    -

    -
      +

      +
      • '; echo ''; ?> @@ -119,25 +119,25 @@ if (! empty($sql_query)) { -
        -

        -
          -
        • - /> - -
        • -
        • - /> - -
        • -
        -
        +
        +

        +
          +
        • + /> + +
        • +
        • + /> + +
        • +
        +
      • ' . "\n" . '
      ' ; } // end of the 'PMA_set_enc_form' function From 6913ce2a42ed063d7db9c42233da893da0aabf1e Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 22 Jun 2010 20:38:52 -0400 Subject: [PATCH 092/206] Removed inline CSS --- libraries/common.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index cb7e1afbf..835215cba 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2865,7 +2865,7 @@ function PMA_browseUploadFile($max_upload_size) { echo ''; echo ''; echo ''; - echo ''; + echo ''; echo PMA_displayMaximumUploadSize($max_upload_size) . "\n"; // some browsers should respect this :) echo PMA_generateHiddenMaxFileSize($max_upload_size) . "\n"; From c9fa5b476ea31a30399170533d7567c0fb4e4ee2 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 22 Jun 2010 20:40:11 -0400 Subject: [PATCH 093/206]
    • tags only shown when there is content in between them --- libraries/display_export.lib.php | 84 ++++++++++++++++---------------- 1 file changed, 41 insertions(+), 43 deletions(-) diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index 99a59734e..d15449f74 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -219,49 +219,47 @@ if (! empty($sql_query)) {
    • -
    • - ' - . __('Character set of the file:') . '' . "\n"; - reset($cfg['AvailableCharsets']); - echo ''; - } // end if - ?> -
    • -
    • - - - - - - -
    • -
    + ' . "\n"; + reset($cfg['AvailableCharsets']); + echo ''; + } // end if + ?> + +
  • + + +
  • + + + +
  • From ee19189db1b581f1e4c5ca6d30f13e5c0d54d62f Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 22 Jun 2010 20:41:34 -0400 Subject: [PATCH 094/206] Added new import/export styles for this theme --- .../darkblue_orange/css/theme_right.css.php | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/themes/darkblue_orange/css/theme_right.css.php b/themes/darkblue_orange/css/theme_right.css.php index c4b8cda00..879577474 100644 --- a/themes/darkblue_orange/css/theme_right.css.php +++ b/themes/darkblue_orange/css/theme_right.css.php @@ -1296,3 +1296,81 @@ table#serverconnection_trg_local { */ .invalid_value {background:#F00;} + +/** + * Export and Import styles + */ +.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, .exportoptions p, .importoptions p { + margin: 5px; + float: none; +} + +#csv_options label.desc, #ldi_options label.desc, #latex_options label.desc, #output label.desc{ + float: left; + width: 15em; +} + +.exportoptions, .importoptions { + margin: 30px 30px 30px 10px +} + +.exportoptions #buttonGo, .importoptions #buttonGo { + padding: 5px 30px; + -moz-border-radius: 11px; + -webkit-border-radius: 11px; + border-radius: 11px; + 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; + cursor: pointer; +} + +p.desc { + margin: 5px; +} + +/** + * Export styles only + */ +select#db_select, select#table_select { + width: 400px; +} + +.export_sub_options { + margin: 30px 0px 0px 30px; +} + +.export_sub_options h4 { + border-bottom: 1px #999999 solid; +} + +/** + * Import styles only + */ + +.importoptions #import_notification { + margin: 10px 0px; + font-style: italic; +} + +input#input_import_file { + margin: 5px; +} + +.formelementrow { + margin: 5px 0px 5px 0px; +} From c8898f764ca66c4357c8fd26912f0c5e733e3300 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 22 Jun 2010 20:43:10 -0400 Subject: [PATCH 095/206] Organized the code and added comments; Updated styles for the submit button --- themes/original/css/theme_right.css.php | 30 ++++++++++++++++--------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index d82f61282..e9259d3b1 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -1230,12 +1230,8 @@ table#serverconnection_trg_local { {background:#F00;} /** - * Export styles + * Export and Import styles */ -select#db_select, select#table_select { - width: 400px; -} - .exportoptions h3, .importoptions h3 { border-bottom: 1px #999999 solid; } @@ -1248,13 +1244,12 @@ select#db_select, select#table_select { .exportoptions li, .importoptions li { margin: 7px; } - .exportoptions label, .importoptions label, .exportoptions p, .importoptions p { margin: 5px; float: none; } -#csv_options .desc, #ldi_options .desc, #latex_options .desc, #output .desc{ +#csv_options label.desc, #ldi_options label.desc, #latex_options label.desc, #output label.desc{ float: left; width: 15em; } @@ -1266,15 +1261,26 @@ select#db_select, select#table_select { .exportoptions #buttonGo, .importoptions #buttonGo { padding: 5px 30px; -moz-border-radius: 11px; - -webkit-border-radius: + -webkit-border-radius: 11px; + border-radius: 11px; 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; } +p.desc { + margin: 5px; +} + +/** + * Export styles only + */ +select#db_select, select#table_select { + width: 400px; +} + .export_sub_options { margin: 30px 0px 0px 30px; } @@ -1283,12 +1289,16 @@ select#db_select, select#table_select { border-bottom: 1px #999999 solid; } +/** + * Import styles only + */ + .importoptions #import_notification { margin: 10px 0px; font-style: italic; } -p.desc { +input#input_import_file { margin: 5px; } From 0a456e86819ab7b7a63416335bf7457c50f85739 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 22 Jun 2010 21:07:43 -0400 Subject: [PATCH 096/206] Updated file selection form --- libraries/display_import.lib.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/libraries/display_import.lib.php b/libraries/display_import.lib.php index adfc29d64..2606c39d8 100644 --- a/libraries/display_import.lib.php +++ b/libraries/display_import.lib.php @@ -138,10 +138,11 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") { } // We don't have show anything about compression, when no supported if ($compressions != array()) { - printf(__('

    File may be compressed (%s) or uncompressed.

    A compressed file\'s name must end in .[format].[compression]. Example: .sql.zip

    '), implode(", ", $compressions)); - } + printf(__('
    File may be compressed (%s) or uncompressed.
    A compressed file\'s name must end in .[format].[compression]. Example: .sql.zip
    '), implode(", ", $compressions)); + }?> - if($GLOBALS['is_upload'] && !empty($cfg['UploadDir'])) { ?> +
    +
    • @@ -154,20 +155,17 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
    -
    - -
    -
    - display(); } else if (!empty($cfg['UploadDir'])) { PMA_selectUploadFile($import_list, $cfg['UploadDir']); } // end if (web-server upload directory) + ?> +
    -// charset of file - echo '
    ' . "\n"; +
    + ' . __('Character set of the file:') . ''; reset($cfg['AvailableCharsets']); @@ -185,8 +183,8 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") { echo '' . "\n"; echo PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_CHARSET, 'charset_of_file', 'charset_of_file', 'utf8', FALSE); } // end if (recoding) - echo '
    ' . "\n"; ?> +

    From 40b9e360adfd56719cfaec4080b499b998e2ef77 Mon Sep 17 00:00:00 2001 From: lorilee Date: Tue, 22 Jun 2010 21:08:01 -0400 Subject: [PATCH 097/206] Fixed the tag in the "File name template" label so it doesn't push the next row to the right --- themes/darkblue_orange/css/theme_right.css.php | 6 +++++- themes/original/css/theme_right.css.php | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/themes/darkblue_orange/css/theme_right.css.php b/themes/darkblue_orange/css/theme_right.css.php index 879577474..74060db20 100644 --- a/themes/darkblue_orange/css/theme_right.css.php +++ b/themes/darkblue_orange/css/theme_right.css.php @@ -1202,6 +1202,10 @@ label.desc { float: ; } +label.desc sup { + position: absolute; +} + code.sql { display: block; padding: 0.3em; @@ -1373,4 +1377,4 @@ input#input_import_file { .formelementrow { margin: 5px 0px 5px 0px; -} +} \ No newline at end of file diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index e9259d3b1..462fec425 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -1153,6 +1153,10 @@ label.desc { float: ; } +label.desc sup { + position: absolute; +} + code.sql { display: block; padding: 0.3em; From 66c6a301859d1ad47478a19a1e92a106fca057c8 Mon Sep 17 00:00:00 2001 From: lorilee Date: Thu, 24 Jun 2010 16:55:55 -0400 Subject: [PATCH 098/206] Changed input element ID names to make more sense --- libraries/common.lib.php | 4 ++-- libraries/display_import.lib.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index 835215cba..8992d70e9 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2862,7 +2862,7 @@ function PMA_js($code, $print=true) */ function PMA_browseUploadFile($max_upload_size) { $uid = uniqid(""); - echo ''; + echo ''; echo ''; echo ''; echo ''; @@ -2875,7 +2875,7 @@ function PMA_browseUploadFile($max_upload_size) { * Display the form used to select a file to import from the server upload directory */ function PMA_selectUploadFile($import_list, $uploaddir) { - echo ''; + echo ''; $extensions = ''; foreach ($import_list as $key => $val) { if (!empty($extensions)) { diff --git a/libraries/display_import.lib.php b/libraries/display_import.lib.php index 2606c39d8..da219222a 100644 --- a/libraries/display_import.lib.php +++ b/libraries/display_import.lib.php @@ -145,11 +145,11 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
    • - +
    • - +
    From 0ede5e680b415580904b42634364855b54a18949 Mon Sep 17 00:00:00 2001 From: lorilee Date: Thu, 24 Jun 2010 16:56:52 -0400 Subject: [PATCH 099/206] Changed label name, added a hint for the "column names" field --- libraries/import/csv.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/import/csv.php b/libraries/import/csv.php index a774371a8..09e600446 100644 --- a/libraries/import/csv.php +++ b/libraries/import/csv.php @@ -25,7 +25,7 @@ if (isset($plugin_list)) { array('type' => 'begin_group', 'name' => 'general_opts'), array('type' => 'bool', 'name' => 'replace', 'text' => __('Replace table data with file')), array('type' => 'bool', 'name' => 'ignore', 'text' => __('Ignore duplicate rows')), - array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns terminated with:'), 'size' => 2, 'len' => 2), + array('type' => 'text', 'name' => 'terminated', 'text' => __('Columns separated with:'), 'size' => 2, 'len' => 2), array('type' => 'text', 'name' => 'enclosed', 'text' => __('Columns enclosed with:'), 'size' => 2, 'len' => 2), array('type' => 'text', 'name' => 'escaped', 'text' => __('Columns escaped with:'), 'size' => 2, 'len' => 2), array('type' => 'text', 'name' => 'new_line', 'text' => __('Lines terminated with:'), 'size' => 2), @@ -37,8 +37,9 @@ if (isset($plugin_list)) { $plugin_list['csv']['options'][] = array('type' => 'bool', 'name' => 'col_names', 'text' => __('The first line of the file contains the table column names (if this is unchecked, the first line will become part of the data)')); } else { + $hint = new PMA_Message(__('If the data in each row of the file is not in the same order as in the database, list the corresponding column names here. Column names must be separated by commas and not enclosed in quotations.')); $plugin_list['csv']['options'][] = - array('type' => 'text', 'name' => 'columns', 'text' => __('Column names')); + array('type' => 'text', 'name' => 'columns', 'text' => __('Column names: ' . PMA_showHint($hint))); } $plugin_list['csv']['options'][] = array('type' => 'end_group'); @@ -118,7 +119,7 @@ if (!$analyze) { } } if (!$found) { - $message = PMA_Message::error(__('Invalid column (%s) specified!')); + $message = PMA_Message::error(__('Invalid column (%s) specified! Ensure that columns names are spelled correctly, separated by commas, and not enclosed in quotes.' )); $message->addParam($val); $error = TRUE; break; From e6932ed3982d3f7d524c7ca65a776a43b7a2d394 Mon Sep 17 00:00:00 2001 From: lorilee Date: Thu, 24 Jun 2010 16:57:28 -0400 Subject: [PATCH 100/206] Causes the correct radio button to be selected in the import file location form --- js/import.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/js/import.js b/js/import.js index 0e3af7ce6..b2c502989 100644 --- a/js/import.js +++ b/js/import.js @@ -61,5 +61,18 @@ $(document).ready(function() { $("#select_local_import_file").change(function() { matchFile($(this).attr("value")); - }) + }); + + /* + * When the "Browse the server" form is clicked or the "Select from the web server upload directory" + * form is clicked, the radio button beside it becomes selected and the other form becomes disabled. + */ + $("#input_import_file").focus(function() { + $("#radio_import_file").attr('checked', 'checked'); + $("#radio_local_import_file").removeAttr('checked'); + }); + $("#select_local_import_file").focus(function() { + $("#radio_local_import_file").attr('checked', 'checked'); + $("#radio_import_file").removeAttr('checked'); + }); }); \ No newline at end of file From 8984ffffbbd806594b485e5bbd36b990aff9fcec Mon Sep 17 00:00:00 2001 From: lorilee Date: Thu, 24 Jun 2010 17:14:20 -0400 Subject: [PATCH 101/206] Modified label text, added "doc" links --- libraries/export/sql.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/export/sql.php b/libraries/export/sql.php index aee3313d9..6251b5576 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -38,20 +38,20 @@ if (isset($plugin_list)) { array('type' => 'bool', 'name' => 'dates', 'text' => __('Include a timestamp of when databases were created, last updated, and last checked')); if (!empty($GLOBALS['cfgRelation']['relation'])) { $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'relation', 'text' => __('Foreign key relationships')); + array('type' => 'bool', 'name' => 'relation', 'text' => __('Display foreign key relationships')); } if (!empty($GLOBALS['cfgRelation']['mimework'])) { $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'mime', 'text' => __('MIME types')); + array('type' => 'bool', 'name' => 'mime', 'text' => __('Display MIME types')); } $plugin_list['sql']['options'][] = array('type' => 'end_subgroup'); /* end comments */ /* enclose in a transaction */ - $plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'use_transaction', 'text' => __('Enclose export in a transaction')); + $plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'use_transaction', 'text' => __('Enclose export in a transaction'), 'doc' => array('programs', 'mysqldump', 'option_mysqldump_single-transaction')); /* disable foreign key checks */ - $plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'disable_fk', 'text' => __('Disable foreign key checks')); + $plugin_list['sql']['options'][] = array('type' => 'bool', 'name' => 'disable_fk', 'text' => __('Disable foreign key checks'), 'doc' => array('manual_MySQL_Database_Administration', 'server-system-variables', 'sysvar_foreign_key_checks')); $plugin_list['sql']['options_text'] = __('Options'); @@ -134,11 +134,11 @@ if (isset($plugin_list)) { /* begin SQL statements */ $plugin_list['sql']['options'][] = - array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Add statements:'))); + array('type' => 'begin_subgroup', 'subgroup_header' => array('type' => 'message_only', 'text' => __('Instead of INSERT statements, use:'))); $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'delayed', 'text' => __('INSERT DELAYED')); + array('type' => 'bool', 'name' => 'delayed', 'text' => __('INSERT DELAYED statements'), 'doc' => array('manual_MySQL_Database_Administration', 'insert_delayed')); $plugin_list['sql']['options'][] = - array('type' => 'bool', 'name' => 'ignore', 'text' => __('INSERT IGNORE')); + array('type' => 'bool', 'name' => 'ignore', 'text' => __('INSERT IGNORE statements'), 'doc' => array('manual_MySQL_Database_Administration', 'insert')); $plugin_list['sql']['options'][] = array('type' => 'end_subgroup'); /* end SQL statements */ From 5c7ee416b39c1bc11ceef8bb42bc19cddac663a5 Mon Sep 17 00:00:00 2001 From: lorilee Date: Mon, 28 Jun 2010 19:14:21 -0400 Subject: [PATCH 102/206] ENUM/SET editor styles --- .../darkblue_orange/css/theme_right.css.php | 50 +++++++++++++++++ themes/original/css/theme_right.css.php | 54 ++++++++++++++++++- 2 files changed, 102 insertions(+), 2 deletions(-) diff --git a/themes/darkblue_orange/css/theme_right.css.php b/themes/darkblue_orange/css/theme_right.css.php index 74060db20..5b1fea4a7 100644 --- a/themes/darkblue_orange/css/theme_right.css.php +++ b/themes/darkblue_orange/css/theme_right.css.php @@ -1377,4 +1377,54 @@ input#input_import_file { .formelementrow { margin: 5px 0px 5px 0px; +} + +/** + * ENUM/SET editor styles + */ +p.enum_notice { + margin: 5px 2px; + font-size: 80%; +} + +#enum_editor { + display: none; + position: fixed; + _position: absolute; /* hack for IE */ + width: 50%; + height: 80%; + background: #D0DCE0; + z-index: 101; + padding: 15px; + overflow: auto; +} + +#popup_background { + display: none; + position: fixed; + _position: absolute; /* hack for IE */ + width: 100%; + height: 100%; + top: 0; + left: 0; + background: #000; + z-index: 100; +} + +a.close_enum_editor { + float: right; +} + +#enum_editor #values { + margin: 15px 0px; +} + +#enum_editor #values input { + margin: 5px 0px; + float: top; + width: 100%; +} + +#enum_editor input { + float: bottom; } \ No newline at end of file diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index 462fec425..3eb8d96d1 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -53,7 +53,7 @@ h3 { font-weight: bold; } -a:link, +a, a:link, a:visited, a:active { text-decoration: none; @@ -1248,7 +1248,7 @@ table#serverconnection_trg_local { .exportoptions li, .importoptions li { margin: 7px; } -.exportoptions label, .importoptions label, .exportoptions p, .importoptions p { +.exportoptions label, .importoptions label, .exportoptions p, .importoptions p { margin: 5px; float: none; } @@ -1309,3 +1309,53 @@ input#input_import_file { .formelementrow { margin: 5px 0px 5px 0px; } + +/** + * ENUM/SET editor styles + */ +p.enum_notice { + margin: 5px 2px; + font-size: 80%; +} + +#enum_editor { + display: none; + position: fixed; + _position: absolute; /* hack for IE */ + width: 50%; + height: 80%; + background: #D0DCE0; + z-index: 101; + padding: 15px; + overflow: auto; +} + +#popup_background { + display: none; + position: fixed; + _position: absolute; /* hack for IE */ + width: 100%; + height: 100%; + top: 0; + left: 0; + background: #000; + z-index: 100; +} + +a.close_enum_editor { + float: right; +} + +#enum_editor #values { + margin: 15px 0px; +} + +#enum_editor #values input { + margin: 5px 0px; + float: top; + width: 100%; +} + +#enum_editor input { + float: bottom; +} \ No newline at end of file From 8b2aa5282a28e073f167068405b43f056b8e795e Mon Sep 17 00:00:00 2001 From: lorilee Date: Mon, 28 Jun 2010 20:48:24 -0400 Subject: [PATCH 103/206] ENUM/SET editor --- js/functions.js | 78 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/js/functions.js b/js/functions.js index a3080180b..1ede62b93 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1727,3 +1727,81 @@ $(document).ready(function(){ }); }); +/** + * Hides/shows the "Open in ENUM/SET editor" message, depending on the data type of the column currently selected + */ +function toggle_enum_notice(dropdown_id) { + // Find the selected value in the drop down list before this + $selected_value = $("select[id='" + dropdown_id + "'] option:selected").attr("value"); + var enum_notice_id = dropdown_id.split("_")[1]; + enum_notice_id += "_" + (parseInt(dropdown_id.split("_")[2]) + 1); + if($selected_value == "ENUM" || $selected_value == "SET") { + $("p[id='enum_notice_" + enum_notice_id + "']").show(); + } else { + $("p[id='enum_notice_" + enum_notice_id + "']").hide(); + } +} + +/** + * Closes the ENUM/SET editor and removes the data in it + */ +function disable_popup() { + $("#popup_background").fadeOut("fast"); + $("#enum_editor").fadeOut("fast"); + // clear the data from the text boxes + $("#enum_editor #values input").remove(); +} + +/** + * Opens the ENUM/SET editor and controls its functions + */ +$(document).ready(function() { + $("a[class='open_enum_editor']").click(function() { + // Center the popup + var windowWidth = document.documentElement.clientWidth; + var windowHeight = document.documentElement.clientHeight; + var popupWidth = $("#enum_editor").width();g + var popupHeight = $("#enum_editor").height(); + var top = windowHeight/2 - popupHeight/2; + var left = windowWidth/2 - popupWidth/2; + $("#enum_editor").css({"position":"absolute", "top": top, "left": left}); + // Make it appear + $("#popup_background").css({"opacity":"0.7"}); + $("#popup_background").fadeIn("fast"); + $("#enum_editor").fadeIn("fast"); + // Get the values + var values = $("p[class='enum_notice']").prev("input").attr("value").split(","); + $.each(values, function(index, val) { + $("#enum_editor #values").append(""); + }); + }); + + // If the "close" link is clicked, close the enum editor + $("a[class='close_enum_editor']").click(function() { + disable_popup(); + }); + + // If the "cancel" link is clicked, close the enum editor + $("a[class='cancel_enum_editor']").click(function() { + disable_popup(); + }); + + // If the "add value" link is clicked, insert another text box + $("a[class='add_value']").click(function() { + $("#enum_editor #values").append(""); + }); + + // When the submit button is clicked, put the data back into the original form + $("#enum_editor input[type='submit']").click(function() { + var value_array = new Array(); + $.each($("#enum_editor #values input"), function(index, input_element) { + val = jQuery.trim(input_element.value); + if(val != "") { + value_array.push("'" + val + "'"); + } + }); + + $("p[class='enum_notice']").prev("input").attr("value", value_array.join(",")); + disable_popup(); + }); +}); From cd7b5448f9cd3219980d285347ba7e125f85fb7a Mon Sep 17 00:00:00 2001 From: lorilee Date: Mon, 28 Jun 2010 20:48:41 -0400 Subject: [PATCH 104/206] ENUM/SET editor --- libraries/tbl_properties.inc.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/libraries/tbl_properties.inc.php b/libraries/tbl_properties.inc.php index 0d00d17ec..a878a7649 100644 --- a/libraries/tbl_properties.inc.php +++ b/libraries/tbl_properties.inc.php @@ -279,8 +279,9 @@ for ($i = 0; $i < $num_fields; $i++) { $ci++; // column type + $select_id = 'field_' . $i . '_' . ($ci - $ci_offset); $content_cells[$i][$ci] = ''; + . ' class="textfield" />' + . '

    + +
    +Close +

    Enter each value in a separate field.

    +
    +

    + Add value

    + Cancel +
    + + \ No newline at end of file From 083f81b59dba42a4ae05ce582b43e60eed6b9e10 Mon Sep 17 00:00:00 2001 From: lorilee Date: Mon, 28 Jun 2010 20:52:56 -0400 Subject: [PATCH 105/206] Corrected a tiny typo which ruined everything --- js/functions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/functions.js b/js/functions.js index 1ede62b93..2f06935ea 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1760,7 +1760,7 @@ $(document).ready(function() { // Center the popup var windowWidth = document.documentElement.clientWidth; var windowHeight = document.documentElement.clientHeight; - var popupWidth = $("#enum_editor").width();g + var popupWidth = $("#enum_editor").width(); var popupHeight = $("#enum_editor").height(); var top = windowHeight/2 - popupHeight/2; var left = windowWidth/2 - popupWidth/2; From 5a67c754d23fbffd688613911439bb1e784e2964 Mon Sep 17 00:00:00 2001 From: lorilee Date: Mon, 28 Jun 2010 22:26:21 -0400 Subject: [PATCH 106/206] Removed inline Javascript, added support for editing multiple columns at once --- js/functions.js | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/js/functions.js b/js/functions.js index 2f06935ea..8b308faa1 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1730,18 +1730,30 @@ $(document).ready(function(){ /** * Hides/shows the "Open in ENUM/SET editor" message, depending on the data type of the column currently selected */ -function toggle_enum_notice(dropdown_id) { - // Find the selected value in the drop down list before this - $selected_value = $("select[id='" + dropdown_id + "'] option:selected").attr("value"); - var enum_notice_id = dropdown_id.split("_")[1]; - enum_notice_id += "_" + (parseInt(dropdown_id.split("_")[2]) + 1); - if($selected_value == "ENUM" || $selected_value == "SET") { +function toggle_enum_notice(selectElement) { + var enum_notice_id = selectElement.attr("id").split("_")[1]; + enum_notice_id += "_" + (parseInt(selectElement.attr("id").split("_")[2]) + 1); + var selectedType = selectElement.attr("value"); + if(selectedType == "ENUM" || selectedType == "SET") { $("p[id='enum_notice_" + enum_notice_id + "']").show(); } else { - $("p[id='enum_notice_" + enum_notice_id + "']").hide(); + $("p[id='enum_notice_" + enum_notice_id + "']").hide(); } } +/** + * Toggle the hiding/showing of the "Open in ENUM/SET editor" message when + * the page loads and when the selected data type changes + */ +$(document).ready(function() { + $.each($("select[class='column_type']"), function() { + toggle_enum_notice($(this)); + }); + $("select[class='column_type']").change(function() { + toggle_enum_notice($(this)); + }); +}); + /** * Closes the ENUM/SET editor and removes the data in it */ @@ -1750,6 +1762,7 @@ function disable_popup() { $("#enum_editor").fadeOut("fast"); // clear the data from the text boxes $("#enum_editor #values input").remove(); + $("#enum_editor input[type='hidden']").remove(); } /** @@ -1770,10 +1783,13 @@ $(document).ready(function() { $("#popup_background").fadeIn("fast"); $("#enum_editor").fadeIn("fast"); // Get the values - var values = $("p[class='enum_notice']").prev("input").attr("value").split(","); + var values = $(this).parent().prev("input").attr("value").split(","); $.each(values, function(index, val) { $("#enum_editor #values").append(""); }); + // So we know which column's data is being edited + $("#enum_editor").append(""); + return false; }); // If the "close" link is clicked, close the enum editor @@ -1800,8 +1816,8 @@ $(document).ready(function() { value_array.push("'" + val + "'"); } }); - - $("p[class='enum_notice']").prev("input").attr("value", value_array.join(",")); + var values_id = $("#enum_editor input[type='hidden']").attr("value"); + $("input[id='" + values_id + "']").attr("value", value_array.join(",")); disable_popup(); }); }); From 9bd658ae0337f4fe90e5ad4e23018ccdb72d7d5e Mon Sep 17 00:00:00 2001 From: lorilee Date: Mon, 28 Jun 2010 22:28:25 -0400 Subject: [PATCH 107/206] Removed inline Javascript, ENUM/SET editor message remains visible when Javascript is disabled --- libraries/tbl_properties.inc.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libraries/tbl_properties.inc.php b/libraries/tbl_properties.inc.php index a878a7649..937528a04 100644 --- a/libraries/tbl_properties.inc.php +++ b/libraries/tbl_properties.inc.php @@ -280,8 +280,8 @@ for ($i = 0; $i < $num_fields; $i++) { // column type $select_id = 'field_' . $i . '_' . ($ci - $ci_offset); - $content_cells[$i][$ci] = ''; if (empty($row['Type'])) { // creating a column @@ -369,13 +369,8 @@ for ($i = 0; $i < $num_fields; $i++) { . ' type="text" name="field_length[' . $i . ']" size="' . $length_values_input_size . '"' . ' value="' . htmlspecialchars($length_to_display) . '"' . ' class="textfield" />' - . '

    '; + $content_cells[$i][$ci] .= 'ENUM or SET data too long? Get more editing space

    '; $ci++; // column default From cd7bf9744de6fec1f2d327bf092fc79eb6213e05 Mon Sep 17 00:00:00 2001 From: lorilee Date: Mon, 5 Jul 2010 16:14:06 -0700 Subject: [PATCH 108/206] Support for no javascript --- js/export.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/js/export.js b/js/export.js index 0257f34bf..f34536a2c 100644 --- a/js/export.js +++ b/js/export.js @@ -172,3 +172,19 @@ $(document).ready(function() { } }); }); + +/** + * Sets up the interface for Javascript-enabled browsers since the default is for + * Javascript-disabled browsers + */ + $(document).ready(function() { + $("#quick_or_custom").show(); + $("#databases_and_tables").hide(); + $("#output_quick_export").show(); + $("#output").hide(); + $("#format_specific_opts").hide(); + $("#scroll_to_options_msg").hide(); + $(".format_specific_options").hide(); + $(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0}); + $(".format_specific_options h3").remove(); +}); \ No newline at end of file From 1b300eed99a965f920ccb6176a605e91ae2a0505 Mon Sep 17 00:00:00 2001 From: lorilee Date: Mon, 5 Jul 2010 16:14:41 -0700 Subject: [PATCH 109/206] Support for no javascript --- js/import.js | 111 ++++++++++++++++++++++++++++----------------------- 1 file changed, 61 insertions(+), 50 deletions(-) diff --git a/js/import.js b/js/import.js index b2c502989..f1ef6ebcb 100644 --- a/js/import.js +++ b/js/import.js @@ -5,53 +5,56 @@ * @version $Id$ */ + +/** + * Toggles the hiding and showing of each plugin's options + * according to the currently selected plugin from the dropdown list + */ +function changePluginOpts() { + $(".format_specific_options").each(function() { + $(this).hide(); + }); + var selected_plugin_name = $("#plugins option:selected").attr("value"); + $("#" + selected_plugin_name + "_options").fadeIn('slow'); + if(selected_plugin_name == "csv") { + $("#import_notification").text("Note: If the file contains multiple tables, they will be combined into one"); + } else { + $("#import_notification").text(""); + } +} + +/** + * Toggles the hiding and showing of each plugin's options and sets the selected value + * in the plugin dropdown list according to the format of the selected file + */ +function matchFile(fname) { + fname_array = fname.toLowerCase().split("."); + len = fname_array.length; + if(len != 0) { + extension = fname_array[len - 1]; + if (extension == "gz" || extension == "bz2" || extension == "zip") { + len--; + } + $("#plugins option:selected").removeAttr("selected"); + switch (fname_array[len - 1]) { + case "csv" : $("select[name='format'] option[value='csv']").attr('selected', 'selected'); break; + case "docsql" : $("select[name='format'] option[value='docsql']").attr('selected', 'selected'); break; + case "ldi" : $("select[name='format'] option[value='ldi']").attr('selected', 'selected'); break; + case "ods" : $("select[name='format'] option[value='ods']").attr('selected', 'selected'); break; + case "sql" : $("select[name='format'] option[value='sql']").attr('selected', 'selected'); break; + case "xls" : $("select[name='format'] option[value='xls']").attr('selected', 'selected'); break; + case "xlsx" : $("select[name='format'] option[value='xlsx']").attr('selected', 'selected'); break; + case "xml" : $("select[name='format'] option[value='xml']").attr('selected', 'selected'); break; + } + changePluginOpts(); + } +} $(document).ready(function() { + // Initially display the options for the selected plugin + changePluginOpts(); - /** - * Toggles the hiding and showing of each plugin's options - * according to the currently selected plugin from the dropdown list - */ - function changePluginOpts() { - $(".format_specific_options").each(function() { - $(this).hide(); - }); - var selected_plugin_name = $("#plugins option:selected").attr("value"); - $("#" + selected_plugin_name + "_options").fadeIn('slow'); - if(selected_plugin_name == "csv") { - $("#import_notification").text("Note: If the file contains multiple tables, they will be combined into one"); - } else { - $("#import_notification").text(""); - } - } - - /** - * Toggles the hiding and showing of each plugin's options and sets the selected value - * in the plugin dropdown list according to the format of the selected file - */ - function matchFile(fname) { - fname_array = fname.toLowerCase().split("."); - len = fname_array.length; - if(len != 0) { - extension = fname_array[len - 1]; - if (extension == "gz" || extension == "bz2" || extension == "zip") { - len--; - } - $("#plugins option:selected").removeAttr("selected"); - switch (fname_array[len - 1]) { - case "csv" : $("select[name='format'] option[value='csv']").attr('selected', 'selected'); break; - case "docsql" : $("select[name='format'] option[value='docsql']").attr('selected', 'selected'); break; - case "ldi" : $("select[name='format'] option[value='ldi']").attr('selected', 'selected'); break; - case "ods" : $("select[name='format'] option[value='ods']").attr('selected', 'selected'); break; - case "sql" : $("select[name='format'] option[value='sql']").attr('selected', 'selected'); break; - case "xls" : $("select[name='format'] option[value='xls']").attr('selected', 'selected'); break; - case "xlsx" : $("select[name='format'] option[value='xlsx']").attr('selected', 'selected'); break; - case "xml" : $("select[name='format'] option[value='xml']").attr('selected', 'selected'); break; - } - changePluginOpts(); - } - } - - $("#plugins").change(function() { + // Whenever the selected plugin changes, change the options displayed + $("#plugins").change(function() { changePluginOpts(); }); @@ -67,12 +70,20 @@ $(document).ready(function() { * When the "Browse the server" form is clicked or the "Select from the web server upload directory" * form is clicked, the radio button beside it becomes selected and the other form becomes disabled. */ - $("#input_import_file").focus(function() { + $("#input_import_file").focus(function() { $("#radio_import_file").attr('checked', 'checked'); $("#radio_local_import_file").removeAttr('checked'); - }); - $("#select_local_import_file").focus(function() { + }); + $("#select_local_import_file").focus(function() { $("#radio_local_import_file").attr('checked', 'checked'); $("#radio_import_file").removeAttr('checked'); - }); - }); \ No newline at end of file + }); + + /** + * Set up the interface for Javascript-enabled browsers since the default is for + * Javascript-disabled browsers + */ + $("#scroll_to_options_msg").hide(); + $(".format_specific_options").css({ "border": 0, "margin": 0, "padding": 0 }); + $(".format_specific_options h3").remove(); +}); \ No newline at end of file From 2e3fad745677eae062739bad3e7bac515f008fee Mon Sep 17 00:00:00 2001 From: lorilee Date: Mon, 5 Jul 2010 16:19:03 -0700 Subject: [PATCH 110/206] Support for no javascript --- libraries/display_export.lib.php | 13 +++++++------ libraries/display_import.lib.php | 1 + libraries/plugin_interface.lib.php | 10 +++------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/libraries/display_export.lib.php b/libraries/display_export.lib.php index d15449f74..375ce3298 100644 --- a/libraries/display_export.lib.php +++ b/libraries/display_export.lib.php @@ -67,7 +67,7 @@ if (! empty($sql_query)) { } ?> -
    + -