@@ -301,7 +301,7 @@ |
||
301 | 301 | |
302 | 302 | if ($response == '404 NOT FOUND') { |
303 | 303 | form_set_error( |
304 | - 'boinc_translate_transifex_' . ($project == $boinc_name ? 'standard' : 'project') . '_resources', |
|
304 | + 'boinc_translate_transifex_'.($project == $boinc_name ? 'standard' : 'project').'_resources', |
|
305 | 305 | t('Resource %name not found in %project.', |
306 | 306 | array( |
307 | 307 | '%name' => $resource, |
@@ -220,8 +220,7 @@ discard block |
||
220 | 220 | if (!$values['boinc_translate_transifex_pass']) { |
221 | 221 | if (!variable_get('boinc_translate_transifex_pass', '')) { |
222 | 222 | form_set_error('boinc_translate_transifex_pass', t('Password is required.')); |
223 | - } |
|
224 | - else { |
|
223 | + } else { |
|
225 | 224 | unset($form_state['values']['boinc_translate_transifex_pass']); |
226 | 225 | } |
227 | 226 | } |
@@ -260,8 +259,7 @@ discard block |
||
260 | 259 | 'boinc_translate_transifex_pass', |
261 | 260 | t('Transifex authentication failed.') |
262 | 261 | ); |
263 | - } |
|
264 | - else { |
|
262 | + } else { |
|
265 | 263 | $authenticated = TRUE; |
266 | 264 | } |
267 | 265 | } |
@@ -278,14 +276,12 @@ discard block |
||
278 | 276 | ); |
279 | 277 | if ($project_name AND $project_resources) { |
280 | 278 | $transifex_resources[$project_name] = $project_resources; |
281 | - } |
|
282 | - elseif ($project_name AND !$project_resources) { |
|
279 | + } elseif ($project_name AND !$project_resources) { |
|
283 | 280 | drupal_set_message( |
284 | 281 | t('No project-specific resources were provided'), |
285 | 282 | 'warning' |
286 | 283 | ); |
287 | - } |
|
288 | - elseif ($project_resources AND !$project_name) { |
|
284 | + } elseif ($project_resources AND !$project_name) { |
|
289 | 285 | drupal_set_message( |
290 | 286 | t('No project-specific Transifex project name was provided'), |
291 | 287 | 'warning' |
@@ -7,85 +7,85 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | /** |
10 | - * The BOINC translation settings form allows configuration of BTS integration |
|
11 | - * (and other translation related settings) |
|
12 | - */ |
|
10 | + * The BOINC translation settings form allows configuration of BTS integration |
|
11 | + * (and other translation related settings) |
|
12 | + */ |
|
13 | 13 | function boinctranslate_admin_settings(&$form_state) { |
14 | - $form = array(); |
|
15 | - $initialized = FALSE; |
|
16 | - $import_enabled = FALSE; |
|
17 | - $default = array( |
|
14 | + $form = array(); |
|
15 | + $initialized = FALSE; |
|
16 | + $import_enabled = FALSE; |
|
17 | + $default = array( |
|
18 | 18 | 'transifex_user' => variable_get('boinc_translate_transifex_user', ''), |
19 | 19 | 'transifex_pass' => variable_get('boinc_translate_transifex_pass', ''), |
20 | 20 | 'transifex_boinc_name' => variable_get( |
21 | - 'boinc_translate_transifex_standard_name', 'boinc' |
|
21 | + 'boinc_translate_transifex_standard_name', 'boinc' |
|
22 | 22 | ), |
23 | 23 | 'transifex_boinc_resources' => variable_get( |
24 | - 'boinc_translate_transifex_standard_resources', |
|
25 | - "project-generic\nweb" |
|
24 | + 'boinc_translate_transifex_standard_resources', |
|
25 | + "project-generic\nweb" |
|
26 | 26 | ), |
27 | 27 | 'transifex_boinc_drupal_resource' => variable_get( |
28 | - 'boinc_translate_transifex_boinc_drupal_resource', |
|
29 | - 'drupal' |
|
28 | + 'boinc_translate_transifex_boinc_drupal_resource', |
|
29 | + 'drupal' |
|
30 | 30 | ), |
31 | 31 | 'transifex_project_name' => variable_get( |
32 | - 'boinc_translate_transifex_project_name', '' |
|
32 | + 'boinc_translate_transifex_project_name', '' |
|
33 | 33 | ), |
34 | 34 | 'transifex_project_resources' => variable_get( |
35 | - 'boinc_translate_transifex_project_resources', '' |
|
35 | + 'boinc_translate_transifex_project_resources', '' |
|
36 | 36 | ), |
37 | - ); |
|
37 | + ); |
|
38 | 38 | |
39 | - if ($default['transifex_user'] AND $default['transifex_pass']) { |
|
39 | + if ($default['transifex_user'] AND $default['transifex_pass']) { |
|
40 | 40 | if (trim($default['transifex_boinc_resources']) |
41 | 41 | OR trim($default['transifex_project_resources'])) { |
42 | - $import_enabled = TRUE; |
|
42 | + $import_enabled = TRUE; |
|
43 | 43 | } |
44 | 44 | if ($default['transifex_boinc_name'] |
45 | 45 | AND $default['transifex_project_name'] |
46 | 46 | AND trim($default['transifex_boinc_resources']) |
47 | 47 | AND trim($default['transifex_project_resources'])) { |
48 | - $initialized = TRUE; |
|
48 | + $initialized = TRUE; |
|
49 | + } |
|
49 | 50 | } |
50 | - } |
|
51 | 51 | |
52 | - // Define the form |
|
52 | + // Define the form |
|
53 | 53 | |
54 | - $form['transifex'] = array( |
|
54 | + $form['transifex'] = array( |
|
55 | 55 | '#title' => t('Transifex settings'), |
56 | 56 | '#type' => 'fieldset', |
57 | 57 | '#description' => '', |
58 | 58 | '#collapsible' => TRUE, |
59 | 59 | '#collapsed' => $initialized, |
60 | 60 | '#attributes' => array('class' => '') |
61 | - ); |
|
62 | - $form['transifex']['boinc_translate_transifex_user'] = array( |
|
61 | + ); |
|
62 | + $form['transifex']['boinc_translate_transifex_user'] = array( |
|
63 | 63 | '#type' => 'textfield', |
64 | 64 | '#title' => t('User name'), |
65 | 65 | '#default_value' => $default['transifex_user'], |
66 | - ); |
|
67 | - $form['transifex']['boinc_translate_transifex_pass'] = array( |
|
66 | + ); |
|
67 | + $form['transifex']['boinc_translate_transifex_pass'] = array( |
|
68 | 68 | '#type' => 'password', |
69 | 69 | '#title' => t('Password'), |
70 | 70 | '#attributes' => array( |
71 | - 'placeholder' => $default['transifex_pass'] ? '********' : '', |
|
71 | + 'placeholder' => $default['transifex_pass'] ? '********' : '', |
|
72 | 72 | ), |
73 | - ); |
|
74 | - $form['transifex']['boinc_translate_transifex_standard_name'] = array( |
|
73 | + ); |
|
74 | + $form['transifex']['boinc_translate_transifex_standard_name'] = array( |
|
75 | 75 | '#type' => 'textfield', |
76 | 76 | '#title' => t('BOINC Transifex project'), |
77 | 77 | '#default_value' => $default['transifex_boinc_name'], |
78 | 78 | '#description' => t('The portion of the Transifex URL that identifies BOINC.'), |
79 | - ); |
|
80 | - $form['transifex']['boinc_translate_transifex_boinc_drupal_resource'] = array( |
|
79 | + ); |
|
80 | + $form['transifex']['boinc_translate_transifex_boinc_drupal_resource'] = array( |
|
81 | 81 | '#type' => 'textfield', |
82 | 82 | '#title' => t('Official BOINC Drupal Resource'), |
83 | 83 | '#default_value' => $default['transifex_boinc_drupal_resource'], |
84 | 84 | '#description' => t('The portion of the Transifex URL that identifies |
85 | 85 | the standard BOINC Resource to use for translation of the public |
86 | 86 | content defined in the Drupal system.'), |
87 | - ); |
|
88 | - $form['transifex']['boinc_translate_transifex_standard_resources'] = array( |
|
87 | + ); |
|
88 | + $form['transifex']['boinc_translate_transifex_standard_resources'] = array( |
|
89 | 89 | '#type' => 'textarea', |
90 | 90 | '#title' => t('Additional BOINC Resources'), |
91 | 91 | '#default_value' => $default['transifex_boinc_resources'], |
@@ -96,14 +96,14 @@ discard block |
||
96 | 96 | by any matching translations found in Resources further down the list. |
97 | 97 | Note that strings from the Official BOINC Drupal Resource will override |
98 | 98 | any strings from these additional Resources.'), |
99 | - ); |
|
100 | - $form['transifex']['boinc_translate_transifex_project_name'] = array( |
|
99 | + ); |
|
100 | + $form['transifex']['boinc_translate_transifex_project_name'] = array( |
|
101 | 101 | '#type' => 'textfield', |
102 | 102 | '#title' => t('Project-specific Transifex project'), |
103 | 103 | '#default_value' => $default['transifex_project_name'], |
104 | 104 | '#description' => t('The portion of the Transifex URL that identifies this project.'), |
105 | - ); |
|
106 | - $form['transifex']['boinc_translate_transifex_project_resources'] = array( |
|
105 | + ); |
|
106 | + $form['transifex']['boinc_translate_transifex_project_resources'] = array( |
|
107 | 107 | '#type' => 'textarea', |
108 | 108 | '#title' => t('Project-specific Resources'), |
109 | 109 | '#default_value' => $default['transifex_project_resources'], |
@@ -116,241 +116,241 @@ discard block |
||
116 | 116 | NOTE: The first Resource listed here is considered the primary Resource |
117 | 117 | for project-specific translations and will be updated by the "Update |
118 | 118 | project-specific Resources" button below!'), |
119 | - ); |
|
120 | - $form['transifex']['buttons']['submit'] = array( |
|
119 | + ); |
|
120 | + $form['transifex']['buttons']['submit'] = array( |
|
121 | 121 | '#type' => 'submit', |
122 | 122 | '#value' => t('Save configuration'), |
123 | - ); |
|
123 | + ); |
|
124 | 124 | |
125 | - $form['tools'] = array( |
|
125 | + $form['tools'] = array( |
|
126 | 126 | '#title' => t('Tools'), |
127 | 127 | '#type' => 'fieldset', |
128 | 128 | '#description' => '', |
129 | 129 | '#collapsible' => TRUE, |
130 | 130 | '#collapsed' => FALSE, |
131 | 131 | '#attributes' => array('class' => '') |
132 | - ); |
|
133 | - $form['tools']['initialize_languages_text'] = array( |
|
132 | + ); |
|
133 | + $form['tools']['initialize_languages_text'] = array( |
|
134 | 134 | '#type' => 'item', |
135 | 135 | '#title' => t('Install official BOINC languages'), |
136 | 136 | '#value' => t('Installs all languages from the BOINC Transifex project. Also installs missing languages in Drupal. <br>Languages must be enabled manually in Administer > Site configuration > Languages.'), |
137 | - ); |
|
138 | - $form['tools']['initialize_languages'] = array( |
|
137 | + ); |
|
138 | + $form['tools']['initialize_languages'] = array( |
|
139 | 139 | '#type' => 'button', |
140 | 140 | '#value' => t('Install official BOINC languages'), |
141 | 141 | '#executes_submit_callback' => TRUE, |
142 | 142 | '#submit' => array('boinctranslate_admin_settings_initialize_languages'), |
143 | 143 | '#disabled' => !$initialized, |
144 | - ); |
|
145 | - $form['tools']['import_now_text'] = array( |
|
144 | + ); |
|
145 | + $form['tools']['import_now_text'] = array( |
|
146 | 146 | '#type' => 'item', |
147 | 147 | '#title' => t('Import all translations'), |
148 | 148 | '#value' => t('Imports from Tranifex all configured Resources into their respective text groups.'), |
149 | - ); |
|
150 | - $form['tools']['import_now'] = array( |
|
149 | + ); |
|
150 | + $form['tools']['import_now'] = array( |
|
151 | 151 | '#type' => 'button', |
152 | 152 | '#value' => t('Import all translations'), |
153 | 153 | '#executes_submit_callback' => TRUE, |
154 | 154 | '#submit' => array('boinctranslate_admin_settings_import_now'), |
155 | 155 | '#disabled' => !$import_enabled, |
156 | - ); |
|
157 | - $form['tools']['download_boinc_pot_text'] = array( |
|
156 | + ); |
|
157 | + $form['tools']['download_boinc_pot_text'] = array( |
|
158 | 158 | '#type' => 'item', |
159 | 159 | '#title' => t('Download official BOINC-Drupal .pot'), |
160 | 160 | '#value' => t('Downloads the generic BOINC-Drupal .pot file. This is the template file for the boinc text group.'), |
161 | - ); |
|
162 | - $form['tools']['download_boinc_pot'] = array( |
|
161 | + ); |
|
162 | + $form['tools']['download_boinc_pot'] = array( |
|
163 | 163 | '#type' => 'button', |
164 | 164 | '#value' => t('Download official BOINC-Drupal .pot'), |
165 | 165 | '#executes_submit_callback' => TRUE, |
166 | 166 | '#submit' => array('boinctranslate_admin_settings_download_boinc_pot'), |
167 | 167 | '#disabled' => !$import_enabled, |
168 | - ); |
|
169 | - $form['tools']['download_project_pot_text'] = array( |
|
168 | + ); |
|
169 | + $form['tools']['download_project_pot_text'] = array( |
|
170 | 170 | '#type' => 'item', |
171 | 171 | '#title' => t('Download project-specific .pot'), |
172 | 172 | '#value' => t('Downloads the project-specific .pot file. This is the template file for the project text group.'), |
173 | - ); |
|
174 | - $form['tools']['download_project_pot'] = array( |
|
173 | + ); |
|
174 | + $form['tools']['download_project_pot'] = array( |
|
175 | 175 | '#type' => 'button', |
176 | 176 | '#value' => t('Download project-specific .pot'), |
177 | 177 | '#executes_submit_callback' => TRUE, |
178 | 178 | '#submit' => array('boinctranslate_admin_settings_download_project_pot'), |
179 | 179 | '#disabled' => !$import_enabled, |
180 | - ); |
|
181 | - if (user_access('update official BOINC translations')) { |
|
180 | + ); |
|
181 | + if (user_access('update official BOINC translations')) { |
|
182 | 182 | $form['tools']['update_official_boinc_text'] = array( |
183 | - '#type' => 'item', |
|
184 | - '#title' => t('Update official BOINC translations'), |
|
185 | - '#value' => t('Updates the official BOINC-Drupal Resource (translatable strings templates) to the BOINC Transifex project, based on the consolidated imported translations.<br><b>WARNING: Do not use unless you have write-access to the BOINC Transifex project.</b>'), |
|
183 | + '#type' => 'item', |
|
184 | + '#title' => t('Update official BOINC translations'), |
|
185 | + '#value' => t('Updates the official BOINC-Drupal Resource (translatable strings templates) to the BOINC Transifex project, based on the consolidated imported translations.<br><b>WARNING: Do not use unless you have write-access to the BOINC Transifex project.</b>'), |
|
186 | 186 | ); |
187 | 187 | $form['tools']['update_official_boinc'] = array( |
188 | - '#type' => 'button', |
|
189 | - '#value' => t('Update official BOINC translations'), |
|
190 | - '#executes_submit_callback' => TRUE, |
|
191 | - '#submit' => array('boinctranslate_admin_settings_update_official_boinc'), |
|
192 | - '#disabled' => !$import_enabled, |
|
188 | + '#type' => 'button', |
|
189 | + '#value' => t('Update official BOINC translations'), |
|
190 | + '#executes_submit_callback' => TRUE, |
|
191 | + '#submit' => array('boinctranslate_admin_settings_update_official_boinc'), |
|
192 | + '#disabled' => !$import_enabled, |
|
193 | 193 | ); |
194 | - } |
|
195 | - $form['tools']['export_now_text'] = array( |
|
194 | + } |
|
195 | + $form['tools']['export_now_text'] = array( |
|
196 | 196 | '#type' => 'item', |
197 | 197 | '#title' => t('Update project-specific Resources'), |
198 | 198 | '#value' => t('Updates the configured Resources (translatable strings templates) to the project\'s Transifex project.<br><b>WARNING: Do not use unless you have write-access to your project\'s Transifex project.</b>'), |
199 | - ); |
|
200 | - $form['tools']['export_now'] = array( |
|
199 | + ); |
|
200 | + $form['tools']['export_now'] = array( |
|
201 | 201 | '#type' => 'button', |
202 | 202 | '#value' => t('Update project-specific Resources'), |
203 | 203 | '#executes_submit_callback' => TRUE, |
204 | 204 | '#submit' => array('boinctranslate_admin_settings_export_now'), |
205 | 205 | '#disabled' => !$import_enabled, |
206 | - ); |
|
206 | + ); |
|
207 | 207 | |
208 | - $form['#submit'][] = 'system_settings_form_submit'; |
|
209 | - $form['#theme'] = 'system_settings_form'; |
|
208 | + $form['#submit'][] = 'system_settings_form_submit'; |
|
209 | + $form['#theme'] = 'system_settings_form'; |
|
210 | 210 | |
211 | - return $form; |
|
211 | + return $form; |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | function boinctranslate_admin_settings_export_now() { |
215 | - drupal_goto('admin/boinc/translation/export'); |
|
215 | + drupal_goto('admin/boinc/translation/export'); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | function boinctranslate_admin_settings_import_now() { |
219 | - drupal_goto('admin/boinc/translation/import'); |
|
219 | + drupal_goto('admin/boinc/translation/import'); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | function boinctranslate_admin_settings_initialize_languages() { |
223 | - drupal_goto('admin/boinc/translation/initialize-languages'); |
|
223 | + drupal_goto('admin/boinc/translation/initialize-languages'); |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | function boinctranslate_admin_settings_update_official_boinc() { |
227 | - drupal_goto('admin/boinc/translation/update-official-boinc'); |
|
227 | + drupal_goto('admin/boinc/translation/update-official-boinc'); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | function boinctranslate_admin_settings_download_boinc_pot() { |
231 | - drupal_goto('admin/boinc/translation/download-pot/boinc'); |
|
231 | + drupal_goto('admin/boinc/translation/download-pot/boinc'); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | function boinctranslate_admin_settings_download_project_pot() { |
235 | - drupal_goto('admin/boinc/translation/download-pot/project'); |
|
235 | + drupal_goto('admin/boinc/translation/download-pot/project'); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | |
239 | 239 | /** |
240 | - * Validate the BOINC translation settings form. |
|
241 | - */ |
|
240 | + * Validate the BOINC translation settings form. |
|
241 | + */ |
|
242 | 242 | function boinctranslate_admin_settings_validate($form, &$form_state) { |
243 | - $values = $form_state['values']; |
|
244 | - $errors = array(); |
|
245 | - $api_base_url = 'https://www.transifex.com/api/2'; |
|
243 | + $values = $form_state['values']; |
|
244 | + $errors = array(); |
|
245 | + $api_base_url = 'https://www.transifex.com/api/2'; |
|
246 | 246 | |
247 | - if (!$values['boinc_translate_transifex_user']) { |
|
247 | + if (!$values['boinc_translate_transifex_user']) { |
|
248 | 248 | form_set_error('boinc_translate_transifex_user', t('User name is required.')); |
249 | - } |
|
250 | - if (!$values['boinc_translate_transifex_pass']) { |
|
249 | + } |
|
250 | + if (!$values['boinc_translate_transifex_pass']) { |
|
251 | 251 | if (!variable_get('boinc_translate_transifex_pass', '')) { |
252 | - form_set_error('boinc_translate_transifex_pass', t('Password is required.')); |
|
252 | + form_set_error('boinc_translate_transifex_pass', t('Password is required.')); |
|
253 | 253 | } |
254 | 254 | else { |
255 | - unset($form_state['values']['boinc_translate_transifex_pass']); |
|
255 | + unset($form_state['values']['boinc_translate_transifex_pass']); |
|
256 | + } |
|
256 | 257 | } |
257 | - } |
|
258 | - if (!$values['boinc_translate_transifex_standard_name']) { |
|
258 | + if (!$values['boinc_translate_transifex_standard_name']) { |
|
259 | 259 | form_set_error('boinc_translate_transifex_standard_name', |
260 | - t('BOINC Transifex project name is required.') |
|
260 | + t('BOINC Transifex project name is required.') |
|
261 | 261 | ); |
262 | - } |
|
263 | - if (!$values['boinc_translate_transifex_standard_resources']) { |
|
262 | + } |
|
263 | + if (!$values['boinc_translate_transifex_standard_resources']) { |
|
264 | 264 | form_set_error('boinc_translate_transifex_standard_resources', |
265 | - t('At least one BOINC Transifex project Resource is required.') |
|
265 | + t('At least one BOINC Transifex project Resource is required.') |
|
266 | 266 | ); |
267 | - } |
|
268 | - if (!$values['boinc_translate_transifex_project_resources']) { |
|
267 | + } |
|
268 | + if (!$values['boinc_translate_transifex_project_resources']) { |
|
269 | 269 | form_set_error('boinc_translate_transifex_project_resources', |
270 | - t('At least one project-specific Transifex Resource is required.') |
|
270 | + t('At least one project-specific Transifex Resource is required.') |
|
271 | 271 | ); |
272 | - } |
|
272 | + } |
|
273 | 273 | |
274 | - $username = $values['boinc_translate_transifex_user']; |
|
275 | - $password = ($values['boinc_translate_transifex_pass']) ? $values['boinc_translate_transifex_pass'] : variable_get('boinc_translate_transifex_pass', ''); |
|
276 | - $boinc_name = $values['boinc_translate_transifex_standard_name']; |
|
277 | - $boinc_resources = boinctranslate_parse_resources( |
|
274 | + $username = $values['boinc_translate_transifex_user']; |
|
275 | + $password = ($values['boinc_translate_transifex_pass']) ? $values['boinc_translate_transifex_pass'] : variable_get('boinc_translate_transifex_pass', ''); |
|
276 | + $boinc_name = $values['boinc_translate_transifex_standard_name']; |
|
277 | + $boinc_resources = boinctranslate_parse_resources( |
|
278 | 278 | $values['boinc_translate_transifex_standard_resources'] |
279 | - ); |
|
279 | + ); |
|
280 | 280 | |
281 | - if ($username AND $password AND $boinc_name AND $boinc_resources) { |
|
281 | + if ($username AND $password AND $boinc_name AND $boinc_resources) { |
|
282 | 282 | // Test authentication |
283 | 283 | $authenticated = FALSE; |
284 | 284 | $path = "project/{$boinc_name}/resource/{$boinc_resources[0]}/translation/en"; |
285 | 285 | $response = boinctranslate_transifex_request($path, NULL, TRUE, FALSE, $username, $password); |
286 | 286 | |
287 | 287 | if ($response) { |
288 | - if ($response == '401 UNAUTHORIZED') { |
|
288 | + if ($response == '401 UNAUTHORIZED') { |
|
289 | 289 | form_set_error( |
290 | - 'boinc_translate_transifex_pass', |
|
291 | - t('Transifex authentication failed.') |
|
290 | + 'boinc_translate_transifex_pass', |
|
291 | + t('Transifex authentication failed.') |
|
292 | 292 | ); |
293 | - } |
|
294 | - else { |
|
293 | + } |
|
294 | + else { |
|
295 | 295 | $authenticated = TRUE; |
296 | - } |
|
296 | + } |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | if ($authenticated) { |
300 | - // Prepare list of resources to validate |
|
301 | - $transifex_resources = array( |
|
300 | + // Prepare list of resources to validate |
|
301 | + $transifex_resources = array( |
|
302 | 302 | 'boinc' => $boinc_resources, |
303 | - ); |
|
304 | - // Parse project-specific resources |
|
305 | - $project_name = trim($values['boinc_translate_transifex_project_name']); |
|
306 | - $project_resources = boinctranslate_parse_resources( |
|
303 | + ); |
|
304 | + // Parse project-specific resources |
|
305 | + $project_name = trim($values['boinc_translate_transifex_project_name']); |
|
306 | + $project_resources = boinctranslate_parse_resources( |
|
307 | 307 | $values['boinc_translate_transifex_project_resources'] |
308 | - ); |
|
309 | - if ($project_name AND $project_resources) { |
|
308 | + ); |
|
309 | + if ($project_name AND $project_resources) { |
|
310 | 310 | $transifex_resources[$project_name] = $project_resources; |
311 | - } |
|
312 | - elseif ($project_name AND !$project_resources) { |
|
311 | + } |
|
312 | + elseif ($project_name AND !$project_resources) { |
|
313 | 313 | drupal_set_message( |
314 | - t('No project-specific resources were provided'), |
|
315 | - 'warning' |
|
314 | + t('No project-specific resources were provided'), |
|
315 | + 'warning' |
|
316 | 316 | ); |
317 | - } |
|
318 | - elseif ($project_resources AND !$project_name) { |
|
317 | + } |
|
318 | + elseif ($project_resources AND !$project_name) { |
|
319 | 319 | drupal_set_message( |
320 | - t('No project-specific Transifex project name was provided'), |
|
321 | - 'warning' |
|
320 | + t('No project-specific Transifex project name was provided'), |
|
321 | + 'warning' |
|
322 | 322 | ); |
323 | - } |
|
323 | + } |
|
324 | 324 | |
325 | - // Try to access the given resources |
|
326 | - foreach ($transifex_resources as $project => $resources) { |
|
325 | + // Try to access the given resources |
|
326 | + foreach ($transifex_resources as $project => $resources) { |
|
327 | 327 | foreach ($resources as $resource) { |
328 | 328 | |
329 | - $path = "project/{$project}/resource/{$resource}/translation/en"; |
|
330 | - $response = boinctranslate_transifex_request($path); |
|
329 | + $path = "project/{$project}/resource/{$resource}/translation/en"; |
|
330 | + $response = boinctranslate_transifex_request($path); |
|
331 | 331 | |
332 | - if ($response == '404 NOT FOUND') { |
|
332 | + if ($response == '404 NOT FOUND') { |
|
333 | 333 | form_set_error( |
334 | - 'boinc_translate_transifex_' . ($project == $boinc_name ? 'standard' : 'project') . '_resources', |
|
335 | - t('Resource %name not found in %project.', |
|
334 | + 'boinc_translate_transifex_' . ($project == $boinc_name ? 'standard' : 'project') . '_resources', |
|
335 | + t('Resource %name not found in %project.', |
|
336 | 336 | array( |
337 | - '%name' => $resource, |
|
338 | - '%project' => $project, |
|
337 | + '%name' => $resource, |
|
338 | + '%project' => $project, |
|
339 | + ) |
|
339 | 340 | ) |
340 | - ) |
|
341 | 341 | ); |
342 | - } |
|
342 | + } |
|
343 | 343 | } |
344 | - } |
|
344 | + } |
|
345 | + } |
|
345 | 346 | } |
346 | - } |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | /** |
350 | - * Handle post-validation submission of BOINC translation settings form. |
|
351 | - */ |
|
350 | + * Handle post-validation submission of BOINC translation settings form. |
|
351 | + */ |
|
352 | 352 | function boinctranslate_admin_settings_submit($form, &$form_state) { |
353 | - drupal_set_message(t('BOINC translation settings have been updated.')); |
|
353 | + drupal_set_message(t('BOINC translation settings have been updated.')); |
|
354 | 354 | } |
355 | 355 | |
356 | 356 |
@@ -12,8 +12,8 @@ discard block |
||
12 | 12 | */ |
13 | 13 | function boinctranslate_admin_settings(&$form_state) { |
14 | 14 | $form = array(); |
15 | - $initialized = FALSE; |
|
16 | - $import_enabled = FALSE; |
|
15 | + $initialized = false; |
|
16 | + $import_enabled = false; |
|
17 | 17 | $default = array( |
18 | 18 | 'transifex_user' => variable_get('boinc_translate_transifex_user', ''), |
19 | 19 | 'transifex_pass' => variable_get('boinc_translate_transifex_pass', ''), |
@@ -36,16 +36,16 @@ discard block |
||
36 | 36 | ), |
37 | 37 | ); |
38 | 38 | |
39 | - if ($default['transifex_user'] AND $default['transifex_pass']) { |
|
39 | + if ($default['transifex_user'] and $default['transifex_pass']) { |
|
40 | 40 | if (trim($default['transifex_boinc_resources']) |
41 | - OR trim($default['transifex_project_resources'])) { |
|
42 | - $import_enabled = TRUE; |
|
41 | + or trim($default['transifex_project_resources'])) { |
|
42 | + $import_enabled = true; |
|
43 | 43 | } |
44 | 44 | if ($default['transifex_boinc_name'] |
45 | - AND $default['transifex_project_name'] |
|
46 | - AND trim($default['transifex_boinc_resources']) |
|
47 | - AND trim($default['transifex_project_resources'])) { |
|
48 | - $initialized = TRUE; |
|
45 | + and $default['transifex_project_name'] |
|
46 | + and trim($default['transifex_boinc_resources']) |
|
47 | + and trim($default['transifex_project_resources'])) { |
|
48 | + $initialized = true; |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | '#title' => t('Transifex settings'), |
56 | 56 | '#type' => 'fieldset', |
57 | 57 | '#description' => '', |
58 | - '#collapsible' => TRUE, |
|
58 | + '#collapsible' => true, |
|
59 | 59 | '#collapsed' => $initialized, |
60 | 60 | '#attributes' => array('class' => '') |
61 | 61 | ); |
@@ -126,8 +126,8 @@ discard block |
||
126 | 126 | '#title' => t('Tools'), |
127 | 127 | '#type' => 'fieldset', |
128 | 128 | '#description' => '', |
129 | - '#collapsible' => TRUE, |
|
130 | - '#collapsed' => FALSE, |
|
129 | + '#collapsible' => true, |
|
130 | + '#collapsed' => false, |
|
131 | 131 | '#attributes' => array('class' => '') |
132 | 132 | ); |
133 | 133 | $form['tools']['initialize_languages_text'] = array( |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $form['tools']['initialize_languages'] = array( |
139 | 139 | '#type' => 'button', |
140 | 140 | '#value' => t('Install official BOINC languages'), |
141 | - '#executes_submit_callback' => TRUE, |
|
141 | + '#executes_submit_callback' => true, |
|
142 | 142 | '#submit' => array('boinctranslate_admin_settings_initialize_languages'), |
143 | 143 | '#disabled' => !$initialized, |
144 | 144 | ); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $form['tools']['import_now'] = array( |
151 | 151 | '#type' => 'button', |
152 | 152 | '#value' => t('Import all translations'), |
153 | - '#executes_submit_callback' => TRUE, |
|
153 | + '#executes_submit_callback' => true, |
|
154 | 154 | '#submit' => array('boinctranslate_admin_settings_import_now'), |
155 | 155 | '#disabled' => !$import_enabled, |
156 | 156 | ); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $form['tools']['download_boinc_pot'] = array( |
163 | 163 | '#type' => 'button', |
164 | 164 | '#value' => t('Download official BOINC-Drupal .pot'), |
165 | - '#executes_submit_callback' => TRUE, |
|
165 | + '#executes_submit_callback' => true, |
|
166 | 166 | '#submit' => array('boinctranslate_admin_settings_download_boinc_pot'), |
167 | 167 | '#disabled' => !$import_enabled, |
168 | 168 | ); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | $form['tools']['download_project_pot'] = array( |
175 | 175 | '#type' => 'button', |
176 | 176 | '#value' => t('Download project-specific .pot'), |
177 | - '#executes_submit_callback' => TRUE, |
|
177 | + '#executes_submit_callback' => true, |
|
178 | 178 | '#submit' => array('boinctranslate_admin_settings_download_project_pot'), |
179 | 179 | '#disabled' => !$import_enabled, |
180 | 180 | ); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $form['tools']['update_official_boinc'] = array( |
188 | 188 | '#type' => 'button', |
189 | 189 | '#value' => t('Update official BOINC translations'), |
190 | - '#executes_submit_callback' => TRUE, |
|
190 | + '#executes_submit_callback' => true, |
|
191 | 191 | '#submit' => array('boinctranslate_admin_settings_update_official_boinc'), |
192 | 192 | '#disabled' => !$import_enabled, |
193 | 193 | ); |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $form['tools']['export_now'] = array( |
201 | 201 | '#type' => 'button', |
202 | 202 | '#value' => t('Update project-specific Resources'), |
203 | - '#executes_submit_callback' => TRUE, |
|
203 | + '#executes_submit_callback' => true, |
|
204 | 204 | '#submit' => array('boinctranslate_admin_settings_export_now'), |
205 | 205 | '#disabled' => !$import_enabled, |
206 | 206 | ); |
@@ -278,11 +278,11 @@ discard block |
||
278 | 278 | $values['boinc_translate_transifex_standard_resources'] |
279 | 279 | ); |
280 | 280 | |
281 | - if ($username AND $password AND $boinc_name AND $boinc_resources) { |
|
281 | + if ($username and $password and $boinc_name and $boinc_resources) { |
|
282 | 282 | // Test authentication |
283 | - $authenticated = FALSE; |
|
283 | + $authenticated = false; |
|
284 | 284 | $path = "project/{$boinc_name}/resource/{$boinc_resources[0]}/translation/en"; |
285 | - $response = boinctranslate_transifex_request($path, NULL, TRUE, FALSE, $username, $password); |
|
285 | + $response = boinctranslate_transifex_request($path, null, true, false, $username, $password); |
|
286 | 286 | |
287 | 287 | if ($response) { |
288 | 288 | if ($response == '401 UNAUTHORIZED') { |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | ); |
293 | 293 | } |
294 | 294 | else { |
295 | - $authenticated = TRUE; |
|
295 | + $authenticated = true; |
|
296 | 296 | } |
297 | 297 | } |
298 | 298 | |
@@ -306,16 +306,16 @@ discard block |
||
306 | 306 | $project_resources = boinctranslate_parse_resources( |
307 | 307 | $values['boinc_translate_transifex_project_resources'] |
308 | 308 | ); |
309 | - if ($project_name AND $project_resources) { |
|
309 | + if ($project_name and $project_resources) { |
|
310 | 310 | $transifex_resources[$project_name] = $project_resources; |
311 | 311 | } |
312 | - elseif ($project_name AND !$project_resources) { |
|
312 | + elseif ($project_name and !$project_resources) { |
|
313 | 313 | drupal_set_message( |
314 | 314 | t('No project-specific resources were provided'), |
315 | 315 | 'warning' |
316 | 316 | ); |
317 | 317 | } |
318 | - elseif ($project_resources AND !$project_name) { |
|
318 | + elseif ($project_resources and !$project_name) { |
|
319 | 319 | drupal_set_message( |
320 | 320 | t('No project-specific Transifex project name was provided'), |
321 | 321 | 'warning' |
@@ -274,7 +274,7 @@ |
||
274 | 274 | function boincuser_views_handlers() { |
275 | 275 | return array( |
276 | 276 | 'info' => array( |
277 | - 'path' => drupal_get_path('module', 'boincuser') . '/views', |
|
277 | + 'path' => drupal_get_path('module', 'boincuser').'/views', |
|
278 | 278 | ), |
279 | 279 | 'handlers' => array( |
280 | 280 | 'views_handler_argument_boincuser_id' => array( |
@@ -34,16 +34,16 @@ discard block |
||
34 | 34 | // Primary keys allowed as arguments |
35 | 35 | |
36 | 36 | $data['user']['id'] = array( |
37 | - 'title' => bts('Id', array(), NULL, 'boinc:user-id'), |
|
37 | + 'title' => bts('Id', array(), null, 'boinc:user-id'), |
|
38 | 38 | 'help' => t('The BOINC ID of the user account.'), |
39 | 39 | 'field' => array( |
40 | 40 | 'handler' => 'views_handler_field_numeric', |
41 | - 'click sortable' => TRUE |
|
41 | + 'click sortable' => true |
|
42 | 42 | ), |
43 | 43 | 'argument' => array( |
44 | 44 | 'handler' => 'views_handler_argument_boincuser_id', // custom handler |
45 | 45 | 'name field' => 'title', // the field to display in the summary. |
46 | - 'numeric' => TRUE, |
|
46 | + 'numeric' => true, |
|
47 | 47 | 'validate type' => 'id' |
48 | 48 | ), |
49 | 49 | 'filter' => array( |
@@ -54,16 +54,16 @@ discard block |
||
54 | 54 | ) |
55 | 55 | ); |
56 | 56 | $data['user']['teamid'] = array( |
57 | - 'title' => bts('Team ID', array(), NULL, 'boinc:team-id'), |
|
57 | + 'title' => bts('Team ID', array(), null, 'boinc:team-id'), |
|
58 | 58 | 'help' => t('The ID of the user\'s team.'), |
59 | 59 | 'field' => array( |
60 | 60 | 'handler' => 'views_handler_field_numeric', |
61 | - 'click sortable' => TRUE, |
|
61 | + 'click sortable' => true, |
|
62 | 62 | ), |
63 | 63 | 'argument' => array( |
64 | 64 | 'handler' => 'views_handler_argument_boincteam_id', // custom handler |
65 | 65 | 'name field' => 'title', // the field to display in the summary. |
66 | - 'numeric' => TRUE, |
|
66 | + 'numeric' => true, |
|
67 | 67 | 'validate type' => 'id' |
68 | 68 | ), |
69 | 69 | 'filter' => array( |
@@ -77,11 +77,11 @@ discard block |
||
77 | 77 | // Descriptions of general host fields (alphabetized) |
78 | 78 | |
79 | 79 | $data['user']['authenticator'] = array( |
80 | - 'title' => bts('Account Key', array(), NULL, 'boinc:user-info'), |
|
80 | + 'title' => bts('Account Key', array(), null, 'boinc:user-info'), |
|
81 | 81 | 'help' => t('The BOINC account key of the user.'), |
82 | 82 | 'field' => array( |
83 | 83 | 'handler' => 'views_handler_field', |
84 | - 'click sortable' => TRUE |
|
84 | + 'click sortable' => true |
|
85 | 85 | ), |
86 | 86 | 'filter' => array( |
87 | 87 | 'handler' => 'views_handler_filter_string' |
@@ -91,11 +91,11 @@ discard block |
||
91 | 91 | ) |
92 | 92 | ); |
93 | 93 | $data['user']['country'] = array( |
94 | - 'title' => bts('Country', array(), NULL, 'boinc:country-of-origin'), |
|
94 | + 'title' => bts('Country', array(), null, 'boinc:country-of-origin'), |
|
95 | 95 | 'help' => t('The country of the user.'), |
96 | 96 | 'field' => array( |
97 | 97 | 'handler' => 'views_handler_field', |
98 | - 'click sortable' => TRUE |
|
98 | + 'click sortable' => true |
|
99 | 99 | ), |
100 | 100 | 'filter' => array( |
101 | 101 | 'handler' => 'views_handler_filter_string' |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | ) |
106 | 106 | ); |
107 | 107 | $data['user']['create_time'] = array( |
108 | - 'title' => bts('Member since', array(), NULL, 'boinc:user-info'), |
|
108 | + 'title' => bts('Member since', array(), null, 'boinc:user-info'), |
|
109 | 109 | 'help' => t('When the BOINC account was created.'), |
110 | 110 | 'field' => array( |
111 | 111 | 'handler' => 'views_handler_field_date', |
112 | - 'click sortable' => TRUE |
|
112 | + 'click sortable' => true |
|
113 | 113 | ), |
114 | 114 | 'filter' => array( |
115 | 115 | 'handler' => 'views_handler_filter_date' |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | ) |
120 | 120 | ); |
121 | 121 | $data['user']['cross_project_id'] = array( |
122 | - 'title' => bts('CPID', array(), NULL, 'boinc:user-info'), |
|
122 | + 'title' => bts('CPID', array(), null, 'boinc:user-info'), |
|
123 | 123 | 'help' => t('The cross project user identifier.'), |
124 | 124 | 'field' => array( |
125 | 125 | 'handler' => 'views_handler_field', |
126 | - 'click sortable' => TRUE |
|
126 | + 'click sortable' => true |
|
127 | 127 | ), |
128 | 128 | 'filter' => array( |
129 | 129 | 'handler' => 'views_handler_filter_string' |
@@ -133,11 +133,11 @@ discard block |
||
133 | 133 | ) |
134 | 134 | ); |
135 | 135 | $data['user']['email_addr'] = array( |
136 | - 'title' => bts('Email Address', array(), NULL, 'boinc:user-info'), |
|
136 | + 'title' => bts('Email Address', array(), null, 'boinc:user-info'), |
|
137 | 137 | 'help' => t('The BOINC account email address.'), |
138 | 138 | 'field' => array( |
139 | 139 | 'handler' => 'views_handler_field', |
140 | - 'click sortable' => TRUE |
|
140 | + 'click sortable' => true |
|
141 | 141 | ), |
142 | 142 | 'filter' => array( |
143 | 143 | 'handler' => 'views_handler_filter_string' |
@@ -147,12 +147,12 @@ discard block |
||
147 | 147 | ) |
148 | 148 | ); |
149 | 149 | $data['user']['expavg_credit'] = array( |
150 | - 'title' => bts('Recent average credit', array(), NULL, 'boinc:user-or-team-RAC'), |
|
150 | + 'title' => bts('Recent average credit', array(), null, 'boinc:user-or-team-RAC'), |
|
151 | 151 | 'help' => t('A decaying average of credit per day for the user.'), |
152 | 152 | 'field' => array( |
153 | 153 | 'handler' => 'views_handler_field_numeric', |
154 | - 'click sortable' => TRUE, |
|
155 | - 'float' => TRUE |
|
154 | + 'click sortable' => true, |
|
155 | + 'float' => true |
|
156 | 156 | ), |
157 | 157 | 'filter' => array( |
158 | 158 | 'handler' => 'views_handler_filter_numeric' |
@@ -162,11 +162,11 @@ discard block |
||
162 | 162 | ) |
163 | 163 | ); |
164 | 164 | $data['user']['name'] = array( |
165 | - 'title' => bts('Name', array(), NULL, 'boinc:user-or-team-name'), |
|
165 | + 'title' => bts('Name', array(), null, 'boinc:user-or-team-name'), |
|
166 | 166 | 'help' => t('The BOINC account user name.'), |
167 | 167 | 'field' => array( |
168 | 168 | 'handler' => 'views_handler_field', |
169 | - 'click sortable' => TRUE |
|
169 | + 'click sortable' => true |
|
170 | 170 | ), |
171 | 171 | 'filter' => array( |
172 | 172 | 'handler' => 'views_handler_filter_string' |
@@ -176,11 +176,11 @@ discard block |
||
176 | 176 | ) |
177 | 177 | ); |
178 | 178 | $data['user']['passwd_hash'] = array( |
179 | - 'title' => bts('Password Hash', array(), NULL, 'boinc:user-info'), |
|
179 | + 'title' => bts('Password Hash', array(), null, 'boinc:user-info'), |
|
180 | 180 | 'help' => t('The user password hash'), |
181 | 181 | 'field' => array( |
182 | 182 | 'handler' => 'views_handler_field', |
183 | - 'click sortable' => TRUE |
|
183 | + 'click sortable' => true |
|
184 | 184 | ), |
185 | 185 | 'filter' => array( |
186 | 186 | 'handler' => 'views_handler_filter_string' |
@@ -190,11 +190,11 @@ discard block |
||
190 | 190 | ) |
191 | 191 | ); |
192 | 192 | $data['user']['postal_code'] = array( |
193 | - 'title' => bts('Postal Code', array(), NULL, 'boinc:user-info'), |
|
193 | + 'title' => bts('Postal Code', array(), null, 'boinc:user-info'), |
|
194 | 194 | 'help' => t('The postal code of the user.'), |
195 | 195 | 'field' => array( |
196 | 196 | 'handler' => 'views_handler_field', |
197 | - 'click sortable' => TRUE |
|
197 | + 'click sortable' => true |
|
198 | 198 | ), |
199 | 199 | 'filter' => array( |
200 | 200 | 'handler' => 'views_handler_filter_string' |
@@ -204,11 +204,11 @@ discard block |
||
204 | 204 | ) |
205 | 205 | ); |
206 | 206 | $data['user']['send_email'] = array( |
207 | - 'title' => bts('Send Email', array(), NULL, 'boinc:user-info'), |
|
207 | + 'title' => bts('Send Email', array(), null, 'boinc:user-info'), |
|
208 | 208 | 'help' => t('User preference to allow email communications.'), |
209 | 209 | 'field' => array( |
210 | 210 | 'handler' => 'views_handler_field_numeric', |
211 | - 'click sortable' => TRUE |
|
211 | + 'click sortable' => true |
|
212 | 212 | ), |
213 | 213 | 'filter' => array( |
214 | 214 | 'handler' => 'views_handler_filter_numeric' |
@@ -218,11 +218,11 @@ discard block |
||
218 | 218 | ) |
219 | 219 | ); |
220 | 220 | $data['user']['show_hosts'] = array( |
221 | - 'title' => bts('Show Hosts', array(), NULL, 'boinc:user-info'), |
|
221 | + 'title' => bts('Show Hosts', array(), null, 'boinc:user-info'), |
|
222 | 222 | 'help' => t('User preference to display owned computers.'), |
223 | 223 | 'field' => array( |
224 | 224 | 'handler' => 'views_handler_field_numeric', |
225 | - 'click sortable' => TRUE |
|
225 | + 'click sortable' => true |
|
226 | 226 | ), |
227 | 227 | 'filter' => array( |
228 | 228 | 'handler' => 'views_handler_filter_numeric' |
@@ -232,12 +232,12 @@ discard block |
||
232 | 232 | ) |
233 | 233 | ); |
234 | 234 | $data['user']['total_credit'] = array( |
235 | - 'title' => bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits'), |
|
235 | + 'title' => bts('Total credit', array(), null, 'boinc:user-or-team-total-credits'), |
|
236 | 236 | 'help' => t('The total accumulated BOINC credit for the user.'), |
237 | 237 | 'field' => array( |
238 | 238 | 'handler' => 'views_handler_field_numeric', |
239 | - 'click sortable' => TRUE, |
|
240 | - 'float' => TRUE |
|
239 | + 'click sortable' => true, |
|
240 | + 'float' => true |
|
241 | 241 | ), |
242 | 242 | 'filter' => array( |
243 | 243 | 'handler' => 'views_handler_filter_numeric' |
@@ -247,11 +247,11 @@ discard block |
||
247 | 247 | ) |
248 | 248 | ); |
249 | 249 | $data['user']['url'] = array( |
250 | - 'title' => bts('URL', array(), NULL, 'boinc:website-of-user-or-team'), |
|
250 | + 'title' => bts('URL', array(), null, 'boinc:website-of-user-or-team'), |
|
251 | 251 | 'help' => t('The URL provided by the user'), |
252 | 252 | 'field' => array( |
253 | 253 | 'handler' => 'views_handler_field', |
254 | - 'click sortable' => TRUE |
|
254 | + 'click sortable' => true |
|
255 | 255 | ), |
256 | 256 | 'filter' => array( |
257 | 257 | 'handler' => 'views_handler_filter_string' |
@@ -13,255 +13,255 @@ discard block |
||
13 | 13 | */ |
14 | 14 | function boincuser_views_data() { |
15 | 15 | |
16 | - // ----------------------------------------------------------------------------------------------- |
|
17 | - // Definition for user table |
|
18 | - // ----------------------------------------------------------------------------------------------- |
|
16 | + // ----------------------------------------------------------------------------------------------- |
|
17 | + // Definition for user table |
|
18 | + // ----------------------------------------------------------------------------------------------- |
|
19 | 19 | |
20 | - $data['user']['table']['group'] = t('BOINC'); |
|
20 | + $data['user']['table']['group'] = t('BOINC'); |
|
21 | 21 | |
22 | - $data['user']['table']['base'] = array( |
|
23 | - 'field' => 'id', |
|
24 | - 'title' => t('BOINC user'), |
|
25 | - 'help' => t('BOINC account data for a user'), |
|
26 | - 'database' => 'boinc_ro' |
|
27 | - ); |
|
22 | + $data['user']['table']['base'] = array( |
|
23 | + 'field' => 'id', |
|
24 | + 'title' => t('BOINC user'), |
|
25 | + 'help' => t('BOINC account data for a user'), |
|
26 | + 'database' => 'boinc_ro' |
|
27 | + ); |
|
28 | 28 | |
29 | - // Describe each of the individual fields in this table to Views. For |
|
30 | - // each field, you may define what field, sort, argument, and/or filter |
|
31 | - // handlers it supports. This will determine where in the Views interface you |
|
32 | - // may use the field. |
|
29 | + // Describe each of the individual fields in this table to Views. For |
|
30 | + // each field, you may define what field, sort, argument, and/or filter |
|
31 | + // handlers it supports. This will determine where in the Views interface you |
|
32 | + // may use the field. |
|
33 | 33 | |
34 | - // Primary keys allowed as arguments |
|
34 | + // Primary keys allowed as arguments |
|
35 | 35 | |
36 | - $data['user']['id'] = array( |
|
36 | + $data['user']['id'] = array( |
|
37 | 37 | 'title' => bts('Id', array(), NULL, 'boinc:user-id'), |
38 | 38 | 'help' => t('The BOINC ID of the user account.'), |
39 | 39 | 'field' => array( |
40 | - 'handler' => 'views_handler_field_numeric', |
|
41 | - 'click sortable' => TRUE |
|
40 | + 'handler' => 'views_handler_field_numeric', |
|
41 | + 'click sortable' => TRUE |
|
42 | 42 | ), |
43 | 43 | 'argument' => array( |
44 | - 'handler' => 'views_handler_argument_boincuser_id', // custom handler |
|
45 | - 'name field' => 'title', // the field to display in the summary. |
|
46 | - 'numeric' => TRUE, |
|
47 | - 'validate type' => 'id' |
|
44 | + 'handler' => 'views_handler_argument_boincuser_id', // custom handler |
|
45 | + 'name field' => 'title', // the field to display in the summary. |
|
46 | + 'numeric' => TRUE, |
|
47 | + 'validate type' => 'id' |
|
48 | 48 | ), |
49 | 49 | 'filter' => array( |
50 | - 'handler' => 'views_handler_filter_numeric' |
|
50 | + 'handler' => 'views_handler_filter_numeric' |
|
51 | 51 | ), |
52 | 52 | 'sort' => array( |
53 | - 'handler' => 'views_handler_sort_numeric' |
|
53 | + 'handler' => 'views_handler_sort_numeric' |
|
54 | 54 | ) |
55 | - ); |
|
56 | - $data['user']['teamid'] = array( |
|
55 | + ); |
|
56 | + $data['user']['teamid'] = array( |
|
57 | 57 | 'title' => bts('Team ID', array(), NULL, 'boinc:team-id'), |
58 | 58 | 'help' => t('The ID of the user\'s team.'), |
59 | 59 | 'field' => array( |
60 | - 'handler' => 'views_handler_field_numeric', |
|
61 | - 'click sortable' => TRUE, |
|
60 | + 'handler' => 'views_handler_field_numeric', |
|
61 | + 'click sortable' => TRUE, |
|
62 | 62 | ), |
63 | 63 | 'argument' => array( |
64 | - 'handler' => 'views_handler_argument_boincteam_id', // custom handler |
|
65 | - 'name field' => 'title', // the field to display in the summary. |
|
66 | - 'numeric' => TRUE, |
|
67 | - 'validate type' => 'id' |
|
64 | + 'handler' => 'views_handler_argument_boincteam_id', // custom handler |
|
65 | + 'name field' => 'title', // the field to display in the summary. |
|
66 | + 'numeric' => TRUE, |
|
67 | + 'validate type' => 'id' |
|
68 | 68 | ), |
69 | 69 | 'filter' => array( |
70 | - 'handler' => 'views_handler_filter_numeric' |
|
70 | + 'handler' => 'views_handler_filter_numeric' |
|
71 | 71 | ), |
72 | 72 | 'sort' => array( |
73 | - 'handler' => 'views_handler_sort_numeric' |
|
73 | + 'handler' => 'views_handler_sort_numeric' |
|
74 | 74 | ) |
75 | - ); |
|
75 | + ); |
|
76 | 76 | |
77 | - // Descriptions of general host fields (alphabetized) |
|
77 | + // Descriptions of general host fields (alphabetized) |
|
78 | 78 | |
79 | - $data['user']['authenticator'] = array( |
|
79 | + $data['user']['authenticator'] = array( |
|
80 | 80 | 'title' => bts('Account Key', array(), NULL, 'boinc:user-info'), |
81 | 81 | 'help' => t('The BOINC account key of the user.'), |
82 | 82 | 'field' => array( |
83 | - 'handler' => 'views_handler_field', |
|
84 | - 'click sortable' => TRUE |
|
83 | + 'handler' => 'views_handler_field', |
|
84 | + 'click sortable' => TRUE |
|
85 | 85 | ), |
86 | 86 | 'filter' => array( |
87 | - 'handler' => 'views_handler_filter_string' |
|
87 | + 'handler' => 'views_handler_filter_string' |
|
88 | 88 | ), |
89 | 89 | 'sort' => array( |
90 | - 'handler' => 'views_handler_sort_string' |
|
90 | + 'handler' => 'views_handler_sort_string' |
|
91 | 91 | ) |
92 | - ); |
|
93 | - $data['user']['country'] = array( |
|
92 | + ); |
|
93 | + $data['user']['country'] = array( |
|
94 | 94 | 'title' => bts('Country', array(), NULL, 'boinc:country-of-origin'), |
95 | 95 | 'help' => t('The country of the user.'), |
96 | 96 | 'field' => array( |
97 | - 'handler' => 'views_handler_field', |
|
98 | - 'click sortable' => TRUE |
|
97 | + 'handler' => 'views_handler_field', |
|
98 | + 'click sortable' => TRUE |
|
99 | 99 | ), |
100 | 100 | 'filter' => array( |
101 | - 'handler' => 'views_handler_filter_string' |
|
101 | + 'handler' => 'views_handler_filter_string' |
|
102 | 102 | ), |
103 | 103 | 'sort' => array( |
104 | - 'handler' => 'views_handler_sort_string' |
|
104 | + 'handler' => 'views_handler_sort_string' |
|
105 | 105 | ) |
106 | - ); |
|
107 | - $data['user']['create_time'] = array( |
|
106 | + ); |
|
107 | + $data['user']['create_time'] = array( |
|
108 | 108 | 'title' => bts('Member since', array(), NULL, 'boinc:user-info'), |
109 | 109 | 'help' => t('When the BOINC account was created.'), |
110 | 110 | 'field' => array( |
111 | - 'handler' => 'views_handler_field_date', |
|
112 | - 'click sortable' => TRUE |
|
111 | + 'handler' => 'views_handler_field_date', |
|
112 | + 'click sortable' => TRUE |
|
113 | 113 | ), |
114 | 114 | 'filter' => array( |
115 | - 'handler' => 'views_handler_filter_date' |
|
115 | + 'handler' => 'views_handler_filter_date' |
|
116 | 116 | ), |
117 | 117 | 'sort' => array( |
118 | - 'handler' => 'views_handler_sort_date' |
|
118 | + 'handler' => 'views_handler_sort_date' |
|
119 | 119 | ) |
120 | - ); |
|
121 | - $data['user']['cross_project_id'] = array( |
|
120 | + ); |
|
121 | + $data['user']['cross_project_id'] = array( |
|
122 | 122 | 'title' => bts('CPID', array(), NULL, 'boinc:user-info'), |
123 | 123 | 'help' => t('The cross project user identifier.'), |
124 | 124 | 'field' => array( |
125 | - 'handler' => 'views_handler_field', |
|
126 | - 'click sortable' => TRUE |
|
125 | + 'handler' => 'views_handler_field', |
|
126 | + 'click sortable' => TRUE |
|
127 | 127 | ), |
128 | 128 | 'filter' => array( |
129 | - 'handler' => 'views_handler_filter_string' |
|
129 | + 'handler' => 'views_handler_filter_string' |
|
130 | 130 | ), |
131 | 131 | 'sort' => array( |
132 | - 'handler' => 'views_handler_sort_string' |
|
132 | + 'handler' => 'views_handler_sort_string' |
|
133 | 133 | ) |
134 | - ); |
|
135 | - $data['user']['email_addr'] = array( |
|
136 | - 'title' => bts('Email Address', array(), NULL, 'boinc:user-info'), |
|
134 | + ); |
|
135 | + $data['user']['email_addr'] = array( |
|
136 | + 'title' => bts('Email Address', array(), NULL, 'boinc:user-info'), |
|
137 | 137 | 'help' => t('The BOINC account email address.'), |
138 | 138 | 'field' => array( |
139 | - 'handler' => 'views_handler_field', |
|
140 | - 'click sortable' => TRUE |
|
139 | + 'handler' => 'views_handler_field', |
|
140 | + 'click sortable' => TRUE |
|
141 | 141 | ), |
142 | 142 | 'filter' => array( |
143 | - 'handler' => 'views_handler_filter_string' |
|
143 | + 'handler' => 'views_handler_filter_string' |
|
144 | 144 | ), |
145 | 145 | 'sort' => array( |
146 | - 'handler' => 'views_handler_sort_string' |
|
146 | + 'handler' => 'views_handler_sort_string' |
|
147 | 147 | ) |
148 | - ); |
|
149 | - $data['user']['expavg_credit'] = array( |
|
148 | + ); |
|
149 | + $data['user']['expavg_credit'] = array( |
|
150 | 150 | 'title' => bts('Recent average credit', array(), NULL, 'boinc:user-or-team-RAC'), |
151 | 151 | 'help' => t('A decaying average of credit per day for the user.'), |
152 | 152 | 'field' => array( |
153 | - 'handler' => 'views_handler_field_numeric', |
|
154 | - 'click sortable' => TRUE, |
|
155 | - 'float' => TRUE |
|
153 | + 'handler' => 'views_handler_field_numeric', |
|
154 | + 'click sortable' => TRUE, |
|
155 | + 'float' => TRUE |
|
156 | 156 | ), |
157 | 157 | 'filter' => array( |
158 | - 'handler' => 'views_handler_filter_numeric' |
|
158 | + 'handler' => 'views_handler_filter_numeric' |
|
159 | 159 | ), |
160 | 160 | 'sort' => array( |
161 | - 'handler' => 'views_handler_sort_numeric' |
|
161 | + 'handler' => 'views_handler_sort_numeric' |
|
162 | 162 | ) |
163 | - ); |
|
164 | - $data['user']['name'] = array( |
|
163 | + ); |
|
164 | + $data['user']['name'] = array( |
|
165 | 165 | 'title' => bts('Name', array(), NULL, 'boinc:user-or-team-name'), |
166 | 166 | 'help' => t('The BOINC account user name.'), |
167 | 167 | 'field' => array( |
168 | - 'handler' => 'views_handler_field', |
|
169 | - 'click sortable' => TRUE |
|
168 | + 'handler' => 'views_handler_field', |
|
169 | + 'click sortable' => TRUE |
|
170 | 170 | ), |
171 | 171 | 'filter' => array( |
172 | - 'handler' => 'views_handler_filter_string' |
|
172 | + 'handler' => 'views_handler_filter_string' |
|
173 | 173 | ), |
174 | 174 | 'sort' => array( |
175 | - 'handler' => 'views_handler_sort_string' |
|
175 | + 'handler' => 'views_handler_sort_string' |
|
176 | 176 | ) |
177 | - ); |
|
178 | - $data['user']['passwd_hash'] = array( |
|
177 | + ); |
|
178 | + $data['user']['passwd_hash'] = array( |
|
179 | 179 | 'title' => bts('Password Hash', array(), NULL, 'boinc:user-info'), |
180 | 180 | 'help' => t('The user password hash'), |
181 | 181 | 'field' => array( |
182 | - 'handler' => 'views_handler_field', |
|
183 | - 'click sortable' => TRUE |
|
182 | + 'handler' => 'views_handler_field', |
|
183 | + 'click sortable' => TRUE |
|
184 | 184 | ), |
185 | 185 | 'filter' => array( |
186 | - 'handler' => 'views_handler_filter_string' |
|
186 | + 'handler' => 'views_handler_filter_string' |
|
187 | 187 | ), |
188 | 188 | 'sort' => array( |
189 | - 'handler' => 'views_handler_sort_string' |
|
189 | + 'handler' => 'views_handler_sort_string' |
|
190 | 190 | ) |
191 | - ); |
|
192 | - $data['user']['postal_code'] = array( |
|
191 | + ); |
|
192 | + $data['user']['postal_code'] = array( |
|
193 | 193 | 'title' => bts('Postal Code', array(), NULL, 'boinc:user-info'), |
194 | 194 | 'help' => t('The postal code of the user.'), |
195 | 195 | 'field' => array( |
196 | - 'handler' => 'views_handler_field', |
|
197 | - 'click sortable' => TRUE |
|
196 | + 'handler' => 'views_handler_field', |
|
197 | + 'click sortable' => TRUE |
|
198 | 198 | ), |
199 | 199 | 'filter' => array( |
200 | - 'handler' => 'views_handler_filter_string' |
|
200 | + 'handler' => 'views_handler_filter_string' |
|
201 | 201 | ), |
202 | 202 | 'sort' => array( |
203 | - 'handler' => 'views_handler_sort_string' |
|
203 | + 'handler' => 'views_handler_sort_string' |
|
204 | 204 | ) |
205 | - ); |
|
206 | - $data['user']['send_email'] = array( |
|
205 | + ); |
|
206 | + $data['user']['send_email'] = array( |
|
207 | 207 | 'title' => bts('Send Email', array(), NULL, 'boinc:user-info'), |
208 | 208 | 'help' => t('User preference to allow email communications.'), |
209 | 209 | 'field' => array( |
210 | - 'handler' => 'views_handler_field_numeric', |
|
211 | - 'click sortable' => TRUE |
|
210 | + 'handler' => 'views_handler_field_numeric', |
|
211 | + 'click sortable' => TRUE |
|
212 | 212 | ), |
213 | 213 | 'filter' => array( |
214 | - 'handler' => 'views_handler_filter_numeric' |
|
214 | + 'handler' => 'views_handler_filter_numeric' |
|
215 | 215 | ), |
216 | 216 | 'sort' => array( |
217 | - 'handler' => 'views_handler_sort_numeric' |
|
217 | + 'handler' => 'views_handler_sort_numeric' |
|
218 | 218 | ) |
219 | - ); |
|
220 | - $data['user']['show_hosts'] = array( |
|
219 | + ); |
|
220 | + $data['user']['show_hosts'] = array( |
|
221 | 221 | 'title' => bts('Show Hosts', array(), NULL, 'boinc:user-info'), |
222 | 222 | 'help' => t('User preference to display owned computers.'), |
223 | 223 | 'field' => array( |
224 | - 'handler' => 'views_handler_field_numeric', |
|
225 | - 'click sortable' => TRUE |
|
224 | + 'handler' => 'views_handler_field_numeric', |
|
225 | + 'click sortable' => TRUE |
|
226 | 226 | ), |
227 | 227 | 'filter' => array( |
228 | - 'handler' => 'views_handler_filter_numeric' |
|
228 | + 'handler' => 'views_handler_filter_numeric' |
|
229 | 229 | ), |
230 | 230 | 'sort' => array( |
231 | - 'handler' => 'views_handler_sort_numeric' |
|
231 | + 'handler' => 'views_handler_sort_numeric' |
|
232 | 232 | ) |
233 | - ); |
|
234 | - $data['user']['total_credit'] = array( |
|
233 | + ); |
|
234 | + $data['user']['total_credit'] = array( |
|
235 | 235 | 'title' => bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits'), |
236 | 236 | 'help' => t('The total accumulated BOINC credit for the user.'), |
237 | 237 | 'field' => array( |
238 | - 'handler' => 'views_handler_field_numeric', |
|
239 | - 'click sortable' => TRUE, |
|
240 | - 'float' => TRUE |
|
238 | + 'handler' => 'views_handler_field_numeric', |
|
239 | + 'click sortable' => TRUE, |
|
240 | + 'float' => TRUE |
|
241 | 241 | ), |
242 | 242 | 'filter' => array( |
243 | - 'handler' => 'views_handler_filter_numeric' |
|
243 | + 'handler' => 'views_handler_filter_numeric' |
|
244 | 244 | ), |
245 | 245 | 'sort' => array( |
246 | - 'handler' => 'views_handler_sort_numeric' |
|
246 | + 'handler' => 'views_handler_sort_numeric' |
|
247 | 247 | ) |
248 | - ); |
|
249 | - $data['user']['url'] = array( |
|
248 | + ); |
|
249 | + $data['user']['url'] = array( |
|
250 | 250 | 'title' => bts('URL', array(), NULL, 'boinc:website-of-user-or-team'), |
251 | 251 | 'help' => t('The URL provided by the user'), |
252 | 252 | 'field' => array( |
253 | - 'handler' => 'views_handler_field', |
|
254 | - 'click sortable' => TRUE |
|
253 | + 'handler' => 'views_handler_field', |
|
254 | + 'click sortable' => TRUE |
|
255 | 255 | ), |
256 | 256 | 'filter' => array( |
257 | - 'handler' => 'views_handler_filter_string' |
|
257 | + 'handler' => 'views_handler_filter_string' |
|
258 | 258 | ), |
259 | 259 | 'sort' => array( |
260 | - 'handler' => 'views_handler_sort_string' |
|
260 | + 'handler' => 'views_handler_sort_string' |
|
261 | 261 | ) |
262 | - ); |
|
262 | + ); |
|
263 | 263 | |
264 | - return $data; |
|
264 | + return $data; |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | /* |
@@ -272,17 +272,17 @@ discard block |
||
272 | 272 | */ |
273 | 273 | |
274 | 274 | function boincuser_views_handlers() { |
275 | - return array( |
|
275 | + return array( |
|
276 | 276 | 'info' => array( |
277 | - 'path' => drupal_get_path('module', 'boincuser') . '/views', |
|
277 | + 'path' => drupal_get_path('module', 'boincuser') . '/views', |
|
278 | 278 | ), |
279 | 279 | 'handlers' => array( |
280 | - 'views_handler_argument_boincuser_id' => array( |
|
280 | + 'views_handler_argument_boincuser_id' => array( |
|
281 | 281 | 'parent' => 'views_handler_argument_numeric' |
282 | - ), |
|
283 | - 'views_handler_argument_boincteam_id' => array( |
|
282 | + ), |
|
283 | + 'views_handler_argument_boincteam_id' => array( |
|
284 | 284 | 'parent' => 'views_handler_argument_numeric' |
285 | - ), |
|
285 | + ), |
|
286 | 286 | ) |
287 | - ); |
|
287 | + ); |
|
288 | 288 | } |
@@ -157,13 +157,11 @@ discard block |
||
157 | 157 | if (!$values['boinc_root_dir']) { |
158 | 158 | form_set_error('boinc_root_dir', t('BOINC project root directory must be |
159 | 159 | defined!')); |
160 | - } |
|
161 | - elseif (!is_dir($values['boinc_root_dir'])) { |
|
160 | + } elseif (!is_dir($values['boinc_root_dir'])) { |
|
162 | 161 | form_set_error('boinc_root_dir', t('BOINC project root not found at %directory', |
163 | 162 | array('%directory' => $values['boinc_root_dir']) |
164 | 163 | )); |
165 | - } |
|
166 | - else { |
|
164 | + } else { |
|
167 | 165 | // By default, try to automatically set specific directories from the root |
168 | 166 | if (!$values['boinc_config_xml_dir']) { |
169 | 167 | $values['boinc_config_xml_dir'] = $values['boinc_root_dir']; |
@@ -285,8 +283,7 @@ discard block |
||
285 | 283 | if (!$values['boinc_scheduler_urls']) { |
286 | 284 | form_set_error('boinc_scheduler_urls', t('At least one scheduling server |
287 | 285 | URL must be specified.')); |
288 | - } |
|
289 | - else { |
|
286 | + } else { |
|
290 | 287 | $urls = explode("\r\n", $values['boinc_scheduler_urls']); |
291 | 288 | foreach ($urls as $key => $url) { |
292 | 289 | if (!$url) { |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | '#default_value' => $default['boinc_server_status_url'], |
121 | 121 | '#description' => t('An absolute URL or path relative to the site base to the server status page (e.g. %full_url or just %relative_url).', |
122 | 122 | array( |
123 | - '%full_url' => $base_url . '/server_status.php', |
|
123 | + '%full_url' => $base_url.'/server_status.php', |
|
124 | 124 | '%relative_url' => 'server_status.php', |
125 | 125 | ) |
126 | 126 | ), |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | '#default_value' => $default['boinc_app_list_url'], |
132 | 132 | '#description' => t('An absolute URL or path relative to the site base to the applications page (e.g. %full_url or just %relative_url).', |
133 | 133 | array( |
134 | - '%full_url' => $base_url . '/apps.php', |
|
134 | + '%full_url' => $base_url.'/apps.php', |
|
135 | 135 | '%relative_url' => 'apps.php', |
136 | 136 | ) |
137 | 137 | ), |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | '#type' => 'checkbox', |
350 | 350 | '#title' => t('Enable create_account.php RPC'), |
351 | 351 | '#default_value' => $default['boinc_weboptions_enableaccountcreateRPC'], |
352 | - '#description' => t('If checked, users will be able to create an account remotely using the create_account.php RPC. This option is independent of the user regsitration option found in ') . l(t('User management -> User settings'), '/admin/user/settings') . '. If enabled, user <b>may not be able to see and agree to the terms-of-use</b> to your site\'s privacy and data retention policies!', |
|
352 | + '#description' => t('If checked, users will be able to create an account remotely using the create_account.php RPC. This option is independent of the user regsitration option found in ').l(t('User management -> User settings'), '/admin/user/settings').'. If enabled, user <b>may not be able to see and agree to the terms-of-use</b> to your site\'s privacy and data retention policies!', |
|
353 | 353 | ); |
354 | 354 | |
355 | 355 | $form['boinc_weboptions_registrationtitle'] = array( |
@@ -386,25 +386,25 @@ discard block |
||
386 | 386 | '#value' => '<h3>Path Options</h3>', |
387 | 387 | ); |
388 | 388 | |
389 | - $form['boinc_weboptions_accountfinish'] = array ( |
|
389 | + $form['boinc_weboptions_accountfinish'] = array( |
|
390 | 390 | '#type' => 'textfield', |
391 | 391 | '#title' => t('Path to a custom account_finish.php page, should be a path to a node'), |
392 | 392 | '#description' => t('Provide a path to a node which will serve as your site\'s landing page for users create an account using the BOINC client manager. They will be directed to this page after the account is created. If blank, a default account_finish page will be used.<br>Examples: account_finish, content/welcome, node/123'), |
393 | 393 | '#default_value' => $default['boinc_weboptions_accountfinish'], |
394 | 394 | ); |
395 | - $form['boinc_weboptions_moderationpage'] = array ( |
|
395 | + $form['boinc_weboptions_moderationpage'] = array( |
|
396 | 396 | '#type' => 'textfield', |
397 | 397 | '#title' => t('Path to the site\'s content moderation info page, should be a path to a node'), |
398 | 398 | '#description' => t('Provide a path to a node which will serve as your site\'s page for account/content moderation information. This will be used on the default account_finish page. If blank, no link to a moderation page will be provided. If a path is provided to the custom account_finish.php page (above), this field will be ignored.<br>Examples: moderation, content/moderation, node/456'), |
399 | 399 | '#default_value' => $default['boinc_weboptions_moderationpage'], |
400 | 400 | ); |
401 | - $form['boinc_weboptions_rulespolicies'] = array ( |
|
401 | + $form['boinc_weboptions_rulespolicies'] = array( |
|
402 | 402 | '#type' => 'textfield', |
403 | 403 | '#title' => t('Path to the site\'s rule and policies page, should be a path to a node'), |
404 | 404 | '#description' => t('Provide a path to a node which will serve as your site\'s rules and policies page. This will be used on the Join page shown to new users. If blank, no link to a rules and policies page will be provided.<br>Examples: rules-and-policies, node/789'), |
405 | 405 | '#default_value' => $default['boinc_weboptions_rulespolicies'], |
406 | 406 | ); |
407 | - $form['boinc_other_frontpage'] = array ( |
|
407 | + $form['boinc_other_frontpage'] = array( |
|
408 | 408 | '#type' => 'textarea', |
409 | 409 | '#title' => bts('Message for site\'s Home Page', array(), NULL, 'boinc:admin-boinc-other-options'), |
410 | 410 | '#default_value' => $default['boinc_other_frontpage'], |
@@ -423,17 +423,17 @@ discard block |
||
423 | 423 | $values = $form_state['values']; |
424 | 424 | |
425 | 425 | $accountfinish = $values['boinc_weboptions_accountfinish']; |
426 | - if ( ($accountfinish) AND (!drupal_lookup_path('source', $accountfinish)) ) { |
|
426 | + if (($accountfinish) AND (!drupal_lookup_path('source', $accountfinish))) { |
|
427 | 427 | form_set_error('boinc weboptions_accountfinish', t('Path to custom account finish page not found. Please provide a valid path, or leave blank to unset.')); |
428 | 428 | } |
429 | 429 | |
430 | 430 | $moderationpage = $values['boinc_weboptions_moderationpage']; |
431 | - if ( ($moderationpage) AND (!drupal_lookup_path('source', $moderationpage)) ) { |
|
431 | + if (($moderationpage) AND (!drupal_lookup_path('source', $moderationpage))) { |
|
432 | 432 | form_set_error('boinc weboptions_moderationpage', t('Path to moderation page not found. Please provide a valid path, or leave blank to unset.')); |
433 | 433 | } |
434 | 434 | |
435 | 435 | $rulespolicies = $values['boinc_weboptions_rulespolicies']; |
436 | - if ( ($rulespolicies) AND (!drupal_lookup_path('source', $rulespolicies)) ) { |
|
436 | + if (($rulespolicies) AND (!drupal_lookup_path('source', $rulespolicies))) { |
|
437 | 437 | form_set_error('boinc weboptions_rulespolicies', t('Path to rules and policies page not found. Please provide a valid path, or leave blank to unset.')); |
438 | 438 | } |
439 | 439 | } |
@@ -442,5 +442,5 @@ discard block |
||
442 | 442 | * Submit BOINC other form |
443 | 443 | */ |
444 | 444 | function boincuser_admin_weboptions_submit($form, &$form_state) { |
445 | - drupal_set_message( bts("Status: Drupa-BOINC Web site options have been updated", array(), NULL, 'boinc:admin-boinc-website-options') ); |
|
445 | + drupal_set_message(bts("Status: Drupa-BOINC Web site options have been updated", array(), NULL, 'boinc:admin-boinc-website-options')); |
|
446 | 446 | } |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | }*/ |
29 | 29 | |
30 | 30 | /** |
31 | - * The BOINC environment form allows paths to be set to connect Drupal to an |
|
32 | - * existing BOINC web interface. |
|
33 | - */ |
|
31 | + * The BOINC environment form allows paths to be set to connect Drupal to an |
|
32 | + * existing BOINC web interface. |
|
33 | + */ |
|
34 | 34 | function boincuser_admin_environment(&$form_state) { |
35 | - global $base_url; |
|
36 | - $form = array(); |
|
37 | - $default = array( |
|
35 | + global $base_url; |
|
36 | + $form = array(); |
|
37 | + $default = array( |
|
38 | 38 | 'boinc_root_dir' => variable_get('boinc_root_dir', ''), |
39 | 39 | 'boinc_config_xml_dir' => variable_get('boinc_config_xml_dir', ''), |
40 | 40 | 'boinc_html_inc_dir' => variable_get('boinc_html_inc_dir', ''), |
@@ -45,290 +45,290 @@ discard block |
||
45 | 45 | 'boinc_app_list_url' => variable_get('boinc_app_list_url', ''), |
46 | 46 | 'boinc_debug_mode' => variable_get('boinc_debug_mode', 0), |
47 | 47 | 'boinc_project_config_keywords' => variable_get('boinc_project_config_keywords', ''), |
48 | - ); |
|
49 | - //drupal_set_message(print_r($default, true)); |
|
50 | - //drupal_set_message(print_r($form_state, true)); |
|
51 | - // Show overrides if the root dir is set and others have not been detected |
|
52 | - $show_overrides = FALSE; |
|
53 | - if ($default['boinc_root_dir']) { |
|
48 | + ); |
|
49 | + //drupal_set_message(print_r($default, true)); |
|
50 | + //drupal_set_message(print_r($form_state, true)); |
|
51 | + // Show overrides if the root dir is set and others have not been detected |
|
52 | + $show_overrides = FALSE; |
|
53 | + if ($default['boinc_root_dir']) { |
|
54 | 54 | foreach ($default as $key => $dir) { |
55 | - switch ($key) { |
|
56 | - case 'boinc_config_xml_dir': |
|
55 | + switch ($key) { |
|
56 | + case 'boinc_config_xml_dir': |
|
57 | 57 | case 'boinc_html_inc_dir': |
58 | 58 | case 'boinc_project_config_dir': |
59 | 59 | case 'boinc_user_image_dir': |
60 | 60 | // If any of these values are not set, show the overrides section |
61 | 61 | if (!$dir) { |
62 | - $default[$key] = $form_state['values'][$key]; |
|
63 | - $show_overrides = TRUE; |
|
64 | - break; |
|
62 | + $default[$key] = $form_state['values'][$key]; |
|
63 | + $show_overrides = TRUE; |
|
64 | + break; |
|
65 | 65 | } |
66 | 66 | break; |
67 | - default: |
|
67 | + default: |
|
68 | 68 | } |
69 | - if ($show_overrides) { |
|
69 | + if ($show_overrides) { |
|
70 | 70 | break; |
71 | - } |
|
71 | + } |
|
72 | + } |
|
72 | 73 | } |
73 | - } |
|
74 | - // Define the form |
|
75 | - $form['boinc_root_dir'] = array( |
|
74 | + // Define the form |
|
75 | + $form['boinc_root_dir'] = array( |
|
76 | 76 | '#type' => 'textfield', |
77 | 77 | '#title' => t('BOINC project root directory'), |
78 | 78 | '#default_value' => $default['boinc_root_dir'], |
79 | 79 | '#description' => t('The filesystem path to the BOINC project root. This |
80 | 80 | directory should contain config.xml as well as the html subdirectory, |
81 | 81 | which itself contains inc/, project/, and user_profile/.'), |
82 | - ); |
|
83 | - $form['overrides'] = array( |
|
82 | + ); |
|
83 | + $form['overrides'] = array( |
|
84 | 84 | '#title' => t('Overrides'), |
85 | 85 | '#type' => 'fieldset', |
86 | 86 | '#description' => '', |
87 | 87 | '#collapsible' => TRUE, |
88 | 88 | '#collapsed' => !$show_overrides, |
89 | 89 | '#attributes' => array('class' => 'advanced-settings') |
90 | - ); |
|
91 | - $form['overrides']['boinc_config_xml_dir'] = array( |
|
90 | + ); |
|
91 | + $form['overrides']['boinc_config_xml_dir'] = array( |
|
92 | 92 | '#type' => 'textfield', |
93 | 93 | '#title' => t('BOINC config.xml directory'), |
94 | 94 | '#default_value' => $default['boinc_config_xml_dir'], |
95 | 95 | '#description' => t('The filesystem path that contains config.xml'), |
96 | - ); |
|
97 | - $form['overrides']['boinc_html_inc_dir'] = array( |
|
96 | + ); |
|
97 | + $form['overrides']['boinc_html_inc_dir'] = array( |
|
98 | 98 | '#type' => 'textfield', |
99 | 99 | '#title' => t('BOINC web includes directory'), |
100 | 100 | '#default_value' => $default['boinc_html_inc_dir'], |
101 | 101 | '#description' => t('The filesystem path to the html/inc/ directory that |
102 | 102 | contains util.inc'), |
103 | - ); |
|
104 | - $form['overrides']['boinc_project_config_dir'] = array( |
|
103 | + ); |
|
104 | + $form['overrides']['boinc_project_config_dir'] = array( |
|
105 | 105 | '#type' => 'textfield', |
106 | 106 | '#title' => t('BOINC project config directory'), |
107 | 107 | '#default_value' => $default['boinc_project_config_dir'], |
108 | 108 | '#description' => t('The filesystem path to the project/ directory that |
109 | 109 | contains project.inc'), |
110 | - ); |
|
111 | - $form['overrides']['boinc_user_image_dir'] = array( |
|
110 | + ); |
|
111 | + $form['overrides']['boinc_user_image_dir'] = array( |
|
112 | 112 | '#type' => 'textfield', |
113 | 113 | '#title' => t('BOINC user profile image directory'), |
114 | 114 | '#default_value' => $default['boinc_user_image_dir'], |
115 | 115 | '#description' => t('The filesystem directory that contains user images'), |
116 | - ); |
|
117 | - $form['boinc_server_status_url'] = array( |
|
116 | + ); |
|
117 | + $form['boinc_server_status_url'] = array( |
|
118 | 118 | '#type' => 'textfield', |
119 | 119 | '#title' => t('BOINC server status page URL (optional)'), |
120 | 120 | '#default_value' => $default['boinc_server_status_url'], |
121 | 121 | '#description' => t('An absolute URL or path relative to the site base to the server status page (e.g. %full_url or just %relative_url).', |
122 | - array( |
|
122 | + array( |
|
123 | 123 | '%full_url' => $base_url . '/server_status.php', |
124 | 124 | '%relative_url' => 'server_status.php', |
125 | - ) |
|
125 | + ) |
|
126 | 126 | ), |
127 | - ); |
|
128 | - $form['boinc_app_list_url'] = array( |
|
127 | + ); |
|
128 | + $form['boinc_app_list_url'] = array( |
|
129 | 129 | '#type' => 'textfield', |
130 | 130 | '#title' => t('BOINC applications page URL (optional)'), |
131 | 131 | '#default_value' => $default['boinc_app_list_url'], |
132 | 132 | '#description' => t('An absolute URL or path relative to the site base to the applications page (e.g. %full_url or just %relative_url).', |
133 | - array( |
|
133 | + array( |
|
134 | 134 | '%full_url' => $base_url . '/apps.php', |
135 | 135 | '%relative_url' => 'apps.php', |
136 | - ) |
|
136 | + ) |
|
137 | 137 | ), |
138 | - ); |
|
139 | - $form['boinc_host_sched_logs_dir'] = array( |
|
138 | + ); |
|
139 | + $form['boinc_host_sched_logs_dir'] = array( |
|
140 | 140 | '#type' => 'textfield', |
141 | 141 | '#title' => t('BOINC host scheduler log directory (optional)'), |
142 | 142 | '#default_value' => $default['boinc_host_sched_logs_dir'], |
143 | 143 | '#description' => t('The filesystem directory that contains host scheduler logs'), |
144 | - ); |
|
145 | - $form['boinc_debug_mode'] = array( |
|
144 | + ); |
|
145 | + $form['boinc_debug_mode'] = array( |
|
146 | 146 | '#type' => 'checkbox', |
147 | 147 | '#title' => t('Show debug messages in system log'), |
148 | 148 | '#default_value' => $default['boinc_debug_mode'] |
149 | - ); |
|
150 | - $form['boinc_project_config_keywords'] = array( |
|
149 | + ); |
|
150 | + $form['boinc_project_config_keywords'] = array( |
|
151 | 151 | '#type' => 'textarea', |
152 | 152 | '#title' => t('Project/Job Keywords for get_project_config RPC'), |
153 | 153 | '#default_value' => $default['boinc_project_config_keywords'], |
154 | 154 | '#description' => t('XML from this text box will be appended to the XML output from the get_project_config RPC. There is no check for XML validity! See !link for more details. It is okay to leave this blank.', |
155 | 155 | array( |
156 | - '!link' => l('BOINC wiki page', 'https://boinc.berkeley.edu/trac/wiki/JobKeywords') |
|
156 | + '!link' => l('BOINC wiki page', 'https://boinc.berkeley.edu/trac/wiki/JobKeywords') |
|
157 | 157 | )), |
158 | - ); |
|
159 | - return system_settings_form($form); |
|
158 | + ); |
|
159 | + return system_settings_form($form); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
163 | - * Validate the BOINC environment form. |
|
164 | - */ |
|
163 | + * Validate the BOINC environment form. |
|
164 | + */ |
|
165 | 165 | function boincuser_admin_environment_validate($form, &$form_state) { |
166 | - $values = $form_state['values']; |
|
167 | - if (!$values['boinc_root_dir']) { |
|
166 | + $values = $form_state['values']; |
|
167 | + if (!$values['boinc_root_dir']) { |
|
168 | 168 | form_set_error('boinc_root_dir', t('BOINC project root directory must be |
169 | 169 | defined!')); |
170 | - } |
|
171 | - elseif (!is_dir($values['boinc_root_dir'])) { |
|
170 | + } |
|
171 | + elseif (!is_dir($values['boinc_root_dir'])) { |
|
172 | 172 | form_set_error('boinc_root_dir', t('BOINC project root not found at %directory', |
173 | - array('%directory' => $values['boinc_root_dir']) |
|
173 | + array('%directory' => $values['boinc_root_dir']) |
|
174 | 174 | )); |
175 | - } |
|
176 | - else { |
|
175 | + } |
|
176 | + else { |
|
177 | 177 | // By default, try to automatically set specific directories from the root |
178 | 178 | if (!$values['boinc_config_xml_dir']) { |
179 | - $values['boinc_config_xml_dir'] = $values['boinc_root_dir']; |
|
180 | - form_set_value($form['overrides']['boinc_config_xml_dir'], $values['boinc_config_xml_dir'], $form_state); |
|
179 | + $values['boinc_config_xml_dir'] = $values['boinc_root_dir']; |
|
180 | + form_set_value($form['overrides']['boinc_config_xml_dir'], $values['boinc_config_xml_dir'], $form_state); |
|
181 | 181 | } |
182 | 182 | if (!$values['boinc_html_inc_dir']) { |
183 | - $values['boinc_html_inc_dir'] = "{$values['boinc_root_dir']}/html/inc"; |
|
184 | - form_set_value($form['overrides']['boinc_html_inc_dir'], $values['boinc_html_inc_dir'], $form_state); |
|
183 | + $values['boinc_html_inc_dir'] = "{$values['boinc_root_dir']}/html/inc"; |
|
184 | + form_set_value($form['overrides']['boinc_html_inc_dir'], $values['boinc_html_inc_dir'], $form_state); |
|
185 | 185 | } |
186 | 186 | if (!$values['boinc_project_config_dir']) { |
187 | - $values['boinc_project_config_dir'] = "{$values['boinc_root_dir']}/html/project"; |
|
188 | - form_set_value($form['overrides']['boinc_project_config_dir'], $values['boinc_project_config_dir'], $form_state); |
|
187 | + $values['boinc_project_config_dir'] = "{$values['boinc_root_dir']}/html/project"; |
|
188 | + form_set_value($form['overrides']['boinc_project_config_dir'], $values['boinc_project_config_dir'], $form_state); |
|
189 | 189 | } |
190 | 190 | if (!$values['boinc_user_image_dir']) { |
191 | - $values['boinc_user_image_dir'] = "{$values['boinc_root_dir']}/html/user_profile/images"; |
|
192 | - form_set_value($form['overrides']['boinc_user_image_dir'], $values['boinc_user_image_dir'], $form_state); |
|
191 | + $values['boinc_user_image_dir'] = "{$values['boinc_root_dir']}/html/user_profile/images"; |
|
192 | + form_set_value($form['overrides']['boinc_user_image_dir'], $values['boinc_user_image_dir'], $form_state); |
|
193 | 193 | } |
194 | 194 | // Validate that required BOINC content is found |
195 | 195 | if (!is_readable("{$values['boinc_config_xml_dir']}/config.xml")) { |
196 | - form_set_error('boinc_config_xml_dir', t('@file not found in %directory', |
|
196 | + form_set_error('boinc_config_xml_dir', t('@file not found in %directory', |
|
197 | 197 | array( |
198 | - '@file' => 'config.xml', |
|
199 | - '%directory' => "{$values['boinc_config_xml_dir']}/" |
|
198 | + '@file' => 'config.xml', |
|
199 | + '%directory' => "{$values['boinc_config_xml_dir']}/" |
|
200 | 200 | ) |
201 | - )); |
|
201 | + )); |
|
202 | 202 | } |
203 | 203 | if (!is_readable("{$values['boinc_html_inc_dir']}/util.inc")) { |
204 | - form_set_error('boinc_html_inc_dir', t('@file not found in %directory', |
|
204 | + form_set_error('boinc_html_inc_dir', t('@file not found in %directory', |
|
205 | 205 | array( |
206 | - '@file' => 'util.inc', |
|
207 | - '%directory' => "{$values['boinc_html_inc_dir']}/" |
|
206 | + '@file' => 'util.inc', |
|
207 | + '%directory' => "{$values['boinc_html_inc_dir']}/" |
|
208 | 208 | ) |
209 | - )); |
|
209 | + )); |
|
210 | 210 | } |
211 | 211 | if (!is_readable("{$values['boinc_project_config_dir']}/project.inc")) { |
212 | - form_set_error('boinc_project_config_dir', t('@file not found in %directory', |
|
212 | + form_set_error('boinc_project_config_dir', t('@file not found in %directory', |
|
213 | 213 | array( |
214 | - '@file' => 'project.inc', |
|
215 | - '%directory' => "{$values['boinc_project_config_dir']}/" |
|
214 | + '@file' => 'project.inc', |
|
215 | + '%directory' => "{$values['boinc_project_config_dir']}/" |
|
216 | 216 | ) |
217 | - )); |
|
217 | + )); |
|
218 | 218 | } |
219 | 219 | if (!is_dir($values['boinc_user_image_dir'])) { |
220 | - form_set_error('boinc_user_image_dir', t('Profile image directory not found |
|
220 | + form_set_error('boinc_user_image_dir', t('Profile image directory not found |
|
221 | 221 | at %directory', array('%directory' => $values['boinc_user_image_dir']) |
222 | - )); |
|
222 | + )); |
|
223 | 223 | } |
224 | 224 | if ($values['boinc_host_sched_logs_dir'] |
225 | 225 | AND !is_dir($values['boinc_host_sched_logs_dir']) |
226 | - ) { |
|
227 | - form_set_error('boinc_host_sched_logs_dir', t('Host scheduler log |
|
226 | + ) { |
|
227 | + form_set_error('boinc_host_sched_logs_dir', t('Host scheduler log |
|
228 | 228 | directory not found at %directory', |
229 | 229 | array('%directory' => $values['boinc_host_sched_logs_dir']) |
230 | - )); |
|
230 | + )); |
|
231 | + } |
|
231 | 232 | } |
232 | - } |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | /** |
236 | - * Handle post-validation submission of BOINC environment form. |
|
237 | - */ |
|
236 | + * Handle post-validation submission of BOINC environment form. |
|
237 | + */ |
|
238 | 238 | function boincuser_admin_environment_submit($form, &$form_state) { |
239 | - unset($_SESSION['boinc_env']); |
|
240 | - drupal_set_message(t('BOINC environment settings have been updated.')); |
|
239 | + unset($_SESSION['boinc_env']); |
|
240 | + drupal_set_message(t('BOINC environment settings have been updated.')); |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | /** |
244 | - * The BOINC scheduler form provides options for how scheduler tags are |
|
245 | - * inserted into the front page |
|
246 | - */ |
|
244 | + * The BOINC scheduler form provides options for how scheduler tags are |
|
245 | + * inserted into the front page |
|
246 | + */ |
|
247 | 247 | function boincuser_admin_scheduler(&$form_state) { |
248 | - $form = array(); |
|
249 | - $config_cgi_url = ''; |
|
250 | - if ($config_xml_dir = variable_get('boinc_config_xml_dir', '')) { |
|
248 | + $form = array(); |
|
249 | + $config_cgi_url = ''; |
|
250 | + if ($config_xml_dir = variable_get('boinc_config_xml_dir', '')) { |
|
251 | 251 | // Get the cgi_url option from the config file as the default scheduler URL |
252 | 252 | $xml = new DOMDocument(); |
253 | 253 | if ($xml->load("{$config_xml_dir}/config.xml")) { |
254 | - $config = xml_to_array($xml); |
|
255 | - if (isset($config['boinc']['config']['cgi_url']['@value'])) { |
|
254 | + $config = xml_to_array($xml); |
|
255 | + if (isset($config['boinc']['config']['cgi_url']['@value'])) { |
|
256 | 256 | $config_cgi_url = rtrim(trim($config['boinc']['config']['cgi_url']['@value']), '/'); |
257 | 257 | $config_cgi_url .= '/cgi'; |
258 | - } |
|
258 | + } |
|
259 | 259 | } |
260 | - } |
|
261 | - $default = array( |
|
260 | + } |
|
261 | + $default = array( |
|
262 | 262 | 'boinc_scheduler_urls' => variable_get('boinc_scheduler_urls', $config_cgi_url), |
263 | 263 | 'boinc_scheduler_tag_format_old' => variable_get('boinc_scheduler_tag_format_old', 1), |
264 | 264 | 'boinc_scheduler_tag_format_new' => variable_get('boinc_scheduler_tag_format_new', 1) |
265 | - ); |
|
265 | + ); |
|
266 | 266 | |
267 | - // Define the form |
|
268 | - $form['boinc_scheduler_urls'] = array( |
|
267 | + // Define the form |
|
268 | + $form['boinc_scheduler_urls'] = array( |
|
269 | 269 | '#type' => 'textarea', |
270 | 270 | '#title' => t('Scheduling server URLs'), |
271 | 271 | '#default_value' => $default['boinc_scheduler_urls'], |
272 | 272 | '#cols' => 60, |
273 | 273 | '#rows' => 5, |
274 | 274 | '#description' => t('If there are multiple URLs, please enter one per line.'), |
275 | - ); |
|
276 | - $form['boinc_scheduler_tag_format_old'] = array( |
|
275 | + ); |
|
276 | + $form['boinc_scheduler_tag_format_old'] = array( |
|
277 | 277 | '#type' => 'checkbox', |
278 | 278 | '#title' => t('Old format (@scheduler tag)', array('@scheduler' => '<scheduler>')), |
279 | 279 | '#default_value' => $default['boinc_scheduler_tag_format_old'] |
280 | - ); |
|
281 | - $form['boinc_scheduler_tag_format_new'] = array( |
|
280 | + ); |
|
281 | + $form['boinc_scheduler_tag_format_new'] = array( |
|
282 | 282 | '#type' => 'checkbox', |
283 | 283 | '#title' => t('New format (@link tag)', array('@link' => '<link>')), |
284 | 284 | '#default_value' => $default['boinc_scheduler_tag_format_new'] |
285 | - ); |
|
285 | + ); |
|
286 | 286 | |
287 | - return system_settings_form($form); |
|
287 | + return system_settings_form($form); |
|
288 | 288 | } |
289 | 289 | |
290 | 290 | /** |
291 | - * Validate the BOINC scheduler form. |
|
292 | - */ |
|
291 | + * Validate the BOINC scheduler form. |
|
292 | + */ |
|
293 | 293 | function boincuser_admin_scheduler_validate($form, &$form_state) { |
294 | - $values = $form_state['values']; |
|
295 | - if (!$values['boinc_scheduler_urls']) { |
|
294 | + $values = $form_state['values']; |
|
295 | + if (!$values['boinc_scheduler_urls']) { |
|
296 | 296 | form_set_error('boinc_scheduler_urls', t('At least one scheduling server |
297 | 297 | URL must be specified.')); |
298 | - } |
|
299 | - else { |
|
298 | + } |
|
299 | + else { |
|
300 | 300 | $urls = explode("\r\n", $values['boinc_scheduler_urls']); |
301 | 301 | foreach ($urls as $key => $url) { |
302 | - if (!$url) { |
|
302 | + if (!$url) { |
|
303 | 303 | unset($urls[$key]); |
304 | 304 | continue; |
305 | - } |
|
306 | - if (!filter_var($url, FILTER_VALIDATE_URL)) { |
|
305 | + } |
|
306 | + if (!filter_var($url, FILTER_VALIDATE_URL)) { |
|
307 | 307 | form_set_error('boinc_scheduler_urls', t('@url is not a valid URL |
308 | 308 | format.', array('@url' => $url))); |
309 | 309 | break; |
310 | - } |
|
310 | + } |
|
311 | 311 | } |
312 | 312 | $form_state['values']['boinc_scheduler_urls'] = implode("\r\n", $urls); |
313 | - } |
|
313 | + } |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
317 | - * Handle post-validation submission of BOINC scheduler form. |
|
318 | - */ |
|
317 | + * Handle post-validation submission of BOINC scheduler form. |
|
318 | + */ |
|
319 | 319 | function boincuser_admin_scheduler_submit($form, &$form_state) { |
320 | - drupal_set_message(t('BOINC scheduling server settings have been updated.')); |
|
320 | + drupal_set_message(t('BOINC scheduling server settings have been updated.')); |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | |
324 | 324 | /** |
325 | - * Drupal-BOINC Web site related options. |
|
326 | - */ |
|
325 | + * Drupal-BOINC Web site related options. |
|
326 | + */ |
|
327 | 327 | function boincuser_admin_weboptions(&$form_state) { |
328 | - $form = array(); |
|
328 | + $form = array(); |
|
329 | 329 | |
330 | - //form defaults |
|
331 | - $default = array( |
|
330 | + //form defaults |
|
331 | + $default = array( |
|
332 | 332 | 'boinc_weboptions_enableaccountcreateRPC' => variable_get('boinc_weboptions_enableaccountcreateRPC', TRUE), |
333 | 333 | 'boinc_weboptions_registrationtitle' => variable_get('boinc_weboptions_registrationtitle', 'Please read and acknowledge our terms of use'), |
334 | 334 | 'boinc_weboptions_termsofuse' => variable_get('boinc_weboptions_termsofuse', ''), |
@@ -340,123 +340,123 @@ discard block |
||
340 | 340 | 'boinc_weboptions_moderationpage' => variable_get('boinc_weboptions_moderationpage', ''), |
341 | 341 | 'boinc_weboptions_rulespolicies' => variable_get('boinc_weboptions_rulespolicies', ''), |
342 | 342 | 'boinc_other_frontpage' => variable_get('boinc_other_frontpage', ''), |
343 | - ); |
|
343 | + ); |
|
344 | 344 | |
345 | - // Define the form |
|
346 | - $form['registrationtitle'] = array( |
|
345 | + // Define the form |
|
346 | + $form['registrationtitle'] = array( |
|
347 | 347 | '#value' => '<h3>BOINC Registration</h3>', |
348 | - ); |
|
348 | + ); |
|
349 | 349 | |
350 | - $form['boinc_weboptions_enableaccountcreateRPC'] = array( |
|
350 | + $form['boinc_weboptions_enableaccountcreateRPC'] = array( |
|
351 | 351 | '#type' => 'checkbox', |
352 | 352 | '#title' => t('Enable create_account.php RPC'), |
353 | 353 | '#default_value' => $default['boinc_weboptions_enableaccountcreateRPC'], |
354 | 354 | '#description' => t('If checked, users will be able to create an account remotely using the create_account.php RPC. This option is independent of the user regsitration option found in ') . l(t('User management -> User settings'), '/admin/user/settings') . '. If enabled, user <b>may not be able to see and agree to the terms-of-use</b> to your site\'s privacy and data retention policies!', |
355 | - ); |
|
355 | + ); |
|
356 | 356 | |
357 | - $form['boinc_weboptions_registrationtitle'] = array( |
|
357 | + $form['boinc_weboptions_registrationtitle'] = array( |
|
358 | 358 | '#type' => 'textfield', |
359 | 359 | '#title' => t('Title of regsistration page'), |
360 | 360 | '#description' => t('Title text presented above the terms of use text.'), |
361 | 361 | '#default_value' => $default['boinc_weboptions_registrationtitle'], |
362 | - ); |
|
362 | + ); |
|
363 | 363 | |
364 | - $form['boinc_weboptions_termsofuse'] = array( |
|
364 | + $form['boinc_weboptions_termsofuse'] = array( |
|
365 | 365 | '#type' => 'textarea', |
366 | 366 | '#title' => t('Terms of Use Message for User Registration Page'), |
367 | 367 | '#default_value' => $default['boinc_weboptions_termsofuse'], |
368 | 368 | '#cols' => 60, |
369 | 369 | '#rows' => 8, |
370 | 370 | '#description' => t('Text to be displayed on site\'s user registration page. Privacy policy and other data retention information goes here. If empty, there will be no terms of use message, and the title above and checkbox below will not be shown.'), |
371 | - ); |
|
371 | + ); |
|
372 | 372 | |
373 | - $form['boinc_weboptions_overrideboinctou'] = array( |
|
373 | + $form['boinc_weboptions_overrideboinctou'] = array( |
|
374 | 374 | '#type' => 'checkbox', |
375 | 375 | '#title' => t('Override BOINC terms of use.'), |
376 | 376 | '#default_value' => $default['boinc_weboptions_overrideboinctou'], |
377 | 377 | '#description' => t('Override the BOINC terms_of_use.txt file for get_profject_config.php RPC. If TRUE, the get_project_config.php RPC will use the above terms of use text entered above. Otherwise, the original terms_of_use.txt text file in the project directory is used. And you will need to be responsible for keeping both the text file and the above terms of use text up-to-date and in sync with each other.'), |
378 | - ); |
|
378 | + ); |
|
379 | 379 | |
380 | - $form['boinc_weboptions_agreequestion'] = array( |
|
380 | + $form['boinc_weboptions_agreequestion'] = array( |
|
381 | 381 | '#type' => 'textfield', |
382 | 382 | '#title' => t('Terms of use agreement question'), |
383 | 383 | '#description' => t('This text is presented to the user as the question next to the \'I agree\' checkbox.'), |
384 | 384 | '#default_value' => $default['boinc_weboptions_agreequestion'], |
385 | - ); |
|
385 | + ); |
|
386 | 386 | |
387 | - $form['boinc_weboptions_registrationtitle2'] = array( |
|
387 | + $form['boinc_weboptions_registrationtitle2'] = array( |
|
388 | 388 | '#type' => 'textfield', |
389 | 389 | '#title' => t('Instructions for username/email/password questions'), |
390 | 390 | '#description' => t('Title text presented below terms of use and above username/email/password textfields.'), |
391 | 391 | '#default_value' => $default['boinc_weboptions_registrationtitle2'], |
392 | - ); |
|
392 | + ); |
|
393 | 393 | |
394 | - $form['boinc_weboptions_existinguser_tou'] = array( |
|
394 | + $form['boinc_weboptions_existinguser_tou'] = array( |
|
395 | 395 | '#type' => 'checkbox', |
396 | 396 | '#title' => t('Are existing users forced to agree to the Terms of Use?'), |
397 | 397 | '#default_value' => $default['boinc_weboptions_existinguser_tou'], |
398 | 398 | '#description' => t('If TRUE, existing users are forced to agree to a terms of use (if present) when the login and the system has detected they have not agreed. Otherwise they may login as normal. This option has no affect on whether or not new users must agree to the terms of use.'), |
399 | - ); |
|
399 | + ); |
|
400 | 400 | |
401 | - $form['pathtitle'] = array( |
|
401 | + $form['pathtitle'] = array( |
|
402 | 402 | '#value' => '<h3>Path Options</h3>', |
403 | - ); |
|
403 | + ); |
|
404 | 404 | |
405 | - $form['boinc_weboptions_accountfinish'] = array ( |
|
405 | + $form['boinc_weboptions_accountfinish'] = array ( |
|
406 | 406 | '#type' => 'textfield', |
407 | 407 | '#title' => t('Path to a custom account_finish.php page, should be a path to a node'), |
408 | 408 | '#description' => t('Provide a path to a node which will serve as your site\'s landing page for users create an account using the BOINC client manager. They will be directed to this page after the account is created. If blank, a default account_finish page will be used.<br>Examples: account_finish, content/welcome, node/123'), |
409 | 409 | '#default_value' => $default['boinc_weboptions_accountfinish'], |
410 | - ); |
|
411 | - $form['boinc_weboptions_moderationpage'] = array ( |
|
410 | + ); |
|
411 | + $form['boinc_weboptions_moderationpage'] = array ( |
|
412 | 412 | '#type' => 'textfield', |
413 | 413 | '#title' => t('Path to the site\'s content moderation info page, should be a path to a node'), |
414 | 414 | '#description' => t('Provide a path to a node which will serve as your site\'s page for account/content moderation information. This will be used on the default account_finish page. If blank, no link to a moderation page will be provided. If a path is provided to the custom account_finish.php page (above), this field will be ignored.<br>Examples: moderation, content/moderation, node/456'), |
415 | 415 | '#default_value' => $default['boinc_weboptions_moderationpage'], |
416 | - ); |
|
417 | - $form['boinc_weboptions_rulespolicies'] = array ( |
|
416 | + ); |
|
417 | + $form['boinc_weboptions_rulespolicies'] = array ( |
|
418 | 418 | '#type' => 'textfield', |
419 | 419 | '#title' => t('Path to the site\'s rule and policies page, should be a path to a node'), |
420 | 420 | '#description' => t('Provide a path to a node which will serve as your site\'s rules and policies page. This will be used on the Join page shown to new users. If blank, no link to a rules and policies page will be provided.<br>Examples: rules-and-policies, node/789'), |
421 | 421 | '#default_value' => $default['boinc_weboptions_rulespolicies'], |
422 | - ); |
|
423 | - $form['boinc_other_frontpage'] = array ( |
|
422 | + ); |
|
423 | + $form['boinc_other_frontpage'] = array ( |
|
424 | 424 | '#type' => 'textarea', |
425 | 425 | '#title' => bts('Message for site\'s Home Page', array(), NULL, 'boinc:admin-boinc-other-options'), |
426 | 426 | '#default_value' => $default['boinc_other_frontpage'], |
427 | 427 | '#cols' => 60, |
428 | 428 | '#rows' => 8, |
429 | 429 | '#description' => bts('Text to be displayed on the site\'s Home landing page.', array(), NULL, 'boinc:admin-boinc-other-options'), |
430 | - ); |
|
430 | + ); |
|
431 | 431 | |
432 | - return system_settings_form($form); |
|
432 | + return system_settings_form($form); |
|
433 | 433 | } |
434 | 434 | |
435 | 435 | /** |
436 | - * Validate BOINC other form |
|
437 | - */ |
|
436 | + * Validate BOINC other form |
|
437 | + */ |
|
438 | 438 | function boincuser_admin_weboptions_validate($form, &$form_state) { |
439 | - $values = $form_state['values']; |
|
439 | + $values = $form_state['values']; |
|
440 | 440 | |
441 | - $accountfinish = $values['boinc_weboptions_accountfinish']; |
|
442 | - if ( ($accountfinish) AND (!drupal_lookup_path('source', $accountfinish)) ) { |
|
441 | + $accountfinish = $values['boinc_weboptions_accountfinish']; |
|
442 | + if ( ($accountfinish) AND (!drupal_lookup_path('source', $accountfinish)) ) { |
|
443 | 443 | form_set_error('boinc weboptions_accountfinish', t('Path to custom account finish page not found. Please provide a valid path, or leave blank to unset.')); |
444 | - } |
|
444 | + } |
|
445 | 445 | |
446 | - $moderationpage = $values['boinc_weboptions_moderationpage']; |
|
447 | - if ( ($moderationpage) AND (!drupal_lookup_path('source', $moderationpage)) ) { |
|
446 | + $moderationpage = $values['boinc_weboptions_moderationpage']; |
|
447 | + if ( ($moderationpage) AND (!drupal_lookup_path('source', $moderationpage)) ) { |
|
448 | 448 | form_set_error('boinc weboptions_moderationpage', t('Path to moderation page not found. Please provide a valid path, or leave blank to unset.')); |
449 | - } |
|
449 | + } |
|
450 | 450 | |
451 | - $rulespolicies = $values['boinc_weboptions_rulespolicies']; |
|
452 | - if ( ($rulespolicies) AND (!drupal_lookup_path('source', $rulespolicies)) ) { |
|
451 | + $rulespolicies = $values['boinc_weboptions_rulespolicies']; |
|
452 | + if ( ($rulespolicies) AND (!drupal_lookup_path('source', $rulespolicies)) ) { |
|
453 | 453 | form_set_error('boinc weboptions_rulespolicies', t('Path to rules and policies page not found. Please provide a valid path, or leave blank to unset.')); |
454 | - } |
|
454 | + } |
|
455 | 455 | } |
456 | 456 | |
457 | 457 | /** |
458 | - * Submit BOINC other form |
|
459 | - */ |
|
458 | + * Submit BOINC other form |
|
459 | + */ |
|
460 | 460 | function boincuser_admin_weboptions_submit($form, &$form_state) { |
461 | - drupal_set_message( bts("Status: Drupa-BOINC Web site options have been updated", array(), NULL, 'boinc:admin-boinc-website-options') ); |
|
461 | + drupal_set_message( bts("Status: Drupa-BOINC Web site options have been updated", array(), NULL, 'boinc:admin-boinc-website-options') ); |
|
462 | 462 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | //drupal_set_message(print_r($default, true)); |
50 | 50 | //drupal_set_message(print_r($form_state, true)); |
51 | 51 | // Show overrides if the root dir is set and others have not been detected |
52 | - $show_overrides = FALSE; |
|
52 | + $show_overrides = false; |
|
53 | 53 | if ($default['boinc_root_dir']) { |
54 | 54 | foreach ($default as $key => $dir) { |
55 | 55 | switch ($key) { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | // If any of these values are not set, show the overrides section |
61 | 61 | if (!$dir) { |
62 | 62 | $default[$key] = $form_state['values'][$key]; |
63 | - $show_overrides = TRUE; |
|
63 | + $show_overrides = true; |
|
64 | 64 | break; |
65 | 65 | } |
66 | 66 | break; |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | '#title' => t('Overrides'), |
85 | 85 | '#type' => 'fieldset', |
86 | 86 | '#description' => '', |
87 | - '#collapsible' => TRUE, |
|
87 | + '#collapsible' => true, |
|
88 | 88 | '#collapsed' => !$show_overrides, |
89 | 89 | '#attributes' => array('class' => 'advanced-settings') |
90 | 90 | ); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | )); |
223 | 223 | } |
224 | 224 | if ($values['boinc_host_sched_logs_dir'] |
225 | - AND !is_dir($values['boinc_host_sched_logs_dir']) |
|
225 | + and !is_dir($values['boinc_host_sched_logs_dir']) |
|
226 | 226 | ) { |
227 | 227 | form_set_error('boinc_host_sched_logs_dir', t('Host scheduler log |
228 | 228 | directory not found at %directory', |
@@ -329,13 +329,13 @@ discard block |
||
329 | 329 | |
330 | 330 | //form defaults |
331 | 331 | $default = array( |
332 | - 'boinc_weboptions_enableaccountcreateRPC' => variable_get('boinc_weboptions_enableaccountcreateRPC', TRUE), |
|
332 | + 'boinc_weboptions_enableaccountcreateRPC' => variable_get('boinc_weboptions_enableaccountcreateRPC', true), |
|
333 | 333 | 'boinc_weboptions_registrationtitle' => variable_get('boinc_weboptions_registrationtitle', 'Please read and acknowledge our terms of use'), |
334 | 334 | 'boinc_weboptions_termsofuse' => variable_get('boinc_weboptions_termsofuse', ''), |
335 | - 'boinc_weboptions_overrideboinctou' => variable_get('boinc_weboptions_overrideboinctou', FALSE), |
|
335 | + 'boinc_weboptions_overrideboinctou' => variable_get('boinc_weboptions_overrideboinctou', false), |
|
336 | 336 | 'boinc_weboptions_agreequestion' => variable_get('boinc_weboptions_agreequestion', 'Do you agree with the above terms of use?'), |
337 | 337 | 'boinc_weboptions_registrationtitle2' => variable_get('boinc_weboptions_registrationtitle2', 'Fill in your name, email, and choose a secure passphrase.'), |
338 | - 'boinc_weboptions_existinguser_tou' => variable_get('boinc_weboptions_existinguser_tou', FALSE), |
|
338 | + 'boinc_weboptions_existinguser_tou' => variable_get('boinc_weboptions_existinguser_tou', false), |
|
339 | 339 | 'boinc_weboptions_accountfinish' => variable_get('boinc_weboptions_accountfinish', ''), |
340 | 340 | 'boinc_weboptions_moderationpage' => variable_get('boinc_weboptions_moderationpage', ''), |
341 | 341 | 'boinc_weboptions_rulespolicies' => variable_get('boinc_weboptions_rulespolicies', ''), |
@@ -422,11 +422,11 @@ discard block |
||
422 | 422 | ); |
423 | 423 | $form['boinc_other_frontpage'] = array ( |
424 | 424 | '#type' => 'textarea', |
425 | - '#title' => bts('Message for site\'s Home Page', array(), NULL, 'boinc:admin-boinc-other-options'), |
|
425 | + '#title' => bts('Message for site\'s Home Page', array(), null, 'boinc:admin-boinc-other-options'), |
|
426 | 426 | '#default_value' => $default['boinc_other_frontpage'], |
427 | 427 | '#cols' => 60, |
428 | 428 | '#rows' => 8, |
429 | - '#description' => bts('Text to be displayed on the site\'s Home landing page.', array(), NULL, 'boinc:admin-boinc-other-options'), |
|
429 | + '#description' => bts('Text to be displayed on the site\'s Home landing page.', array(), null, 'boinc:admin-boinc-other-options'), |
|
430 | 430 | ); |
431 | 431 | |
432 | 432 | return system_settings_form($form); |
@@ -439,17 +439,17 @@ discard block |
||
439 | 439 | $values = $form_state['values']; |
440 | 440 | |
441 | 441 | $accountfinish = $values['boinc_weboptions_accountfinish']; |
442 | - if ( ($accountfinish) AND (!drupal_lookup_path('source', $accountfinish)) ) { |
|
442 | + if ( ($accountfinish) and (!drupal_lookup_path('source', $accountfinish)) ) { |
|
443 | 443 | form_set_error('boinc weboptions_accountfinish', t('Path to custom account finish page not found. Please provide a valid path, or leave blank to unset.')); |
444 | 444 | } |
445 | 445 | |
446 | 446 | $moderationpage = $values['boinc_weboptions_moderationpage']; |
447 | - if ( ($moderationpage) AND (!drupal_lookup_path('source', $moderationpage)) ) { |
|
447 | + if ( ($moderationpage) and (!drupal_lookup_path('source', $moderationpage)) ) { |
|
448 | 448 | form_set_error('boinc weboptions_moderationpage', t('Path to moderation page not found. Please provide a valid path, or leave blank to unset.')); |
449 | 449 | } |
450 | 450 | |
451 | 451 | $rulespolicies = $values['boinc_weboptions_rulespolicies']; |
452 | - if ( ($rulespolicies) AND (!drupal_lookup_path('source', $rulespolicies)) ) { |
|
452 | + if ( ($rulespolicies) and (!drupal_lookup_path('source', $rulespolicies)) ) { |
|
453 | 453 | form_set_error('boinc weboptions_rulespolicies', t('Path to rules and policies page not found. Please provide a valid path, or leave blank to unset.')); |
454 | 454 | } |
455 | 455 | } |
@@ -458,5 +458,5 @@ discard block |
||
458 | 458 | * Submit BOINC other form |
459 | 459 | */ |
460 | 460 | function boincuser_admin_weboptions_submit($form, &$form_state) { |
461 | - drupal_set_message( bts("Status: Drupa-BOINC Web site options have been updated", array(), NULL, 'boinc:admin-boinc-website-options') ); |
|
461 | + drupal_set_message( bts("Status: Drupa-BOINC Web site options have been updated", array(), null, 'boinc:admin-boinc-website-options') ); |
|
462 | 462 | } |
@@ -15,42 +15,42 @@ |
||
15 | 15 | */ |
16 | 16 | function boinc_settings($saved_settings) { |
17 | 17 | |
18 | - // Get the default values from the .info file. |
|
19 | - $defaults = zen_theme_get_default_settings('boinc'); |
|
18 | + // Get the default values from the .info file. |
|
19 | + $defaults = zen_theme_get_default_settings('boinc'); |
|
20 | 20 | |
21 | - // Merge the saved variables and their default values. |
|
22 | - $settings = array_merge($defaults, $saved_settings); |
|
21 | + // Merge the saved variables and their default values. |
|
22 | + $settings = array_merge($defaults, $saved_settings); |
|
23 | 23 | |
24 | - /* |
|
24 | + /* |
|
25 | 25 | * Create the form using Forms API: http://api.drupal.org/api/6 |
26 | 26 | */ |
27 | - $form = array(); |
|
28 | - $form['boinc_stats_charts'] = array( |
|
27 | + $form = array(); |
|
28 | + $form['boinc_stats_charts'] = array( |
|
29 | 29 | '#type' => 'fieldset', |
30 | 30 | '#title' => t('Chart settings'), |
31 | 31 | '#attributes' => array( |
32 | - 'class' => 'zen-settings', |
|
32 | + 'class' => 'zen-settings', |
|
33 | 33 | ), |
34 | - ); |
|
35 | - $form['boinc_stats_charts']['boinc_stats_chart_color'] = array( |
|
34 | + ); |
|
35 | + $form['boinc_stats_charts']['boinc_stats_chart_color'] = array( |
|
36 | 36 | '#type' => 'textfield', |
37 | 37 | '#title' => t('Chart color'), |
38 | 38 | '#default_value' => $settings['boinc_stats_chart_color'], |
39 | 39 | '#description' => t('The primary color of the stats chart in hex format (e.g. #FAA341).'), |
40 | - ); |
|
41 | - $form['boinc_stats_charts']['boinc_stats_chart_bcolor'] = array( |
|
40 | + ); |
|
41 | + $form['boinc_stats_charts']['boinc_stats_chart_bcolor'] = array( |
|
42 | 42 | '#type' => 'textfield', |
43 | 43 | '#title' => t('Chart background color'), |
44 | 44 | '#default_value' => $settings['boinc_stats_chart_bcolor'], |
45 | 45 | '#description' => t('The background color of the stats chart in hex format (e.g. #FFFFFF).'), |
46 | - ); |
|
46 | + ); |
|
47 | 47 | |
48 | - // Add the base theme's settings. |
|
49 | - $form += zen_settings($saved_settings, $defaults); |
|
48 | + // Add the base theme's settings. |
|
49 | + $form += zen_settings($saved_settings, $defaults); |
|
50 | 50 | |
51 | - // Remove some of the base theme's settings. |
|
52 | - unset($form['themedev']['zen_layout']); // We don't need to select the base stylesheet. |
|
51 | + // Remove some of the base theme's settings. |
|
52 | + unset($form['themedev']['zen_layout']); // We don't need to select the base stylesheet. |
|
53 | 53 | |
54 | - // Return the form |
|
55 | - return $form; |
|
54 | + // Return the form |
|
55 | + return $form; |
|
56 | 56 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | // $Id: theme-settings.php,v 1.7 2008/09/11 09:36:50 johnalbin Exp $ |
3 | 3 | |
4 | 4 | // Include the definition of zen_settings() and zen_theme_get_default_settings(). |
5 | -include_once './' . drupal_get_path('theme', 'zen') . '/theme-settings.php'; |
|
5 | +include_once './'.drupal_get_path('theme', 'zen').'/theme-settings.php'; |
|
6 | 6 | |
7 | 7 | |
8 | 8 | /** |
@@ -4,34 +4,34 @@ |
||
4 | 4 | * Implementation of hook_strongarm(). |
5 | 5 | */ |
6 | 6 | function internationalization_strongarm() { |
7 | - $export = array(); |
|
7 | + $export = array(); |
|
8 | 8 | |
9 | - $strongarm = new stdClass; |
|
10 | - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ |
|
11 | - $strongarm->api_version = 1; |
|
12 | - $strongarm->name = 'i18nstrings_allowed_formats'; |
|
13 | - $strongarm->value = array( |
|
9 | + $strongarm = new stdClass; |
|
10 | + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ |
|
11 | + $strongarm->api_version = 1; |
|
12 | + $strongarm->name = 'i18nstrings_allowed_formats'; |
|
13 | + $strongarm->value = array( |
|
14 | 14 | 0 => 4, |
15 | 15 | 1 => 5, |
16 | - ); |
|
17 | - $export['i18nstrings_allowed_formats'] = $strongarm; |
|
16 | + ); |
|
17 | + $export['i18nstrings_allowed_formats'] = $strongarm; |
|
18 | 18 | |
19 | - $strongarm = new stdClass; |
|
20 | - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ |
|
21 | - $strongarm->api_version = 1; |
|
22 | - $strongarm->name = 'i18ntaxonomy_vocabulary'; |
|
23 | - $strongarm->value = array( |
|
19 | + $strongarm = new stdClass; |
|
20 | + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ |
|
21 | + $strongarm->api_version = 1; |
|
22 | + $strongarm->name = 'i18ntaxonomy_vocabulary'; |
|
23 | + $strongarm->value = array( |
|
24 | 24 | 2 => '1', |
25 | 25 | 1 => '0', |
26 | - ); |
|
27 | - $export['i18ntaxonomy_vocabulary'] = $strongarm; |
|
26 | + ); |
|
27 | + $export['i18ntaxonomy_vocabulary'] = $strongarm; |
|
28 | 28 | |
29 | - $strongarm = new stdClass; |
|
30 | - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ |
|
31 | - $strongarm->api_version = 1; |
|
32 | - $strongarm->name = 'language_negotiation'; |
|
33 | - $strongarm->value = '2'; |
|
34 | - $export['language_negotiation'] = $strongarm; |
|
29 | + $strongarm = new stdClass; |
|
30 | + $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ |
|
31 | + $strongarm->api_version = 1; |
|
32 | + $strongarm->name = 'language_negotiation'; |
|
33 | + $strongarm->value = '2'; |
|
34 | + $export['language_negotiation'] = $strongarm; |
|
35 | 35 | |
36 | - return $export; |
|
36 | + return $export; |
|
37 | 37 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | $export = array(); |
8 | 8 | |
9 | 9 | $strongarm = new stdClass; |
10 | - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ |
|
10 | + $strongarm->disabled = false; /* Edit this to true to make a default strongarm disabled initially */ |
|
11 | 11 | $strongarm->api_version = 1; |
12 | 12 | $strongarm->name = 'i18nstrings_allowed_formats'; |
13 | 13 | $strongarm->value = array( |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $export['i18nstrings_allowed_formats'] = $strongarm; |
18 | 18 | |
19 | 19 | $strongarm = new stdClass; |
20 | - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ |
|
20 | + $strongarm->disabled = false; /* Edit this to true to make a default strongarm disabled initially */ |
|
21 | 21 | $strongarm->api_version = 1; |
22 | 22 | $strongarm->name = 'i18ntaxonomy_vocabulary'; |
23 | 23 | $strongarm->value = array( |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $export['i18ntaxonomy_vocabulary'] = $strongarm; |
28 | 28 | |
29 | 29 | $strongarm = new stdClass; |
30 | - $strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */ |
|
30 | + $strongarm->disabled = false; /* Edit this to true to make a default strongarm disabled initially */ |
|
31 | 31 | $strongarm->api_version = 1; |
32 | 32 | $strongarm->name = 'language_negotiation'; |
33 | 33 | $strongarm->value = '2'; |
@@ -4,47 +4,47 @@ |
||
4 | 4 | * Implementation of hook_user_default_permissions(). |
5 | 5 | */ |
6 | 6 | function internationalization_user_default_permissions() { |
7 | - $permissions = array(); |
|
7 | + $permissions = array(); |
|
8 | 8 | |
9 | - // Exported permission: administer all languages |
|
10 | - $permissions['administer all languages'] = array( |
|
9 | + // Exported permission: administer all languages |
|
10 | + $permissions['administer all languages'] = array( |
|
11 | 11 | 'name' => 'administer all languages', |
12 | 12 | 'roles' => array( |
13 | - '0' => 'administrator', |
|
13 | + '0' => 'administrator', |
|
14 | 14 | ), |
15 | - ); |
|
15 | + ); |
|
16 | 16 | |
17 | - // Exported permission: administer languages |
|
18 | - $permissions['administer languages'] = array( |
|
17 | + // Exported permission: administer languages |
|
18 | + $permissions['administer languages'] = array( |
|
19 | 19 | 'name' => 'administer languages', |
20 | 20 | 'roles' => array( |
21 | - '0' => 'administrator', |
|
21 | + '0' => 'administrator', |
|
22 | 22 | ), |
23 | - ); |
|
23 | + ); |
|
24 | 24 | |
25 | - // Exported permission: administer translations |
|
26 | - $permissions['administer translations'] = array( |
|
25 | + // Exported permission: administer translations |
|
26 | + $permissions['administer translations'] = array( |
|
27 | 27 | 'name' => 'administer translations', |
28 | 28 | 'roles' => array( |
29 | - '0' => 'administrator', |
|
29 | + '0' => 'administrator', |
|
30 | 30 | ), |
31 | - ); |
|
31 | + ); |
|
32 | 32 | |
33 | - // Exported permission: translate content |
|
34 | - $permissions['translate content'] = array( |
|
33 | + // Exported permission: translate content |
|
34 | + $permissions['translate content'] = array( |
|
35 | 35 | 'name' => 'translate content', |
36 | 36 | 'roles' => array( |
37 | - '0' => 'administrator', |
|
37 | + '0' => 'administrator', |
|
38 | 38 | ), |
39 | - ); |
|
39 | + ); |
|
40 | 40 | |
41 | - // Exported permission: translate interface |
|
42 | - $permissions['translate interface'] = array( |
|
41 | + // Exported permission: translate interface |
|
42 | + $permissions['translate interface'] = array( |
|
43 | 43 | 'name' => 'translate interface', |
44 | 44 | 'roles' => array( |
45 | - '0' => 'administrator', |
|
45 | + '0' => 'administrator', |
|
46 | 46 | ), |
47 | - ); |
|
47 | + ); |
|
48 | 48 | |
49 | - return $permissions; |
|
49 | + return $permissions; |
|
50 | 50 | } |
@@ -4,8 +4,8 @@ |
||
4 | 4 | * Implementation of hook_ctools_plugin_api(). |
5 | 5 | */ |
6 | 6 | function internationalization_ctools_plugin_api() { |
7 | - list($module, $api) = func_get_args(); |
|
8 | - if ($module == "strongarm" && $api == "strongarm") { |
|
7 | + list($module, $api) = func_get_args(); |
|
8 | + if ($module == "strongarm" && $api == "strongarm") { |
|
9 | 9 | return array("version" => 1); |
10 | - } |
|
10 | + } |
|
11 | 11 | } |
@@ -4,8 +4,8 @@ |
||
4 | 4 | * Implementation of hook_ctools_plugin_api(). |
5 | 5 | */ |
6 | 6 | function global_search_teams_solr_ctools_plugin_api() { |
7 | - list($module, $api) = func_get_args(); |
|
8 | - if ($module == "apachesolr_search" && $api == "apachesolr_search_defaults") { |
|
7 | + list($module, $api) = func_get_args(); |
|
8 | + if ($module == "apachesolr_search" && $api == "apachesolr_search_defaults") { |
|
9 | 9 | return array("version" => 3); |
10 | - } |
|
10 | + } |
|
11 | 11 | } |
@@ -4,20 +4,20 @@ discard block |
||
4 | 4 | * Implementation of hook_apachesolr_search_default_searchers(). |
5 | 5 | */ |
6 | 6 | function global_search_teams_solr_apachesolr_search_default_searchers() { |
7 | - $export = array(); |
|
7 | + $export = array(); |
|
8 | 8 | |
9 | - $searcher = new stdClass; |
|
10 | - $searcher->disabled = FALSE; /* Edit this to true to make a default searcher disabled initially */ |
|
11 | - $searcher->api_version = 3; |
|
12 | - $searcher->page_id = 'team_search'; |
|
13 | - $searcher->label = 'Team search'; |
|
14 | - $searcher->description = ''; |
|
15 | - $searcher->search_path = 'search/team'; |
|
16 | - $searcher->page_title = 'Search teams'; |
|
17 | - $searcher->env_id = 'solr'; |
|
18 | - $searcher->settings = array( |
|
9 | + $searcher = new stdClass; |
|
10 | + $searcher->disabled = FALSE; /* Edit this to true to make a default searcher disabled initially */ |
|
11 | + $searcher->api_version = 3; |
|
12 | + $searcher->page_id = 'team_search'; |
|
13 | + $searcher->label = 'Team search'; |
|
14 | + $searcher->description = ''; |
|
15 | + $searcher->search_path = 'search/team'; |
|
16 | + $searcher->page_title = 'Search teams'; |
|
17 | + $searcher->env_id = 'solr'; |
|
18 | + $searcher->settings = array( |
|
19 | 19 | 'fq' => array( |
20 | - 0 => 'bundle:team', |
|
20 | + 0 => 'bundle:team', |
|
21 | 21 | ), |
22 | 22 | 'apachesolr_search_custom_enable' => 1, |
23 | 23 | 'apachesolr_search_search_type' => 'custom', |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | 'apachesolr_search_browse' => 'none', |
27 | 27 | 'apachesolr_search_spellcheck' => 1, |
28 | 28 | 'apachesolr_search_allow_user_input' => 0, |
29 | - ); |
|
30 | - $export['team_search'] = $searcher; |
|
29 | + ); |
|
30 | + $export['team_search'] = $searcher; |
|
31 | 31 | |
32 | - return $export; |
|
32 | + return $export; |
|
33 | 33 | } |
@@ -7,7 +7,7 @@ |
||
7 | 7 | $export = array(); |
8 | 8 | |
9 | 9 | $searcher = new stdClass; |
10 | - $searcher->disabled = FALSE; /* Edit this to true to make a default searcher disabled initially */ |
|
10 | + $searcher->disabled = false; /* Edit this to true to make a default searcher disabled initially */ |
|
11 | 11 | $searcher->api_version = 3; |
12 | 12 | $searcher->page_id = 'team_search'; |
13 | 13 | $searcher->label = 'Team search'; |