Add settings for max tree depth and exclusion path.
Fixes T8
This commit is contained in:
parent
05ded3b757
commit
53b593400c
4 changed files with 21 additions and 2 deletions
3
conf/default.php
Normal file
3
conf/default.php
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
$conf['treedepth'] = 3;
|
||||
$conf['exclusion_mask'] = '/sidebar|wiki(.*)/';
|
8
conf/metadata.php
Normal file
8
conf/metadata.php
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
$meta['treedepth'] = array(
|
||||
'numeric'
|
||||
);
|
||||
|
||||
$meta['exclusion_mask'] = array(
|
||||
'string'
|
||||
);
|
3
lang/en/settings.php
Normal file
3
lang/en/settings.php
Normal file
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
$lang['treedepth'] = 'The maximum depth the navigation tree will be rendered';
|
||||
$lang['exclusion_mask'] = 'Hide the pages matching this regexp';
|
|
@ -22,12 +22,17 @@ require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'objectrepresentation' .
|
|||
class syntax_plugin_navigation extends DokuWiki_Syntax_Plugin
|
||||
{
|
||||
|
||||
// TODO add a config option for this
|
||||
private $maxDepth = 3;
|
||||
private $depth = 0;
|
||||
|
||||
/** @var string A regexp to configure which pages to exclude */
|
||||
private $exclusion_mask = '/sidebar/';
|
||||
private $exclusion_mask = '';
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->exclusion_mask = $this->getConf('exclusion_mask');
|
||||
$this->maxDepth = $this->getConf('treedepth');
|
||||
}
|
||||
|
||||
function getInfo()
|
||||
{
|
||||
|
|
Reference in a new issue