From 4c92fd582797a11bbbed0c1388b5e47bc12ae85d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Wed, 28 Jun 2017 23:03:45 -0300 Subject: [PATCH] Port templates to Twig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Port export templates to Twig - Port javascript/display template to Twig - Port list templates to Twig Signed-off-by: MaurĂ­cio Meneghini Fauth --- templates/export/alias_add.phtml | 54 ------------------- templates/export/alias_add.twig | 49 +++++++++++++++++ templates/export/alias_item.phtml | 10 ---- templates/export/alias_item.twig | 10 ++++ .../{display.phtml => display.twig} | 4 +- templates/list/item.phtml | 45 ---------------- templates/list/item.twig | 19 +++++++ templates/list/unordered.phtml | 27 ---------- templates/list/unordered.twig | 14 +++++ test/libraries/PMA_FormDisplay_tpl_test.php | 2 +- 10 files changed, 95 insertions(+), 139 deletions(-) delete mode 100644 templates/export/alias_add.phtml create mode 100644 templates/export/alias_add.twig delete mode 100644 templates/export/alias_item.phtml create mode 100644 templates/export/alias_item.twig rename templates/javascript/{display.phtml => display.twig} (86%) delete mode 100644 templates/list/item.phtml create mode 100644 templates/list/item.twig delete mode 100644 templates/list/unordered.phtml create mode 100644 templates/list/unordered.twig diff --git a/templates/export/alias_add.phtml b/templates/export/alias_add.phtml deleted file mode 100644 index 3f29fa9467..0000000000 --- a/templates/export/alias_add.phtml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
- - - - - - - -
- - - - - - - -
diff --git a/templates/export/alias_add.twig b/templates/export/alias_add.twig new file mode 100644 index 0000000000..bc409e60d2 --- /dev/null +++ b/templates/export/alias_add.twig @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
{% trans 'Define new aliases' %}
+ + + + + + + +
+ + + + + + + +
+ + + + + + + +
diff --git a/templates/export/alias_item.phtml b/templates/export/alias_item.phtml deleted file mode 100644 index 3e5b18b757..0000000000 --- a/templates/export/alias_item.phtml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/templates/export/alias_item.twig b/templates/export/alias_item.twig new file mode 100644 index 0000000000..b016861b95 --- /dev/null +++ b/templates/export/alias_item.twig @@ -0,0 +1,10 @@ + + {{ type }} + {{ name }} + + + + + + + diff --git a/templates/javascript/display.phtml b/templates/javascript/display.twig similarity index 86% rename from templates/javascript/display.phtml rename to templates/javascript/display.twig index d037e42b69..12027efc12 100644 --- a/templates/javascript/display.phtml +++ b/templates/javascript/display.twig @@ -1,7 +1,7 @@ \ No newline at end of file + diff --git a/templates/list/item.phtml b/templates/list/item.phtml deleted file mode 100644 index c3efdde8e0..0000000000 --- a/templates/list/item.phtml +++ /dev/null @@ -1,45 +0,0 @@ - -
  • - > - - - - - - - - > - - - - - - - - -
  • diff --git a/templates/list/item.twig b/templates/list/item.twig new file mode 100644 index 0000000000..54b0195aeb --- /dev/null +++ b/templates/list/item.twig @@ -0,0 +1,19 @@ + + + {% if url is defined and url is iterable %} + + {% endif %} + {{ content|raw }} + {% if url is defined and url is iterable %} + + {% endif %} + {% if mysql_help_page is not empty %} + {{ Util_showMySQLDocu(mysql_help_page) }} + {% endif %} + diff --git a/templates/list/unordered.phtml b/templates/list/unordered.phtml deleted file mode 100644 index c65a549af5..0000000000 --- a/templates/list/unordered.phtml +++ /dev/null @@ -1,27 +0,0 @@ - - - > - - - - - $item) ?> - - render($item) - ?> - - - - - \ No newline at end of file diff --git a/templates/list/unordered.twig b/templates/list/unordered.twig new file mode 100644 index 0000000000..11f114e1b4 --- /dev/null +++ b/templates/list/unordered.twig @@ -0,0 +1,14 @@ + + + {% if items is not empty %} + {% for item in items %} + {% if item is not iterable %} + {% set item = {'content': item} %} + {% endif %} + {% include 'list/item.twig' with item only %} + {% endfor %} + {% elseif content is not empty %} + {{ content|raw }} + {% endif %} + diff --git a/test/libraries/PMA_FormDisplay_tpl_test.php b/test/libraries/PMA_FormDisplay_tpl_test.php index 5198ba48e7..c1d2858850 100644 --- a/test/libraries/PMA_FormDisplay_tpl_test.php +++ b/test/libraries/PMA_FormDisplay_tpl_test.php @@ -550,7 +550,7 @@ class PMA_FormDisplay_Tpl_Test extends PHPUnit_Framework_TestCase . '});' . "\n" . 'if (typeof configScriptLoaded !== "undefined"' . ' && configInlineParams) loadInlineConfig();' - . "\n" . '', + . "\n" . ''. "\n", $result ); }