Hi,
how do I reference a preference variable (test_nameX in this example)
in Settings.pm if it is set in my basic.html like this:
[% WRAPPER settingSection %]
[% FOREACH scr = [0 .. 1] %]
[% WRAPPER settingGroup title="PLUGIN_NAME$scr" desc="" %]
<input type="text" class="stdedit" name="test_name[% scr %]"
id="test_name[% scr %]" value="[% prefs.test_name(scr) %]" size="20"
/>
[% END %]
[% END %]
[% END %]
This is what my Settings.pm looks like at the moment, and I guess that
I am quite lost here:
# When save is pressed put the value into prefs
for (my $scr = 0; $scr <= 1; $scr++) {
if ($params->{'saveSettings'} &&
$params->{'test_name'.$scr}) {
my $test_name = $params->{'test_name'.$scr};
$prefs->set('test_name'.$scr, "$test_name");
}
}
# Put the value on the webpage
for (my $scr = 0; $scr <= 1; $scr++) {
$params->{'prefs'}->{'test_name'.$scr} =
$prefs->get('test_name'.$scr);
}
The above code in Settings.pm does not get the correct values for
test_nameX.
What I am trying to do is to have a variable number of settings in my
web interface, e.g. like the alarm clock in which you can add and
remove one or several alarms via the web.
Thanks for any support.
--
m_gustafsson
------------------------------------------------------------------------
m_gustafsson's Profile: http://forums.slimdevices.com/member.php?userid=20104
View this thread: http://forums.slimdevices.com/showthread.php?t=57952
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/plugins