From 4cda7126d6ccb9a47b245260d35625c9ff7a6f7e Mon Sep 17 00:00:00 2001 From: Sam Bennett Date: Thu, 28 Jun 2012 10:32:24 +0200 Subject: [PATCH] Added the option to ignore files in root. --- assets/menu.php | 8 +++++++- mdocs.php | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/assets/menu.php b/assets/menu.php index 490e396..5a40db4 100644 --- a/assets/menu.php +++ b/assets/menu.php @@ -55,10 +55,16 @@ function rglob($pattern='*', $flags = 0, $path='') * * @return string $html */ - function generate() + function generate($ignore = false) { $files = $this->rglob('*'.$this->filetype,0,$this->dir); + if($ignore) { + foreach ($files as $k => $v) { + if(is_int($k)) unset($files[$k]); + } + } + $this->html = ""; $this->_list_files($files); diff --git a/mdocs.php b/mdocs.php index 6605fa2..08a960d 100644 --- a/mdocs.php +++ b/mdocs.php @@ -44,6 +44,11 @@ $config->maxlevel = 1; $config->minlevel = 2; +/** +* Ignore files in the root of Docs? +*/ +$config->ignore = true; + /** @@ -104,7 +109,7 @@ $doc = $geshi->parse_codeblocks($doc); // Create Menu: -$menu->generate(); +$menu->generate($config->ignore); // Create TOC: $toc->generate();