[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-13347-gf9a713d
Michal Čihař
nijel at users.sourceforge.net
Mon Aug 8 09:57:14 CEST 2011
The branch, master has been updated
via f9a713dea195f8b9dc0cac9bedfd5e490fd7a440 (commit)
via 2f9ca4de9998d6686d259d8a4a0db7ca6bf59247 (commit)
via c9434d11c79d3a9047127e6b6e98829d009159e0 (commit)
via 6ec8bb013b8f36b8b8cbcba539616dc6146c2727 (commit)
from 21c3988cbf2ab7272e5b9acf65f37e649001c6b7 (commit)
- Log -----------------------------------------------------------------
commit f9a713dea195f8b9dc0cac9bedfd5e490fd7a440
Author: Michal Čihař <mcihar at suse.cz>
Date: Mon Aug 8 09:56:43 2011 +0200
Use PMA_linkOrButton here as the query can be quite long
commit 2f9ca4de9998d6686d259d8a4a0db7ca6bf59247
Merge: 21c3988cbf2ab7272e5b9acf65f37e649001c6b7 c9434d11c79d3a9047127e6b6e98829d009159e0
Author: Michal Čihař <mcihar at suse.cz>
Date: Mon Aug 8 09:44:19 2011 +0200
Merge branch 'edit-view' of git://github.com/csware/phpmyadmin into int
commit c9434d11c79d3a9047127e6b6e98829d009159e0
Author: Sven Strickroth <email at cs-ware.de>
Date: Mon Aug 1 15:38:41 2011 +0200
add "edit view" link to table structure view
Signed-off-by: Sven Strickroth <email at cs-ware.de>
commit 6ec8bb013b8f36b8b8cbcba539616dc6146c2727
Author: Sven Strickroth <email at cs-ware.de>
Date: Mon Aug 1 15:38:10 2011 +0200
extend PMA_DBI_get_definition to support views
Signed-off-by: Sven Strickroth <email at cs-ware.de>
-----------------------------------------------------------------------
Summary of changes:
libraries/database_interface.lib.php | 9 +++++----
tbl_structure.php | 15 +++++++++++++++
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php
index 8877dad..1873ef1 100644
--- a/libraries/database_interface.lib.php
+++ b/libraries/database_interface.lib.php
@@ -1271,11 +1271,11 @@ function PMA_DBI_get_procedures_or_functions($db, $which, $link = null)
}
/**
- * returns the definition of a specific PROCEDURE, FUNCTION or EVENT
+ * returns the definition of a specific PROCEDURE, FUNCTION, EVENT or VIEW
*
* @param string $db db name
- * @param string $which PROCEDURE | FUNCTION | EVENT
- * @param string $name the procedure|function|event name
+ * @param string $which PROCEDURE | FUNCTION | EVENT | VIEW
+ * @param string $name the procedure|function|event|view name
* @param resource $link mysql link
*
* @return string the definition
@@ -1285,7 +1285,8 @@ function PMA_DBI_get_definition($db, $which, $name, $link = null)
$returned_field = array(
'PROCEDURE' => 'Create Procedure',
'FUNCTION' => 'Create Function',
- 'EVENT' => 'Create Event'
+ 'EVENT' => 'Create Event',
+ 'VIEW' => 'Create View'
);
$query = 'SHOW CREATE ' . $which . ' ' . PMA_backquote($db) . '.' . PMA_backquote($name);
return(PMA_DBI_fetch_value($query, 0, $returned_field[$which]));
diff --git a/tbl_structure.php b/tbl_structure.php
index 1b39340..cab5484 100644
--- a/tbl_structure.php
+++ b/tbl_structure.php
@@ -589,7 +589,22 @@ if (! $tbl_is_view && ! $db_is_information_schema) {
/**
* Work on the table
*/
+
+if ($tbl_is_view) {
+ $create_view = PMA_DBI_get_definition($db, 'VIEW', $table);
+ echo PMA_linkOrButton(
+ 'tbl_sql.php' . PMA_generate_common_url(
+ $url_params +
+ array(
+ 'sql_query' => $create_view,
+ 'show_query' => '1',
+ )
+ ),
+ sprintf('<img class="icon ic_b_edit" src="themes/dot.gif" alt="%1$s"/> %1$s', __('Edit view'))
+ );
+}
?>
+
<a href="tbl_printview.php?<?php echo $url_query; ?>"><?php
if ($cfg['PropertiesIconic']) {
echo '<img class="icon ic_b_print" src="themes/dot.gif" alt="' . __('Print view') . '"/>';
hooks/post-receive
--
phpMyAdmin
More information about the Git
mailing list