Only take action if the current page is not included in a namespace
This is to avoid recursive children pages creation, a future update will handle this in a smarter way.
This commit is contained in:
parent
ec2433d044
commit
a1c1c23c45
1 changed files with 5 additions and 0 deletions
|
@ -27,6 +27,7 @@ class action_plugin_childrenpages extends DokuWiki_Action_Plugin {
|
|||
* @param Doku_Event $event
|
||||
*/
|
||||
public function addMenuItem(Doku_Event $event) : void {
|
||||
global $INFO;
|
||||
// Check that this method has been called in the expected context
|
||||
if ( $event->name !== 'MENU_ITEMS_ASSEMBLY' ) {
|
||||
$message = "Tabpage plugin error:";
|
||||
|
@ -38,6 +39,10 @@ class action_plugin_childrenpages extends DokuWiki_Action_Plugin {
|
|||
if ( $event->data['view'] !== 'page' ) {
|
||||
return;
|
||||
}
|
||||
// Only add links if the current page is not included in a namespace
|
||||
if ( ! empty($INFO['namespace']) ) {
|
||||
return;
|
||||
}
|
||||
trigger_error('addMenuItem() not implemented in '.get_class($this), E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue