Message Box for admin config pages

Posts from previous Beta sessions

Message Box for admin config pages

Postby Vlorn » Fri Dec 07, 2007 4:42 am

Is there anyway to add a message box to the bottom of a dynamically created addon config page? I'd like to add simple instructions below each page. It's obviously simple enoough to do with my external linked admin pages but I don't see anyway to do it with the dynamic pages.


-Vlorn
User avatar
Vlorn
WR.net Apprentice
WR.net Apprentice
 
Posts: 29
Joined: Tue Jul 04, 2006 7:57 pm

Message Box for admin config pages

Postby zanix » Fri Dec 07, 2007 5:25 am

Just to the top atm

Make a file called config.func.php in your admin folder in your addon
Make a function called topBox() and have it return what you need
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: 5543
Joined: Mon Jul 03, 2006 8:29 am
Location: Idaho Falls, Idaho
Realm: Doomhammer (PvE) - US

Message Box for admin config pages

Postby PleegWat » Fri Dec 07, 2007 6:20 am

Alternatively, you can use the box model to create two boxes on each config page, and set the bottom one as sourced by a function that contains the data. You could reuse the same function for all pages, but you'll need to duplicate the structure lines.

form parent - form name - form type
menu - my_page - page{1
my_page - config_box - blockframe
config_box - ...
(all your settings under config_box)
my_page - comment_box - function{myfuncname

Create a function called myfuncname which returns your information, including the surrounding box.
Alternatively:

my_page - comment_box - pageframe{1
comment_box - comment_text - function{myfuncname

and have myfuncname return just the text.

You can consult the roster config formtypes for examples, specifically the menu page uses the box model. The function formtype for blocks isn't used anywhere at the moment, so they may not work - please report back if you can't get them to work.
There should be documentation about this stuff somewhere too.
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: Message Box for admin config pages

Postby Vlorn » Fri Dec 07, 2007 2:19 pm

Zanix,
I understand what you've suggested, but I'm not sure how to make the topbox display info relative to the config page, IE Main Player and Guild config menus.

PleegWat,
What you seem to be describing is closer to what I need, I'd really prefer the boxes below the actula menu options, but I have no idea how to implement what you've suggested.

-Vlorn
User avatar
Vlorn
WR.net Apprentice
WR.net Apprentice
 
Posts: 29
Joined: Tue Jul 04, 2006 7:57 pm

Message Box for admin config pages

Postby boyo » Sat Dec 08, 2007 1:20 pm

If i'm understanding what he is saying, you could just put the function at the end of your list for each page, but it would still show above the save button.
boyo
Roster AddOn Dev
Roster AddOn Dev
 
Posts: 103
Joined: Wed Jan 24, 2007 7:37 am

Message Box for admin config pages

Postby PleegWat » Sat Dec 08, 2007 7:36 pm

Not quite.

You need to add a layer between the menu and the actual settings.

Instead of setting the config entry 'mypage' with parent 'menu' to config_type 'blockframe', you set it to config_type 'page{1'
You then add an extra entry 'myblock' with 'mypage' as parent, and config_type 'blockframe'
You set the config settings with 'myblock' as parent
You add the function with 'mypage' as parent.
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


Return to Archived

Who is online

Users browsing this forum: Majestic-12 [Bot] and 0 guests

cron