diff --git a/ChangeLog b/ChangeLog index 1fbd7dbe96..d5ff82f11d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ phpMyAdmin - ChangeLog ====================== +<<<<<<< HEAD 4.1.0.0 (not yet released) + rfe #499 On user creation, warn if the user already exists + Use indeterminate check all checkbox in server privileges @@ -9,6 +10,7 @@ phpMyAdmin - ChangeLog + [interface] Make warning about existing config directory clearer + rfe #1414 Allow specifying controlport + PMA_DBI functions in database interface libraries renamed to be compliant with PEAR standards ++ rfe #1412 Creating a view from an empty set of results 4.0.1.0 (not yet released) - bug #3879 Import broken for CSV using LOAD DATA diff --git a/libraries/DisplayResults.class.php b/libraries/DisplayResults.class.php index 7c57411831..d175e82934 100644 --- a/libraries/DisplayResults.class.php +++ b/libraries/DisplayResults.class.php @@ -5136,12 +5136,70 @@ class PMA_DisplayResults } // end of the '_getPlacedTableNavigations()' function + /** + * Generates HTML to display the Create view in span tag + * + * @param array $analyzed_sql the analyzed Query + * @param string $url_query String with URL Parameters + * + * @return string + * + * @access private + * + * @see _getResultsOperations() + */ + private function _getLinkForCreateView($analyzed_sql, $url_query) + { + $results_operations_html = ''; + if (!PMA_DRIZZLE && !isset($analyzed_sql[0]['queryflags']['procedure'])) { + + $ajax_class = ' ajax'; + + $results_operations_html .= '' + . PMA_Util::linkOrButton( + 'view_create.php' . $url_query, + PMA_Util::getIcon( + 'b_views.png', __('Create view'), true + ), + array('class' => 'create_view' . $ajax_class), true, true, '' + ) + . '' . "\n"; + } + return $results_operations_html; + + } + + /** + * Calls the _getResultsOperations with $only_view as true + * + * @param array $analyzed_sql the analyzed Query + * + * @return string + * + * @access public + * + */ + public function getCreateViewQueryResultOp($analyzed_sql) + { + + $results_operations_html = ''; + $fake_display_mode = array(); + //calling to _getResultOperations with a fake display mode + //and setting only_view parameter to be true to generate just view + $results_operations_html .= $this->_getResultsOperations( + $fake_display_mode, + $analyzed_sql, + true + ); + return $results_operations_html; + } /** * Get operations that are available on results. * - * @param array $the_disp_mode the display mode - * @param array $analyzed_sql the analyzed query + * @param array $the_disp_mode the display mode + * @param array $analyzed_sql the analyzed query + * @param boolean $only_view Whether to show only view * * @return string $results_operations_html html content * @@ -5149,31 +5207,42 @@ class PMA_DisplayResults * * @see getTable() */ - private function _getResultsOperations($the_disp_mode, $analyzed_sql) + private function _getResultsOperations( + $the_disp_mode, $analyzed_sql, $only_view = false + ) { - $results_operations_html = ''; $fields_meta = $this->__get('fields_meta'); // To safe use in foreach $header_shown = false; $header = '