From bd477be73648fa5e7642bdb442ed6b968fb19ae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Sun, 6 Oct 2013 17:33:37 -0400 Subject: [PATCH] Merge footer and header into a single file (layout.php) --- templates/app_footer.php | 3 --- templates/{app_header.php => layout.php} | 16 ++++++++++------ vendor/PicoTools/Template.php | 8 ++------ 3 files changed, 12 insertions(+), 15 deletions(-) delete mode 100644 templates/app_footer.php rename templates/{app_header.php => layout.php} (79%) diff --git a/templates/app_footer.php b/templates/app_footer.php deleted file mode 100644 index 6805ce9..0000000 --- a/templates/app_footer.php +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/templates/app_header.php b/templates/layout.php similarity index 79% rename from templates/app_header.php rename to templates/layout.php index b822302..7b40f4e 100644 --- a/templates/app_header.php +++ b/templates/layout.php @@ -3,12 +3,12 @@ - + - - - - + + + + <?= isset($title) ? Helper\escape($title) : 'miniflux' ?> @@ -41,4 +41,8 @@
%s') ?> - %s') ?> \ No newline at end of file + %s') ?> + +
+ + \ No newline at end of file diff --git a/vendor/PicoTools/Template.php b/vendor/PicoTools/Template.php index 3e5effa..e4ec23d 100644 --- a/vendor/PicoTools/Template.php +++ b/vendor/PicoTools/Template.php @@ -45,11 +45,7 @@ function load() } -function layout($template_name, array $template_args = array()) +function layout($template_name, array $template_args = array(), $layout_name = 'layout') { - $output = load('app_header', $template_args); - $output .= load($template_name, $template_args); - $output .= load('app_footer', $template_args); - - return $output; + return load($layout_name, $template_args + array('content_for_layout' => load($template_name, $template_args))); } \ No newline at end of file