Skip to content

Commit

Permalink
Merge pull request #8 from micgro42/publicOption
Browse files Browse the repository at this point in the history
Add conf option to show non public pages
  • Loading branch information
micgro42 committed Nov 16, 2015
2 parents 97841e0 + b362a9e commit d002aee
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions conf/default.php
Expand Up @@ -2,3 +2,4 @@


$conf['hide_start_pages'] = 1;
$conf['show_only_public'] = 1;
1 change: 1 addition & 0 deletions conf/metadata.php
@@ -1,3 +1,4 @@
<?php

$meta['hide_start_pages'] = array('onoff');
$meta['show_only_public'] = array('onoff');
1 change: 1 addition & 0 deletions lang/de/settings.php
@@ -1,3 +1,4 @@
<?php

$lang['hide_start_pages'] = 'Zeige die Startseite(n) des Wikis nicht an.';
$lang['show_only_public'] = 'Zeige nur öffentliche Seiten an';
1 change: 1 addition & 0 deletions lang/en/settings.php
@@ -1,3 +1,4 @@
<?php

$lang['hide_start_pages'] = 'Hide the startpage of the wiki and its translation namespaces';
$lang['show_only_public'] = 'Show only public pages';
2 changes: 1 addition & 1 deletion plugin.info.txt
@@ -1,7 +1,7 @@
base top
author Andreas Gohr
email gohr@cosmocode.de
date 2015-04-16
date 2015-11-16
name top plugin
desc show the top ten most visited pages
url https://www.dokuwiki.org/plugin:top
6 changes: 5 additions & 1 deletion syntax.php
Expand Up @@ -85,7 +85,11 @@ public function render($mode, Doku_Renderer $renderer, $data) {

$num_items=0;
foreach($list as $item) {
if (auth_aclcheck($item['page'],'',null) < AUTH_READ) continue;
if ($this->getConf('show_only_public')) {
if (auth_aclcheck($item['page'],'',null) < AUTH_READ) continue;
} else {
if (auth_quickaclcheck($item['page']) < AUTH_READ) continue;
}
if (!page_exists($item['page'])) continue;
$num_items = $num_items +1;
$renderer->listitem_open(1);
Expand Down

0 comments on commit d002aee

Please sign in to comment.