1
Goofster
Configoptions: string as value in select formtype
  • 2004/4/7 22:22

  • Goofster

  • Just popping in

  • Posts: 6

  • Since: 2004/4/6 1


heyhey, it's me again :)

I'm using auto-generated preferences for a new module, but instead of '0' or '1' I want 'true' or 'false' as choices for a configuration options.

what is the correct syntax for this? i tried

$modversion['config'][10]['formtype'] = 'select';
$modversion['config'][10]['valuetype'] = 'text';
$modversion['config'][10]['options'] = array('true' => 'true', 'false' => 'false');
$modversion['config'][27]['default'] = 'true';

which doesnt't work....any ideas?

o by the way, I promise I'll write some documentation on all this stuff when I have the time.

Roel

2
Mithrandir
Re: Configoptions: string as value in select formtype

May I be so bold as to ask why? 0 or 1 is an excellent on/off or true/false indicator.

You could use the formtype yesno for a true/false selection -

two things, to get the current thing working would be
1) use $modversion['config'][10] throughout the config
2) use valuetype = 'array' and not text

3
Goofster
Re: Configoptions: string as value in select formtype
  • 2004/4/8 7:42

  • Goofster

  • Just popping in

  • Posts: 6

  • Since: 2004/4/6 1


The application that is in the module (Jirc, java-irc applet (yes I know there is already a pjirc module)) uses true/false for it's variables. I tried converting the moduleconfig array values from 0 to false and 1 to true but that is tricky because you cannot use the value "1" in any configoption anymore. Unless you know a way to find out if a moduleconfig entry is of type 'yesno'

Roel

ps. I'll try the array solution

Login

Who's Online

882 user(s) are online (57 user(s) are browsing Support Forums)


Members: 0


Guests: 882


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits