Code Monkey home page Code Monkey logo

simplenavi's Introduction

simplenavi plugin for DokuWiki

Create a simple navigation tree based on namespaces

All documentation for this plugin can be found at
https://www.dokuwiki.org/plugin:simplenavi

If you install this plugin manually, make sure it is installed in
lib/plugins/simplenavi/ - if the folder is called different it
will not work!

Please refer to http://www.dokuwiki.org/extensions for additional info
on how to install extensions in DokuWiki.

----
Copyright (C) Andreas Gohr <[email protected]>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

See the LICENSING file for details

simplenavi's People

Contributors

igittigitt avatar micgro42 avatar splitbrain avatar vkristian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simplenavi's Issues

Is it possible to set the depth of the navigation?

One of my name spaces is a blog feed where all sub documents are posts. If I include the blog namespace in simplenavi, it adds every post in the sidebar and I'd prefer that particular navigation namespace to only show the top level, or somehow provide a dropdown menu or accordion menu so the menu doesn't become overwhelming.

relative namespace with startpage outside the namespace

I really appreciate the simplicity of simplenavi, and there may be a way to do this that I have missed or not tried, but would dit be possible to use simplenavi with a generic form to show only the pages below the current namespace for instances where the landing page for the namespace is outside of the namespace

e.g.

:namespace:
:namespace < page outside namespace

as opposed to

:namespace:start < page Inside namespace which works as expected.

TypeError: array_key_last(): Argument #1 ($array) must be of type array, null given

Since recent update of simplenavi, I get this error whenever I try to click on the first entry of the simplenavi menu:

2023-08-30 10:44:28TypeError: array_key_last(): Argument #1 ($array) must be of type array, null given/srv/www/vhosts/dokuwiki/lib/plugins/simplenavi/syntax.php(121)
    #0 /srv/www/vhosts/dokuwiki/lib/plugins/simplenavi/syntax.php(121): array_key_last(NULL)
    #1 /srv/www/vhosts/dokuwiki/lib/plugins/simplenavi/syntax.php(70): syntax_plugin_simplenavi->getSortedItems('systemen', 1, 0, 1, 1)
    #2 /srv/www/vhosts/dokuwiki/inc/parser/renderer.php(119): syntax_plugin_simplenavi->render('xhtml', Object(Doku_Renderer_xhtml), Array)
    #3 /srv/www/vhosts/dokuwiki/inc/parserutils.php(700): Doku_Renderer->plugin('simplenavi', Array, 5, '{{simplenavi>sy...')
    #4 /srv/www/vhosts/dokuwiki/inc/parserutils.php(158): p_render('xhtml', Array, NULL)
    #5 /srv/www/vhosts/dokuwiki/inc/parserutils.php(96): p_cached_output('/srv/www/vhosts...', 'xhtml', 'systemen:sideba...')
    #6 /srv/www/vhosts/dokuwiki/inc/template.php(1592): p_wiki_xhtml('systemen:sideba...', '', false)
    #7 /srv/www/vhosts/dokuwiki/lib/tpl/bootstrap3/tpl/sidebar.php(33): tpl_include_page('systemen:sideba...', 0, 1, 0)
    #8 /srv/www/vhosts/dokuwiki/lib/tpl/bootstrap3/Template.php(1383): require('/srv/www/vhosts...')
    #9 /srv/www/vhosts/dokuwiki/lib/tpl/bootstrap3/Template.php(1346): dokuwiki\template\bootstrap3\Template->sidebarWrapper('sidebar', 'dokuwiki__aside', 'col-sm-3 col-md...', 'sidebarheader', 'sidebarfooter')
    #10 /srv/www/vhosts/dokuwiki/lib/tpl/bootstrap3/main.php(93): dokuwiki\template\bootstrap3\Template->includeSidebar('left')
    #11 /srv/www/vhosts/dokuwiki/inc/actions.php(27): include('/srv/www/vhosts...')
    #12 /srv/www/vhosts/dokuwiki/doku.php(126): act_dispatch()
    #13 {main}

Support for Move Plugin

Without fully understanding how the Move Plug-in makes its magic work, it seems to expose an integration method to other plugins.

Integrating Simplenavi would make wiki restructuring much faster and easier.

First indentation

Hello,

the first indentation when opening a branch does not work. The objects are placed directly under the parent. This behaviour makes the visual aspect confusing.

thx

Wrong rendering if the name of namespace matches page name

Hi Gents,

