Merge branch 'master' of gitlab.cosmocode.de:deutschlaender/sprintdoc-template into spis-master

This commit is contained in:
Silke Pisulla 2017-03-30 10:41:53 +02:00
commit 93c8a202bd
5 changed files with 65 additions and 17 deletions

View file

@ -17,6 +17,7 @@ class Template {
protected $plugins = array(
'sqlite' => null,
'tagging' => null,
'magicmatcher' => null,
);
/**
@ -35,6 +36,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;
}
/**
@ -44,7 +75,9 @@ 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');
}
$this->plugins['tplinc'] = plugin_load('helper', 'tplinc');
}
/**
@ -75,7 +108,14 @@ class Template {
);
}
// fixme add magicmatcher info
if ($this->plugins['magicmatcher']) {
$tabs[] = array(
'id' => 'spr__tab-issues',
'label' => tpl_getLang('tab_issues'),
'tab' => $this->plugins['magicmatcher']->getIssueListHTML(),
'count' => $this->plugins['magicmatcher']->getCountIssues(),
);
}
return $tabs;
}

View file

@ -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;

View file

@ -54,3 +54,7 @@
margin-top: -.5rem;
}
}
.dokuwiki .struct_inlineditor {
z-index: 3;
}

View file

@ -31,6 +31,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';

View file

@ -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');
?>
<html class="edge no-js" lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>">
<head>
@ -301,19 +300,13 @@ $classWideContent = ($ACT === "show") ? "": "wide-content ";
tpl_content(false); /* the main content */
?>
<div class="clearer"></div>
<?php if($showFooter):
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
/* Page Include Hook: pagefooter.txt */
/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + */
?>
<div class="wikipagefooter">
<hr>
<?php tpl_include_page('pagefooter', true, true) ?>
<div class="clearer"></div>
</div>
<?php endif; ?>
<?php
if($ACT == 'show') echo Template::getInstance()->getInclude(
'footer',
'<div class="wikipagefooter"><hr>',
'<div class="clearer"></div></div>'
);
?>
</div><!-- .main-content -->