Skip to content

Commit

Permalink
Merge pull request #17 from gamma/master
Browse files Browse the repository at this point in the history
Add option to only include certain number of pages
  • Loading branch information
Matthias Schulte committed Mar 2, 2015
2 parents 580f0ff + 52981e8 commit b00f849
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugin.info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
base dir
author Jacobus Geluk
email Jacobus.Geluk@gmail.com
date 2013-03-29
date 2014-07-15
name dir
desc Show content of current namespace, including sub namespaces and/or parent/sibling namespaces, in a table or list.
url http://www.dokuwiki.org/plugin:dir
11 changes: 10 additions & 1 deletion syntax.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* - Sebastian Menge
* - Matthias Schulte
* - Geert Janssens
* - Gerry Weißbach
*/

if(!defined('DOKU_INC')) {
Expand Down Expand Up @@ -396,6 +397,11 @@ function _initOpts($flags) {

case "debug":
$this->debug = true;
break;
case "last":
$key = 'maxrows';
$val = intval($val);
break;
}
$this->opts [$key] = $val;
}
Expand Down Expand Up @@ -828,7 +834,10 @@ function _parseOptions($data) {
}

$this->_sortResult();

if ( !empty($this->opts['maxrows']) && $this->opts['maxrows'] > 0 ) {
$this->pages = array_slice($this->pages, 0, $this->opts['maxrows']);
}

return true;
}

Expand Down

0 comments on commit b00f849

Please sign in to comment.