@@ -33,7 +33,9 module SettingsHelper | |||
|
33 | 33 | choices = [[blank_text.is_a?(Symbol) ? l(blank_text) : blank_text, '']] + choices |
|
34 | 34 | end |
|
35 | 35 | setting_label(setting, options) + |
|
36 | select_tag("settings[#{setting}]", options_for_select(choices, Setting.send(setting).to_s), options) | |
|
36 | select_tag("settings[#{setting}]", | |
|
37 | options_for_select(choices, Setting.send(setting).to_s), | |
|
38 | options) | |
|
37 | 39 | end |
|
38 | 40 | |
|
39 | 41 | def setting_multiselect(setting, choices, options={}) |
@@ -44,10 +46,15 module SettingsHelper | |||
|
44 | 46 | hidden_field_tag("settings[#{setting}][]", '') + |
|
45 | 47 | choices.collect do |choice| |
|
46 | 48 | text, value = (choice.is_a?(Array) ? choice : [choice, choice]) |
|
47 |
content_tag( |
|
|
48 | check_box_tag("settings[#{setting}][]", value, Setting.send(setting).include?(value)) + text.to_s, | |
|
49 | content_tag( | |
|
50 | 'label', | |
|
51 | check_box_tag( | |
|
52 | "settings[#{setting}][]", | |
|
53 | value, | |
|
54 | Setting.send(setting).include?(value) | |
|
55 | ) + text.to_s, | |
|
49 | 56 | :class => 'block' |
|
50 | ) | |
|
57 | ) | |
|
51 | 58 | end.join |
|
52 | 59 | end |
|
53 | 60 | |
@@ -64,7 +71,7 module SettingsHelper | |||
|
64 | 71 | def setting_check_box(setting, options={}) |
|
65 | 72 | setting_label(setting, options) + |
|
66 | 73 | hidden_field_tag("settings[#{setting}]", 0) + |
|
67 | check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options) | |
|
74 | check_box_tag("settings[#{setting}]", 1, Setting.send("#{setting}?"), options) | |
|
68 | 75 | end |
|
69 | 76 | |
|
70 | 77 | def setting_label(setting, options={}) |
General Comments 0
You need to be logged in to leave comments.
Login now