Current time: 03-20-2010, 09:22 AM Hello There, Guest! (LoginRegister)


Post Reply 
Hide Setings Javascript
06-29-2009, 03:06 AM
Post: #1
Hide Setings Javascript
I'm working on a plugin, my first for mybb, and was wondering if theres some kind of hook or something that I could use to hide irrelevant settings in the plugin's settings depending on the user's selection.

An example of what I'm talking about is the Board Open/Closed settings, when you select closed the text area appears in order to enter the reason, when you select open, the text area disappears.

The only way I've been able to do this is a source edit to load the peekers, but I'd like to avoid editing the source and do it through the plugin if possible.

Any pointers??
Find all posts by this user
Quote this message in a reply
06-29-2009, 08:50 AM (This post was last modified: 06-29-2009 03:11 PM by querschlaeger.)
Post: #2
RE: Hide Setings Javascript
Hi,

it's possible with this two hooks:

admin_config_settings_change
admin_page_output_footer

take a look at this plugin made by me: http://mods.mybboard.net/view/shadowbox
it uses this js-hide-function.

Visit this user's website Find all posts by this user
Quote this message in a reply
06-29-2009, 10:32 PM
Post: #3
RE: Hide Setings Javascript
Thanks! That was great help. Lets see if I can get my plugin released today Wink
Find all posts by this user
Quote this message in a reply
06-29-2009, 10:40 PM
Post: #4
RE: Hide Setings Javascript
Glad to hear that I was able to help.
But: Please do not use the same function names as in my plugin. This would collide and none of our plugins can work togehter...

Visit this user's website Find all posts by this user
Quote this message in a reply
06-29-2009, 11:49 PM (This post was last modified: 06-30-2009 12:16 AM by - G33K -.)
Post: #5
RE: Hide Setings Javascript
(06-29-2009 10:40 PM)querschlaeger Wrote:  Glad to hear that I was able to help.
But: Please do not use the same function names as in my plugin. This would collide and none of our plugins can work togehter...

Yes yes, I know Wink My functions are different
Ok thats done but now I'm stumped with something else:

I have some settings nested, for example:

-Main Switch (on/off) << Hides/Shows all the settings
---Setting 1 (radio: X/Y)
------Sub-Setting 1 dependent on Setting 1, Shown only if Setting 1 == X
---Setting 2 (on/off)
------Sub-Setting 1 dependent on Setting 2, Shown only if Setting 2 is on
...

Individually the show/hide works great, all the settings show hide as they are supposed to, however when I use the master switch to hide then show all the settings, the Subsettings are always shown.
Any work around? I didn't see anything in peeker to make it watch change in 2 different ids
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: