Completed
Pull Request — master (#2190)
by Christian
10:55
created
drupal/sites/default/boinc/modules/boinctranslate/boinctranslate.admin.inc 4 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -301,7 +301,7 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -220,8 +220,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'
Please login to merge, or discard this patch.
Indentation   +145 added lines, -145 removed lines patch added patch discarded remove patch
@@ -7,85 +7,85 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Upper-Lower-Casing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincuser/boincuser.views.inc 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -274,7 +274,7 @@
 block discarded – undo
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(
Please login to merge, or discard this patch.
Indentation   +125 added lines, -125 removed lines patch added patch discarded remove patch
@@ -13,255 +13,255 @@  discard block
 block discarded – undo
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'
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'
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -34,16 +34,16 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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'
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincuser/boincuser.admin.inc 4 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -157,13 +157,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
   //drupal_set_message(print_r($default, true));
49 49
   //drupal_set_message(print_r($form_state, true));
50 50
   // Show overrides if the root dir is set and others have not been detected
51
-  $show_overrides = FALSE;
51
+  $show_overrides = false;
52 52
   if ($default['boinc_root_dir']) {
53 53
     foreach ($default as $key => $dir) {
54 54
       switch ($key) {
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         // If any of these values are not set, show the overrides section
60 60
         if (!$dir) {
61 61
           $default[$key] = $form_state['values'][$key];
62
-          $show_overrides = TRUE;
62
+          $show_overrides = true;
63 63
           break;
64 64
         }
65 65
         break;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     '#title' => t('Overrides'),
84 84
     '#type' => 'fieldset',
85 85
     '#description' => '',
86
-    '#collapsible' => TRUE,
86
+    '#collapsible' => true,
87 87
     '#collapsed' => !$show_overrides,
88 88
     '#attributes' => array('class' => 'advanced-settings')
89 89
   );
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
       ));
213 213
     }
214 214
     if ($values['boinc_host_sched_logs_dir']
215
-        AND !is_dir($values['boinc_host_sched_logs_dir'])
215
+        and !is_dir($values['boinc_host_sched_logs_dir'])
216 216
       ) {
217 217
       form_set_error('boinc_host_sched_logs_dir', t('Host scheduler log
218 218
         directory not found at %directory',
@@ -346,11 +346,11 @@  discard block
 block discarded – undo
346 346
   );
347 347
   $form['boinc_other_frontpage'] = array (
348 348
     '#type' => 'textarea',
349
-    '#title' => bts('Message for site\'s Home Page', array(), NULL, 'boinc:admin-boinc-other-options'),
349
+    '#title' => bts('Message for site\'s Home Page', array(), null, 'boinc:admin-boinc-other-options'),
350 350
     '#default_value' => $default['boinc_other_frontpage'],
351 351
     '#cols' => 60,
352 352
     '#rows' => 8,
353
-    '#description' => bts('Text to be displayed on the site\'s Home landing page.', array(), NULL, 'boinc:admin-boinc-other-options'),
353
+    '#description' => bts('Text to be displayed on the site\'s Home landing page.', array(), null, 'boinc:admin-boinc-other-options'),
354 354
   );
355 355
     
356 356
   return system_settings_form($form);
@@ -363,17 +363,17 @@  discard block
 block discarded – undo
363 363
   $values = $form_state['values'];
364 364
 
365 365
   $accountfinish = $values['boinc_weboptions_accountfinish'];
366
-  if ( ($accountfinish) AND (!drupal_lookup_path('source', $accountfinish)) ) {
366
+  if ( ($accountfinish) and (!drupal_lookup_path('source', $accountfinish)) ) {
367 367
     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.'));
368 368
   }
369 369
 
370 370
   $moderationpage = $values['boinc_weboptions_moderationpage'];
371
-  if ( ($moderationpage) AND (!drupal_lookup_path('source', $moderationpage)) ) {
371
+  if ( ($moderationpage) and (!drupal_lookup_path('source', $moderationpage)) ) {
372 372
     form_set_error('boinc weboptions_moderationpage', t('Path to moderation page not found. Please provide a valid path, or leave blank to unset.'));
373 373
   }
374 374
 
375 375
   $rulespolicies = $values['boinc_weboptions_rulespolicies'];
376
-  if ( ($rulespolicies) AND (!drupal_lookup_path('source', $rulespolicies)) ) {
376
+  if ( ($rulespolicies) and (!drupal_lookup_path('source', $rulespolicies)) ) {
377 377
     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.'));
378 378
   }
379 379
 }
@@ -382,5 +382,5 @@  discard block
 block discarded – undo
382 382
   * Submit BOINC other form
383 383
   */
384 384
 function boincuser_admin_weboptions_submit($form, &$form_state) {
385
-  drupal_set_message( bts("Status: Drupa-BOINC Web site options have been updated", array(), NULL, 'boinc:admin-boinc-website-options') );
385
+  drupal_set_message( bts("Status: Drupa-BOINC Web site options have been updated", array(), null, 'boinc:admin-boinc-website-options') );
386 386
 }
Please login to merge, or discard this patch.
Indentation   +151 added lines, -151 removed lines patch added patch discarded remove patch
@@ -28,13 +28,13 @@  discard block
 block discarded – undo
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', ''),
@@ -44,343 +44,343 @@  discard block
 block discarded – undo
44 44
     'boinc_server_status_url' => variable_get('boinc_server_status_url', ''),
45 45
     'boinc_app_list_url' => variable_get('boinc_app_list_url', ''),
46 46
     'boinc_debug_mode' => variable_get('boinc_debug_mode', 0),
47
-  );
48
-  //drupal_set_message(print_r($default, true));
49
-  //drupal_set_message(print_r($form_state, true));
50
-  // Show overrides if the root dir is set and others have not been detected
51
-  $show_overrides = FALSE;
52
-  if ($default['boinc_root_dir']) {
47
+    );
48
+    //drupal_set_message(print_r($default, true));
49
+    //drupal_set_message(print_r($form_state, true));
50
+    // Show overrides if the root dir is set and others have not been detected
51
+    $show_overrides = FALSE;
52
+    if ($default['boinc_root_dir']) {
53 53
     foreach ($default as $key => $dir) {
54
-      switch ($key) {
55
-      case 'boinc_config_xml_dir':
54
+        switch ($key) {
55
+        case 'boinc_config_xml_dir':
56 56
       case 'boinc_html_inc_dir':
57 57
       case 'boinc_project_config_dir':
58 58
       case 'boinc_user_image_dir':
59 59
         // If any of these values are not set, show the overrides section
60 60
         if (!$dir) {
61
-          $default[$key] = $form_state['values'][$key];
62
-          $show_overrides = TRUE;
63
-          break;
61
+            $default[$key] = $form_state['values'][$key];
62
+            $show_overrides = TRUE;
63
+            break;
64 64
         }
65 65
         break;
66
-      default:
66
+        default:
67 67
       }
68
-      if ($show_overrides) {
68
+        if ($show_overrides) {
69 69
         break;
70
-      }
70
+        }
71 71
     }
72
-  }
73
-  // Define the form
74
-  $form['boinc_root_dir'] = array(
72
+    }
73
+    // Define the form
74
+    $form['boinc_root_dir'] = array(
75 75
     '#type' => 'textfield',
76 76
     '#title' => t('BOINC project root directory'),
77 77
     '#default_value' => $default['boinc_root_dir'], 
78 78
     '#description' => t('The filesystem path to the BOINC project root. This
79 79
       directory should contain config.xml as well as the html subdirectory,
80 80
       which itself contains inc/, project/, and user_profile/.'),
81
-  );
82
-  $form['overrides'] = array(
81
+    );
82
+    $form['overrides'] = array(
83 83
     '#title' => t('Overrides'),
84 84
     '#type' => 'fieldset',
85 85
     '#description' => '',
86 86
     '#collapsible' => TRUE,
87 87
     '#collapsed' => !$show_overrides,
88 88
     '#attributes' => array('class' => 'advanced-settings')
89
-  );
90
-  $form['overrides']['boinc_config_xml_dir'] = array(
89
+    );
90
+    $form['overrides']['boinc_config_xml_dir'] = array(
91 91
     '#type' => 'textfield',
92 92
     '#title' => t('BOINC config.xml directory'),
93 93
     '#default_value' => $default['boinc_config_xml_dir'],
94 94
     '#description' => t('The filesystem path that contains config.xml'),
95
-  );
96
-  $form['overrides']['boinc_html_inc_dir'] = array(
95
+    );
96
+    $form['overrides']['boinc_html_inc_dir'] = array(
97 97
     '#type' => 'textfield',
98 98
     '#title' => t('BOINC web includes directory'),
99 99
     '#default_value' => $default['boinc_html_inc_dir'],
100 100
     '#description' => t('The filesystem path to the html/inc/ directory that
101 101
       contains util.inc'),
102
-  );
103
-  $form['overrides']['boinc_project_config_dir'] = array(
102
+    );
103
+    $form['overrides']['boinc_project_config_dir'] = array(
104 104
     '#type' => 'textfield',
105 105
     '#title' => t('BOINC project config directory'),
106 106
     '#default_value' => $default['boinc_project_config_dir'],
107 107
     '#description' => t('The filesystem path to the project/ directory that
108 108
       contains project.inc'),
109
-  );
110
-  $form['overrides']['boinc_user_image_dir'] = array(
109
+    );
110
+    $form['overrides']['boinc_user_image_dir'] = array(
111 111
     '#type' => 'textfield',
112 112
     '#title' => t('BOINC user profile image directory'),
113 113
     '#default_value' => $default['boinc_user_image_dir'],
114 114
     '#description' => t('The filesystem directory that contains user images'),
115
-  );
116
-  $form['boinc_server_status_url'] = array(
115
+    );
116
+    $form['boinc_server_status_url'] = array(
117 117
     '#type' => 'textfield',
118 118
     '#title' => t('BOINC server status page URL (optional)'),
119 119
     '#default_value' => $default['boinc_server_status_url'],
120 120
     '#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).',
121
-      array(
121
+        array(
122 122
         '%full_url' => $base_url . '/server_status.php',
123 123
         '%relative_url' => 'server_status.php',
124
-      )
124
+        )
125 125
     ),
126
-  );
127
-  $form['boinc_app_list_url'] = array(
126
+    );
127
+    $form['boinc_app_list_url'] = array(
128 128
     '#type' => 'textfield',
129 129
     '#title' => t('BOINC applications page URL (optional)'),
130 130
     '#default_value' => $default['boinc_app_list_url'],
131 131
     '#description' => t('An absolute URL or path relative to the site base to the applications page (e.g. %full_url or just %relative_url).',
132
-      array(
132
+        array(
133 133
         '%full_url' => $base_url . '/apps.php',
134 134
         '%relative_url' => 'apps.php',
135
-      )
135
+        )
136 136
     ),
137
-  );
138
-  $form['boinc_host_sched_logs_dir'] = array(
137
+    );
138
+    $form['boinc_host_sched_logs_dir'] = array(
139 139
     '#type' => 'textfield',
140 140
     '#title' => t('BOINC host scheduler log directory (optional)'),
141 141
     '#default_value' => $default['boinc_host_sched_logs_dir'],
142 142
     '#description' => t('The filesystem directory that contains host scheduler logs'),
143
-  );
144
-  $form['boinc_debug_mode'] = array(
143
+    );
144
+    $form['boinc_debug_mode'] = array(
145 145
     '#type' => 'checkbox',
146 146
     '#title' => t('Show debug messages in system log'),
147 147
     '#default_value' => $default['boinc_debug_mode']
148
-  );
149
-  return system_settings_form($form);
148
+    );
149
+    return system_settings_form($form);
150 150
 }
151 151
 
152 152
 /**
153
-  * Validate the BOINC environment form.
154
-  */
153
+ * Validate the BOINC environment form.
154
+ */
155 155
 function boincuser_admin_environment_validate($form, &$form_state) {
156
-  $values = $form_state['values'];
157
-  if (!$values['boinc_root_dir']) {
156
+    $values = $form_state['values'];
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
+    }
161
+    elseif (!is_dir($values['boinc_root_dir'])) {
162 162
     form_set_error('boinc_root_dir', t('BOINC project root not found at %directory',
163
-      array('%directory' => $values['boinc_root_dir'])
163
+        array('%directory' => $values['boinc_root_dir'])
164 164
     ));
165
-  }
166
-  else {
165
+    }
166
+    else {
167 167
     // By default, try to automatically set specific directories from the root
168 168
     if (!$values['boinc_config_xml_dir']) {
169
-      $values['boinc_config_xml_dir'] = $values['boinc_root_dir'];
170
-      form_set_value($form['overrides']['boinc_config_xml_dir'], $values['boinc_config_xml_dir'], $form_state);
169
+        $values['boinc_config_xml_dir'] = $values['boinc_root_dir'];
170
+        form_set_value($form['overrides']['boinc_config_xml_dir'], $values['boinc_config_xml_dir'], $form_state);
171 171
     }
172 172
     if (!$values['boinc_html_inc_dir']) {
173
-      $values['boinc_html_inc_dir'] = "{$values['boinc_root_dir']}/html/inc";
174
-      form_set_value($form['overrides']['boinc_html_inc_dir'], $values['boinc_html_inc_dir'], $form_state);
173
+        $values['boinc_html_inc_dir'] = "{$values['boinc_root_dir']}/html/inc";
174
+        form_set_value($form['overrides']['boinc_html_inc_dir'], $values['boinc_html_inc_dir'], $form_state);
175 175
     }
176 176
     if (!$values['boinc_project_config_dir']) {
177
-      $values['boinc_project_config_dir'] = "{$values['boinc_root_dir']}/html/project";
178
-      form_set_value($form['overrides']['boinc_project_config_dir'], $values['boinc_project_config_dir'], $form_state);
177
+        $values['boinc_project_config_dir'] = "{$values['boinc_root_dir']}/html/project";
178
+        form_set_value($form['overrides']['boinc_project_config_dir'], $values['boinc_project_config_dir'], $form_state);
179 179
     }
180 180
     if (!$values['boinc_user_image_dir']) {
181
-      $values['boinc_user_image_dir'] = "{$values['boinc_root_dir']}/html/user_profile/images";
182
-      form_set_value($form['overrides']['boinc_user_image_dir'], $values['boinc_user_image_dir'], $form_state);
181
+        $values['boinc_user_image_dir'] = "{$values['boinc_root_dir']}/html/user_profile/images";
182
+        form_set_value($form['overrides']['boinc_user_image_dir'], $values['boinc_user_image_dir'], $form_state);
183 183
     }
184 184
     // Validate that required BOINC content is found
185 185
     if (!is_readable("{$values['boinc_config_xml_dir']}/config.xml")) {
186
-      form_set_error('boinc_config_xml_dir', t('@file not found in %directory',
186
+        form_set_error('boinc_config_xml_dir', t('@file not found in %directory',
187 187
         array(
188
-          '@file' => 'config.xml',
189
-          '%directory' => "{$values['boinc_config_xml_dir']}/"
188
+            '@file' => 'config.xml',
189
+            '%directory' => "{$values['boinc_config_xml_dir']}/"
190 190
         )
191
-      ));
191
+        ));
192 192
     }
193 193
     if (!is_readable("{$values['boinc_html_inc_dir']}/util.inc")) {
194
-      form_set_error('boinc_html_inc_dir', t('@file not found in %directory',
194
+        form_set_error('boinc_html_inc_dir', t('@file not found in %directory',
195 195
         array(
196
-          '@file' => 'util.inc',
197
-          '%directory' => "{$values['boinc_html_inc_dir']}/"
196
+            '@file' => 'util.inc',
197
+            '%directory' => "{$values['boinc_html_inc_dir']}/"
198 198
         )
199
-      ));
199
+        ));
200 200
     }
201 201
     if (!is_readable("{$values['boinc_project_config_dir']}/project.inc")) {
202
-      form_set_error('boinc_project_config_dir', t('@file not found in %directory',
202
+        form_set_error('boinc_project_config_dir', t('@file not found in %directory',
203 203
         array(
204
-          '@file' => 'project.inc',
205
-          '%directory' => "{$values['boinc_project_config_dir']}/"
204
+            '@file' => 'project.inc',
205
+            '%directory' => "{$values['boinc_project_config_dir']}/"
206 206
         )
207
-      ));
207
+        ));
208 208
     }
209 209
     if (!is_dir($values['boinc_user_image_dir'])) {
210
-      form_set_error('boinc_user_image_dir', t('Profile image directory not found
210
+        form_set_error('boinc_user_image_dir', t('Profile image directory not found
211 211
         at %directory', array('%directory' => $values['boinc_user_image_dir'])
212
-      ));
212
+        ));
213 213
     }
214 214
     if ($values['boinc_host_sched_logs_dir']
215 215
         AND !is_dir($values['boinc_host_sched_logs_dir'])
216
-      ) {
217
-      form_set_error('boinc_host_sched_logs_dir', t('Host scheduler log
216
+        ) {
217
+        form_set_error('boinc_host_sched_logs_dir', t('Host scheduler log
218 218
         directory not found at %directory',
219 219
         array('%directory' => $values['boinc_host_sched_logs_dir'])
220
-      ));
220
+        ));
221
+    }
221 222
     }
222
-  }
223 223
 }
224 224
 
225 225
 /**
226
-  * Handle post-validation submission of BOINC environment form.
227
-  */
226
+ * Handle post-validation submission of BOINC environment form.
227
+ */
228 228
 function boincuser_admin_environment_submit($form, &$form_state) {
229
-  unset($_SESSION['boinc_env']);
230
-  drupal_set_message(t('BOINC environment settings have been updated.'));
229
+    unset($_SESSION['boinc_env']);
230
+    drupal_set_message(t('BOINC environment settings have been updated.'));
231 231
 }
232 232
 
233 233
 /**
234
-  * The BOINC scheduler form provides options for how scheduler tags are
235
-  * inserted into the front page
236
-  */
234
+ * The BOINC scheduler form provides options for how scheduler tags are
235
+ * inserted into the front page
236
+ */
237 237
 function boincuser_admin_scheduler(&$form_state) {
238
-  $form = array();
239
-  $config_cgi_url = '';
240
-  if ($config_xml_dir = variable_get('boinc_config_xml_dir', '')) {
238
+    $form = array();
239
+    $config_cgi_url = '';
240
+    if ($config_xml_dir = variable_get('boinc_config_xml_dir', '')) {
241 241
     // Get the cgi_url option from the config file as the default scheduler URL
242 242
     $xml = new DOMDocument();
243 243
     if ($xml->load("{$config_xml_dir}/config.xml")) {
244
-      $config = xml_to_array($xml);
245
-      if (isset($config['boinc']['config']['cgi_url']['@value'])) {
244
+        $config = xml_to_array($xml);
245
+        if (isset($config['boinc']['config']['cgi_url']['@value'])) {
246 246
         $config_cgi_url = rtrim(trim($config['boinc']['config']['cgi_url']['@value']), '/');
247 247
         $config_cgi_url .= '/cgi';
248
-      }
248
+        }
249
+    }
249 250
     }
250
-  }
251
-  $default = array(
251
+    $default = array(
252 252
     'boinc_scheduler_urls' => variable_get('boinc_scheduler_urls', $config_cgi_url),
253 253
     'boinc_scheduler_tag_format_old' => variable_get('boinc_scheduler_tag_format_old', 1),
254 254
     'boinc_scheduler_tag_format_new' => variable_get('boinc_scheduler_tag_format_new', 1)
255
-  );
255
+    );
256 256
   
257
-  // Define the form
258
-  $form['boinc_scheduler_urls'] = array(
257
+    // Define the form
258
+    $form['boinc_scheduler_urls'] = array(
259 259
     '#type' => 'textarea',
260 260
     '#title' => t('Scheduling server URLs'),
261 261
     '#default_value' => $default['boinc_scheduler_urls'],
262 262
     '#cols' => 60,
263 263
     '#rows' => 5,
264 264
     '#description' => t('If there are multiple URLs, please enter one per line.'),
265
-  );
266
-  $form['boinc_scheduler_tag_format_old'] = array(
265
+    );
266
+    $form['boinc_scheduler_tag_format_old'] = array(
267 267
     '#type' => 'checkbox',
268 268
     '#title' => t('Old format (@scheduler tag)', array('@scheduler' => '<scheduler>')),
269 269
     '#default_value' => $default['boinc_scheduler_tag_format_old']
270
-  );
271
-  $form['boinc_scheduler_tag_format_new'] = array(
270
+    );
271
+    $form['boinc_scheduler_tag_format_new'] = array(
272 272
     '#type' => 'checkbox',
273 273
     '#title' => t('New format (@link tag)', array('@link' => '<link>')),
274 274
     '#default_value' => $default['boinc_scheduler_tag_format_new']
275
-  );
275
+    );
276 276
   
277
-  return system_settings_form($form);
277
+    return system_settings_form($form);
278 278
 }
279 279
 
280 280
 /**
281
-  * Validate the BOINC scheduler form.
282
-  */
281
+ * Validate the BOINC scheduler form.
282
+ */
283 283
 function boincuser_admin_scheduler_validate($form, &$form_state) {
284
-  $values = $form_state['values'];
285
-  if (!$values['boinc_scheduler_urls']) {
284
+    $values = $form_state['values'];
285
+    if (!$values['boinc_scheduler_urls']) {
286 286
     form_set_error('boinc_scheduler_urls', t('At least one scheduling server
287 287
       URL must be specified.'));
288
-  }
289
-  else {
288
+    }
289
+    else {
290 290
     $urls = explode("\r\n", $values['boinc_scheduler_urls']);
291 291
     foreach ($urls as $key => $url) {
292
-      if (!$url) {
292
+        if (!$url) {
293 293
         unset($urls[$key]);
294 294
         continue;
295
-      }
296
-      if (!filter_var($url, FILTER_VALIDATE_URL)) {
295
+        }
296
+        if (!filter_var($url, FILTER_VALIDATE_URL)) {
297 297
         form_set_error('boinc_scheduler_urls', t('@url is not a valid URL
298 298
           format.', array('@url' => $url)));
299 299
         break;
300
-      }
300
+        }
301 301
     }
302 302
     $form_state['values']['boinc_scheduler_urls'] = implode("\r\n", $urls);
303
-  }
303
+    }
304 304
 }
305 305
 
306 306
 /**
307
-  * Handle post-validation submission of BOINC scheduler form.
308
-  */
307
+ * Handle post-validation submission of BOINC scheduler form.
308
+ */
309 309
 function boincuser_admin_scheduler_submit($form, &$form_state) {
310
-  drupal_set_message(t('BOINC scheduling server settings have been updated.'));
310
+    drupal_set_message(t('BOINC scheduling server settings have been updated.'));
311 311
 }
312 312
 
313 313
 
314 314
 /**
315
-  * Drupal-BOINC Web site related options.
316
-  */
315
+ * Drupal-BOINC Web site related options.
316
+ */
317 317
 function boincuser_admin_weboptions(&$form_state) {
318
-  $form = array();
318
+    $form = array();
319 319
 
320
-  //form defaults
321
-  $default = array(
320
+    //form defaults
321
+    $default = array(
322 322
     'boinc_weboptions_accountfinish' => variable_get('boinc_weboptions_accountfinish', ''),
323 323
     'boinc_weboptions_moderationpage' => variable_get('boinc_weboptions_moderationpage', ''),
324 324
     'boinc_weboptions_rulespolicies' => variable_get('boinc_weboptions_rulespolicies', ''),
325 325
     'boinc_other_frontpage' => variable_get('boinc_other_frontpage', ''),
326
-  );
326
+    );
327 327
   
328
-  // Define the form
329
-  $form['boinc_weboptions_accountfinish'] = array (
328
+    // Define the form
329
+    $form['boinc_weboptions_accountfinish'] = array (
330 330
     '#type' => 'textfield',
331 331
     '#title' => t('Path to a custom account_finish.php page, should be a path to a node'),
332 332
     '#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'),
333 333
     '#default_value' => $default['boinc_weboptions_accountfinish'],
334
-  );
335
-  $form['boinc_weboptions_moderationpage'] = array (
334
+    );
335
+    $form['boinc_weboptions_moderationpage'] = array (
336 336
     '#type' => 'textfield',
337 337
     '#title' => t('Path to the site\'s content moderation info page, should be a path to a node'),
338 338
     '#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'),
339 339
     '#default_value' => $default['boinc_weboptions_moderationpage'],
340
-  );
341
-  $form['boinc_weboptions_rulespolicies'] = array (
340
+    );
341
+    $form['boinc_weboptions_rulespolicies'] = array (
342 342
     '#type' => 'textfield',
343 343
     '#title' => t('Path to the site\'s rule and policies page, should be a path to a node'),
344 344
     '#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'),
345 345
     '#default_value' => $default['boinc_weboptions_rulespolicies'],
346
-  );
347
-  $form['boinc_other_frontpage'] = array (
346
+    );
347
+    $form['boinc_other_frontpage'] = array (
348 348
     '#type' => 'textarea',
349 349
     '#title' => bts('Message for site\'s Home Page', array(), NULL, 'boinc:admin-boinc-other-options'),
350 350
     '#default_value' => $default['boinc_other_frontpage'],
351 351
     '#cols' => 60,
352 352
     '#rows' => 8,
353 353
     '#description' => bts('Text to be displayed on the site\'s Home landing page.', array(), NULL, 'boinc:admin-boinc-other-options'),
354
-  );
354
+    );
355 355
     
356
-  return system_settings_form($form);
356
+    return system_settings_form($form);
357 357
 }
358 358
 
359 359
 /**
360
-  * Validate BOINC other form
361
-  */
360
+ * Validate BOINC other form
361
+ */
362 362
 function boincuser_admin_weboptions_validate($form, &$form_state) {
363
-  $values = $form_state['values'];
363
+    $values = $form_state['values'];
364 364
 
365
-  $accountfinish = $values['boinc_weboptions_accountfinish'];
366
-  if ( ($accountfinish) AND (!drupal_lookup_path('source', $accountfinish)) ) {
365
+    $accountfinish = $values['boinc_weboptions_accountfinish'];
366
+    if ( ($accountfinish) AND (!drupal_lookup_path('source', $accountfinish)) ) {
367 367
     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.'));
368
-  }
368
+    }
369 369
 
370
-  $moderationpage = $values['boinc_weboptions_moderationpage'];
371
-  if ( ($moderationpage) AND (!drupal_lookup_path('source', $moderationpage)) ) {
370
+    $moderationpage = $values['boinc_weboptions_moderationpage'];
371
+    if ( ($moderationpage) AND (!drupal_lookup_path('source', $moderationpage)) ) {
372 372
     form_set_error('boinc weboptions_moderationpage', t('Path to moderation page not found. Please provide a valid path, or leave blank to unset.'));
373
-  }
373
+    }
374 374
 
375
-  $rulespolicies = $values['boinc_weboptions_rulespolicies'];
376
-  if ( ($rulespolicies) AND (!drupal_lookup_path('source', $rulespolicies)) ) {
375
+    $rulespolicies = $values['boinc_weboptions_rulespolicies'];
376
+    if ( ($rulespolicies) AND (!drupal_lookup_path('source', $rulespolicies)) ) {
377 377
     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.'));
378
-  }
378
+    }
379 379
 }
380 380
 
381 381
 /**
382
-  * Submit BOINC other form
383
-  */
382
+ * Submit BOINC other form
383
+ */
384 384
 function boincuser_admin_weboptions_submit($form, &$form_state) {
385
-  drupal_set_message( bts("Status: Drupa-BOINC Web site options have been updated", array(), NULL, 'boinc:admin-boinc-website-options') );
385
+    drupal_set_message( bts("Status: Drupa-BOINC Web site options have been updated", array(), NULL, 'boinc:admin-boinc-website-options') );
386 386
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     '#default_value' => $default['boinc_server_status_url'],
120 120
     '#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).',
121 121
       array(
122
-        '%full_url' => $base_url . '/server_status.php',
122
+        '%full_url' => $base_url.'/server_status.php',
123 123
         '%relative_url' => 'server_status.php',
124 124
       )
125 125
     ),
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     '#default_value' => $default['boinc_app_list_url'],
131 131
     '#description' => t('An absolute URL or path relative to the site base to the applications page (e.g. %full_url or just %relative_url).',
132 132
       array(
133
-        '%full_url' => $base_url . '/apps.php',
133
+        '%full_url' => $base_url.'/apps.php',
134 134
         '%relative_url' => 'apps.php',
135 135
       )
136 136
     ),
@@ -326,25 +326,25 @@  discard block
 block discarded – undo
326 326
   );
327 327
   
328 328
   // Define the form
329
-  $form['boinc_weboptions_accountfinish'] = array (
329
+  $form['boinc_weboptions_accountfinish'] = array(
330 330
     '#type' => 'textfield',
331 331
     '#title' => t('Path to a custom account_finish.php page, should be a path to a node'),
332 332
     '#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'),
333 333
     '#default_value' => $default['boinc_weboptions_accountfinish'],
334 334
   );
335
-  $form['boinc_weboptions_moderationpage'] = array (
335
+  $form['boinc_weboptions_moderationpage'] = array(
336 336
     '#type' => 'textfield',
337 337
     '#title' => t('Path to the site\'s content moderation info page, should be a path to a node'),
338 338
     '#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'),
339 339
     '#default_value' => $default['boinc_weboptions_moderationpage'],
340 340
   );
341
-  $form['boinc_weboptions_rulespolicies'] = array (
341
+  $form['boinc_weboptions_rulespolicies'] = array(
342 342
     '#type' => 'textfield',
343 343
     '#title' => t('Path to the site\'s rule and policies page, should be a path to a node'),
344 344
     '#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'),
345 345
     '#default_value' => $default['boinc_weboptions_rulespolicies'],
346 346
   );
347
-  $form['boinc_other_frontpage'] = array (
347
+  $form['boinc_other_frontpage'] = array(
348 348
     '#type' => 'textarea',
349 349
     '#title' => bts('Message for site\'s Home Page', array(), NULL, 'boinc:admin-boinc-other-options'),
350 350
     '#default_value' => $default['boinc_other_frontpage'],
@@ -363,17 +363,17 @@  discard block
 block discarded – undo
363 363
   $values = $form_state['values'];
364 364
 
365 365
   $accountfinish = $values['boinc_weboptions_accountfinish'];
366
-  if ( ($accountfinish) AND (!drupal_lookup_path('source', $accountfinish)) ) {
366
+  if (($accountfinish) AND (!drupal_lookup_path('source', $accountfinish))) {
367 367
     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.'));
368 368
   }
369 369
 
370 370
   $moderationpage = $values['boinc_weboptions_moderationpage'];
371
-  if ( ($moderationpage) AND (!drupal_lookup_path('source', $moderationpage)) ) {
371
+  if (($moderationpage) AND (!drupal_lookup_path('source', $moderationpage))) {
372 372
     form_set_error('boinc weboptions_moderationpage', t('Path to moderation page not found. Please provide a valid path, or leave blank to unset.'));
373 373
   }
374 374
 
375 375
   $rulespolicies = $values['boinc_weboptions_rulespolicies'];
376
-  if ( ($rulespolicies) AND (!drupal_lookup_path('source', $rulespolicies)) ) {
376
+  if (($rulespolicies) AND (!drupal_lookup_path('source', $rulespolicies))) {
377 377
     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.'));
378 378
   }
379 379
 }
@@ -382,5 +382,5 @@  discard block
 block discarded – undo
382 382
   * Submit BOINC other form
383 383
   */
384 384
 function boincuser_admin_weboptions_submit($form, &$form_state) {
385
-  drupal_set_message( bts("Status: Drupa-BOINC Web site options have been updated", array(), NULL, 'boinc:admin-boinc-website-options') );
385
+  drupal_set_message(bts("Status: Drupa-BOINC Web site options have been updated", array(), NULL, 'boinc:admin-boinc-website-options'));
386 386
 }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/themes/boinc/theme-settings.php 2 patches
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -15,42 +15,42 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
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
 /**
Please login to merge, or discard this patch.
sites/all/features/internationalization/internationalization.strongarm.inc 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -4,34 +4,34 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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';
Please login to merge, or discard this patch.
internationalization/internationalization.features.user_permission.inc 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -4,47 +4,47 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
sites/all/features/internationalization/internationalization.features.inc 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
all/features/global_search_teams_solr/global_search_teams_solr.features.inc 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
global_search_teams_solr.apachesolr_search_defaults.inc 2 patches
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -4,20 +4,20 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
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';
Please login to merge, or discard this patch.