1 | {literal} |
---|
2 | <script type="text/javascript"> |
---|
3 | |
---|
4 | //global var ; need to not have to initialize them every time a value is changed |
---|
5 | var objlang; |
---|
6 | var objnames = new Array('imenbartit', 'igentexuser', 'igentexguest', 'inotpubrestex'); |
---|
7 | var objinput = new Array(); //input text from form => objinput[name] |
---|
8 | var objhidden = new Array(); //input hidden from form => objhidden[name][lang] |
---|
9 | |
---|
10 | |
---|
11 | function change_color(inputzone, colorsquare) |
---|
12 | { |
---|
13 | var objinp = document.getElementById(inputzone); |
---|
14 | var objcol = document.getElementById(colorsquare); |
---|
15 | var colvalue = objinp.value; |
---|
16 | |
---|
17 | while(colvalue.length<6) { colvalue+='0'; } |
---|
18 | |
---|
19 | objcol.style.background = '#'+colvalue; |
---|
20 | } |
---|
21 | |
---|
22 | function change_width(inputzone, widthbar) |
---|
23 | { |
---|
24 | var objinp = document.getElementById(inputzone); |
---|
25 | var objbar = document.getElementById(widthbar); |
---|
26 | objbar.style.width = objinp.value+'px'; |
---|
27 | } |
---|
28 | |
---|
29 | function init() |
---|
30 | { |
---|
31 | objlang = document.getElementById('islang'); |
---|
32 | for(i=0;i<objnames.length;i++) |
---|
33 | { |
---|
34 | objinput[i] = document.getElementById(objnames[i]); |
---|
35 | objhidden[i] = new Array(); |
---|
36 | for(j=0;j<objlang.options.length;j++) |
---|
37 | { |
---|
38 | objhidden[i][j] = document.getElementById(objnames[i]+'_'+objlang.options[j].value); |
---|
39 | } |
---|
40 | } |
---|
41 | } |
---|
42 | |
---|
43 | function change_lang() |
---|
44 | { |
---|
45 | for(i=0;i<objnames.length;i++) |
---|
46 | { |
---|
47 | objinput[i].value = objhidden[i][objlang.options.selectedIndex].value; |
---|
48 | } |
---|
49 | } |
---|
50 | |
---|
51 | function apply_changes(input_id) |
---|
52 | { |
---|
53 | var obj=document.getElementById(input_id); |
---|
54 | objhidden[objnames.indexOf(input_id)][objlang.options.selectedIndex].value = obj.value; |
---|
55 | |
---|
56 | } |
---|
57 | |
---|
58 | </script> |
---|
59 | {/literal} |
---|
60 | |
---|
61 | |
---|
62 | <form method="post" action="" class="general"> |
---|
63 | |
---|
64 | <fieldset > |
---|
65 | <legend>{'mypolls_poll_display_config'|@translate}</legend> |
---|
66 | <table class="formtable" > |
---|
67 | <tr> |
---|
68 | <td>{'mypolls_config_color_bars'|@translate}</td> |
---|
69 | <td> |
---|
70 | <input type="text" name="f_mypolls_color_bars" size="6" |
---|
71 | value="{$datas.MYPOLLS_CFG_COLOR_BARS}" maxlength="6" id="idz1" |
---|
72 | onkeyup="change_color('idz1', 'ids1');change_color('idz1', 'ids4')"/> |
---|
73 | </td> |
---|
74 | <td> |
---|
75 | <div id="ids1" style="display:block;width:15px;height:15px;border:0px;background-color:#{$datas.MYPOLLS_CFG_COLOR_BARS};"/> |
---|
76 | </td> |
---|
77 | </tr> |
---|
78 | |
---|
79 | <tr> |
---|
80 | <td>{'mypolls_config_maxbarwidth'|@translate}</td> |
---|
81 | <td> |
---|
82 | <input type="text" name="f_mypolls_maxbarwidth" value="{$datas.MYPOLLS_CFG_MAXBARWIDTH}" |
---|
83 | maxlength="4" size="6" id="idz4" onkeyup="change_width('idz4', 'ids4')"/> |
---|
84 | </td> |
---|
85 | <td> |
---|
86 | <div id="ids4" style="display:block;width:{$datas.MYPOLLS_CFG_MAXBARWIDTH}px;height:8px;top:3px;border:0px;background-color:#{$datas.MYPOLLS_CFG_COLOR_BARS}"/> |
---|
87 | </td> |
---|
88 | </tr> |
---|
89 | |
---|
90 | <tr> |
---|
91 | <td>{'mypolls_config_display_type'|@translate}</td> |
---|
92 | <td colspan="2"> |
---|
93 | <select name="f_mypolls_display_type_default"> |
---|
94 | {html_options values=$mypolls_display_list_values output=$mypolls_display_list_labels selected=$mypolls_display_selected} |
---|
95 | </select> |
---|
96 | </td> |
---|
97 | </tr> |
---|
98 | |
---|
99 | </table> |
---|
100 | </fieldset> |
---|
101 | |
---|
102 | <fieldset> |
---|
103 | <legend>{'mypolls_integration_config'|@translate}</legend> |
---|
104 | |
---|
105 | {if isset($mypolls_language_list) and count($mypolls_language_list)} |
---|
106 | {foreach from=$mypolls_language_list key=name item=mypolls_language_row} |
---|
107 | <input type="hidden" name="f_mypolls_menubar_title_{$mypolls_language_row.LANG}" |
---|
108 | id="imenbartit_{$mypolls_language_row.LANG}" value="{$mypolls_language_row.MENUBARTIT}"> |
---|
109 | <input type="hidden" name="f_mypolls_generic_text_users_{$mypolls_language_row.LANG}" |
---|
110 | id="igentexuser_{$mypolls_language_row.LANG}" value="{$mypolls_language_row.GENTEXUSER}"> |
---|
111 | <input type="hidden" name="f_mypolls_generic_text_guests_{$mypolls_language_row.LANG}" |
---|
112 | id="igentexguest_{$mypolls_language_row.LANG}" value="{$mypolls_language_row.GENTEXGUEST}"> |
---|
113 | <input type="hidden" name="f_mypolls_not_public_results_{$mypolls_language_row.LANG}" |
---|
114 | id="inotpubrestex_{$mypolls_language_row.LANG}" value="{$mypolls_language_row.NOTPUBRESTEX}"> |
---|
115 | {/foreach} |
---|
116 | {/if} |
---|
117 | |
---|
118 | <table class="formtable"> |
---|
119 | <tr> |
---|
120 | <td>{'mypolls_config_language'|@translate}</td> |
---|
121 | <td> |
---|
122 | <select onchange="change_lang();" id="islang"> |
---|
123 | {html_options values=$mypolls_language_list_values output=$mypolls_language_list_labels selected=$mypolls_language_selected} |
---|
124 | </select> |
---|
125 | </td> |
---|
126 | </tr> |
---|
127 | |
---|
128 | <tr> |
---|
129 | <td>{'mypolls_config_menubar_title'|@translate}</td> |
---|
130 | <td><input type="text" id="imenbartit" value="" maxlength="20" onkeyup="apply_changes('imenbartit');" /></td> |
---|
131 | </tr> |
---|
132 | |
---|
133 | <tr> |
---|
134 | <td>{'mypolls_config_generic_text_users'|@translate}</td> |
---|
135 | <td><input type="text" id="igentexuser" value="" maxlength="250" size="60" onkeyup="apply_changes('igentexuser');" /></td> |
---|
136 | </tr> |
---|
137 | |
---|
138 | <tr> |
---|
139 | <td>{'mypolls_config_generic_text_guests'|@translate}</td> |
---|
140 | <td><input type="text" id="igentexguest" value="" maxlength="250" size="60" onkeyup="apply_changes('igentexguest');" /></td> |
---|
141 | </tr> |
---|
142 | |
---|
143 | <tr> |
---|
144 | <td>{'mypolls_config_not_public_result_text'|@translate}</td> |
---|
145 | <td><textarea id="inotpubrestex" rows="5" cols="60" onkeyup="apply_changes('inotpubrestex');" /></textarea> |
---|
146 | </tr> |
---|
147 | </table> |
---|
148 | </fieldset> |
---|
149 | |
---|
150 | <fieldset> |
---|
151 | <legend>{'mypolls_general_config'|@translate}</legend> |
---|
152 | <table class="formtable" > |
---|
153 | <tr> |
---|
154 | <td>{'mypolls_config_admincolor'|@translate}</td> |
---|
155 | <td><input type="text" name="f_mypolls_admincolor" value="{$datas.MYPOLLS_CFG_ADMINCOLOR}" |
---|
156 | maxlength="6" size="6" id="idz2" onkeyup="change_color('idz2', 'ids2')"/> |
---|
157 | </td> |
---|
158 | <td> |
---|
159 | <div id="ids2" style="display:block;width:15px;height:15px;border:0px;background-color:#{$datas.MYPOLLS_CFG_ADMINCOLOR}"/> |
---|
160 | </td> |
---|
161 | </tr> |
---|
162 | |
---|
163 | <tr> |
---|
164 | <td>{'mypolls_config_mouseovercolor'|@translate}</td> |
---|
165 | <td><input type="text" name="f_mypolls_mouseovercolor" value="{$datas.MYPOLLS_CFG_MOUSEOVERCOLOR}" |
---|
166 | maxlength="6" size="6" id="idz5" onkeyup="change_color('idz5', 'ids5')"/> |
---|
167 | </td> |
---|
168 | |
---|
169 | <td> |
---|
170 | <div id="ids5" style="display:block;width:15px;height:15px;border:0px;background-color:#{$datas.MYPOLLS_CFG_MOUSEOVERCOLOR}"/> |
---|
171 | </td> |
---|
172 | </tr> |
---|
173 | |
---|
174 | <tr> |
---|
175 | <td>{'mypolls_config_nbuser_per_page'|@translate}</td> |
---|
176 | <td><input type="text" name="f_mypolls_nbuser_per_page" value="{$datas.MYPOLLS_CFG_NBUSER_PER_PAGE}" maxlength="4" size="6"/></td> |
---|
177 | </tr> |
---|
178 | |
---|
179 | <tr> |
---|
180 | <td>{'mypolls_config_nbcomment_per_page'|@translate}</td> |
---|
181 | <td><input type="text" name="f_mypolls_nbcomment_per_page" value="{$datas.MYPOLLS_CFG_NBCOMMENT_PER_PAGE}" maxlength="4" size="6"/></td> |
---|
182 | </tr> |
---|
183 | </table> |
---|
184 | </fieldset> |
---|
185 | |
---|
186 | |
---|
187 | <p> |
---|
188 | <input type="submit" value="{'mypolls_do_save'|@translate}" name="submit_save_config"/> |
---|
189 | </p> |
---|
190 | </form> |
---|
191 | |
---|
192 | <script type="text/javascript"> |
---|
193 | init(); |
---|
194 | change_lang(); |
---|
195 | </script> |
---|