diff --git a/libraries/classes/Twig/PhpFunctionsExtension.php b/libraries/classes/Twig/PhpFunctionsExtension.php index ab054317a1..78c77ecd25 100644 --- a/libraries/classes/Twig/PhpFunctionsExtension.php +++ b/libraries/classes/Twig/PhpFunctionsExtension.php @@ -27,6 +27,7 @@ class PhpFunctionsExtension extends Twig_Extension return array( new Twig_SimpleFunction('array_search', 'array_search'), new Twig_SimpleFunction('md5', 'md5'), + new Twig_SimpleFunction('preg_replace', 'preg_replace'), ); } } diff --git a/templates/table/search/search_and_replace.phtml b/templates/table/search/search_and_replace.phtml deleted file mode 100644 index 714b0198db..0000000000 --- a/templates/table/search/search_and_replace.phtml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - -
-render( - array( - 'html_field_name' => 'useRegex', - 'label' => __('Use regular expression'), - 'checked' => false, - 'onclick' => false, - 'html_field_id' => 'useRegex', - ) -); ?> diff --git a/templates/table/search/search_and_replace.twig b/templates/table/search/search_and_replace.twig new file mode 100644 index 0000000000..cddd580661 --- /dev/null +++ b/templates/table/search/search_and_replace.twig @@ -0,0 +1,25 @@ +{% trans 'Find:' %} + +{% trans 'Replace with:' %} + + +{% trans 'Column:' %} + + +{% include 'checkbox.twig' with { + 'html_field_id': 'useRegex', + 'html_field_name': 'useRegex', + 'label': 'Use regular expression'|trans, + 'checked': false, + 'onclick': false +} only %} diff --git a/templates/table/search/selection_form.phtml b/templates/table/search/selection_form.phtml index 792f266e89..b2e95861bd 100644 --- a/templates/table/search/selection_form.phtml +++ b/templates/table/search/selection_form.phtml @@ -90,8 +90,9 @@ switch ($searchType) { render(array( - 'columnNames' => $columnNames, - 'columnTypes' => $columnTypes + 'column_names' => $columnNames, + 'column_types' => $columnTypes, + 'sql_types' => $GLOBALS['PMA_Types'], )); ?>