From 4b7b8d4a13ded86e6d45e4914e333ce7ba060166 Mon Sep 17 00:00:00 2001 From: Tilman Kranz Date: Tue, 30 Nov 2021 01:48:11 +0100 Subject: [PATCH] project_header formatting --- linuxfoo-gitlab.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/linuxfoo-gitlab.php b/linuxfoo-gitlab.php index 03cf0b0..44e0a02 100644 --- a/linuxfoo-gitlab.php +++ b/linuxfoo-gitlab.php @@ -28,6 +28,14 @@ class LinuxfooGitlab { ''; } + static function project_header($atts, $project) { + return + ''. + __('Gitlab project', 'linuxfoo-gitlab').' '. + ''.$project->name.''. + ''; + } + static function format_since($since) { preg_match('/^([0-9]+)\s+(.*)$/', $since, $m); $num = $m[1]; @@ -243,12 +251,7 @@ class LinuxfooGitlab { $out .= self::error('Project information not readable.'); } else { - $out .= - ''. - __('Gitlab project', 'linuxfoo-gitlab').' '. - ''.$project->name.''. - ''; - + $out .= self::project_header($atts, $project); $out .= self::commits_list($atts, $project_url); $out .= self::releases_list($atts, $project_url); }