Extension talk:DynamicTabs

Please report new issues at the bug tracker: http://code.google.com/p/micke/issues/list

suggestion to hide new tabs from users
Hi, I tried your current extension and realized that when I create a new tab (internal link) it cannot bei hidden from a user even when I add the tabs descriptor to hideUser-section

I suggest a simple solution, which already works within my testwiki fine:

I relocated the code section for intLinks (if-block) within DynamicTabs line 72 on top of the function dynamicTabs just before the hideUser -if-block (line 37). The problem was that the function first reads which tab to hide and then it creates the new tab, so from my point of view the order was wrong. So I just switched the order. My example: I created a new tab ToDos (which points to a page with some todo-items) which should only be seen by sysops not by anyone else and it works. --Pianorob 16:07, 26 June 2009 (UTC)
 * Thanks for your suggestion, I'll look in to it when I have some more time (currently on vacation). It definitly looks like the way to go. MiCkE 18:23, 26 June 2009 (UTC)
 * Come to think of it, if you post the code (or a link to it) I could put it up on googlecode more speedily. MiCkE 08:05, 27 June 2009 (UTC)
 * I changed the code per this suggestion when I fixed the bug below, so it works properly in v 0.3.MiCkE 09:26, 9 July 2009 (UTC)

Hi Micke: this is the code part I modified to my needs, you see I also included some user groups, so that this new tab can only be seen by them, not by normal logged-in users: --Pianorob 13:52, 13 July 2009 (UTC)


 * Yupp, this is pretty much what I fixed in the last revision, although I moved up all the loops, not just the intLinks. MiCkE 18:06, 13 July 2009 (UTC)

Small issue with DPL
For some reason, I was getting this error at the top of a page when DPL was used on a page while DynamicTabs was enabled:

Notice: Undefined offset: 0 in /homepages/39/d204873744/htdocs/wiki/wiki/extensions/DynamicTabs/DynamicTabs.php on line 36

There didn't seem to be any problem with DynamicTabs not working, but since I couldn't figure out how to hide the error, I just commented out lines 36 through 84 in DynamicTabs.php and it went away. DynamicTabs still appears to function correctly. DPL was returning articles from a category. The error went away when I removed the DPL section, and returned when I added the DPL section. I use DPL on other pages without any problem. Any clue what could have caused this? What do these lines do exactly? --PicklePower 02:46, 9 July 2009 (UTC)
 * Line 36-84 displays the "namespace-tabs" and tabs with arbitrary external and internal links. After doing some googleing it seems that the error has something to do with the foreach-loops and the array of tabs. Could you please post the contents of your MediaWiki:DynamicTabs here below? MiCkE 08:22, 9 July 2009 (UTC)
 * Never mind, I was able to reproduce the bug and I fixed it so it works in my test wiki with the trunk version of DPL. I'd be greatful if you would download the new code and confirm that it works. MiCkE 09:26, 9 July 2009 (UTC)

Just a little request
How could I realize the "hide-edit" tab while showing "new-section" tab based on different groups or namespaces? Is it possible to manage custom groups? Or different namespaces? --Federicodip 20:13, 8 August 2009 (UTC)
 * I don't understand exactly what you mean, could you please elaborate, perhaps by giving an example? MiCkE 08:43, 9 August 2009 (UTC)
 * I'll try to explain better: there are two tabs on the tab section, one with a + sign (edit&section=new) and the normal edit tab. In my wiki I created custom groups named "members" and "management" added to the default "users", "sysop" and managed different user rights for the different groups (the gerarchy is sysop>management>soci>users>anonimous). I also created new custom namespaces (private area, members area...) reserved to the different groups (using Lockdown Extension). Now my purpose was to hide the edit tab from some discussion namespaces, but mantaining visible the edit&section=new tab. I also wanted to perform this action only for some groups (users and members but not for sysops & management). Thank you.--Federicodip 11:06, 9 August 2009 (UTC)
 * I don't think I'll implement per group hiding/adding of tabs just yet (sysops aside), but it is definitly on the wish list for the future (and if someone wanted to supplay a patch I'd be happy to add it to the package right away). It is possible to hide the "add new section" though, if someone wants to know, just add #addsection to the list of tabs to be hidden. MiCkE 18:56, 10 August 2009 (UTC)

Manage Tabs for Anonymous user
I need to be able to manage the tabs for the Anonymous user too. Here are the code modifications I did for that:

and then in the next function:


 * Nice, I'll look in to this and merge your code with mine (that I recently got into svn over at Google code). FYI I am thinking about how to implement dynamic tabs for an arbitrary number of custom groups as well. If any one of you have any idea as how to go about doing this I'd be greatfull. MiCkE 14:07, 1 October 2009 (UTC)
 * I added this section as version 0.5 MiCkE 19:52, 1 October 2009 (UTC)

Bugs in code
I am refering to version 0.5.1.
 * Line 25: Namespace should read MWNamespace
 * Line 28: Namespace should read MWNamespace
 * Function getTabsConfig consistently has $OrganizedArray which should read $organizedArray
 * So long as the configuration page is empty there still is an uninitialized variable $organizedArray in the code which may lead to pollution of the template if PHP error messages are activated
 * The code with the comment "ul-tag needs a child element li in order to validate" produces an unwanted empty tag in my case and thus I moved the return true before this to remove it.