diff --git a/view_create.php b/view_create.php index 6401bc7a9..de893bb1d 100644 --- a/view_create.php +++ b/view_create.php @@ -1,10 +1,20 @@ setMessage(PMA_DBI_getError()); } +} - $message .= PMA_DBI_query($create_query) ? $strSuccess : $strError; +// prefill values if not already filled from former submission +$view = array( + 'or_replace' => '', + 'algorithm' => '', + 'name' => '', + 'column_names' => '', + 'as' => $sql_query, + 'with' => array(), +); - // to display the CREATE VIEW query - $sql_query = $create_query; +if (PMA_isValid($_REQUEST['view'], 'array')) { + $view = array_merge($view, $_REQUEST['view']); +} - require './' . $cfg['DefaultTabDatabase']; - exit(); +/** + * Displays top menu links + * We use db links because a VIEW is not necessarily on a single table + */ +$num_tables = 0; +require_once './libraries/db_links.inc.php'; -} else { - /** - * Displays top menu links - * We use db links because a VIEW is not necessarily on a single table - */ - $num_tables = 0; - require_once './libraries/db_links.inc.php'; - - $url_params['goto'] = 'view_create.php'; - $url_params['back'] = 'view_create.php'; - - /** - * Displays the page - * - * @todo js error when view name is empty (strFormEmpty) - * @todo (also validate if js is disabled, after form submission?) - */ +$url_params['db'] = $GLOBALS['db']; +$url_params['reload'] = 1; +/** + * Displays the page + */ ?>
- - +
CREATE VIEW - - - - - +
+ checked="checked" + value="1" />
+
+
AS - +
WITH - - - - - - + '; + echo ''; + } + ?>
- +
@@ -143,5 +189,4 @@ if (isset($_POST['submitoptions'])) { */ require_once './libraries/footer.inc.php'; -} // end if ?>