how does wowroster sort the addon buttons

Theme, template, layout, or image issues

how does wowroster sort the addon buttons

Postby Grammaton » Fri Feb 22, 2008 6:25 am

Hi,

I want to rearrange the addon buttons on the rosters main page.
I figured out that the addon buttons are some way sorted by the addon folder names.
I tried to rename the addon folders but couldnt find a logical pattern how the sorting works.

Can sbdy tell me how i have to rename the folders so i can bring them in a certain order?

\\Grammaton
Last edited by Grammaton on Fri Feb 22, 2008 6:26 am, edited 1 time in total.
Grammaton
WR.net Apprentice
WR.net Apprentice
 
Posts: 5
Joined: Fri Feb 22, 2008 2:45 am

how does wowroster sort the addon buttons

Postby zanix » Fri Feb 22, 2008 6:51 am

A word of caution on renaming addon folders
Some addons do not use the addon variable for pathing so renaming them could break the addon

As for the sorting, lib/menu.php scans the addon folders looking for a menu.php file inside every addon folder and adds it to an array
There is no sorting, except by the operating system

In Roster 2.0 beta, the menu is completely redesigned and configurable
Read the Forum Rules, the WiKi, and Search before posting!
WoWRoster v2.1 - SigGen v0.3.3.523 - WoWRosterDF
User avatar
zanix
Admin
Admin
WoWRoster.net Dev Team
WoWRoster.net Dev Team
UA/UU Developer
UA/UU Developer
 
Posts: 5546
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Re: how does wowroster sort the addon buttons

Postby Grammaton » Fri Feb 22, 2008 3:21 pm

Thx for your answer zanix.

Basically i like how the lib/menu.php works, but is there some way to add some kind of sorting or do i have to add static entries?

\\\Grammaton

P.S.: I altered the lib/menu.php now.
Addon links are now static.
I just entered code like this
Code: Select all
$addons = '<li><a href=addon_url>link text</a></li>'.'<li><a href=addon_url2>link test 2</a></li>'. ...
Last edited by Grammaton on Fri Feb 22, 2008 4:47 pm, edited 1 time in total.
Grammaton
WR.net Apprentice
WR.net Apprentice
 
Posts: 5
Joined: Fri Feb 22, 2008 2:45 am

how does wowroster sort the addon buttons

Postby PleegWat » Fri Feb 22, 2008 9:46 pm

It is possible to implement sorting.
In the addon/*/menu.php files, add a ['order'] key
In lib/menu.php, after the menu entries have been fetched, use http://php.net/usort to sort the entries according to this key.

I'm not gonna bother writing it out, if someone else feels like it they're welcome.
I <3 /bin/bash
User avatar
PleegWat
WoWRoster.net Dev Team
WoWRoster.net Dev Team
 
Posts: 1636
Joined: Tue Jul 04, 2006 1:43 pm

Re: how does wowroster sort the addon buttons

Postby Grammaton » Fri Feb 22, 2008 11:06 pm

Thank you.

\\Grammaton
Grammaton
WR.net Apprentice
WR.net Apprentice
 
Posts: 5
Joined: Fri Feb 22, 2008 2:45 am


Return to Appearance

Who is online

Users browsing this forum: No registered users and 0 guests

cron