diff --git a/ChangeLog b/ChangeLog index a0c4a03e29..155813e169 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,7 @@ phpMyAdmin - ChangeLog - issue #13095 Fixed alignmnet of foreign keys editing - issue #12944 Improved inline editor for JSON - issue #13145 Improved layout of operations pages +- issue #13448 Add "format" query button in edit view form 4.7.3 (not yet released) - issue #13447 Large multi-line query removes Export operation and blanks query box options diff --git a/js/functions.js b/js/functions.js index 107daf8934..3789aa158d 100644 --- a/js/functions.js +++ b/js/functions.js @@ -4721,21 +4721,21 @@ AJAX.registerOnload('functions.js', function () { }); // end $(document).on() } - syntaxHighlighter = PMA_getSQLEditor($('textarea[name="view[as]"]')); + codemirror_editor = PMA_getSQLEditor($('textarea[name="view[as]"]')); }); function PMA_createViewDialog($this) { var $msg = PMA_ajaxShowMessage(); - var syntaxHighlighter = null; + var codemirror_editor = null; $.get($this.attr('href') + '&ajax_request=1&ajax_dialog=1', function (data) { if (typeof data !== 'undefined' && data.success === true) { PMA_ajaxRemoveMessage($msg); var buttonOptions = {}; buttonOptions[PMA_messages.strGo] = function () { if (typeof CodeMirror !== 'undefined') { - syntaxHighlighter.save(); + codemirror_editor.save(); } $msg = PMA_ajaxShowMessage(); $.post('view_create.php', $('#createViewDialog').find('form').serialize(), function (data) { @@ -4763,7 +4763,7 @@ function PMA_createViewDialog($this) } }); // Attach syntax highlighted editor - syntaxHighlighter = PMA_getSQLEditor($dialog.find('textarea')); + codemirror_editor = PMA_getSQLEditor($dialog.find('textarea')); $('input:visible[type=text]', $dialog).first().focus(); } else { PMA_ajaxShowMessage(data.error); diff --git a/templates/view_create.twig b/templates/view_create.twig new file mode 100644 index 0000000000..45ac37767e --- /dev/null +++ b/templates/view_create.twig @@ -0,0 +1,123 @@ + +
+
+ {{ URL_getHiddenInputs(url_params) }} +
+ + {% if ajax_dialog %} + {% trans 'Details' %} + {% else %} + {% if view['operation'] == 'create' %} + {% trans 'Create view' %} + {% else %} + {% trans 'Edit view' %} + {% endif %} + {% endif %} + + + {% if view['operation'] == 'create' %} + + + + + {% endif %} + + + + + + + + + + + + + + + + + {% if view['operation'] == 'create' %} + + + + + {% else %} + + + + {% endif %} + + + + + + + + + + + + + + + + +
+ +
+ +
{% trans 'Definer' %}
SQL SECURITY + +
{% trans 'VIEW name' %} + +
+ +
{% trans 'Column names' %} + +
AS +
+ + +
WITH CHECK OPTION + +
+
+ + {% if ajax_dialog %} +
+ + +
+ {% else %} + + + + {% endif %} + +
+
diff --git a/themes/pmahomme/css/rte.css.php b/themes/pmahomme/css/rte.css.php index 55d7832e9a..f75488ccf0 100644 --- a/themes/pmahomme/css/rte.css.php +++ b/themes/pmahomme/css/rte.css.php @@ -38,6 +38,7 @@ if (! defined('PMA_MINIMUM_COMMON') && ! defined('TESTSUITE')) { -webkit-box-sizing: border-box; } +.rte_table input[type=button], .rte_table input[type=checkbox], .rte_table input[type=radio] { width: auto; diff --git a/view_create.php b/view_create.php index fbe8e6747c..ca2672c019 100644 --- a/view_create.php +++ b/view_create.php @@ -11,6 +11,7 @@ use PhpMyAdmin\Core; use PhpMyAdmin\Url; use PhpMyAdmin\Response; +use PhpMyAdmin\Template; require_once './libraries/common.inc.php'; @@ -194,122 +195,9 @@ if (Core::isValid($_REQUEST['view'], 'array')) { $url_params['db'] = $GLOBALS['db']; $url_params['reload'] = 1; -/** - * Displays the page - */ -$htmlString = '' - . '
' - . '
' - . Url::getHiddenInputs($url_params) - . '
' - . '' - . (isset($_REQUEST['ajax_dialog']) ? - __('Details') : - ($view['operation'] == 'create' ? __('Create view') : __('Edit view')) - ) - . '' - . ''; - -if ($view['operation'] == 'create') { - $htmlString .= '' - . '' - . '' - . ''; - -$htmlString .= '' - . ''; - -$htmlString .= '' - . ''; - -if ($view['operation'] == 'create') { - $htmlString .= '' - . ''; -} else { - $htmlString .= ''; -} - -$htmlString .= '' - . ''; - -$htmlString .= '' - . '
' - . '
' . __('Definer') . '' - . '
SQL SECURITY' - . '
' . __('VIEW name') . '' - . '
' - . '
' . __('Column names') . '' - . '
AS' - . '