diff --git a/libraries/database_interface.lib.php b/libraries/database_interface.lib.php index 8877dad54a..1873ef11b6 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/sql.php b/sql.php index 07d54de880..2ce10ea0db 100644 --- a/sql.php +++ b/sql.php @@ -1013,8 +1013,7 @@ $(document).ready(makeProfilingChart);
' : '') - . __('Bookmark this SQL query'); + echo PMA_getIcon('b_bookmark.png', __('Bookmark this SQL query')); ?> diff --git a/tbl_structure.php b/tbl_structure.php index 1b39340c96..25787e3646 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -589,12 +589,24 @@ 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', + ) + ), + PMA_getIcon('b_edit.png', __('Edit view')) + ); } -echo __('Print view'); +?> + + '; - } - echo __('Relation view'); + echo PMA_getIcon('b_relations.png', __('Relation view')); ?> '; - } - echo __('Propose table structure'); + echo PMA_getIcon('b_tblanalyse.png', __('Propose table structure')); ?>'; - - if ($cfg['PropertiesIconic']) - { - echo '' . __('Track table') . ' '; - } - echo __('Track table') . ''; + echo PMA_getIcon('eye.png', __('Track table')); + echo ''; } ?> @@ -805,10 +807,7 @@ if ($cfg['ShowStats']) { '; - } - echo __('Optimize table'); + echo PMA_getIcon('b_tbloptimize.png', __('Optimize table')); ?>