I've found a little annoying problem with the rendering order (LI & UL elements) of sub-namespaces.
Condition of the problem: the name of a sub-namespace matches the name of a page.

Consider the following namespaces:

[[**test:**first]]
[[**test:**second]]
[[**test:**second:first]]
[[**test:**third]]

[[**second:**first]]
[[**second:**second]]

Note: the name of 2nd level sub-namespace (test -> second) matches the name of the 1st level "second" namespace.

The list items ought to be rendered in alphabetical order as follows:

  • second->
    • second:first
    • second:second
  • test->
    • test:first
    • test:second->
      • test:second:first
    • test:third

But the plugin renders them this way...

a) IF any page opened in "test" namespace:

image1
Notice the "second:second" page is displayed as first item instead of "second" namespace.

b) IF any page opened in "second" 1st level namespace:

image2
Notice the missing sub-menu for "second" namespace, and as page names from "second" namespace are displayed in reverse order as 1st level items instead of 2nd level items of "second" namespace.

The problem is caused - IMHO - by the fact that a name of a 1st level namespace matches a name of a page name:

  • "second" page name [[test:second]] or [[second:second]] matches to "second" of [[second:]] namespace.

Hope I could clearly demonstrate the issue.

Ciao,
DelD.

Fatal Error after updating plugin simplenavi

Hi,
I use Dokuwiki since ca. 6 years.
And i like the plugin simplenavi, because it makes the navigation so much easy.
Thank you so far.
My Dokuwiki runs in a Synology NAS and it is kept uptodate automaticly.
Now I found out, that some of my plugins need an update manualy.
After updating the plugins (the newest update was simplenavi) I get an error-stack shown in the sidebar, where simplenavi used to be present:
The error-stack:
Fatal error: Uncaught Error: Class 'dokuwiki\File\PageResolver' not found in /volume1/web/dokuwiki/lib/plugins/simplenavi/syntax.php:163 Stack trace: #0 /volume1/web/dokuwiki/inc/search.php(59): syntax_plugin_simplenavi->cbSearch(Array, '/var/services/w...', '/linux', 'd', 1, Array) #1 /volume1/web/dokuwiki/lib/plugins/simplenavi/syntax.php(66): search(Array, '/var/services/w...', Array, Array, '/linux', 1, 'natural') #2 /volume1/web/dokuwiki/inc/parser/renderer.php(117): syntax_plugin_simplenavi->render('xhtml', Object(Doku_Renderer_xhtml), Array) #3 /volume1/web/dokuwiki/inc/parserutils.php(673): Doku_Renderer->plugin('simplenavi', Array, 5, '{{simplenavi>}}') #4 /volume1/web/dokuwiki/inc/parserutils.php(142): p_render('xhtml', Array, NULL) #5 /volume1/web/dokuwiki/inc/parserutils.php(89): p_cached_output('/var/services/w...', 'xhtml', 'sidebar') #6 /volume1/web/dokuwiki/inc/template.php(1580): p_wiki_xhtml('sidebar', '', false) #7 /volume1/web/dokuwiki/lib/tpl/dokuwiki/main.php(42): tpl_include_page('sidebar', true, tr in /volume1/web/dokuwiki/lib/plugins/simplenavi/syntax.php on line 163

Can you help me, please?

Expand Namespaces/Subnamespaces

Hello,

Today, each time we want to go to a subsection, we need to click in one namespace and then navigate to the next one.
Do you think an expanding option is feasible?

image

Thanks!

Sort namespaces by headline of start-page

Namespace lists are currently ordered by their namespace. This leads to strange results, if the option "use_heading" is set and headings differ from namespace-name.

To avoid this, the use_heading option should be honored and if set, the list should be sorted (natural oder ascii) by the headlines of the namespaces start-page.

dokuwiki as string in pagetitle

I made a simple doku and tried to name the page "docker-dokuwiki" and it disapearded in the menu.

If I rename it to "docker-dokuviki" everything is fine. And my page "docker-dokuwiki" could not be found in the search, if I Click on create, the content is displayed in edit mode.

Hide sidebar-page in navigation

I really like this plugin, it looks good, but it does also show the "sidebar" page in the menu, is it possible to hide it?
I could not find an option for something like that.

Hide entries of no read+ permission

How can I hide simplenavi menu entries, if the user has no permission to read the linked page/namespace?

I guess this is a feature request?

ACL is not honered

I've noticed that ACL is not actually honored.

