Git
Threads by month
- ----- 2026 -----
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- 9 participants
- 39111 discussions
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-8289-g9ca378d
by Rouslan Placella 14 Jul '11
by Rouslan Placella 14 Jul '11
14 Jul '11
The branch, master has been updated
via 9ca378d79454c5a021bfdd9f231c399cfe8355fc (commit)
via 0e622faed642b3814ec140b287ad5ad7ad1655c7 (commit)
via d3fa11c19b27d3c7debfb70edbe1bc046a8e37bb (commit)
from ad87dcf884efa277fc9ed546e1986e511ae7928a (commit)
- Log -----------------------------------------------------------------
commit 9ca378d79454c5a021bfdd9f231c399cfe8355fc
Merge: ad87dcf884efa277fc9ed546e1986e511ae7928a 0e622faed642b3814ec140b287ad5ad7ad1655c7
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Thu Jul 14 12:57:31 2011 +0100
Merge branch 'rte'
commit 0e622faed642b3814ec140b287ad5ad7ad1655c7
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Thu Jul 14 12:46:23 2011 +0100
Removed redundant code from rte_routines.lib.php
commit d3fa11c19b27d3c7debfb70edbe1bc046a8e37bb
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Wed Jul 13 18:42:10 2011 +0100
Move declarations of globals into functions, so that unit tests are possible
-----------------------------------------------------------------------
Summary of changes:
libraries/rte/rte_events.lib.php | 35 ++++++++++++++++++++++++++++
libraries/rte/rte_main.inc.php | 45 ------------------------------------
libraries/rte/rte_routines.lib.php | 37 ++++++++++++++++------------
libraries/rte/rte_triggers.lib.php | 16 ++++++++++++
4 files changed, 72 insertions(+), 61 deletions(-)
diff --git a/libraries/rte/rte_events.lib.php b/libraries/rte/rte_events.lib.php
index 070dc20..d7ffbc5 100644
--- a/libraries/rte/rte_events.lib.php
+++ b/libraries/rte/rte_events.lib.php
@@ -10,6 +10,40 @@ if (! defined('PHPMYADMIN')) {
}
/**
+ * Sets required globals
+ */
+function PMA_EVN_setGlobals()
+{
+ global $event_status, $event_type, $event_interval;
+
+ $event_status = array(
+ 'query' => array('ENABLE',
+ 'DISABLE',
+ 'DISABLE ON SLAVE'),
+ 'display' => array('ENABLED',
+ 'DISABLED',
+ 'SLAVESIDE_DISABLED')
+ );
+ $event_type = array('RECURRING',
+ 'ONE TIME');
+ $event_interval = array('YEAR',
+ 'QUARTER',
+ 'MONTH',
+ 'DAY',
+ 'HOUR',
+ 'MINUTE',
+ 'WEEK',
+ 'SECOND',
+ 'YEAR_MONTH',
+ 'DAY_HOUR',
+ 'DAY_MINUTE',
+ 'DAY_SECOND',
+ 'HOUR_MINUTE',
+ 'HOUR_SECOND',
+ 'MINUTE_SECOND');
+}
+
+/**
* This function is defined in: rte_routines.lib.php, rte_triggers.lib.php and
* rte_events.lib.php. It is used to retreive some language strings that are
* used in functionalities that are common to routines, triggers and events.
@@ -40,6 +74,7 @@ function PMA_RTE_main()
{
global $db;
+ PMA_EVN_setGlobals();
/**
* Process all requests
*/
diff --git a/libraries/rte/rte_main.inc.php b/libraries/rte/rte_main.inc.php
index deae1d2..dd3e4c0 100644
--- a/libraries/rte/rte_main.inc.php
+++ b/libraries/rte/rte_main.inc.php
@@ -71,51 +71,6 @@ $titles = PMA_buildActionTitles();
*/
$errors = array();
-// Some definitions for triggers
-$action_timings = array('BEFORE',
- 'AFTER');
-$event_manipulations = array('INSERT',
- 'UPDATE',
- 'DELETE');
-
-// Some definitions for routines
-$param_directions = array('IN',
- 'OUT',
- 'INOUT');
-$param_opts_num = array('UNSIGNED',
- 'ZEROFILL',
- 'UNSIGNED ZEROFILL');
-$param_sqldataaccess = array('NO SQL',
- 'CONTAINS SQL',
- 'READS SQL DATA',
- 'MODIFIES SQL DATA');
-
-// Some definitions for events
-$event_status = array(
- 'query' => array('ENABLE',
- 'DISABLE',
- 'DISABLE ON SLAVE'),
- 'display' => array('ENABLED',
- 'DISABLED',
- 'SLAVESIDE_DISABLED')
- );
-$event_type = array('RECURRING',
- 'ONE TIME');
-$event_interval = array('YEAR',
- 'QUARTER',
- 'MONTH',
- 'DAY',
- 'HOUR',
- 'MINUTE',
- 'WEEK',
- 'SECOND',
- 'YEAR_MONTH',
- 'DAY_HOUR',
- 'DAY_MINUTE',
- 'DAY_SECOND',
- 'HOUR_MINUTE',
- 'HOUR_SECOND',
- 'MINUTE_SECOND');
/**
* The below function is defined in rte_routines.lib.php,
* rte_triggers.lib.php and rte_events.lib.php
diff --git a/libraries/rte/rte_routines.lib.php b/libraries/rte/rte_routines.lib.php
index a5a136f..4172208 100644
--- a/libraries/rte/rte_routines.lib.php
+++ b/libraries/rte/rte_routines.lib.php
@@ -10,6 +10,25 @@ if (! defined('PHPMYADMIN')) {
}
/**
+ * Sets required globals
+ */
+function PMA_RTN_setGlobals()
+{
+ global $param_directions, $param_opts_num, $param_sqldataaccess;
+
+ $param_directions = array('IN',
+ 'OUT',
+ 'INOUT');
+ $param_opts_num = array('UNSIGNED',
+ 'ZEROFILL',
+ 'UNSIGNED ZEROFILL');
+ $param_sqldataaccess = array('NO SQL',
+ 'CONTAINS SQL',
+ 'READS SQL DATA',
+ 'MODIFIES SQL DATA');
+}
+
+/**
* This function is defined in: rte_routines.lib.php, rte_triggers.lib.php and
* rte_events.lib.php. It is used to retreive some language strings that are
* used in functionalities that are common to routines, triggers and events.
@@ -40,6 +59,7 @@ function PMA_RTE_main()
{
global $db;
+ PMA_RTN_setGlobals();
/**
* Process all requests
*/
@@ -1100,22 +1120,7 @@ function PMA_RTN_getQueryFromRequest()
}
$query .= " (" . $params . ") ";
if ($_REQUEST['item_type'] == 'FUNCTION') {
- // Make a flat array with column types
- $columnTypes = array();
- foreach ($cfg['ColumnTypes'] as $key => $value) {
- if (is_array($value)) {
- $columnTypes = array_merge($value, $columnTypes);
- } else {
- $columnTypes[] = $value;
- }
- }
- foreach ($columnTypes as $key => $type) {
- if ($type == '-') {
- unset($columnTypes[$key]);
- }
- }
- // Search the flat array for the supplied return type
- if (! empty($_REQUEST['item_returntype']) && in_array($_REQUEST['item_returntype'], $columnTypes)) {
+ if (! empty($_REQUEST['item_returntype']) && in_array($_REQUEST['item_returntype'], PMA_getSupportedDatatypes())) {
$query .= "RETURNS {$_REQUEST['item_returntype']}";
} else {
$errors[] = __('You must provide a valid return type for the routine.');
diff --git a/libraries/rte/rte_triggers.lib.php b/libraries/rte/rte_triggers.lib.php
index a80fca0..61b9943 100644
--- a/libraries/rte/rte_triggers.lib.php
+++ b/libraries/rte/rte_triggers.lib.php
@@ -10,6 +10,21 @@ if (! defined('PHPMYADMIN')) {
}
/**
+ * Sets required globals
+ */
+function PMA_TRI_setGlobals()
+{
+ global $action_timings, $event_manipulations;
+
+ // Some definitions for triggers
+ $action_timings = array('BEFORE',
+ 'AFTER');
+ $event_manipulations = array('INSERT',
+ 'UPDATE',
+ 'DELETE');
+}
+
+/**
* This function is defined in: rte_routines.lib.php, rte_triggers.lib.php and
* rte_events.lib.php. It is used to retreive some language strings that are
* used in functionalities that are common to routines, triggers and events.
@@ -40,6 +55,7 @@ function PMA_RTE_main()
{
global $db, $table;
+ PMA_TRI_setGlobals();
/**
* Process all requests
*/
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-8286-gad87dcf
by Piotr Przybylski 13 Jul '11
by Piotr Przybylski 13 Jul '11
13 Jul '11
The branch, master has been updated
via ad87dcf884efa277fc9ed546e1986e511ae7928a (commit)
from bce8eaf40a42b4982f4125e23f4ab988ed8e113b (commit)
- Log -----------------------------------------------------------------
commit ad87dcf884efa277fc9ed546e1986e511ae7928a
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Thu Jul 14 01:48:13 2011 +0200
Removed useless code
-----------------------------------------------------------------------
Summary of changes:
libraries/export/htmlword.php | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/libraries/export/htmlword.php b/libraries/export/htmlword.php
index a97aab2..e662cfb 100644
--- a/libraries/export/htmlword.php
+++ b/libraries/export/htmlword.php
@@ -313,8 +313,6 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
if ($row['Null'] != 'NO') {
$row['Default'] = 'NULL';
}
- } else {
- $row['Default'] = $row['Default'];
}
$fmt_pre = '';
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-8285-gbce8eaf
by Piotr Przybylski 13 Jul '11
by Piotr Przybylski 13 Jul '11
13 Jul '11
The branch, master has been updated
via bce8eaf40a42b4982f4125e23f4ab988ed8e113b (commit)
via 059ddeb79788a969c94c7817f0ccab4686511a73 (commit)
via 590059cc30038d60e9c5ad11b2cb369c9ebc14fc (commit)
from 151799f17f63f1329b381f61f0bf0e238565842b (commit)
- Log -----------------------------------------------------------------
commit bce8eaf40a42b4982f4125e23f4ab988ed8e113b
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Thu Jul 14 01:44:41 2011 +0200
JSON export plugin: fix syntax for empty table, better data escaping
commit 059ddeb79788a969c94c7817f0ccab4686511a73
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Thu Jul 14 01:43:30 2011 +0200
Better db and table name escaping in codegen and htmlword export plugins
commit 590059cc30038d60e9c5ad11b2cb369c9ebc14fc
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Thu Jul 14 01:30:25 2011 +0200
Fix db/table name escaping in UI preferences
-----------------------------------------------------------------------
Summary of changes:
libraries/Table.class.php | 9 +++++----
libraries/export/codegen.php | 4 ++--
libraries/export/htmlword.php | 6 +++---
libraries/export/json.php | 14 ++++++++------
4 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/libraries/Table.class.php b/libraries/Table.class.php
index 9a15c48..83e67fd 100644
--- a/libraries/Table.class.php
+++ b/libraries/Table.class.php
@@ -1240,8 +1240,8 @@ class PMA_Table
$sql_query =
" SELECT `prefs` FROM " . $pma_table .
" WHERE `username` = '" . $GLOBALS['cfg']['Server']['user'] . "'" .
- " AND `db_name` = '" . $this->db_name . "'" .
- " AND `table_name` = '" . $this->name . "'";
+ " AND `db_name` = '" . PMA_sqlAddSlashes($this->db_name) . "'" .
+ " AND `table_name` = '" . PMA_sqlAddSlashes($this->name) . "'";
$row = PMA_DBI_fetch_array(PMA_query_as_controluser($sql_query));
if (isset($row[0])) {
@@ -1264,8 +1264,9 @@ class PMA_Table
$username = $GLOBALS['cfg']['Server']['user'];
$sql_query =
" REPLACE INTO " . $pma_table .
- " VALUES ('" . $username . "', '" . $this->db_name . "', '" .
- $this->name . "', '" . PMA_sqlAddSlashes(json_encode($this->uiprefs)) . "')";
+ " VALUES ('" . $username . "', '" . PMA_sqlAddSlashes($this->db_name) . "', '" .
+ PMA_sqlAddSlashes($this->name) . "', '" .
+ PMA_sqlAddSlashes(json_encode($this->uiprefs)) . "')";
$success = PMA_DBI_try_query($sql_query, $GLOBALS['controllink']);
diff --git a/libraries/export/codegen.php b/libraries/export/codegen.php
index d60785c..fb81cf9 100644
--- a/libraries/export/codegen.php
+++ b/libraries/export/codegen.php
@@ -268,8 +268,8 @@ class TableProperty
{
$lines=array();
$lines[] = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>";
- $lines[] = "<hibernate-mapping xmlns=\"urn:nhibernate-mapping-2.2\" namespace=\"".ucfirst($db)."\" assembly=\"".ucfirst($db)."\">";
- $lines[] = " <class name=\"".ucfirst($table)."\" table=\"".$table."\">";
+ $lines[] = "<hibernate-mapping xmlns=\"urn:nhibernate-mapping-2.2\" namespace=\"".ucfirst(htmlspecialchars($db, ENT_COMPAT, 'UTF-8'))."\" assembly=\"".ucfirst(htmlspecialchars($db, ENT_COMPAT, 'UTF-8'))."\">";
+ $lines[] = " <class name=\"".ucfirst(htmlspecialchars($table, ENT_COMPAT, 'UTF-8'))."\" table=\"".htmlspecialchars($table, ENT_COMPAT, 'UTF-8')."\">";
$result = PMA_DBI_query(sprintf("DESC %s.%s", PMA_backquote($db), PMA_backquote($table)));
if ($result)
{
diff --git a/libraries/export/htmlword.php b/libraries/export/htmlword.php
index c840e93..a97aab2 100644
--- a/libraries/export/htmlword.php
+++ b/libraries/export/htmlword.php
@@ -75,7 +75,7 @@ xmlns="http://www.w3.org/TR/REC-html40">
* @access public
*/
function PMA_exportDBHeader($db) {
- return PMA_exportOutputHandler('<h1>' . __('Database') . ' ' . $db . '</h1>');
+ return PMA_exportOutputHandler('<h1>' . __('Database') . ' ' . htmlspecialchars($db) . '</h1>');
}
/**
@@ -118,7 +118,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
{
global $what;
- if (! PMA_exportOutputHandler('<h2>' . __('Dumping data for table') . ' ' . $table . '</h2>')) {
+ if (! PMA_exportOutputHandler('<h2>' . __('Dumping data for table') . ' ' . htmlspecialchars($table) . '</h2>')) {
return false;
}
if (! PMA_exportOutputHandler('<table class="width100" cellspacing="1">')) {
@@ -192,7 +192,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $do_relation = fals
{
global $cfgRelation;
- if (! PMA_exportOutputHandler('<h2>' . __('Table structure for table') . ' ' .$table . '</h2>')) {
+ if (! PMA_exportOutputHandler('<h2>' . __('Table structure for table') . ' ' . htmlspecialchars($table) . '</h2>')) {
return false;
}
diff --git a/libraries/export/json.php b/libraries/export/json.php
index 86e2e89..989ef88 100644
--- a/libraries/export/json.php
+++ b/libraries/export/json.php
@@ -74,7 +74,7 @@ function PMA_exportHeader()
*/
function PMA_exportDBHeader($db)
{
- PMA_exportOutputHandler('/* Database \'' . $db . '\' */ ' . $GLOBALS['crlf'] );
+ PMA_exportOutputHandler('// Database \'' . $db . '\'' . $GLOBALS['crlf'] );
return true;
}
@@ -134,7 +134,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
// Output table name as comment if this is the first record of the table
if ($record_cnt == 1) {
- $buffer .= '/* ' . $db . '.' . $table . ' */' . $crlf . $crlf;
+ $buffer .= '// ' . $db . '.' . $table . $crlf . $crlf;
$buffer .= '[{';
} else {
$buffer .= ', {';
@@ -147,18 +147,20 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query)
$column = $columns[$i];
if (is_null($record[$i])) {
- $buffer .= '"' . $column . '": null' . (! $isLastLine ? ',' : '');
+ $buffer .= '"' . addslashes($column) . '": null' . (! $isLastLine ? ',' : '');
} elseif (is_numeric($record[$i])) {
- $buffer .= '"' . $column . '": ' . $record[$i] . (! $isLastLine ? ',' : '');
+ $buffer .= '"' . addslashes($column) . '": ' . $record[$i] . (! $isLastLine ? ',' : '');
} else {
- $buffer .= '"' . $column . '": "' . addslashes($record[$i]) . '"' . (! $isLastLine ? ',' : '');
+ $buffer .= '"' . addslashes($column) . '": "' . addslashes($record[$i]) . '"' . (! $isLastLine ? ',' : '');
}
}
$buffer .= '}';
}
- $buffer .= ']';
+ if ($record_cnt) {
+ $buffer .= ']';
+ }
if (! PMA_exportOutputHandler($buffer)) {
return false;
}
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-8282-g151799f
by Piotr Przybylski 13 Jul '11
by Piotr Przybylski 13 Jul '11
13 Jul '11
The branch, master has been updated
via 151799f17f63f1329b381f61f0bf0e238565842b (commit)
from d84d51c77552bd166c03dcb6a1623f93952ad058 (commit)
- Log -----------------------------------------------------------------
commit 151799f17f63f1329b381f61f0bf0e238565842b
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Thu Jul 14 00:41:11 2011 +0200
Properly escape database name
-----------------------------------------------------------------------
Summary of changes:
libraries/export/xml.php | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libraries/export/xml.php b/libraries/export/xml.php
index 85bab5f..cfa07f5 100644
--- a/libraries/export/xml.php
+++ b/libraries/export/xml.php
@@ -105,7 +105,7 @@ function PMA_exportHeader() {
$head .= '<pma_xml_export version="1.0"' . (($export_struct) ? ' xmlns:pma="http://www.phpmyadmin.net/some_doc_url/"' : '') . '>' . $crlf;
if ($export_struct) {
- $result = PMA_DBI_fetch_result('SELECT `DEFAULT_CHARACTER_SET_NAME`, `DEFAULT_COLLATION_NAME` FROM `information_schema`.`SCHEMATA` WHERE `SCHEMA_NAME` = \''.$db.'\' LIMIT 1');
+ $result = PMA_DBI_fetch_result('SELECT `DEFAULT_CHARACTER_SET_NAME`, `DEFAULT_COLLATION_NAME` FROM `information_schema`.`SCHEMATA` WHERE `SCHEMA_NAME` = \''.PMA_sqlAddSlashes($db).'\' LIMIT 1');
$db_collation = $result[0]['DEFAULT_COLLATION_NAME'];
$db_charset = $result[0]['DEFAULT_CHARACTER_SET_NAME'];
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-8281-gd84d51c
by Piotr Przybylski 13 Jul '11
by Piotr Przybylski 13 Jul '11
13 Jul '11
The branch, master has been updated
via d84d51c77552bd166c03dcb6a1623f93952ad058 (commit)
via 667cf67954c44facf978660f5fa7b9ed5c2b1b89 (commit)
via 09e74a94150d84ba0014f7455446383311c6d190 (commit)
from f57faf6b58702ad09e6c333fd927778fb6af1e41 (commit)
- Log -----------------------------------------------------------------
commit d84d51c77552bd166c03dcb6a1623f93952ad058
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Thu Jul 14 00:05:58 2011 +0200
Fix XML export so it actually can export table structure
More escaping fixes
commit 667cf67954c44facf978660f5fa7b9ed5c2b1b89
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Wed Jul 13 23:42:29 2011 +0200
Better escaping in XML export
Note: it's still incorrect
commit 09e74a94150d84ba0014f7455446383311c6d190
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Wed Jul 13 23:40:58 2011 +0200
Improve readability of XML export code
-----------------------------------------------------------------------
Summary of changes:
libraries/export/xml.php | 42 ++++++++++++++++++++----------------------
1 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/libraries/export/xml.php b/libraries/export/xml.php
index 2665051..85bab5f 100644
--- a/libraries/export/xml.php
+++ b/libraries/export/xml.php
@@ -71,13 +71,14 @@ function PMA_exportFooter() {
function PMA_exportHeader() {
global $crlf;
global $cfg;
- global $what;
global $db;
global $table;
global $tables;
- $export_struct = isset($GLOBALS[$what . '_export_struc']) ? true : false;
- $export_data = isset($GLOBALS[$what . '_export_contents']) ? true : false;
+ $export_struct = isset($GLOBALS['xml_export_functions']) || isset($GLOBALS['xml_export_procedures'])
+ || isset($GLOBALS['xml_export_tables']) || isset($GLOBALS['xml_export_triggers'])
+ || isset($GLOBALS['xml_export_views']);
+ $export_data = isset($GLOBALS['xml_export_contents']) ? true : false;
if ($GLOBALS['output_charset_conversion']) {
$charset = $GLOBALS['charset_of_file'];
@@ -112,7 +113,7 @@ function PMA_exportHeader() {
$head .= ' - Structure schemas' . $crlf;
$head .= ' -->' . $crlf;
$head .= ' <pma:structure_schemas>' . $crlf;
- $head .= ' <pma:database name="' . $db . '" collation="' . $db_collation . '" charset="' . $db_charset . '">' . $crlf;
+ $head .= ' <pma:database name="' . htmlspecialchars($db) . '" collation="' . $db_collation . '" charset="' . $db_charset . '">' . $crlf;
if (count($tables) == 0) {
$tables[] = $table;
@@ -131,23 +132,23 @@ function PMA_exportHeader() {
$type = 'table';
}
- if ($is_view && ! isset($GLOBALS[$what . '_export_views'])) {
+ if ($is_view && ! isset($GLOBALS['xml_export_views'])) {
continue;
}
- if (! $is_view && ! isset($GLOBALS[$what . '_export_tables'])) {
+ if (! $is_view && ! isset($GLOBALS['xml_export_tables'])) {
continue;
}
$head .= ' <pma:' . $type . ' name="' . $table . '">' . $crlf;
- $tbl = " " . $tbl;
+ $tbl = " " . htmlspecialchars($tbl);
$tbl = str_replace("\n", "\n ", $tbl);
$head .= $tbl . ';' . $crlf;
$head .= ' </pma:' . $type . '>' . $crlf;
- if (isset($GLOBALS[$what . '_export_triggers']) && $GLOBALS[$what . '_export_triggers']) {
+ if (isset($GLOBALS['xml_export_triggers']) && $GLOBALS['xml_export_triggers']) {
// Export triggers
$triggers = PMA_DBI_get_triggers($db, $table);
if ($triggers) {
@@ -157,7 +158,7 @@ function PMA_exportHeader() {
// Do some formatting
$code = substr(rtrim($code), 0, -3);
- $code = " " . $code;
+ $code = " " . htmlspecialchars($code);
$code = str_replace("\n", "\n ", $code);
$head .= $code . $crlf;
@@ -170,7 +171,7 @@ function PMA_exportHeader() {
}
}
- if (isset($GLOBALS[$what . '_export_functions']) && $GLOBALS[$what . '_export_functions']) {
+ if (isset($GLOBALS['xml_export_functions']) && $GLOBALS['xml_export_functions']) {
// Export functions
$functions = PMA_DBI_get_procedures_or_functions($db, 'FUNCTION');
if ($functions) {
@@ -180,7 +181,7 @@ function PMA_exportHeader() {
// Do some formatting
$sql = PMA_DBI_get_definition($db, 'FUNCTION', $function);
$sql = rtrim($sql);
- $sql = " " . $sql;
+ $sql = " " . htmlspecialchars($sql);
$sql = str_replace("\n", "\n ", $sql);
$head .= $sql . $crlf;
@@ -193,7 +194,7 @@ function PMA_exportHeader() {
}
}
- if (isset($GLOBALS[$what . '_export_procedures']) && $GLOBALS[$what . '_export_procedures']) {
+ if (isset($GLOBALS['xml_export_procedures']) && $GLOBALS['xml_export_procedures']) {
// Export procedures
$procedures = PMA_DBI_get_procedures_or_functions($db, 'PROCEDURE');
if ($procedures) {
@@ -203,7 +204,7 @@ function PMA_exportHeader() {
// Do some formatting
$sql = PMA_DBI_get_definition($db, 'PROCEDURE', $procedure);
$sql = rtrim($sql);
- $sql = " " . $sql;
+ $sql = " " . htmlspecialchars($sql);
$sql = str_replace("\n", "\n ", $sql);
$head .= $sql . $crlf;
@@ -239,13 +240,12 @@ function PMA_exportHeader() {
*/
function PMA_exportDBHeader($db) {
global $crlf;
- global $what;
- if (isset($GLOBALS[$what . '_export_contents']) && $GLOBALS[$what . '_export_contents']) {
+ if (isset($GLOBALS['xml_export_contents']) && $GLOBALS['xml_export_contents']) {
$head = ' <!--' . $crlf
. ' - ' . __('Database') . ': ' . (isset($GLOBALS['use_backquotes']) ? PMA_backquote($db) : '\'' . $db . '\''). $crlf
. ' -->' . $crlf
- . ' <database name="' . $db . '">' . $crlf;
+ . ' <database name="' . htmlspecialchars($db) . '">' . $crlf;
return PMA_exportOutputHandler($head);
}
@@ -265,9 +265,8 @@ function PMA_exportDBHeader($db) {
*/
function PMA_exportDBFooter($db) {
global $crlf;
- global $what;
- if (isset($GLOBALS[$what . '_export_contents']) && $GLOBALS[$what . '_export_contents']) {
+ if (isset($GLOBALS['xml_export_contents']) && $GLOBALS['xml_export_contents']) {
return PMA_exportOutputHandler(' </database>' . $crlf);
}
else
@@ -301,12 +300,11 @@ function PMA_exportDBCreate($db) {
* @access public
*/
function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
- global $what;
-
- if (isset($GLOBALS[$what . '_export_contents']) && $GLOBALS[$what . '_export_contents']) {
+ if (isset($GLOBALS['xml_export_contents']) && $GLOBALS['xml_export_contents']) {
$result = PMA_DBI_query($sql_query, null, PMA_DBI_QUERY_UNBUFFERED);
$columns_cnt = PMA_DBI_num_fields($result);
+ $columns = array();
for ($i = 0; $i < $columns_cnt; $i++) {
$columns[$i] = stripslashes(str_replace(' ', '_', PMA_DBI_field_name($result, $i)));
}
@@ -324,7 +322,7 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) {
if (!isset($record[$i]) || is_null($record[$i])) {
$record[$i] = 'NULL';
}
- $buffer .= ' <column name="' . $columns[$i] . '">' . htmlspecialchars((string)$record[$i])
+ $buffer .= ' <column name="' . htmlspecialchars($columns[$i]) . '">' . htmlspecialchars((string)$record[$i])
. '</column>' . $crlf;
}
$buffer .= ' </table>' . $crlf;
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-8278-gf57faf6
by Piotr Przybylski 13 Jul '11
by Piotr Przybylski 13 Jul '11
13 Jul '11
The branch, master has been updated
via f57faf6b58702ad09e6c333fd927778fb6af1e41 (commit)
via df4c23f0c9fa5481558c890fed8ea9737dd74f1d (commit)
via b5d450ff3193258a95c4d1a6700edf74dd1a17dc (commit)
from ae780330e870052b1cd2ad84d0b7326074bef90a (commit)
- Log -----------------------------------------------------------------
commit f57faf6b58702ad09e6c333fd927778fb6af1e41
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Wed Jul 13 17:25:10 2011 +0200
Removed unused code
commit df4c23f0c9fa5481558c890fed8ea9737dd74f1d
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Wed Jul 13 17:22:07 2011 +0200
Comments and formatting in common.lib.php
commit b5d450ff3193258a95c4d1a6700edf74dd1a17dc
Author: Piotr Przybylski <piotrprz(a)gmail.com>
Date: Wed Jul 13 17:07:08 2011 +0200
PMA_MYSQL_INT_VERSION is at least 50015
-----------------------------------------------------------------------
Summary of changes:
libraries/common.lib.php | 100 ++++++++++++++++++++-----------------------
libraries/db_links.inc.php | 4 +-
libraries/tbl_links.inc.php | 2 +-
3 files changed, 49 insertions(+), 57 deletions(-)
diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 7d9564e..e64c751 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -140,10 +140,10 @@ function PMA_displayMaximumUploadSize($max_upload_size)
*
* @access public
*/
- function PMA_generateHiddenMaxFileSize($max_size)
- {
- return '<input type="hidden" name="MAX_FILE_SIZE" value="' .$max_size . '" />';
- }
+function PMA_generateHiddenMaxFileSize($max_size)
+{
+ return '<input type="hidden" name="MAX_FILE_SIZE" value="' .$max_size . '" />';
+}
/**
* Add slashes before "'" and "\" characters so a value containing them can
@@ -377,7 +377,7 @@ function PMA_showMySQLDocu($chapter, $link, $big_icon = false, $anchor = '', $ju
$mysql = '5.1';
/* l10n: Language to use for MySQL 5.1 documentation, please use only languages which do exist in official documentation. */
$lang = _pgettext('MySQL 5.1 documentation language', 'en');
- } elseif (PMA_MYSQL_INT_VERSION >= 50000) {
+ } else {
$mysql = '5.0';
/* l10n: Language to use for MySQL 5.0 documentation, please use only languages which do exist in official documentation. */
$lang = _pgettext('MySQL 5.0 documentation language', 'en');
@@ -707,7 +707,7 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count =
$group_name_full = '';
$parts_cnt = count($parts) - 1;
while ($i < $parts_cnt
- && $i < $GLOBALS['cfg']['LeftFrameTableLevel']) {
+ && $i < $GLOBALS['cfg']['LeftFrameTableLevel']) {
$group_name = $parts[$i] . $sep;
$group_name_full .= $group_name;
@@ -739,7 +739,7 @@ function PMA_getTableList($db, $tables = null, $limit_offset = 0, $limit_count =
if ($GLOBALS['cfg']['ShowTooltipAliasTB']
- && $GLOBALS['cfg']['ShowTooltipAliasTB'] !== 'nested') {
+ && $GLOBALS['cfg']['ShowTooltipAliasTB'] !== 'nested') {
// switch tooltip and name
$table['Comment'] = $table['Name'];
$table['disp_name'] = $table['Comment'];
@@ -807,8 +807,6 @@ function PMA_backquote($a_name, $do_it = true)
*/
function PMA_whichCrlf()
{
- $the_crlf = "\n";
-
// The 'PMA_USR_OS' constant is defined in "./libraries/Config.class.php"
// Win case
if (PMA_USR_OS == 'Win') {
@@ -825,15 +823,12 @@ function PMA_whichCrlf()
/**
* Reloads navigation if needed.
*
- * @param $jsonly prints out pure JavaScript
- * @global array configuration
+ * @param bool $jsonly prints out pure JavaScript
*
* @access public
*/
function PMA_reloadNavigation($jsonly=false)
{
- global $cfg;
-
// Reloads the navigation frame via JavaScript if required
if (isset($GLOBALS['reload']) && $GLOBALS['reload']) {
// one of the reasons for a reload is when a table is dropped
@@ -869,7 +864,7 @@ if (!$jsonly)
* @param string $sql_query the query to display
* @param string $type the type (level) of the message
* @param boolean $is_view is this a message after a VIEW operation?
- * @global array the configuration array
+ * @return string
* @access public
*/
function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view = false)
@@ -1218,6 +1213,7 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
ob_end_clean();
return $buffer_contents;
}
+ return null;
} // end of the 'PMA_showMessage()' function
/**
@@ -1225,7 +1221,6 @@ function PMA_showMessage($message, $sql_query = null, $type = 'notice', $is_view
*
* @access public
* @return boolean whether profiling is supported
- *
*/
function PMA_profilingSupported()
{
@@ -1250,7 +1245,6 @@ function PMA_profilingSupported()
*
* @param string $sql_query
* @access public
- *
*/
function PMA_profilingCheckbox($sql_query)
{
@@ -1350,8 +1344,6 @@ function PMA_localizeNumber($value)
* @return string the formatted value and its unit
*
* @access public
- *
- * @version 1.1.0 - 2005-10-27
*/
function PMA_formatNumber($value, $digits_left = 3, $digits_right = 0, $only_down = false, $noTrailingZero = true)
{
@@ -1769,7 +1761,7 @@ function PMA_linkOrButton($url, $message, $tag_params = array(),
}
} // end if... else...
- return $ret;
+ return $ret;
} // end of the 'PMA_linkOrButton()' function
@@ -1843,7 +1835,6 @@ function PMA_flipstring($string, $Separator = "<br />\n")
return $format_string;
}
-
/**
* Function added to avoid path disclosures.
* Called by each script that needs parameters, it displays
@@ -1930,9 +1921,8 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force
$meta->orgname = $meta->name;
if (isset($GLOBALS['analyzed_sql'][0]['select_expr'])
- && is_array($GLOBALS['analyzed_sql'][0]['select_expr'])) {
- foreach ($GLOBALS['analyzed_sql'][0]['select_expr']
- as $select_expr) {
+ && is_array($GLOBALS['analyzed_sql'][0]['select_expr'])) {
+ foreach ($GLOBALS['analyzed_sql'][0]['select_expr'] as $select_expr) {
// need (string) === (string)
// '' !== 0 but '' == 0
if ((string) $select_expr['alias'] === (string) $meta->name) {
@@ -1980,18 +1970,18 @@ function PMA_getUniqueCondition($handle, $fields_cnt, $fields_meta, $row, $force
$condition .= '= ' . $row[$i] . ' AND';
} elseif (($meta->type == 'blob' || $meta->type == 'string')
// hexify only if this is a true not empty BLOB or a BINARY
- && stristr($field_flags, 'BINARY')
- && !empty($row[$i])) {
- // do not waste memory building a too big condition
- if (strlen($row[$i]) < 1000) {
- // use a CAST if possible, to avoid problems
- // if the field contains wildcard characters % or _
- $condition .= '= CAST(0x' . bin2hex($row[$i])
- . ' AS BINARY) AND';
- } else {
- // this blob won't be part of the final condition
- $condition = '';
- }
+ && stristr($field_flags, 'BINARY')
+ && !empty($row[$i])) {
+ // do not waste memory building a too big condition
+ if (strlen($row[$i]) < 1000) {
+ // use a CAST if possible, to avoid problems
+ // if the field contains wildcard characters % or _
+ $condition .= '= CAST(0x' . bin2hex($row[$i])
+ . ' AS BINARY) AND';
+ } else {
+ // this blob won't be part of the final condition
+ $condition = '';
+ }
} elseif ($meta->type == 'bit') {
$condition .= "= b'" . PMA_printable_bit_value($row[$i], $meta->length) . "' AND";
} else {
@@ -2167,12 +2157,12 @@ function PMA_pageselector($rows, $pageNow = 1, $nbTotalPage = 1,
* Generate navigation for a list
*
* @todo use $pos from $_url_params
- * @param integer number of elements in the list
- * @param integer current position in the list
- * @param array url parameters
- * @param string script name for form target
- * @param string target frame
- * @param integer maximum number of elements to display from the list
+ * @param int $count number of elements in the list
+ * @param int $pos current position in the list
+ * @param array $_url_params url parameters
+ * @param string $script script name for form target
+ * @param string $frame target frame
+ * @param int $max_count maximum number of elements to display from the list
*
* @access public
*/
@@ -2354,10 +2344,11 @@ function PMA_display_html_radio($html_field_name, $choices, $checked_choice = ''
* Generates and returns an HTML dropdown
*
* @param string $select_name
- * @param array $choices the choices values
- * @param string $active_choice the choice to select by default
- * @param string $id the id of the select element; can be different in case
- * the dropdown is present more than once on the page
+ * @param array $choices choices values
+ * @param string $active_choice the choice to select by default
+ * @param string $id id of the select element; can be different in case
+ * the dropdown is present more than once on the page
+ * @return string
* @todo support titles
*/
function PMA_generate_html_dropdown($select_name, $choices, $active_choice, $id)
@@ -2492,8 +2483,8 @@ function PMA_clearUserCache() {
/**
* Verifies if something is cached in the session
*
- * @param string $var
- * @param scalar $server
+ * @param string $var
+ * @param int|true $server
* @return boolean
*/
function PMA_cacheExists($var, $server = 0)
@@ -2507,8 +2498,8 @@ function PMA_cacheExists($var, $server = 0)
/**
* Gets cached information from the session
*
- * @param string $var
- * @param scalar $server
+ * @param string $var
+ * @param int|true $server
* @return mixed
*/
function PMA_cacheGet($var, $server = 0)
@@ -2526,9 +2517,9 @@ function PMA_cacheGet($var, $server = 0)
/**
* Caches information in the session
*
- * @param string $var
- * @param mixed $val
- * @param integer $server
+ * @param string $var
+ * @param mixed $val
+ * @param int|true $server
* @return mixed
*/
function PMA_cacheSet($var, $val = null, $server = 0)
@@ -2542,8 +2533,8 @@ function PMA_cacheSet($var, $val = null, $server = 0)
/**
* Removes cached information from the session
*
- * @param string $var
- * @param scalar $server
+ * @param string $var
+ * @param int|true $server
*/
function PMA_cacheUnset($var, $server = 0)
{
@@ -3130,6 +3121,7 @@ function PMA_getFunctionsForField($field, $insert_mode)
* string, db name where to also check for privileges
* @param mixed $tbl null, to only check global privileges
* string, db name where to also check for privileges
+ * @return bool
*/
function PMA_currentUserHasPrivilege($priv, $db = null, $tbl = null)
{
diff --git a/libraries/db_links.inc.php b/libraries/db_links.inc.php
index 87fb98c..604efde 100644
--- a/libraries/db_links.inc.php
+++ b/libraries/db_links.inc.php
@@ -121,7 +121,7 @@ if (! $db_is_information_schema) {
if ($is_superuser) {
$tabs[] =& $tab_privileges;
}
- if (PMA_MYSQL_INT_VERSION >= 50002 && ! PMA_DRIZZLE) {
+ if (!PMA_DRIZZLE) {
$tabs[] =& $tab_routines;
}
if (PMA_MYSQL_INT_VERSION >= 50106 && ! PMA_DRIZZLE) {
@@ -129,7 +129,7 @@ if (! $db_is_information_schema) {
$tabs[] =& $tab_events;
}
}
- if (PMA_MYSQL_INT_VERSION >= 50002 && ! PMA_DRIZZLE) {
+ if (!PMA_DRIZZLE) {
if (PMA_currentUserHasPrivilege('TRIGGER', $db)) {
$tabs[] =& $tab_triggers;
}
diff --git a/libraries/tbl_links.inc.php b/libraries/tbl_links.inc.php
index 5f24800..4008fba 100644
--- a/libraries/tbl_links.inc.php
+++ b/libraries/tbl_links.inc.php
@@ -97,7 +97,7 @@ if(PMA_Tracker::isActive()) {
$tabs['tracking']['text'] = __('Tracking');
$tabs['tracking']['link'] = 'tbl_tracking.php';
}
-if (! $db_is_information_schema && PMA_MYSQL_INT_VERSION >= 50002 && ! PMA_DRIZZLE) {
+if (!$db_is_information_schema && !PMA_DRIZZLE) {
if (PMA_currentUserHasPrivilege('TRIGGER', $db, $table)) {
$tabs['triggers']['link'] = 'tbl_triggers.php';
$tabs['triggers']['text'] = __('Triggers');
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-8275-gae78033
by Michal ÄŒihaÅ™ 13 Jul '11
by Michal ÄŒihaÅ™ 13 Jul '11
13 Jul '11
The branch, master has been updated
via ae780330e870052b1cd2ad84d0b7326074bef90a (commit)
from 8eaaa70f21f455b23c1e24acd5064a0c2a269940 (commit)
- Log -----------------------------------------------------------------
commit ae780330e870052b1cd2ad84d0b7326074bef90a
Author: Michal ÄŒihaÅ™ <mcihar(a)suse.cz>
Date: Wed Jul 13 17:05:13 2011 +0200
Add missing semicolon
-----------------------------------------------------------------------
Summary of changes:
libraries/export/sql.php | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libraries/export/sql.php b/libraries/export/sql.php
index 625e716..efda8d7 100644
--- a/libraries/export/sql.php
+++ b/libraries/export/sql.php
@@ -964,7 +964,7 @@ function PMA_exportStructure($db, $table, $crlf, $error_url, $relation = false,
switch($export_mode) {
case 'create_table':
- $dump .= PMA_exportComment(__('Table structure for table') . ' ' . $formatted_table_name)
+ $dump .= PMA_exportComment(__('Table structure for table') . ' ' . $formatted_table_name);
$dump .= PMA_exportComment();
$dump .= PMA_getTableDef($db, $table, $crlf, $error_url, $dates);
$dump .= PMA_getTableComments($db, $table, $crlf, $relation, $mime);
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-8274-g8eaaa70
by Rouslan Placella 13 Jul '11
by Rouslan Placella 13 Jul '11
13 Jul '11
The branch, master has been updated
via 8eaaa70f21f455b23c1e24acd5064a0c2a269940 (commit)
from b2d8e0b60ffdda22bbbc165674088094d26f31f1 (commit)
- Log -----------------------------------------------------------------
commit 8eaaa70f21f455b23c1e24acd5064a0c2a269940
Author: Rouslan Placella <rouslan(a)placella.com>
Date: Wed Jul 13 14:33:05 2011 +0100
Changelog entries for support for events and triggers
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a137c4a..0889f7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,8 @@ phpMyAdmin - ChangeLog
- bug #3354356 [interface] Timepicker does not work in AJAX dialogs
+ AJAX for table Structure Indexes Edit
+ AJAX for table Structure column Change
++ [interface] Improved support for events
++ [interface] Improved support for triggers
3.4.4.0 (not yet released)
- bug #3323060 [parser] SQL parser breaks AJAX requests if query has unclosed quotes
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-8273-gb2d8e0b
by Marc Delisle 13 Jul '11
by Marc Delisle 13 Jul '11
13 Jul '11
The branch, master has been updated
via b2d8e0b60ffdda22bbbc165674088094d26f31f1 (commit)
from 0131d16548e5bc32d7619d43c97272a5a2c1474f (commit)
- Log -----------------------------------------------------------------
commit b2d8e0b60ffdda22bbbc165674088094d26f31f1
Author: Marc Delisle <marc(a)infomarc.info>
Date: Wed Jul 13 09:19:38 2011 -0400
Clarify directive name: ShowDisplayDir -> ShowDisplayDirection
-----------------------------------------------------------------------
Summary of changes:
Documentation.html | 2 +-
libraries/config.default.php | 2 +-
libraries/config/messages.inc.php | 10 +++++-----
libraries/config/setup.forms.php | 2 +-
libraries/config/user_preferences.forms.php | 2 +-
libraries/display_tbl.lib.php | 2 +-
6 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/Documentation.html b/Documentation.html
index 0b3bd92..6a8d5dc 100644
--- a/Documentation.html
+++ b/Documentation.html
@@ -2143,7 +2143,7 @@ setfacl -d -m "g:www-data:rwx" tmp
identify what they mean.
</dd>
- <dt id="cfg_ShowDisplayDir">$cfg['ShowDisplayDir'] boolean</dt>
+ <dt id="cfg_ShowDisplayDirection">$cfg['ShowDisplayDirection'] boolean</dt>
<dd>
Defines whether or not type display direction option is shown
when browsing a table.
diff --git a/libraries/config.default.php b/libraries/config.default.php
index d54dc5a..5762531 100644
--- a/libraries/config.default.php
+++ b/libraries/config.default.php
@@ -2315,7 +2315,7 @@ $cfg['ShowPropertyComments']= true;
/**
* shows table display direction.
*/
-$cfg['ShowDisplayDir'] = false;
+$cfg['ShowDisplayDirection'] = false;
/**
* repeat header names every X cells? (0 = deactivate)
diff --git a/libraries/config/messages.inc.php b/libraries/config/messages.inc.php
index 0602cae..5d42f89 100644
--- a/libraries/config/messages.inc.php
+++ b/libraries/config/messages.inc.php
@@ -3,9 +3,9 @@
/**
* Messages for phpMyAdmin.
*
- * This file is here for easy transition to Gettext. You should not add any
- * new messages here, use instead gettext directly in your template/PHP
- * file.
+ * This file defines variables in a special format suited for the
+ * configuration subsystem, with $strConfig as a prefix, _desc or _name
+ * as a suffix, and the directive name in between.
*
* @package phpMyAdmin
*/
@@ -450,8 +450,8 @@ $strConfigShowAll_name = __('Allow to display all the rows');
$strConfigShowChgPassword_desc = __('Please note that enabling this has no effect with [kbd]config[/kbd] authentication mode because the password is hard coded in the configuration file; this does not limit the ability to execute the same command directly');
$strConfigShowChgPassword_name = __('Show password change form');
$strConfigShowCreateDb_name = __('Show create database form');
-$strConfigShowDisplayDir_desc = __('Defines whether or not type display direction option is shown when browsing a table');
-$strConfigShowDisplayDir_name = __('Show display direction');
+$strConfigShowDisplayDirection_desc = __('Defines whether or not type display direction option is shown when browsing a table');
+$strConfigShowDisplayDirection_name = __('Show display direction');
$strConfigShowFieldTypesInDataEditView_desc = __('Defines whether or not type fields should be initially displayed in edit/insert mode');
$strConfigShowFieldTypesInDataEditView_name = __('Show field types');
$strConfigShowFunctionFields_desc = __('Display the function fields in edit/insert mode');
diff --git a/libraries/config/setup.forms.php b/libraries/config/setup.forms.php
index e1865fa..5598b93 100644
--- a/libraries/config/setup.forms.php
+++ b/libraries/config/setup.forms.php
@@ -198,7 +198,7 @@ $forms['Main_frame']['Browse'] = array(
'Order',
'BrowsePointerEnable',
'BrowseMarkerEnable',
- 'ShowDisplayDir',
+ 'ShowDisplayDirection',
'RepeatCells',
'LimitChars',
'RowActionLinks',
diff --git a/libraries/config/user_preferences.forms.php b/libraries/config/user_preferences.forms.php
index f1363b4..8dc78fe 100644
--- a/libraries/config/user_preferences.forms.php
+++ b/libraries/config/user_preferences.forms.php
@@ -108,7 +108,7 @@ $forms['Main_frame']['Browse'] = array(
'DisplayBinaryAsHex',
'BrowsePointerEnable',
'BrowseMarkerEnable',
- 'ShowDisplayDir',
+ 'ShowDisplayDirection',
'RepeatCells',
'LimitChars',
'RowActionLinks',
diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php
index a120037..e231b84 100644
--- a/libraries/display_tbl.lib.php
+++ b/libraries/display_tbl.lib.php
@@ -438,7 +438,7 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, $id_for_di
<?php echo __('Number of rows') . ': ' . "\n"; ?>
<input type="text" name="session_max_rows" size="3" value="<?php echo (($_SESSION['tmp_user_values']['max_rows'] != 'all') ? $_SESSION['tmp_user_values']['max_rows'] : $GLOBALS['cfg']['MaxRows']); ?>" class="textfield" onfocus="this.select()" />
<?php
- if ($GLOBALS['cfg']['ShowDisplayDir']) {
+ if ($GLOBALS['cfg']['ShowDisplayDirection']) {
// Display mode (horizontal/vertical and repeat headers)
echo __('Mode') . ': ' . "\n";
$choices = array(
hooks/post-receive
--
phpMyAdmin
1
0
[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-8272-g0131d16
by Marc Delisle 13 Jul '11
by Marc Delisle 13 Jul '11
13 Jul '11
The branch, master has been updated
via 0131d16548e5bc32d7619d43c97272a5a2c1474f (commit)
via 010f19912460c8e3b925ff7b19f7e2f37361a339 (commit)
via 954d39b305e2b3e8082a2ff484b06a176052bf4f (commit)
via ecade8433a19f6600e7202494f7acc6584f913ce (commit)
via 991deb415ba369d87b2a816feb0180660329b332 (commit)
via 7c4e0114e9d88120b6446eef88b3b9ad2203622c (commit)
via 63c7cee5d96d8c25b2181192451790cc6f8103cd (commit)
via 9ec2daa4c61c701553dc49d2256730ce9f841e34 (commit)
via 705bdd73565d43ea40b7e9ed7259e867d7503b42 (commit)
via dbf06b6a1ba2ea901351718aad8c1f92de286daa (commit)
from d2d2c3c9959f865a6340474d3f9bdab03101f82c (commit)
- Log -----------------------------------------------------------------
commit 0131d16548e5bc32d7619d43c97272a5a2c1474f
Merge: d2d2c3c9959f865a6340474d3f9bdab03101f82c 010f19912460c8e3b925ff7b19f7e2f37361a339
Author: Marc Delisle <marc(a)infomarc.info>
Date: Wed Jul 13 09:04:51 2011 -0400
Merge commit '010f19912460c8e3b925ff7b19f7e2f37361a339'
commit 010f19912460c8e3b925ff7b19f7e2f37361a339
Author: Aris Feryanto <aris_feryanto(a)yahoo.com>
Date: Mon Jul 11 15:15:24 2011 +0800
Remove vertical support for inline edit
commit 954d39b305e2b3e8082a2ff484b06a176052bf4f
Merge: 991deb415ba369d87b2a816feb0180660329b332 ecade8433a19f6600e7202494f7acc6584f913ce
Author: Aris Feryanto <aris_feryanto(a)yahoo.com>
Date: Mon Jul 11 09:52:37 2011 +0800
Merge branch 'hidecol' into aris
commit ecade8433a19f6600e7202494f7acc6584f913ce
Author: Aris Feryanto <aris_feryanto(a)yahoo.com>
Date: Mon Jul 11 09:52:02 2011 +0800
Show/hide column: fix bug - use .text instead of .html to handle special column name
commit 991deb415ba369d87b2a816feb0180660329b332
Merge: 9ec2daa4c61c701553dc49d2256730ce9f841e34 7c4e0114e9d88120b6446eef88b3b9ad2203622c
Author: Aris Feryanto <aris_feryanto(a)yahoo.com>
Date: Sun Jul 10 10:06:33 2011 +0800
Fix merge conflict with bug fix for show/hide column feature
commit 7c4e0114e9d88120b6446eef88b3b9ad2203622c
Author: Aris Feryanto <aris_feryanto(a)yahoo.com>
Date: Sun Jul 10 10:04:06 2011 +0800
Show/hide column: fix bug - clickable area in column visibility checkbox list not span correctly if columns have short names
commit 63c7cee5d96d8c25b2181192451790cc6f8103cd
Merge: dbf06b6a1ba2ea901351718aad8c1f92de286daa c8ba421d379c15cd6bac620a77be50513e7da710
Author: Aris Feryanto <aris_feryanto(a)yahoo.com>
Date: Sun Jul 10 09:59:51 2011 +0800
Merge remote-tracking branch 'origin/master' into hidecol
commit 9ec2daa4c61c701553dc49d2256730ce9f841e34
Author: Aris Feryanto <aris_feryanto(a)yahoo.com>
Date: Fri Jul 8 15:41:09 2011 +0800
Remove vertical support for column resizing/reordering
commit 705bdd73565d43ea40b7e9ed7259e867d7503b42
Merge: c8ba421d379c15cd6bac620a77be50513e7da710 dbf06b6a1ba2ea901351718aad8c1f92de286daa
Author: Aris Feryanto <aris_feryanto(a)yahoo.com>
Date: Fri Jul 8 15:22:34 2011 +0800
Merge branch 'hidecol' into aris
commit dbf06b6a1ba2ea901351718aad8c1f92de286daa
Author: Aris Feryanto <aris_feryanto(a)yahoo.com>
Date: Fri Jul 8 15:22:27 2011 +0800
Show/hide column: fix bug - hint is still shown when we can't toggle column visibility (i.e., when there is only 1 column available)
-----------------------------------------------------------------------
Summary of changes:
js/functions.js | 2 +-
js/makegrid.js | 283 +++++++++++--------------------
js/sql.js | 249 ++++++----------------------
themes/original/css/theme_right.css.php | 16 +--
themes/original/img/col_pointer_ver.png | Bin 128 -> 0 bytes
themes/pmahomme/css/theme_right.css.php | 16 +--
themes/pmahomme/img/col_pointer_ver.png | Bin 138 -> 0 bytes
7 files changed, 154 insertions(+), 412 deletions(-)
delete mode 100644 themes/original/img/col_pointer_ver.png
delete mode 100644 themes/pmahomme/img/col_pointer_ver.png
diff --git a/js/functions.js b/js/functions.js
index 1b874ca..04fe9e3 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -2389,7 +2389,7 @@ $(function() {
* Get the row number from the classlist (for example, row_1)
*/
function PMA_getRowNumber(classlist) {
- return parseInt(classlist.split(/row_/)[1]);
+ return parseInt(classlist.split(/\s+row_/)[1]);
}
/**
diff --git a/js/makegrid.js b/js/makegrid.js
index 11bfa09..970ed59 100644
--- a/js/makegrid.js
+++ b/js/makegrid.js
@@ -6,7 +6,6 @@
minColWidth: 15,
// variables, assigned with default value, changed later
- alignment: 'horizontal', // 3 possibilities: vertical, horizontal, horizontalflipped
actionSpan: 5,
colOrder: new Array(), // array of column order
colVisib: new Array(), // array of column visibility
@@ -32,9 +31,7 @@
n: n,
obj: obj,
objLeft: $(obj).position().left,
- objWidth: this.alignment != 'vertical' ?
- $(this.t).find('th.draggable:visible:eq(' + n + ') span').outerWidth() :
- $(this.t).find('tr:first td:eq(' + n + ') span').outerWidth()
+ objWidth: $(this.t).find('th.draggable:visible:eq(' + n + ') span').outerWidth()
};
$('body').css('cursor', 'col-resize');
$('body').noSelect();
@@ -44,27 +41,15 @@
// prepare the cCpy and cPointer from the dragged column
$(this.cCpy).text($(obj).text());
var objPos = $(obj).position();
- if (this.alignment != 'vertical') {
- $(this.cCpy).css({
- top: objPos.top + 20,
- left: objPos.left,
- height: $(obj).height(),
- width: $(obj).width()
- });
- $(this.cPointer).css({
- top: objPos.top
- });
- } else { // vertical alignment
- $(this.cCpy).css({
- top: objPos.top,
- left: objPos.left + 30,
- height: $(obj).height(),
- width: $(obj).width()
- });
- $(this.cPointer).css({
- top: objPos.top
- });
- }
+ $(this.cCpy).css({
+ top: objPos.top + 20,
+ left: objPos.left,
+ height: $(obj).height(),
+ width: $(obj).width()
+ });
+ $(this.cPointer).css({
+ top: objPos.top
+ });
// get the column index, zero-based
var n = this.getHeaderIdx(obj);
@@ -90,17 +75,10 @@
$(this.colRsz.obj).css('left', this.colRsz.objLeft + dx + 'px');
} else if (this.colMov) {
// dragged column animation
- if (this.alignment != 'vertical') {
- var dx = e.pageX - this.colMov.x0;
- $(this.cCpy)
- .css('left', this.colMov.objLeft + dx)
- .show();
- } else { // vertical alignment
- var dy = e.pageY - this.colMov.y0;
- $(this.cCpy)
- .css('top', this.colMov.objTop + dy)
- .show();
- }
+ var dx = e.pageX - this.colMov.x0;
+ $(this.cCpy)
+ .css('left', this.colMov.objLeft + dx)
+ .show();
// pointer animation
var hoveredCol = this.getHoveredCol(e);
@@ -110,25 +88,14 @@
if (newn != this.colMov.n) {
// show the column pointer in the right place
var colPos = $(hoveredCol).position();
- if (this.alignment != 'vertical') {
- var newleft = newn < this.colMov.n ?
- colPos.left :
- colPos.left + $(hoveredCol).outerWidth();
- $(this.cPointer)
- .css({
- left: newleft,
- visibility: 'visible'
- });
- } else { // vertical alignment
- var newtop = newn < this.colMov.n ?
- colPos.top :
- colPos.top + $(hoveredCol).outerHeight();
- $(this.cPointer)
- .css({
- top: newtop,
- visibility: 'visible'
- });
- }
+ var newleft = newn < this.colMov.n ?
+ colPos.left :
+ colPos.left + $(hoveredCol).outerWidth();
+ $(this.cPointer)
+ .css({
+ left: newleft,
+ visibility: 'visible'
+ });
} else {
// no movement to other column, hide the column pointer
$(this.cPointer).css('visibility', 'hidden');
@@ -187,18 +154,11 @@
* Resize column n to new width "nw"
*/
resize: function(n, nw) {
- if (this.alignment != 'vertical') {
- $(this.t).find('tr').each(function() {
- $(this).find('th.draggable:visible:eq(' + n + ') span,' +
- 'td:visible:eq(' + (g.actionSpan + n) + ') span')
- .css('width', nw);
- });
- } else { // vertical alignment
- $(this.t).find('tr').each(function() {
- $(this).find('td:eq(' + n + ') span')
- .css('width', nw);
- });
- }
+ $(this.t).find('tr').each(function() {
+ $(this).find('th.draggable:visible:eq(' + n + ') span,' +
+ 'td:visible:eq(' + (g.actionSpan + n) + ') span')
+ .css('width', nw);
+ });
},
/**
@@ -206,9 +166,7 @@
*/
reposRsz: function() {
$(this.cRsz).find('div').hide();
- $firstRowCols = this.alignment != 'vertical' ?
- $(this.t).find('tr:first th.draggable:visible') :
- $(this.t).find('tr:first td');
+ $firstRowCols = $(this.t).find('tr:first th.draggable:visible');
for (var n = 0; n < $firstRowCols.length; n++) {
$this = $($firstRowCols[n]);
$cb = $(g.cRsz).find('div:eq(' + n + ')'); // column border
@@ -222,40 +180,29 @@
* Shift column from index oldn to newn.
*/
shiftCol: function(oldn, newn) {
- if (this.alignment != 'vertical') {
- $(this.t).find('tr').each(function() {
- if (newn < oldn) {
- $(this).find('th.draggable:eq(' + newn + '),' +
- 'td:eq(' + (g.actionSpan + newn) + ')')
- .before($(this).find('th.draggable:eq(' + oldn + '),' +
- 'td:eq(' + (g.actionSpan + oldn) + ')'));
- } else {
- $(this).find('th.draggable:eq(' + newn + '),' +
- 'td:eq(' + (g.actionSpan + newn) + ')')
- .after($(this).find('th.draggable:eq(' + oldn + '),' +
- 'td:eq(' + (g.actionSpan + oldn) + ')'));
- }
- });
- // reposition the column resize bars
- this.reposRsz();
-
- } else { // vertical alignment
- // shift rows
+ $(this.t).find('tr').each(function() {
if (newn < oldn) {
- $(this.t).find('tr:eq(' + (g.actionSpan + newn) + ')')
- .before($(this.t).find('tr:eq(' + (g.actionSpan + oldn) + ')'));
+ $(this).find('th.draggable:eq(' + newn + '),' +
+ 'td:eq(' + (g.actionSpan + newn) + ')')
+ .before($(this).find('th.draggable:eq(' + oldn + '),' +
+ 'td:eq(' + (g.actionSpan + oldn) + ')'));
} else {
- $(this.t).find('tr:eq(' + (g.actionSpan + newn) + ')')
- .after($(this.t).find('tr:eq(' + (g.actionSpan + oldn) + ')'));
+ $(this).find('th.draggable:eq(' + newn + '),' +
+ 'td:eq(' + (g.actionSpan + newn) + ')')
+ .after($(this).find('th.draggable:eq(' + oldn + '),' +
+ 'td:eq(' + (g.actionSpan + oldn) + ')'));
}
- }
+ });
+ // reposition the column resize bars
+ this.reposRsz();
+
// adjust the column visibility list
if (newn < oldn) {
- $(g.cList).find('tr:eq(' + newn + ')')
- .before($(g.cList).find('tr:eq(' + oldn + ')'));
+ $(g.cList).find('.lDiv div:eq(' + newn + ')')
+ .before($(g.cList).find('.lDiv div:eq(' + oldn + ')'));
} else {
- $(g.cList).find('tr:eq(' + newn + ')')
- .after($(g.cList).find('tr:eq(' + oldn + ')'));
+ $(g.cList).find('.lDiv div:eq(' + newn + ')')
+ .after($(g.cList).find('.lDiv div:eq(' + oldn + ')'));
}
// adjust the colOrder
var tmp = this.colOrder[oldn];
@@ -274,23 +221,13 @@
getHoveredCol: function(e) {
var hoveredCol;
$headers = $(this.t).find('th.draggable:visible');
- if (this.alignment != 'vertical') {
- $headers.each(function() {
- var left = $(this).offset().left;
- var right = left + $(this).outerWidth();
- if (left <= e.pageX && e.pageX <= right) {
- hoveredCol = this;
- }
- });
- } else { // vertical alignment
- $headers.each(function() {
- var top = $(this).offset().top;
- var bottom = top + $(this).height();
- if (top <= e.pageY && e.pageY <= bottom) {
- hoveredCol = this;
- }
- });
- }
+ $headers.each(function() {
+ var left = $(this).offset().left;
+ var right = left + $(this).outerWidth();
+ if (left <= e.pageX && e.pageX <= right) {
+ hoveredCol = this;
+ }
+ });
return hoveredCol;
},
@@ -298,15 +235,7 @@
* Get a zero-based index from a <th class="draggable"> tag in a table.
*/
getHeaderIdx: function(obj) {
- var n;
- if (this.alignment != 'vertical') {
- n = $(obj).parents('tr').find('th.draggable').index(obj);
- } else {
- var column_idx = $(obj).index();
- var $th_in_same_column = $(this.t).find('th.draggable:nth-child(' + (column_idx + 1) + ')');
- n = $th_in_same_column.index(obj);
- }
- return n;
+ return $(obj).parents('tr').find('th.draggable').index(obj);
},
/**
@@ -453,36 +382,26 @@
if (this.colVisib[n]) {
// can hide if more than one column is visible
if (this.visibleHeadersCount > 1) {
- if (this.alignment != 'vertical') {
- $(this.t).find('tr').each(function() {
- $(this).find('th.draggable:eq(' + n + '),' +
- 'td:eq(' + (g.actionSpan + n) + ')')
- .hide();
- });
- } else { // vertical alignment
- $(this.t).find('tr:eq(' + (g.actionSpan + n) + ')')
- .hide();
- }
+ $(this.t).find('tr').each(function() {
+ $(this).find('th.draggable:eq(' + n + '),' +
+ 'td:eq(' + (g.actionSpan + n) + ')')
+ .hide();
+ });
this.colVisib[n] = 0;
- $(this.cList).find('tr:eq(' + n + ') input').removeAttr('checked');
+ $(this.cList).find('.lDiv div:eq(' + n + ') input').removeAttr('checked');
} else {
// cannot hide, force the checkbox to stay checked
- $(this.cList).find('tr:eq(' + n + ') input').attr('checked', 'checked');
+ $(this.cList).find('.lDiv div:eq(' + n + ') input').attr('checked', 'checked');
return false;
}
} else { // column n is not visible
- if (this.alignment != 'vertical') {
- $(this.t).find('tr').each(function() {
- $(this).find('th.draggable:eq(' + n + '),' +
- 'td:eq(' + (g.actionSpan + n) + ')')
- .show();
- });
- } else { // vertical alignment
- $(this.t).find('tr:eq(' + (g.actionSpan + n) + ')')
- .show();
- }
+ $(this.t).find('tr').each(function() {
+ $(this).find('th.draggable:eq(' + n + '),' +
+ 'td:eq(' + (g.actionSpan + n) + ')')
+ .show();
+ });
this.colVisib[n] = 1;
- $(this.cList).find('tr:eq(' + n + ') input').attr('checked', 'checked');
+ $(this.cList).find('.lDiv div:eq(' + n + ') input').attr('checked', 'checked');
}
return true;
},
@@ -500,9 +419,7 @@
this.sendColPrefs();
// check visible first row headers count
- this.visibleHeadersCount = this.alignment != 'vertical' ?
- $(this.t).find('tr:first th.draggable:visible').length :
- $(this.t).find('th.draggable:nth-child(1):visible').length;
+ this.visibleHeadersCount = $(this.t).find('tr:first th.draggable:visible').length;
this.refreshRestoreButton();
},
@@ -574,15 +491,12 @@
g.cDrop = document.createElement('div'); // column drop-down arrows
g.cList = document.createElement('div'); // column visibility list
- // assign the table alignment
- g.alignment = $("#top_direction_dropdown").val();
-
// adjust g.cCpy
g.cCpy.className = 'cCpy';
$(g.cCpy).hide();
// adjust g.cPoint
- g.cPointer.className = g.alignment != 'vertical' ? 'cPointer' : 'cPointerVer';
+ g.cPointer.className = 'cPointer';
$(g.cPointer).css('visibility', 'hidden');
// adjust g.dHint
@@ -601,23 +515,14 @@
g.t = t;
// get first row data columns
- var $firstRowCols = g.alignment != 'vertical' ?
- $(t).find('tr:first th.draggable') :
- $(t).find('tr:first td');
-
- // get first row of data headers (first column of data headers, in vertical mode)
- var $firstRowHeaders = g.alignment != 'vertical' ?
- $(t).find('tr:first th.draggable') :
- $(t).find('th.draggable:nth-child(1)');
+ var $firstRowCols = $(t).find('tr:first th.draggable');
// initialize g.visibleHeadersCount
- g.visibleHeadersCount = $firstRowHeaders.filter(':visible').length;
+ g.visibleHeadersCount = $firstRowCols.filter(':visible').length;
// assign first column (actions) span
if (! $(t).find('tr:first th:first').hasClass('draggable')) { // action header exist
- g.actionSpan = g.alignment != 'vertical' ?
- $(t).find('tr:first th:first').prop('colspan') :
- $(t).find('tr:first th:first').prop('rowspan');
+ g.actionSpan = $(t).find('tr:first th:first').prop('colspan');
} else {
g.actionSpan = 0;
}
@@ -642,7 +547,7 @@
}
} else {
g.colOrder = new Array();
- for (var i = 0; i < $firstRowHeaders.length; i++) {
+ for (var i = 0; i < $firstRowCols.length; i++) {
g.colOrder.push(i);
}
}
@@ -656,12 +561,12 @@
}
} else {
g.colVisib = new Array();
- for (var i = 0; i < $firstRowHeaders.length; i++) {
+ for (var i = 0; i < $firstRowCols.length; i++) {
g.colVisib.push(1);
}
}
- if ($firstRowHeaders.length > 1) {
+ if ($firstRowCols.length > 1) {
// create column drop-down arrow(s)
$(t).find('th:not(.draggable)').each(function() {
var cd = document.createElement('div'); // column drop-down arrow
@@ -682,16 +587,16 @@
});
// add column visibility control
- g.cList.innerHTML = '<table cellpadding="0" cellspacing="0"><tbody></tbody></table>';
- var $tbody = $(g.cList).find('tbody');
- for (var i = 0; i < $firstRowHeaders.length; i++) {
- var currHeader = $firstRowHeaders[i];
- var tr = document.createElement('tr');
- $(tr).html('<td><input type="checkbox" ' + (g.colVisib[i] ? 'checked="checked" ' : '') + '/></td>' +
- '<td>' + $(currHeader).text() + '</td>');
- $tbody.append(tr);
+ g.cList.innerHTML = '<div class="lDiv"></div>';
+ var $listDiv = $(g.cList).find('div');
+ for (var i = 0; i < $firstRowCols.length; i++) {
+ var currHeader = $firstRowCols[i];
+ var listElmt = document.createElement('div');
+ $(listElmt).text($(currHeader).text())
+ .prepend('<input type="checkbox" ' + (g.colVisib[i] ? 'checked="checked" ' : '') + '/>');
+ $listDiv.append(listElmt);
// add event on click
- $(tr).click(function() {
+ $(listElmt).click(function() {
if ( g.toggleCol($(this).index()) ) {
g.afterToggleCol();
}
@@ -706,7 +611,7 @@
g.showAllColumns();
});
// prepend "show all column" button at top if the list is too long
- if ($firstRowHeaders.length > 10) {
+ if ($firstRowCols.length > 10) {
var clone = showAll.cloneNode(true);
$(g.cList).prepend(clone);
$(clone).click(function() {
@@ -749,15 +654,17 @@
g.showHint(e);
});
}
- $(t).find('th:not(.draggable)')
- .mouseenter(function(e) {
- g.showColVisibHint = true;
- g.showHint(e);
- })
- .mouseleave(function(e) {
- g.showColVisibHint = false;
- g.showHint(e);
- });
+ if ($firstRowCols.length > 1) {
+ $(t).find('th:not(.draggable)')
+ .mouseenter(function(e) {
+ g.showColVisibHint = true;
+ g.showHint(e);
+ })
+ .mouseleave(function(e) {
+ g.showColVisibHint = false;
+ g.showHint(e);
+ });
+ }
$(t).find('th.draggable a')
.attr('title', '') // hide default tooltip for sorting
.mouseenter(function(e) {
diff --git a/js/sql.js b/js/sql.js
index 9b54bb9..ab38420 100644
--- a/js/sql.js
+++ b/js/sql.js
@@ -28,28 +28,18 @@ function PMA_urlencode(str) {
* for inline editing
*
* @param $this_field jQuery object that points to the current field's tr
- * @param disp_mode string
*/
-function getFieldName($this_field, disp_mode) {
-
- if(disp_mode == 'vertical') {
- var field_name = $this_field.siblings('th').find('a').text();
- // happens when just one row (headings contain no a)
- if ("" == field_name) {
- field_name = $this_field.siblings('th').text();
- }
- }
- else {
- var this_field_index = $this_field.index();
- // ltr or rtl direction does not impact how the DOM was generated
- // check if the action column in the left exist
- var leftActionExist = !$('#table_results').find('th:first').hasClass('draggable');
- // 5 columns to account for the checkbox, edit, appended inline edit, copy and delete anchors but index is zero-based so substract 4
- var field_name = $('#table_results').find('thead').find('th:nth('+ (this_field_index - (leftActionExist ? 4 : 0)) + ') a').text();
- // happens when just one row (headings contain no a)
- if ("" == field_name) {
- field_name = $('#table_results').find('thead').find('th:nth('+ (this_field_index - (leftActionExist ? 4 : 0)) + ')').text();
- }
+function getFieldName($this_field) {
+
+ var this_field_index = $this_field.index();
+ // ltr or rtl direction does not impact how the DOM was generated
+ // check if the action column in the left exist
+ var leftActionExist = !$('#table_results').find('th:first').hasClass('draggable');
+ // 5 columns to account for the checkbox, edit, appended inline edit, copy and delete anchors but index is zero-based so substract 4
+ var field_name = $('#table_results').find('thead').find('th:nth('+ (this_field_index - (leftActionExist ? 4 : 0)) + ') a').text();
+ // happens when just one row (headings contain no a)
+ if ("" == field_name) {
+ field_name = $('#table_results').find('thead').find('th:nth('+ (this_field_index - (leftActionExist ? 4 : 0)) + ')').text();
}
field_name = $.trim(field_name);
@@ -63,49 +53,9 @@ function getFieldName($this_field, disp_mode) {
*
*/
function appendInlineAnchor() {
+ // TODO: remove two lines below if vertical display mode has been completely removed
var disp_mode = $("#top_direction_dropdown").val();
-
- if (disp_mode == 'vertical') {
- // there can be one or two tr containing this class, depending
- // on the RowActionLinks cfg parameter
- $('#table_results tr')
- .find('.edit_row_anchor')
- .removeClass('edit_row_anchor')
- .parent().each(function() {
- var $this_tr = $(this);
- var $cloned_tr = $this_tr.clone();
-
- var $img_object = $cloned_tr.find('img:first').attr('title', PMA_messages['strInlineEdit']);
- if ($img_object.length != 0) {
- var img_src = $img_object.attr('src').replace(/b_edit/,'b_inline_edit');
- $img_object.attr('src', img_src);
- }
-
- $cloned_tr.find('td')
- .addClass('inline_edit_anchor')
- .find('a').attr('href', '#');
- var $edit_span = $cloned_tr.find('span:contains("' + PMA_messages['strEdit'] + '")');
- var $span = $cloned_tr.find('a').find('span');
- if ($edit_span.length > 0) {
- $span.text(' ' + PMA_messages['strInlineEdit']);
- $span.prepend($img_object);
- } else {
- $span.text('');
- $span.append($img_object);
- }
-
- $cloned_tr.insertAfter($this_tr);
- });
-
- $('#resultsForm').find('tbody').find('th').each(function() {
- var $this_th = $(this);
- if ($this_th.attr('rowspan') == 4) {
- $this_th.attr('rowspan', '5');
- }
- });
- }
- else {
- // horizontal mode
+ if (disp_mode != 'vertical') {
$('.edit_row_anchor').each(function() {
var $this_td = $(this);
@@ -195,23 +145,6 @@ $(document).ready(function() {
}).trigger('keyup');
/**
- * current value of the direction in which the table is displayed
- * @type String
- * @fieldOf jQuery
- * @name disp_mode
- */
- var disp_mode = $("#top_direction_dropdown").val();
-
- /**
- * Update value of {@link jQuery.disp_mode} everytime the direction dropdown changes value
- * @memberOf jQuery
- * @name direction_dropdown_change
- */
- $("#top_direction_dropdown, #bottom_direction_dropdown").live('change', function(event) {
- disp_mode = $(this).val();
- })
-
- /**
* Attach the {@link appendInlineAnchor} function to a custom event, which
* will be triggered manually everytime the table of results is reloaded
* @memberOf jQuery
@@ -536,95 +469,39 @@ $(document).ready(function() {
// Add hide icon and/or text.
$edit_td.children('span.nowrap').append($('<br /><br />')).append($hide_a);
- if (disp_mode != 'vertical') {
- $('#table_results tbody tr td span a#hide').click(function() {
- var $this_hide = $(this).parents('td');
-
- var $this_span = $this_hide.find('span');
- $this_span.find('a, br').remove();
- $this_span.append($data_a.clone());
-
- $this_hide.removeClass("inline_edit_active hover").addClass("inline_edit_anchor");
- $this_hide.parent().removeClass("hover noclick");
- $this_hide.siblings().removeClass("hover");
-
- var $input_siblings = $this_hide.parent('tr').find('.inline_edit');
- var txt = '';
- $input_siblings.each(function() {
- var $this_hide_siblings = $(this);
- txt = $this_hide_siblings.data('original_data');
- if($this_hide_siblings.children('span').children().length != 0) {
- $this_hide_siblings.children('span').empty();
- $this_hide_siblings.children('span').append(txt);
- }
- });
- $(this).prev().prev().remove();
- $(this).prev().remove();
- $(this).remove();
-
- // refresh the grid
- $("#sqlqueryresults").trigger('refreshgrid');
- });
- } else {
- var txt = '';
- var rows = $edit_td.parent().siblings().length;
-
- $('#table_results tbody tr td span a#hide').click(function() {
- var $hide_a = $(this);
- var $this_hide = $(this).parents('td');
- var pos = $this_hide.index();
-
- var $this_span = $hide_a.parent();
- $this_span.find('a, br').remove();
- $this_span.append($data_a.clone());
+ $('#table_results tbody tr td span a#hide').click(function() {
+ var $this_hide = $(this).parents('td');
- var $this_row = $this_span.parents('tr');
- // changing inline_edit_active to inline_edit_anchor
- $this_hide.removeClass("inline_edit_active").addClass("inline_edit_anchor");
+ var $this_span = $this_hide.find('span');
+ $this_span.find('a, br').remove();
+ $this_span.append($data_a.clone());
- // removing marked and hover classes.
- $this_row.parent('tbody').find('tr').find("td:eq(" + pos + ")").removeClass("marked hover");
+ $this_hide.removeClass("inline_edit_active hover").addClass("inline_edit_anchor");
+ $this_hide.parent().removeClass("hover noclick");
+ $this_hide.siblings().removeClass("hover");
- for( var i = 0; i <= rows + 2; i++){
- if( $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")").hasClass("inline_edit") == false) {
- continue;
- }
- $this_row_siblings = $this_row.siblings("tr:eq(" + i + ") td:eq(" + pos + ")");
- txt = $this_row_siblings.data('original_data');
- $this_row_siblings.children('span').empty();
- $this_row_siblings.children('span').append(txt);
+ var $input_siblings = $this_hide.parent('tr').find('.inline_edit');
+ var txt = '';
+ $input_siblings.each(function() {
+ var $this_hide_siblings = $(this);
+ txt = $this_hide_siblings.data('original_data');
+ if($this_hide_siblings.children('span').children().length != 0) {
+ $this_hide_siblings.children('span').empty();
+ $this_hide_siblings.children('span').append(txt);
}
- $(this).prev().remove();
- $(this).prev().remove();
- $(this).remove();
-
- // refresh the grid
- $("#sqlqueryresults").trigger('refreshgrid');
});
- }
+ $(this).prev().prev().remove();
+ $(this).prev().remove();
+ $(this).remove();
+
+ // refresh the grid
+ $("#sqlqueryresults").trigger('refreshgrid');
+ });
// Initialize some variables
- if(disp_mode == 'vertical') {
- /**
- * @var this_row_index Index of the current <td> in the parent <tr>
- * Current <td> is the inline edit anchor.
- */
- var this_row_index = $edit_td.index();
- /**
- * @var $input_siblings Object referring to all inline editable events from same row
- */
- var $input_siblings = $edit_td.parents('tbody').find('tr').find('.inline_edit:nth('+this_row_index+')');
- /**
- * @var where_clause String containing the WHERE clause to select this row
- */
- var where_clause = $edit_td.parents('tbody').find('tr').find('.where_clause:nth('+this_row_index+')').val();
- }
- // horizontal mode
- else {
- var this_row_index = $edit_td.parent().index();
- var $input_siblings = $edit_td.parent('tr').find('.inline_edit');
- var where_clause = $edit_td.parent('tr').find('.where_clause').val();
- }
+ var this_row_index = $edit_td.parent().index();
+ var $input_siblings = $edit_td.parent('tr').find('.inline_edit');
+ var where_clause = $edit_td.parent('tr').find('.where_clause').val();
$input_siblings.each(function() {
/** @lends jQuery */
@@ -648,7 +525,7 @@ $(document).ready(function() {
* @var field_name String containing the name of this field.
* @see getFieldName()
*/
- var field_name = getFieldName($this_field, disp_mode);
+ var field_name = getFieldName($this_field);
/**
* @var relation_curr_value String current value of the field (for fields that are foreign keyed).
*/
@@ -859,24 +736,8 @@ $(document).ready(function() {
var $test_element = ''; // to test the presence of a element
// Initialize variables
- if(disp_mode == 'vertical') {
- /**
- * @var this_td_index Index of the current <td> in the parent <tr>
- * Current <td> is the inline edit anchor.
- */
- var this_td_index = $this_td.index();
- /**
- * @var $input_siblings Object referring to all inline editable events from same row
- */
- var $input_siblings = $this_td.parents('tbody').find('tr').find('.inline_edit:nth('+this_td_index+')');
- /**
- * @var where_clause String containing the WHERE clause to select this row
- */
- var where_clause = $this_td.parents('tbody').find('tr').find('.where_clause:nth('+this_td_index+')').val();
- } else {
- var $input_siblings = $this_td.parent('tr').find('.inline_edit');
- var where_clause = $this_td.parent('tr').find('.where_clause').val();
- }
+ var $input_siblings = $this_td.parent('tr').find('.inline_edit');
+ var where_clause = $this_td.parent('tr').find('.where_clause').val();
/**
* @var nonunique Boolean, whether this row is unique or not
@@ -927,7 +788,7 @@ $(document).ready(function() {
* @var field_name String containing the name of this field.
* @see getFieldName()
*/
- var field_name = getFieldName($this_field, disp_mode);
+ var field_name = getFieldName($this_field);
/**
* @var this_field_params Array temporary storage for the name/value of current field
@@ -1027,7 +888,6 @@ $(document).ready(function() {
*/
var post_params = {'ajax_request' : true,
'sql_query' : sql_query,
- 'disp_direction' : disp_mode,
'token' : window.parent.token,
'db' : window.parent.db,
'table' : window.parent.table,
@@ -1044,19 +904,14 @@ $(document).ready(function() {
$.post('tbl_replace.php', post_params, function(data) {
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
- if(disp_mode == 'vertical') {
- $this_td.parents('tbody').find('tr').find('.where_clause:nth(' + this_td_index + ')').attr('value', new_clause);
- }
- else {
- $this_td.parent('tr').find('.where_clause').attr('value', new_clause);
- }
+ $this_td.parent('tr').find('.where_clause').attr('value', new_clause);
// remove possible previous feedback message
$('#result_query').remove();
if (typeof data.sql_query != 'undefined') {
// display feedback
$('#sqlqueryresults').prepend(data.sql_query);
}
- PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, data, disp_mode);
+ PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, data);
} else {
PMA_ajaxShowMessage(data.error);
};
@@ -1064,7 +919,7 @@ $(document).ready(function() {
} else {
// no posting was done but still need to display the row
// in its previous format
- PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, '', disp_mode);
+ PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, '');
}
}) // End After editing, clicking again should post data
@@ -1229,7 +1084,7 @@ $(document).ready(function() {
* (when called in the situation where no posting was done, the data
* parameter is empty)
*/
-function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, data, disp_mode) {
+function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings, data) {
// deleting the hide button. remove <br><br><a> tags
$del_hide.find('a, br').remove();
@@ -1241,11 +1096,7 @@ function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings,
// removing hover, marked and noclick classes
$this_td.parent('tr').removeClass('noclick');
- if(disp_mode != 'vertical') {
- $this_td.parent('tr').removeClass('hover').find('td').removeClass('hover');
- } else {
- $this_td.parents('tbody').find('tr').find('td:eq(' + $this_td.index() + ')').removeClass('marked hover');
- }
+ $this_td.parent('tr').removeClass('hover').find('td').removeClass('hover');
$input_siblings.each(function() {
// Inline edit post has been successful.
@@ -1265,7 +1116,7 @@ function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings,
var new_html = $this_sibling.find('textarea').val();
if($this_sibling.is('.transformed')) {
- var field_name = getFieldName($this_sibling, disp_mode);
+ var field_name = getFieldName($this_sibling);
if (typeof data.transformations != 'undefined') {
$.each(data.transformations, function(key, value) {
if(key == field_name) {
@@ -1294,7 +1145,7 @@ function PMA_unInlineEditRow($del_hide, $chg_submit, $this_td, $input_siblings,
}
if($this_sibling.is('.relation')) {
- var field_name = getFieldName($this_sibling, disp_mode);
+ var field_name = getFieldName($this_sibling);
if (typeof data.relations != 'undefined') {
$.each(data.relations, function(key, value) {
if(key == field_name) {
diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php
index c18e003..5445d88 100644
--- a/themes/original/css/theme_right.css.php
+++ b/themes/original/css/theme_right.css.php
@@ -2163,15 +2163,6 @@ span.mysql-number {
width: 10px;
}
-.cPointerVer { /* cPointer with vertical display mode */
- background: url(<?php echo $_SESSION['PMA_Theme']->getImgPath(); ?>col_pointer_ver.png);
- height: 10px;
- margin-left: -5px;
- margin-top: -5px; /* must be minus half of its height */
- position: absolute;
- width: 20px;
-}
-
.dHint {
background: #333;
border:1px solid #000;
@@ -2233,15 +2224,16 @@ span.mysql-number {
position: absolute;
}
-.cList table {
+.cList .lDiv div {
+ padding: 0.2em 0.5em 0.2em 0.2em;
}
-.cList table tr:hover {
+.cList .lDiv div:hover {
background: #DDD;
cursor: pointer;
}
-.cList table td input {
+.cList .lDiv div input {
cursor: pointer;
}
diff --git a/themes/original/img/col_pointer_ver.png b/themes/original/img/col_pointer_ver.png
deleted file mode 100644
index 4607912..0000000
Binary files a/themes/original/img/col_pointer_ver.png and /dev/null differ
diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php
index f6d523c..a224e14 100644
--- a/themes/pmahomme/css/theme_right.css.php
+++ b/themes/pmahomme/css/theme_right.css.php
@@ -2534,15 +2534,6 @@ span.mysql-number {
width: 10px;
}
-.cPointerVer { /* cPointer with vertical display mode */
- background: url(./themes/pmahomme/img/col_pointer_ver.png);
- height: 10px;
- margin-left: -5px;
- margin-top: -5px; /* must be minus half of its height */
- position: absolute;
- width: 20px;
-}
-
.dHint {
background: #333;
border:1px solid #000;
@@ -2603,15 +2594,16 @@ span.mysql-number {
box-shadow: 0 0.2em 0.5em #333;
}
-.cList table {
+.cList .lDiv div {
+ padding: 0.2em 0.5em 0.2em 0.2em;
}
-.cList table tr:hover {
+.cList .lDiv div:hover {
background: #DDD;
cursor: pointer;
}
-.cList table td input {
+.cList .lDiv div input {
cursor: pointer;
}
diff --git a/themes/pmahomme/img/col_pointer_ver.png b/themes/pmahomme/img/col_pointer_ver.png
deleted file mode 100644
index 8964754..0000000
Binary files a/themes/pmahomme/img/col_pointer_ver.png and /dev/null differ
hooks/post-receive
--
phpMyAdmin
1
0