-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13207 from mauriciofauth/templates
Port some templates to Twig
- Loading branch information
Showing
38 changed files
with
303 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/* vim: set expandtab sw=4 ts=4 sts=4: */ | ||
/** | ||
* hold PMA\libraries\twig\UtilExtension class | ||
* | ||
* @package PMA\libraries\twig | ||
*/ | ||
namespace PMA\libraries\twig; | ||
|
||
use Twig_Extension; | ||
use Twig_SimpleFunction; | ||
|
||
/** | ||
* Class UtilExtension | ||
* | ||
* @package PMA\libraries\twig | ||
*/ | ||
class UtilExtension extends Twig_Extension | ||
{ | ||
/** | ||
* Returns a list of functions to add to the existing list. | ||
* | ||
* @return Twig_SimpleFunction[] | ||
*/ | ||
public function getFunctions() | ||
{ | ||
return array( | ||
new Twig_SimpleFunction( | ||
'Util_showIcons', | ||
'PMA\libraries\Util::showIcons' | ||
), | ||
new Twig_SimpleFunction( | ||
'Util_getImage', | ||
'PMA\libraries\Util::getImage', | ||
array('is_safe' => array('html')) | ||
), | ||
new Twig_SimpleFunction( | ||
'Util_formatSql', | ||
'PMA\libraries\Util::formatSql', | ||
array('is_safe' => array('html')) | ||
), | ||
new Twig_SimpleFunction( | ||
'Util_getHtmlTab', | ||
'PMA\libraries\Util::getHtmlTab', | ||
array('is_safe' => array('html')) | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<input type="checkbox" name="{{ html_field_name }}" | ||
{%- if html_field_id is defined %} id="{{ html_field_id }}"{% endif -%} | ||
{%- if checked is defined and checked %} checked="checked"{% endif -%} | ||
{%- if onclick is defined and onclick %} class="autosubmit"{% endif %} /><label | ||
{%- if html_field_id is defined %} for="{{ html_field_id }}" | ||
{%- endif %}>{{ label }}</label> |
4 changes: 2 additions & 2 deletions
4
templates/components/error_message.phtml → templates/components/error_message.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<div class="error"> | ||
<img src="themes/dot.gif" title="" alt="" class="icon ic_s_error" /> | ||
<?= $msg; ?> | ||
</div> | ||
{{ msg }} | ||
</div> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div class="{{ parentDivClasses }}"> | ||
{% for content in contentArray %} | ||
{% if content is defined %} | ||
<span class="{{ content[0] }}"> | ||
{{ content[1] }} | ||
{% if content['extraSpan'] is defined %} | ||
: <span>{{ content['extraSpan'] }}</span> | ||
{% endif %} | ||
</span> | ||
{% endif %} | ||
{% endfor %} | ||
</div> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="toolbar {{ parentDivClasses }}"> | ||
{% for content in contentArray %} | ||
{% if content is defined %} | ||
<div class="{{ content[0] }}"> | ||
{{ content['image'] ? content['image'] }} | ||
<span>{{ content[1] }}</span> | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
</div> |
16 changes: 8 additions & 8 deletions
16
templates/database/create_table.phtml → templates/database/create_table.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
<form id="create_table_form_minimal" method="post" action="tbl_create.php" class="lock-page"> | ||
<fieldset> | ||
<legend> | ||
<?php if (PMA\libraries\Util::showIcons('ActionLinksMode')): ?> | ||
<?= PMA\libraries\Util::getImage('b_table_add.png'); ?>  | ||
<?php endif; ?> | ||
<?= __('Create table'); ?> | ||
{% if Util_showIcons('ActionLinksMode') -%} | ||
{{ Util_getImage('b_table_add.png') }} | ||
{%- endif %} | ||
{% trans "Create table" %} | ||
</legend> | ||
<?= PMA\libraries\URL::getHiddenInputs($db); ?> | ||
{{ URL_getHiddenInputs(db) }} | ||
<div class="formelement"> | ||
<?= __('Name'); ?>: | ||
{% trans "Name" %}: | ||
<input type="text" name="table" maxlength="64" size="30" required="required" /> | ||
</div> | ||
<div class="formelement"> | ||
<?= __('Number of columns'); ?>: | ||
{% trans "Number of columns" %}: | ||
<input type="number" min="1" name="num_fields" value="4" required="required" /> | ||
</div> | ||
<div class="clearfloat"></div> | ||
</fieldset> | ||
<fieldset class="tblFooters"> | ||
<input type="submit" value="<?= __('Go'); ?>" /> | ||
<input type="submit" value="{% trans "Go" %}" /> | ||
</fieldset> | ||
</form> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{% if InitialSlidersState == 'disabled' %} | ||
<div{% if id is defined %} id="{{ id }}"{% endif %}> | ||
{% else %} | ||
{# | ||
Bad hack on the next line. document.write() conflicts with jQuery, | ||
hence, opening the <div> with PHP itself instead of JavaScript. | ||
@todo find a better solution that uses $.append(), the recommended | ||
method maybe by using an additional param, the id of the div to | ||
append to | ||
#} | ||
<div{% if id is defined %} id="{{ id }}" | ||
{%- endif %} {% if InitialSlidersState == 'closed' -%} | ||
style="display: none; overflow:auto;"{% endif %} class="pma_auto_slider" | ||
{%- if message is defined %} title="{{ message }}"{% endif %}> | ||
{% endif %} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<select name="{{ select_name }}" id="{{ id }}"{{ class ? ' class="' ~ class ~ '"' }}> | ||
{% if placeholder is not empty %} | ||
<option value="" disabled="disabled" | ||
{%- if not selected %} selected="selected"{% endif %}>{{ placeholder }}</option> | ||
{% endif %} | ||
{% for option in resultOptions %} | ||
<option value="{{ option['value'] }}" | ||
{{- option['selected'] ? ' selected="selected"' }}>{{ option['label'] }}</option> | ||
{% endfor %} | ||
</select> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<form action="error_report.php" method="post" name="report_frm" id="report_frm" | ||
class="ajax"> | ||
<fieldset style="padding-top:0"> | ||
|
||
<p> | ||
{% trans %} | ||
This report automatically includes data about the error and information about relevant configuration settings. It will be sent to the phpMyAdmin team for debugging the error. | ||
{% endtrans %} | ||
</p> | ||
|
||
<div class="label"><label><strong> | ||
{% trans "Can you tell us the steps leading to this error? It decisively helps in debugging:" %} | ||
</strong></label> | ||
</div> | ||
<textarea class="report-description" name="description" | ||
id="report_description"></textarea> | ||
|
||
<div class="label"><label><p> | ||
{% trans "You may examine the data in the error report:" %} | ||
</p></label></div> | ||
<pre class="report-data">{{ report_data }}</pre> | ||
|
||
<input type="checkbox" name="always_send" id="always_send_checkbox" /> | ||
<label for="always_send_checkbox"> | ||
{% trans "Automatically send report next time" %} | ||
</label> | ||
|
||
</fieldset> | ||
|
||
{{ hidden_inputs }} | ||
{{ hidden_fields }} | ||
</form> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<fieldset id="tableFilter"> | ||
<legend>{% trans "Filters" %}</legend> | ||
<div class="formelement"> | ||
<label for="filterText">{% trans "Containing the word:" %}</label> | ||
<input name="filterText" type="text" id="filterText" | ||
value="{{ filterValue }}" /> | ||
</div> | ||
</fieldset> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div id="prefs_autoload" class="notice print_ignore" style="display:none"> | ||
<form action="prefs_manage.php" method="post" class="disableAjax"> | ||
{{ hiddenInputs|raw }} | ||
<input type="hidden" name="json" value="" /> | ||
<input type="hidden" name="submit_import" value="1" /> | ||
<input type="hidden" name="return_url" value="{{ return_url }}" /> | ||
{% trans %} | ||
Your browser has phpMyAdmin configuration for this domain. Would you like to import it for current session? | ||
{% endtrans %} | ||
<br /> | ||
<a href="#yes">{% trans "Yes" %}</a> | ||
/ <a href="#no">{% trans "No" %}</a> | ||
/ <a href="#delete">{% trans "Delete settings" %}</a> | ||
</form> | ||
</div> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<div class="preview_sql"> | ||
{% if query_data is empty %} | ||
{% trans 'No change' %} | ||
{% elseif query_data is iterable %} | ||
{% for query in query_data %} | ||
{{ Util_formatSql(query) }} | ||
{% endfor %} | ||
{% else %} | ||
{{ Util_formatSql(query_data) }} | ||
{% endif %} | ||
</div> |
Oops, something went wrong.