When you set restrictions to a namespace (for example, you want to restrict access to http://yoursite/admin:\* pages), the link is still visible.

To fix that you need to remove $type=='f' && from line 127 of syntax.php resulting this code:

//check ACL
if(auth_quickaclcheck($id) < AUTH_READ){
    return false;
}

It's possible working with sneaky_index fix plugin?

I use sneaky_index fix plugin to show my sitemap,and the result is I want.
But I'll try simplenavi to show my sitemap in sidebar page that result is different from my sitemap.

I use sneaky_index fix to affect ACL,but simplenavi does not been affected

Problem with ÅÄÖ in filenames

We use URL as fnencode and our namespaces contains Å Ä Ö. This makes the index created by simplenavi look strange (wrong characters). Is there any way for us to correct this on our own or could you in some way "translate" the characters via coding? I saw in the built in Dokuwiki index that it shows up correct as ÅÄÖ.

Limit navigation to namespaces

I would like a way to limit the navigation to only namespaces. Some of our pages have a large number of links and it causes the navigation bar to become very long.

Start pages in sidebar in 2018-04-22a "Greebo"

In dokuwiki 2018-04-22a "Greebo" the simplenavi sidebar shows the start pages in a namespace as well as the namespace itself. As a result the sidebar shows both the namespace (as a folder) using the title of the start page and the start itself.
How it was:
simplenavi_old
Simplenavi sidebar in greebo:
simplenavi_greebo

plugin spoils pages since upgrade 2023-08-03 while 2023-01-09 still works

Today I upgraded the simplenavi plugin to 2023-08-03, did not change anything and am left with broken pages: instead of the navbar on the left, there is only a red box with a message

Error: Call to undefined function array_key_last()
An unforeseen error has occured. This is most likely a bug somewhere.
It might be a problem in the simplenavi plugin.
More info has been written to the DokuWiki error log.
and the rest of the page content doesn't show up anymore. The top menu is visible and accessible.

Downgrading only the plugin to 2023-01-09 resolved the issue immediately.
Our dokuwiki is Jack Jackrum since longer, uses the Bootstrap3 template and several plugins, all updated.

The error log, repeated several times, this is the only entry-block

  #0 /var/www/html/dokuwiki/lib/plugins/simplenavi/syntax.php(70): syntax_plugin_simplenavi->getSortedItems('', 1, 1, 1, 1)
  #1 /var/www/html/dokuwiki/inc/parser/renderer.php(119): syntax_plugin_simplenavi->render('xhtml', Object(Doku_Renderer_xhtml), Array)
  #2 /var/www/html/dokuwiki/inc/parserutils.php(700): Doku_Renderer->plugin('simplenavi', Array, 5, '{{simplenavi>}}')
  #3 /var/www/html/dokuwiki/inc/parserutils.php(158): p_render('xhtml', Array, NULL)
  #4 /var/www/html/dokuwiki/inc/parserutils.php(96): p_cached_output('/var/www/html/d...', 'xhtml', 'wiki:navigation')
  #5 /var/www/html/dokuwiki/inc/template.php(1592): p_wiki_xhtml('wiki:navigation', '', false)
  #6 /var/www/html/dokuwiki/lib/tpl/bootstrap3/tpl/sidebar.php(33): tpl_include_page('wiki:navigation', 0, 1, 0)
  #7 /var/www/html/dokuwiki/lib/tpl/bootstrap3/Template.php(1383): require('/var/www/html/d...')
  #8 /var/www/html/dokuwiki/lib/tpl/bootstrap3/Template.php(1346): dokuwiki\template\bootstrap3\Template->sidebarWrapper('wiki:navigation', 'dokuwiki__aside', 'col-sm-3 col-md...', 'sidebarheader', 'sidebarfooter')
  #9 /var/www/html/dokuwiki/lib/tpl/bootstrap3/main.php(93): dokuwiki\template\bootstrap3\Template->includeSidebar('left')
  #10 /var/www/html/dokuwiki/inc/actions.php(27): include('/var/www/html/d...')
  #11 /var/www/html/dokuwiki/doku.php(126): act_dispatch()
  #12 {main}

but this is unfortunately nothing obvious to me, sorry.

BUG: simplenavi is broken under subnamespaces

Scenario:

I created a sidebar page namespace/sidebar with the content:

{{simplenavi>namespace}}

then I created a page index under the subnamespace: namespace:subnamespace:index.

When I access namespace:subnamespace:index, then i get the following error:

Error: Call to undefined function array_key_last()
An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the simplenavi plugin.

More info has been written to the DokuWiki error log.

CleanShot 2023-08-07 at 07 27 42

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.