diff --git a/action.php b/action.php index a97fc81..dccc97c 100644 --- a/action.php +++ b/action.php @@ -40,17 +40,19 @@ class action_plugin_childrenpages extends DokuWiki_Action_Plugin { if ( $event->data['view'] !== 'page' ) { return; } + // Check if all links should be shown, or if the one to the current page shoud be excluded + $show_all_links = (bool) $this->getConf('show_link_to_current_page'); // If the current page is included in a reserved namespace, add a link back to main page $children_types = $this->getConf('children_list'); $top_namespace = $this->getTopLevelNamespace(); $is_child_page = in_array($top_namespace, $children_types); - if ( $is_child_page ) { + if ( $show_all_links || $is_child_page ) { $main_label = $this->getLang('btn_main'); $this->addMenuItem($event, '_main', $main_label, $top_namespace); } // Add menu items for each child page foreach ( $children_types as $child_type ) { - if ( $child_type !== $top_namespace ) { + if ( $show_all_links || $child_type !== $top_namespace ) { $child_label = $this->getLang("btn_$child_type"); $this->addMenuItem($event, $child_type, $child_label, $is_child_page); } diff --git a/conf/default.php b/conf/default.php index 611cbb3..94c2d59 100644 --- a/conf/default.php +++ b/conf/default.php @@ -1,3 +1,4 @@