[Moin-user] Customize navi_bar per group?

R.Bauer rb.proj at gmail.com
Tue Oct 7 09:23:58 EDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steve Lianoglou schrieb:
> Hi all,
> 
> I was curious if there was anyway we can define custom "navi_bar" elements on a
> per group basis?
> 
> I can set which quicklinks appear in the navigation bar on a wiki-wide basis,
> and I know each user can specify their own quicklinks they'd like through their
> preferences, but perhaps sometimes it would be nice to customize the interface
> (these links specificaly for now) bases on *Group inclusion.
> 
> Is that currently possible (btw, I'm using moin 1.7.2)?
> 
> Thanks,
> -steve

Hi

You mean you want to add a different navibar dependent on member of a group?

If so the answer is no - not implemented yet.

But it is not difficult to do this. If you look into the theme navibar
code it looks like:

# Process config navi_bar
        if request.cfg.navi_bar:
            for text in request.cfg.navi_bar:
                pagename, link = self.splitNavilink(text)
                if pagename == current:
                    cls = 'wikilink current'
                else:
                    cls = 'wikilink'
                items.append(item % (cls, link))
                found[pagename] = 1


You can add there another requirement, something like this:
(or you extend the user object by a method which get's the dependent
entries)

pagename = u'WhateverGroup'
user_group = wikidicts.Group(request, pagename)
members = user_group.members()
if request.user.name in members:
....

lot's of examples at:
http://moinmo.in/MoinAPI/Beispiele

cheers
Reimar



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFI62Lt5aOc3Q9hk/kRAvdEAJ95Yx/SVGTxD9JRoZBVmNSVYe4+0QCeOfzk
PWklFMgTLDeKXwQ7z28H4r0=
=6Oq3
-----END PGP SIGNATURE-----





More information about the Moin-user mailing list