From 038d4bfe8d10e79235383d279d00a4b25ecced03 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 15 Feb 2017 16:17:17 +0100 Subject: [PATCH] moved tab generation to PHP, no empty tabs SPR-799 I still don't like the code directly in the template there. I think it should be moved to a helper class. The TOC CSS seems to be broken when there are no tabs right of the TOC. --- lang/en/lang.php | 2 ++ tpl/nav-meta-box.php | 74 ++++++++++++++++++++++++++++---------------- 2 files changed, 49 insertions(+), 27 deletions(-) diff --git a/lang/en/lang.php b/lang/en/lang.php index 20da35f..3ae289b 100755 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -27,6 +27,8 @@ $lang['meta_box_jira_tickets_none'] = 'jira associated tickets found: none'; $lang['meta_box_tags_none'] = 'tags found: none'; $lang['js']['meta_box_toc_none'] = 'no Table of Contents available'; +$lang['tab_tags'] = 'Tags'; + $lang['quality_trigger'] = 'toggle page analysis'; $lang['prefix_tasks'] = 'open tasks: '; diff --git a/tpl/nav-meta-box.php b/tpl/nav-meta-box.php index 4b9390f..05077fb 100755 --- a/tpl/nav-meta-box.php +++ b/tpl/nav-meta-box.php @@ -1,39 +1,59 @@ 'spr__tab-toc', + 'label' => $lang['toc'], + 'tab' => $toc, + 'count' => null, + ); +} + +/** @var helper_plugin_tagging $tags */ +$tags = plugin_load('helper', 'tagging'); +if($tags) { + $tabs[] = array( + 'id' => 'spr__tab-tags', + 'label' => tpl_getLang('tab_tags'), + 'tab' => $tags->tpl_tags(false), + 'count' => null, // FIXME + ); +} + +// fixme add magicmatcher info ?>