From 9ac51e0523c97a5ef1581d01efe61a279ad95872 Mon Sep 17 00:00:00 2001 From: "Marcel Kapfer (mmk2410)" Date: Thu, 29 Dec 2016 21:59:55 +0100 Subject: [PATCH] Improved testability of BlogListGenerator --- index.php | 4 ++-- res/php/BlogListGenerator.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 02e6d8a..cf4b1c2 100644 --- a/index.php +++ b/index.php @@ -195,7 +195,7 @@ if ($config["design"]["drawer"] == "on") { if ($getblog == "") { // Run when on main blog if ($navblog != "main.md") { // excluding main blog // creating navigation item - BlogListGenerator::listBlog( + echo BlogListGenerator::listBlog( "./blogs/", $navblog, $config["blog"]["title"] @@ -206,7 +206,7 @@ if ($config["design"]["drawer"] == "on") { // -> this blog will be excluded if ($getblog . ".md" != $navblog) { // creating navigation item - BlogListGenerator::listBlog( + echo BlogListGenerator::listBlog( "./blogs/", $navblog, $blogmaintitle diff --git a/res/php/BlogListGenerator.php b/res/php/BlogListGenerator.php index dc959dd..6666fc9 100644 --- a/res/php/BlogListGenerator.php +++ b/res/php/BlogListGenerator.php @@ -64,7 +64,7 @@ class BlogListGenerator $itemurl = substr($blog, 6, strpos($blog, "\n") - 6); $atag = "$itemname"; } - echo $atag; + return $atag; } /**