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