From 1f3641a82800e91ebfaed80dcbc1e35a818cf20d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Wed, 15 Mar 2017 18:07:41 +0100 Subject: [PATCH 1/4] Add MagicMatcher Issue list to meta box This adds the issue list to the meta-box. SPR-881 --- Template.php | 11 ++++++++++- css/plugins/magic-matcher.less | 10 ++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Template.php b/Template.php index f1f71f4..68fd351 100644 --- a/Template.php +++ b/Template.php @@ -17,6 +17,7 @@ class Template { protected $plugins = array( 'sqlite' => null, 'tagging' => null, + 'magicmatcher' => null, ); /** @@ -44,6 +45,7 @@ class Template { $this->plugins['sqlite'] = plugin_load('helper', 'sqlite'); if($this->plugins['sqlite']) { $this->plugins['tagging'] = plugin_load('helper', 'tagging'); + $this->plugins['magicmatcher'] = plugin_load('syntax', 'magicmatcher_issuelist'); } } @@ -75,7 +77,14 @@ class Template { ); } - // fixme add magicmatcher info + if ($this->plugins['magicmatcher']) { + $tabs[] = array( + 'id' => 'spr__tab-issues', + 'label' => 'Issues', // FIXME + 'tab' => $this->plugins['magicmatcher']->getIssueListHTML(), + 'count' => $this->plugins['magicmatcher']->getCountIssues(), + ); + } return $tabs; } diff --git a/css/plugins/magic-matcher.less b/css/plugins/magic-matcher.less index 84035fc..6366c45 100755 --- a/css/plugins/magic-matcher.less +++ b/css/plugins/magic-matcher.less @@ -76,6 +76,16 @@ } } + +/* + + + + + in meta box + + + + + */ +#spr__tab-issues { + ul.mmissuelist { + padding-left: 0; + margin-top: 1rem; + } +} + + /* + + + + + in content + + + + + */ a.jiralink { font-size: @font-size-default; From d14ffc9215f2963a812c4057cf8384bc370b9367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Fri, 17 Mar 2017 11:46:12 +0100 Subject: [PATCH 2/4] Raise struct inline editors again above content The alternative would be to give the content etc. a z-index of 0. SPR-899 --- css/plugins/struct.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/css/plugins/struct.less b/css/plugins/struct.less index ccff3f3..34f8512 100755 --- a/css/plugins/struct.less +++ b/css/plugins/struct.less @@ -45,3 +45,7 @@ margin-top: -.5rem; } } + +.dokuwiki .struct_inlineditor { + z-index: 3; +} From 9cae5e77236d47da2ce4eb8636749cb612a11a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Mon, 20 Mar 2017 16:58:22 +0100 Subject: [PATCH 3/4] Make Issues tab-heading translateable --- Template.php | 2 +- lang/en/lang.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Template.php b/Template.php index 68fd351..52d46bd 100644 --- a/Template.php +++ b/Template.php @@ -80,7 +80,7 @@ class Template { if ($this->plugins['magicmatcher']) { $tabs[] = array( 'id' => 'spr__tab-issues', - 'label' => 'Issues', // FIXME + 'label' => tpl_getLang('tab_issues'), 'tab' => $this->plugins['magicmatcher']->getIssueListHTML(), 'count' => $this->plugins['magicmatcher']->getCountIssues(), ); diff --git a/lang/en/lang.php b/lang/en/lang.php index b12f687..d06471c 100755 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -30,6 +30,7 @@ $lang['meta_box_tags_none'] = 'tags found: none'; $lang['js']['meta_box_toc_none'] = 'no Table of Contents available'; $lang['tab_tags'] = 'Tags'; +$lang['tab_issues'] = 'Issues'; $lang['quality_trigger'] = 'toggle page analysis'; From cad2e674423f1c3a46761f737a36e1dd04069565 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 28 Mar 2017 16:55:26 +0200 Subject: [PATCH 4/4] support the tplinc plugin This is a first commit to generally support the plugin and make the page footer use it. More includes should be added at other places. --- Template.php | 31 +++++++++++++++++++++++++++++++ main.php | 25 +++++++++---------------- 2 files changed, 40 insertions(+), 16 deletions(-) diff --git a/Template.php b/Template.php index f1f71f4..b10d973 100644 --- a/Template.php +++ b/Template.php @@ -35,6 +35,36 @@ class Template { */ protected function __construct() { $this->initializePlugins(); + + /** @var \Doku_Event_Handler */ + global $EVENT_HANDLER; + $EVENT_HANDLER->register_hook('PLUGIN_TPLINC_LOCATIONS_SET', 'BEFORE', $this, 'registerIncludes'); + } + + /** + * Makes include position info available to the tplinc plugin + * + * @param \Doku_Event $event + */ + public function registerIncludes(\Doku_Event $event) { + $event->data['footer'] = 'Footer below the page content'; + } + + /** + * Get the content to include from the tplinc plugin + * + * prefix and postfix are only added when there actually is any content + * + * @param string $location + * @param string $pre prepend this before the content + * @param string $post append this to the content + * @return string + */ + public function getInclude($location, $pre = '', $post = '') { + if(!$this->plugins['tplinc']) return ''; + $content = $this->plugins['tplinc']->renderIncludes($location); + if($content === '') return ''; + return $pre . $content . $post; } /** @@ -45,6 +75,7 @@ class Template { if($this->plugins['sqlite']) { $this->plugins['tagging'] = plugin_load('helper', 'tagging'); } + $this->plugins['tplinc'] = plugin_load('helper', 'tplinc'); } /** diff --git a/main.php b/main.php index 2934e3f..e0f96e4 100755 --- a/main.php +++ b/main.php @@ -9,14 +9,13 @@ * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) */ +use dokuwiki\template\sprintdoc\Template; + if (!defined('DOKU_INC')) die(); /* must be run from within DokuWiki */ header('X-UA-Compatible: IE=edge,chrome=1'); $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && !empty($_SERVER['REMOTE_USER']) ); $showSidebar = true; /* */ -$hasFooter = page_findnearest('pagefooter'); -$showFooter = $hasFooter && ($ACT === 'show'); - ?> @@ -277,19 +276,13 @@ $classWideContent = ($ACT === "show") ? "": "wide-content "; tpl_content(false); /* the main content */ ?>
- -
-
- -
-
- + getInclude( + 'footer', + '

', + '
' + ); + ?>