Skip to content
Permalink
Browse files

Rename message Twig extensions

Signed-off-by: Leonardo Strozzi <laps15@inf.ufpr.br>
  • Loading branch information...
laps15 committed Aug 1, 2018
1 parent aee045f commit 00aea8821a7380f0db9cff3809b7ae917d53377a
@@ -11,7 +11,7 @@
use PhpMyAdmin\Message;
use Twig\Extension\AbstractExtension;
use Twig\TwigFunction;
use Twig\TwigFilter;
/**
* Class MessageExtension
@@ -21,22 +21,22 @@
class MessageExtension extends AbstractExtension
{
/**
* Returns a list of functions to add to the existing list.
* Returns a list of filters to add to the existing list.
*
* @return TwigFunction[]
* @return TwigFilter[]
*/
public function getFunctions()
public function getFilters()
{
return [
new TwigFunction(
'Message_notice',
new TwigFilter(
'notice',
function ($string) {
return Message::notice($string)->getDisplay();
},
['is_safe' => ['html']]
),
new TwigFunction(
'Message_error',
new TwigFilter(
'error',
function ($string) {
return Message::error($string)->getDisplay();
},
@@ -83,7 +83,7 @@
{{ Util_getBrowseUploadFileBlock(max_upload_size) }}
<p>{% trans 'You may also drag and drop a file on any page.' %}</p>
{% elseif not is_upload %}
{{ Message_notice('File uploads are not allowed on this server.'|trans) }}
{{ 'File uploads are not allowed on this server.'|trans|notice }}
{% elseif upload_dir is not empty %}
{{ Util_getSelectUploadFileBlock(
import_list,
@@ -5,9 +5,9 @@
<h1>{{ 'Welcome to %s'|trans|format('<bdo dir="ltr" lang="en">phpMyAdmin</bdo>')|raw }}</h1>

<noscript>
{{ Message_error("Javascript must be enabled past this point!"|trans) }}
{{ "Javascript must be enabled past this point!"|trans|error }}
</noscript>

<div class="hide" id="js-https-mismatch">
{{ Message_error("There is mismatch between HTTPS indicated on the server and client. This can lead to non working phpMyAdmin or a security risk. Please fix your server configuration to indicate HTTPS properly."|trans) }}
{{ "There is mismatch between HTTPS indicated on the server and client. This can lead to non working phpMyAdmin or a security risk. Please fix your server configuration to indicate HTTPS properly."|trans|error }}
</div>
@@ -2,7 +2,7 @@
<h2>{% trans "Confirm disabling two-factor authentication" %}</h2>
<div class="group-cnt">
<form method="POST" action="prefs_twofactor.php">
{{ Message_notice("By disabling two factor authentication you will be again able to login using password only."|trans) }}
{{ "By disabling two factor authentication you will be again able to login using password only."|trans|notice }}
{{ Url_getHiddenInputs() }}
{{ form|raw }}
<input type="hidden" name="2fa_remove" value="1" />
@@ -52,7 +52,7 @@

{# Enable statistics #}
{% if dbstats is empty %}
{{ Message_notice('Note: Enabling the database statistics here might cause heavy traffic between the web server and the MySQL server.'|trans) }}
{{ 'Note: Enabling the database statistics here might cause heavy traffic between the web server and the MySQL server.'|trans|notice }}

{% set content %}
<strong>{% trans 'Enable statistics' %}</strong>
@@ -5,7 +5,7 @@
{{ Util_showMySQLDocu('partitioning') }}
</legend>
{% if partitions is empty %}
{{ Message_notice('No partitioning defined!'|trans) }}
{{ 'No partitioning defined!'|trans|notice }}
{% else %}
<p>
{% trans 'Partitioned by:' %}

0 comments on commit 00aea88

Please sign in to comment.
You can’t perform that action at this time.