From ad59cb9c2026d3f27869599dd2337f718a1332d1 Mon Sep 17 00:00:00 2001 From: Hugues Peccatte Date: Fri, 17 Jul 2015 23:22:11 +0200 Subject: Templating header location. Signed-off-by: Hugues Peccatte --- libraries/core.lib.php | 24 ++++--------------- templates/header_location.phtml | 21 +++++++++++++++++ test/libraries/core/PMA_headerLocation_test.php | 31 +++++++++---------------- 3 files changed, 36 insertions(+), 40 deletions(-) create mode 100644 templates/header_location.phtml diff --git a/libraries/core.lib.php b/libraries/core.lib.php index a1f44b3424..f448e18880 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -590,26 +590,10 @@ function PMA_sendHeaderLocation($uri, $use_refresh = false) include_once './libraries/js_escape.lib.php'; PMA_Response::getInstance()->disable(); - echo '- - -' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; - echo '' . "\n"; + include_once './libraries/Template.class.php'; + + echo PMA\Template::get('header_location') + ->render(array('uri' => $uri)); return; } diff --git a/templates/header_location.phtml b/templates/header_location.phtml new file mode 100644 index 0000000000..957441727f --- /dev/null +++ b/templates/header_location.phtml @@ -0,0 +1,21 @@ + + + - - - + + + + + + + + + + \ No newline at end of file diff --git a/test/libraries/core/PMA_headerLocation_test.php b/test/libraries/core/PMA_headerLocation_test.php index 012ba6174b..063c51243e 100644 --- a/test/libraries/core/PMA_headerLocation_test.php +++ b/test/libraries/core/PMA_headerLocation_test.php @@ -257,26 +257,17 @@ class PMA_HeaderLocation_Test extends PHPUnit_Framework_TestCase $testUri_html = htmlspecialchars($testUri); $testUri_js = PMA_escapeJsString($testUri); - $header = "- - -\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n" . - "\n"; + $header = "- - - + " + . "" + . "" + . "" + . " +"; $this->expectOutputString($header); -- cgit v1.2.3