Passed
Pull Request — master (#3196)
by Christian
10:54
created
drupal/sites/all/features/teams/teams.views_default.inc 2 patches
Upper-Lower-Casing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
   $view->base_table = 'user';
15 15
   $view->core = 6;
16 16
   $view->api_version = '2';
17
-  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
17
+  $view->disabled = false; /* Edit this to true to make a default view disabled initially */
18 18
   $handler = $view->new_display('default', 'Defaults', 'default');
19 19
   $handler->override_option('fields', array(
20 20
     'id' => array(
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
       'hide_empty' => 0,
44 44
       'empty_zero' => 0,
45 45
       'hide_alter_empty' => 1,
46
-      'set_precision' => FALSE,
46
+      'set_precision' => false,
47 47
       'precision' => 0,
48 48
       'decimal' => '.',
49 49
       'separator' => ',',
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
       'hide_empty' => 0,
341 341
       'empty_zero' => 0,
342 342
       'hide_alter_empty' => 1,
343
-      'set_precision' => FALSE,
343
+      'set_precision' => false,
344 344
       'precision' => 0,
345 345
       'decimal' => '.',
346 346
       'separator' => '',
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
       'hide_empty' => 0,
849 849
       'empty_zero' => 0,
850 850
       'hide_alter_empty' => 1,
851
-      'set_precision' => FALSE,
851
+      'set_precision' => false,
852 852
       'precision' => 0,
853 853
       'decimal' => '.',
854 854
       'separator' => '',
@@ -1364,7 +1364,7 @@  discard block
 block discarded – undo
1364 1364
       'hide_empty' => 0,
1365 1365
       'empty_zero' => 0,
1366 1366
       'hide_alter_empty' => 1,
1367
-      'set_precision' => FALSE,
1367
+      'set_precision' => false,
1368 1368
       'precision' => 0,
1369 1369
       'decimal' => '.',
1370 1370
       'separator' => '',
@@ -1583,9 +1583,9 @@  discard block
 block discarded – undo
1583 1583
         'max' => '',
1584 1584
       ),
1585 1585
       'group' => '0',
1586
-      'exposed' => FALSE,
1586
+      'exposed' => false,
1587 1587
       'expose' => array(
1588
-        'operator' => FALSE,
1588
+        'operator' => false,
1589 1589
         'label' => '',
1590 1590
       ),
1591 1591
       'id' => 'send_email',
@@ -1655,7 +1655,7 @@  discard block
 block discarded – undo
1655 1655
       'hide_empty' => 0,
1656 1656
       'empty_zero' => 0,
1657 1657
       'hide_alter_empty' => 1,
1658
-      'set_precision' => FALSE,
1658
+      'set_precision' => false,
1659 1659
       'precision' => 0,
1660 1660
       'decimal' => '.',
1661 1661
       'separator' => '',
@@ -2144,7 +2144,7 @@  discard block
 block discarded – undo
2144 2144
       'hide_empty' => 0,
2145 2145
       'empty_zero' => 0,
2146 2146
       'hide_alter_empty' => 1,
2147
-      'set_precision' => FALSE,
2147
+      'set_precision' => false,
2148 2148
       'precision' => 0,
2149 2149
       'decimal' => '.',
2150 2150
       'separator' => '',
@@ -2616,7 +2616,7 @@  discard block
 block discarded – undo
2616 2616
   $view->base_table = 'team';
2617 2617
   $view->core = 6;
2618 2618
   $view->api_version = '2';
2619
-  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
2619
+  $view->disabled = false; /* Edit this to true to make a default view disabled initially */
2620 2620
   $handler = $view->new_display('default', 'Defaults', 'default');
2621 2621
   $handler->override_option('fields', array(
2622 2622
     'rownumber' => array(
@@ -2677,7 +2677,7 @@  discard block
 block discarded – undo
2677 2677
       'hide_empty' => 0,
2678 2678
       'empty_zero' => 0,
2679 2679
       'hide_alter_empty' => 1,
2680
-      'set_precision' => FALSE,
2680
+      'set_precision' => false,
2681 2681
       'precision' => 0,
2682 2682
       'decimal' => '.',
2683 2683
       'separator' => '',
@@ -2952,9 +2952,9 @@  discard block
 block discarded – undo
2952 2952
         'max' => '',
2953 2953
       ),
2954 2954
       'group' => '0',
2955
-      'exposed' => FALSE,
2955
+      'exposed' => false,
2956 2956
       'expose' => array(
2957
-        'operator' => FALSE,
2957
+        'operator' => false,
2958 2958
         'label' => '',
2959 2959
       ),
2960 2960
       'id' => 'total_credit',
@@ -3050,9 +3050,9 @@  discard block
 block discarded – undo
3050 3050
         'max' => '',
3051 3051
       ),
3052 3052
       'group' => '0',
3053
-      'exposed' => FALSE,
3053
+      'exposed' => false,
3054 3054
       'expose' => array(
3055
-        'operator' => FALSE,
3055
+        'operator' => false,
3056 3056
         'label' => '',
3057 3057
       ),
3058 3058
       'id' => 'total_credit',
@@ -3184,7 +3184,7 @@  discard block
 block discarded – undo
3184 3184
       'hide_empty' => 0,
3185 3185
       'empty_zero' => 0,
3186 3186
       'hide_alter_empty' => 1,
3187
-      'set_precision' => FALSE,
3187
+      'set_precision' => false,
3188 3188
       'precision' => 0,
3189 3189
       'decimal' => '.',
3190 3190
       'separator' => '',
@@ -3300,7 +3300,7 @@  discard block
 block discarded – undo
3300 3300
       'hide_empty' => 0,
3301 3301
       'empty_zero' => 0,
3302 3302
       'hide_alter_empty' => 0,
3303
-      'set_precision' => FALSE,
3303
+      'set_precision' => false,
3304 3304
       'precision' => 0,
3305 3305
       'decimal' => '.',
3306 3306
       'separator' => '',
@@ -3550,7 +3550,7 @@  discard block
 block discarded – undo
3550 3550
       'hide_empty' => 0,
3551 3551
       'empty_zero' => 0,
3552 3552
       'hide_alter_empty' => 1,
3553
-      'set_precision' => FALSE,
3553
+      'set_precision' => false,
3554 3554
       'precision' => 0,
3555 3555
       'decimal' => '.',
3556 3556
       'separator' => '',
@@ -3594,7 +3594,7 @@  discard block
 block discarded – undo
3594 3594
       'hide_empty' => 0,
3595 3595
       'empty_zero' => 0,
3596 3596
       'hide_alter_empty' => 1,
3597
-      'set_precision' => FALSE,
3597
+      'set_precision' => false,
3598 3598
       'precision' => 0,
3599 3599
       'decimal' => '.',
3600 3600
       'separator' => '',
@@ -3818,9 +3818,9 @@  discard block
 block discarded – undo
3818 3818
         'max' => '',
3819 3819
       ),
3820 3820
       'group' => '0',
3821
-      'exposed' => FALSE,
3821
+      'exposed' => false,
3822 3822
       'expose' => array(
3823
-        'operator' => FALSE,
3823
+        'operator' => false,
3824 3824
         'label' => '',
3825 3825
       ),
3826 3826
       'id' => 'userid',
@@ -3960,7 +3960,7 @@  discard block
 block discarded – undo
3960 3960
       'hide_empty' => 0,
3961 3961
       'empty_zero' => 0,
3962 3962
       'hide_alter_empty' => 1,
3963
-      'set_precision' => FALSE,
3963
+      'set_precision' => false,
3964 3964
       'precision' => 0,
3965 3965
       'decimal' => '.',
3966 3966
       'separator' => '',
@@ -4148,9 +4148,9 @@  discard block
 block discarded – undo
4148 4148
         'max' => '',
4149 4149
       ),
4150 4150
       'group' => '0',
4151
-      'exposed' => FALSE,
4151
+      'exposed' => false,
4152 4152
       'expose' => array(
4153
-        'operator' => FALSE,
4153
+        'operator' => false,
4154 4154
         'label' => '',
4155 4155
       ),
4156 4156
       'id' => 'total_credit',
Please login to merge, or discard this patch.
Indentation   +2112 added lines, -2112 removed lines patch added patch discarded remove patch
@@ -4,22 +4,22 @@  discard block
 block discarded – undo
4 4
  * Implementation of hook_views_default_views().
5 5
  */
6 6
 function teams_views_default_views() {
7
-  $views = array();
7
+    $views = array();
8 8
 
9
-  // Exported view: boinc_team_members
10
-  $view = new view;
11
-  $view->name = 'boinc_team_members';
12
-  $view->description = '';
13
-  $view->tag = '';
14
-  $view->base_table = 'user';
15
-  $view->core = 6;
16
-  $view->api_version = '2';
17
-  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
18
-  $handler = $view->new_display('default', 'Defaults', 'default');
19
-  $handler->override_option('fields', array(
9
+    // Exported view: boinc_team_members
10
+    $view = new view;
11
+    $view->name = 'boinc_team_members';
12
+    $view->description = '';
13
+    $view->tag = '';
14
+    $view->base_table = 'user';
15
+    $view->core = 6;
16
+    $view->api_version = '2';
17
+    $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
18
+    $handler = $view->new_display('default', 'Defaults', 'default');
19
+    $handler->override_option('fields', array(
20 20
     'id' => array(
21
-      'label' => 'Id',
22
-      'alter' => array(
21
+        'label' => 'Id',
22
+        'alter' => array(
23 23
         'alter_text' => 0,
24 24
         'text' => '',
25 25
         'make_link' => 0,
@@ -38,29 +38,29 @@  discard block
 block discarded – undo
38 38
         'ellipsis' => 1,
39 39
         'html' => 0,
40 40
         'strip_tags' => 0,
41
-      ),
42
-      'empty' => '',
43
-      'hide_empty' => 0,
44
-      'empty_zero' => 0,
45
-      'hide_alter_empty' => 1,
46
-      'set_precision' => FALSE,
47
-      'precision' => 0,
48
-      'decimal' => '.',
49
-      'separator' => ',',
50
-      'format_plural' => 0,
51
-      'format_plural_singular' => '1',
52
-      'format_plural_plural' => '@count',
53
-      'prefix' => '',
54
-      'suffix' => '',
55
-      'exclude' => 0,
56
-      'id' => 'id',
57
-      'table' => 'user',
58
-      'field' => 'id',
59
-      'relationship' => 'none',
41
+        ),
42
+        'empty' => '',
43
+        'hide_empty' => 0,
44
+        'empty_zero' => 0,
45
+        'hide_alter_empty' => 1,
46
+        'set_precision' => FALSE,
47
+        'precision' => 0,
48
+        'decimal' => '.',
49
+        'separator' => ',',
50
+        'format_plural' => 0,
51
+        'format_plural_singular' => '1',
52
+        'format_plural_plural' => '@count',
53
+        'prefix' => '',
54
+        'suffix' => '',
55
+        'exclude' => 0,
56
+        'id' => 'id',
57
+        'table' => 'user',
58
+        'field' => 'id',
59
+        'relationship' => 'none',
60 60
     ),
61 61
     'name' => array(
62
-      'label' => 'Name',
63
-      'alter' => array(
62
+        'label' => 'Name',
63
+        'alter' => array(
64 64
         'alter_text' => 0,
65 65
         'text' => '',
66 66
         'make_link' => 0,
@@ -79,20 +79,20 @@  discard block
 block discarded – undo
79 79
         'ellipsis' => 1,
80 80
         'html' => 0,
81 81
         'strip_tags' => 0,
82
-      ),
83
-      'empty' => '',
84
-      'hide_empty' => 0,
85
-      'empty_zero' => 0,
86
-      'hide_alter_empty' => 1,
87
-      'exclude' => 0,
88
-      'id' => 'name',
89
-      'table' => 'user',
90
-      'field' => 'name',
91
-      'relationship' => 'none',
82
+        ),
83
+        'empty' => '',
84
+        'hide_empty' => 0,
85
+        'empty_zero' => 0,
86
+        'hide_alter_empty' => 1,
87
+        'exclude' => 0,
88
+        'id' => 'name',
89
+        'table' => 'user',
90
+        'field' => 'name',
91
+        'relationship' => 'none',
92 92
     ),
93 93
     'total_credit' => array(
94
-      'label' => 'Total Credit',
95
-      'alter' => array(
94
+        'label' => 'Total Credit',
95
+        'alter' => array(
96 96
         'alter_text' => 0,
97 97
         'text' => '',
98 98
         'make_link' => 0,
@@ -111,29 +111,29 @@  discard block
 block discarded – undo
111 111
         'ellipsis' => 1,
112 112
         'html' => 0,
113 113
         'strip_tags' => 0,
114
-      ),
115
-      'empty' => '',
116
-      'hide_empty' => 0,
117
-      'empty_zero' => 0,
118
-      'hide_alter_empty' => 1,
119
-      'set_precision' => 1,
120
-      'precision' => '0',
121
-      'decimal' => '.',
122
-      'separator' => ',',
123
-      'format_plural' => 0,
124
-      'format_plural_singular' => '1',
125
-      'format_plural_plural' => '@count',
126
-      'prefix' => '',
127
-      'suffix' => '',
128
-      'exclude' => 0,
129
-      'id' => 'total_credit',
130
-      'table' => 'user',
131
-      'field' => 'total_credit',
132
-      'relationship' => 'none',
114
+        ),
115
+        'empty' => '',
116
+        'hide_empty' => 0,
117
+        'empty_zero' => 0,
118
+        'hide_alter_empty' => 1,
119
+        'set_precision' => 1,
120
+        'precision' => '0',
121
+        'decimal' => '.',
122
+        'separator' => ',',
123
+        'format_plural' => 0,
124
+        'format_plural_singular' => '1',
125
+        'format_plural_plural' => '@count',
126
+        'prefix' => '',
127
+        'suffix' => '',
128
+        'exclude' => 0,
129
+        'id' => 'total_credit',
130
+        'table' => 'user',
131
+        'field' => 'total_credit',
132
+        'relationship' => 'none',
133 133
     ),
134 134
     'expavg_credit' => array(
135
-      'label' => 'Recent average credit',
136
-      'alter' => array(
135
+        'label' => 'Recent average credit',
136
+        'alter' => array(
137 137
         'alter_text' => 0,
138 138
         'text' => '',
139 139
         'make_link' => 0,
@@ -152,29 +152,29 @@  discard block
 block discarded – undo
152 152
         'ellipsis' => 1,
153 153
         'html' => 0,
154 154
         'strip_tags' => 0,
155
-      ),
156
-      'empty' => '',
157
-      'hide_empty' => 0,
158
-      'empty_zero' => 0,
159
-      'hide_alter_empty' => 1,
160
-      'set_precision' => 1,
161
-      'precision' => '2',
162
-      'decimal' => '.',
163
-      'separator' => ',',
164
-      'format_plural' => 0,
165
-      'format_plural_singular' => '1',
166
-      'format_plural_plural' => '@count',
167
-      'prefix' => '',
168
-      'suffix' => '',
169
-      'exclude' => 0,
170
-      'id' => 'expavg_credit',
171
-      'table' => 'user',
172
-      'field' => 'expavg_credit',
173
-      'relationship' => 'none',
155
+        ),
156
+        'empty' => '',
157
+        'hide_empty' => 0,
158
+        'empty_zero' => 0,
159
+        'hide_alter_empty' => 1,
160
+        'set_precision' => 1,
161
+        'precision' => '2',
162
+        'decimal' => '.',
163
+        'separator' => ',',
164
+        'format_plural' => 0,
165
+        'format_plural_singular' => '1',
166
+        'format_plural_plural' => '@count',
167
+        'prefix' => '',
168
+        'suffix' => '',
169
+        'exclude' => 0,
170
+        'id' => 'expavg_credit',
171
+        'table' => 'user',
172
+        'field' => 'expavg_credit',
173
+        'relationship' => 'none',
174 174
     ),
175 175
     'country' => array(
176
-      'label' => 'Country',
177
-      'alter' => array(
176
+        'label' => 'Country',
177
+        'alter' => array(
178 178
         'alter_text' => 0,
179 179
         'text' => '',
180 180
         'make_link' => 0,
@@ -193,20 +193,20 @@  discard block
 block discarded – undo
193 193
         'ellipsis' => 1,
194 194
         'html' => 0,
195 195
         'strip_tags' => 0,
196
-      ),
197
-      'empty' => '',
198
-      'hide_empty' => 0,
199
-      'empty_zero' => 0,
200
-      'hide_alter_empty' => 1,
201
-      'exclude' => 0,
202
-      'id' => 'country',
203
-      'table' => 'user',
204
-      'field' => 'country',
205
-      'relationship' => 'none',
196
+        ),
197
+        'empty' => '',
198
+        'hide_empty' => 0,
199
+        'empty_zero' => 0,
200
+        'hide_alter_empty' => 1,
201
+        'exclude' => 0,
202
+        'id' => 'country',
203
+        'table' => 'user',
204
+        'field' => 'country',
205
+        'relationship' => 'none',
206 206
     ),
207 207
     'create_time' => array(
208
-      'label' => 'Member since',
209
-      'alter' => array(
208
+        'label' => 'Member since',
209
+        'alter' => array(
210 210
         'alter_text' => 0,
211 211
         'text' => '',
212 212
         'make_link' => 0,
@@ -225,31 +225,31 @@  discard block
 block discarded – undo
225 225
         'ellipsis' => 1,
226 226
         'html' => 0,
227 227
         'strip_tags' => 0,
228
-      ),
229
-      'empty' => '',
230
-      'hide_empty' => 0,
231
-      'empty_zero' => 0,
232
-      'hide_alter_empty' => 1,
233
-      'date_format' => 'small',
234
-      'custom_date_format' => '',
235
-      'exclude' => 0,
236
-      'id' => 'create_time',
237
-      'table' => 'user',
238
-      'field' => 'create_time',
239
-      'relationship' => 'none',
240
-    ),
241
-  ));
242
-  $handler->override_option('access', array(
228
+        ),
229
+        'empty' => '',
230
+        'hide_empty' => 0,
231
+        'empty_zero' => 0,
232
+        'hide_alter_empty' => 1,
233
+        'date_format' => 'small',
234
+        'custom_date_format' => '',
235
+        'exclude' => 0,
236
+        'id' => 'create_time',
237
+        'table' => 'user',
238
+        'field' => 'create_time',
239
+        'relationship' => 'none',
240
+    ),
241
+    ));
242
+    $handler->override_option('access', array(
243 243
     'type' => 'none',
244
-  ));
245
-  $handler->override_option('cache', array(
244
+    ));
245
+    $handler->override_option('cache', array(
246 246
     'type' => 'none',
247
-  ));
248
-  $handler = $view->new_display('panel_pane', 'Team member list', 'panel_pane_1');
249
-  $handler->override_option('fields', array(
247
+    ));
248
+    $handler = $view->new_display('panel_pane', 'Team member list', 'panel_pane_1');
249
+    $handler->override_option('fields', array(
250 250
     'rownumber' => array(
251
-      'label' => 'Rank',
252
-      'alter' => array(
251
+        'label' => 'Rank',
252
+        'alter' => array(
253 253
         'alter_text' => 0,
254 254
         'text' => '',
255 255
         'make_link' => 0,
@@ -268,23 +268,23 @@  discard block
 block discarded – undo
268 268
         'ellipsis' => 1,
269 269
         'html' => 0,
270 270
         'strip_tags' => 0,
271
-      ),
272
-      'empty' => '',
273
-      'hide_empty' => 0,
274
-      'empty_zero' => 0,
275
-      'hide_alter_empty' => 1,
276
-      'exclude' => 0,
277
-      'id' => 'rownumber',
278
-      'table' => 'customfield',
279
-      'field' => 'rownumber',
280
-      'override' => array(
271
+        ),
272
+        'empty' => '',
273
+        'hide_empty' => 0,
274
+        'empty_zero' => 0,
275
+        'hide_alter_empty' => 1,
276
+        'exclude' => 0,
277
+        'id' => 'rownumber',
278
+        'table' => 'customfield',
279
+        'field' => 'rownumber',
280
+        'override' => array(
281 281
         'button' => 'Use default',
282
-      ),
283
-      'relationship' => 'none',
282
+        ),
283
+        'relationship' => 'none',
284 284
     ),
285 285
     'id' => array(
286
-      'label' => 'Id',
287
-      'alter' => array(
286
+        'label' => 'Id',
287
+        'alter' => array(
288 288
         'alter_text' => 0,
289 289
         'text' => '',
290 290
         'make_link' => 0,
@@ -303,32 +303,32 @@  discard block
 block discarded – undo
303 303
         'ellipsis' => 1,
304 304
         'html' => 0,
305 305
         'strip_tags' => 0,
306
-      ),
307
-      'empty' => '',
308
-      'hide_empty' => 0,
309
-      'empty_zero' => 0,
310
-      'hide_alter_empty' => 1,
311
-      'set_precision' => FALSE,
312
-      'precision' => 0,
313
-      'decimal' => '.',
314
-      'separator' => '',
315
-      'format_plural' => 0,
316
-      'format_plural_singular' => '1',
317
-      'format_plural_plural' => '@count',
318
-      'prefix' => '',
319
-      'suffix' => '',
320
-      'exclude' => 1,
321
-      'id' => 'id',
322
-      'table' => 'user',
323
-      'field' => 'id',
324
-      'relationship' => 'none',
325
-      'override' => array(
306
+        ),
307
+        'empty' => '',
308
+        'hide_empty' => 0,
309
+        'empty_zero' => 0,
310
+        'hide_alter_empty' => 1,
311
+        'set_precision' => FALSE,
312
+        'precision' => 0,
313
+        'decimal' => '.',
314
+        'separator' => '',
315
+        'format_plural' => 0,
316
+        'format_plural_singular' => '1',
317
+        'format_plural_plural' => '@count',
318
+        'prefix' => '',
319
+        'suffix' => '',
320
+        'exclude' => 1,
321
+        'id' => 'id',
322
+        'table' => 'user',
323
+        'field' => 'id',
324
+        'relationship' => 'none',
325
+        'override' => array(
326 326
         'button' => 'Use default',
327
-      ),
327
+        ),
328 328
     ),
329 329
     'phpcode' => array(
330
-      'label' => 'Uid',
331
-      'alter' => array(
330
+        'label' => 'Uid',
331
+        'alter' => array(
332 332
         'alter_text' => 0,
333 333
         'text' => '',
334 334
         'make_link' => 0,
@@ -347,26 +347,26 @@  discard block
 block discarded – undo
347 347
         'ellipsis' => 1,
348 348
         'html' => 0,
349 349
         'strip_tags' => 0,
350
-      ),
351
-      'empty' => '',
352
-      'hide_empty' => 0,
353
-      'empty_zero' => 0,
354
-      'hide_alter_empty' => 1,
355
-      'value' => '<?php
350
+        ),
351
+        'empty' => '',
352
+        'hide_empty' => 0,
353
+        'empty_zero' => 0,
354
+        'hide_alter_empty' => 1,
355
+        'value' => '<?php
356 356
   echo boincuser_lookup_uid($data->id);
357 357
 ?>',
358
-      'exclude' => 1,
359
-      'id' => 'phpcode',
360
-      'table' => 'customfield',
361
-      'field' => 'phpcode',
362
-      'override' => array(
358
+        'exclude' => 1,
359
+        'id' => 'phpcode',
360
+        'table' => 'customfield',
361
+        'field' => 'phpcode',
362
+        'override' => array(
363 363
         'button' => 'Use default',
364
-      ),
365
-      'relationship' => 'none',
364
+        ),
365
+        'relationship' => 'none',
366 366
     ),
367 367
     'name' => array(
368
-      'label' => 'Name',
369
-      'alter' => array(
368
+        'label' => 'Name',
369
+        'alter' => array(
370 370
         'alter_text' => 0,
371 371
         'text' => '',
372 372
         'make_link' => 1,
@@ -385,23 +385,23 @@  discard block
 block discarded – undo
385 385
         'ellipsis' => 1,
386 386
         'html' => 0,
387 387
         'strip_tags' => 0,
388
-      ),
389
-      'empty' => '',
390
-      'hide_empty' => 0,
391
-      'empty_zero' => 0,
392
-      'hide_alter_empty' => 1,
393
-      'exclude' => 0,
394
-      'id' => 'name',
395
-      'table' => 'user',
396
-      'field' => 'name',
397
-      'relationship' => 'none',
398
-      'override' => array(
388
+        ),
389
+        'empty' => '',
390
+        'hide_empty' => 0,
391
+        'empty_zero' => 0,
392
+        'hide_alter_empty' => 1,
393
+        'exclude' => 0,
394
+        'id' => 'name',
395
+        'table' => 'user',
396
+        'field' => 'name',
397
+        'relationship' => 'none',
398
+        'override' => array(
399 399
         'button' => 'Use default',
400
-      ),
400
+        ),
401 401
     ),
402 402
     'total_credit' => array(
403
-      'label' => 'Total Credit',
404
-      'alter' => array(
403
+        'label' => 'Total Credit',
404
+        'alter' => array(
405 405
         'alter_text' => 0,
406 406
         'text' => '',
407 407
         'make_link' => 0,
@@ -420,32 +420,32 @@  discard block
 block discarded – undo
420 420
         'ellipsis' => 1,
421 421
         'html' => 0,
422 422
         'strip_tags' => 0,
423
-      ),
424
-      'empty' => '',
425
-      'hide_empty' => 0,
426
-      'empty_zero' => 0,
427
-      'hide_alter_empty' => 1,
428
-      'set_precision' => 1,
429
-      'precision' => '0',
430
-      'decimal' => '.',
431
-      'separator' => ',',
432
-      'format_plural' => 0,
433
-      'format_plural_singular' => '1',
434
-      'format_plural_plural' => '@count',
435
-      'prefix' => '',
436
-      'suffix' => '',
437
-      'exclude' => 0,
438
-      'id' => 'total_credit',
439
-      'table' => 'user',
440
-      'field' => 'total_credit',
441
-      'relationship' => 'none',
442
-      'override' => array(
423
+        ),
424
+        'empty' => '',
425
+        'hide_empty' => 0,
426
+        'empty_zero' => 0,
427
+        'hide_alter_empty' => 1,
428
+        'set_precision' => 1,
429
+        'precision' => '0',
430
+        'decimal' => '.',
431
+        'separator' => ',',
432
+        'format_plural' => 0,
433
+        'format_plural_singular' => '1',
434
+        'format_plural_plural' => '@count',
435
+        'prefix' => '',
436
+        'suffix' => '',
437
+        'exclude' => 0,
438
+        'id' => 'total_credit',
439
+        'table' => 'user',
440
+        'field' => 'total_credit',
441
+        'relationship' => 'none',
442
+        'override' => array(
443 443
         'button' => 'Use default',
444
-      ),
444
+        ),
445 445
     ),
446 446
     'expavg_credit' => array(
447
-      'label' => 'Recent average credit',
448
-      'alter' => array(
447
+        'label' => 'Recent average credit',
448
+        'alter' => array(
449 449
         'alter_text' => 0,
450 450
         'text' => '',
451 451
         'make_link' => 0,
@@ -464,29 +464,29 @@  discard block
 block discarded – undo
464 464
         'ellipsis' => 1,
465 465
         'html' => 0,
466 466
         'strip_tags' => 0,
467
-      ),
468
-      'empty' => '',
469
-      'hide_empty' => 0,
470
-      'empty_zero' => 0,
471
-      'hide_alter_empty' => 1,
472
-      'set_precision' => 1,
473
-      'precision' => '2',
474
-      'decimal' => '.',
475
-      'separator' => ',',
476
-      'format_plural' => 0,
477
-      'format_plural_singular' => '1',
478
-      'format_plural_plural' => '@count',
479
-      'prefix' => '',
480
-      'suffix' => '',
481
-      'exclude' => 0,
482
-      'id' => 'expavg_credit',
483
-      'table' => 'user',
484
-      'field' => 'expavg_credit',
485
-      'relationship' => 'none',
467
+        ),
468
+        'empty' => '',
469
+        'hide_empty' => 0,
470
+        'empty_zero' => 0,
471
+        'hide_alter_empty' => 1,
472
+        'set_precision' => 1,
473
+        'precision' => '2',
474
+        'decimal' => '.',
475
+        'separator' => ',',
476
+        'format_plural' => 0,
477
+        'format_plural_singular' => '1',
478
+        'format_plural_plural' => '@count',
479
+        'prefix' => '',
480
+        'suffix' => '',
481
+        'exclude' => 0,
482
+        'id' => 'expavg_credit',
483
+        'table' => 'user',
484
+        'field' => 'expavg_credit',
485
+        'relationship' => 'none',
486 486
     ),
487 487
     'country' => array(
488
-      'label' => 'Country',
489
-      'alter' => array(
488
+        'label' => 'Country',
489
+        'alter' => array(
490 490
         'alter_text' => 0,
491 491
         'text' => '',
492 492
         'make_link' => 0,
@@ -505,23 +505,23 @@  discard block
 block discarded – undo
505 505
         'ellipsis' => 1,
506 506
         'html' => 0,
507 507
         'strip_tags' => 0,
508
-      ),
509
-      'empty' => '',
510
-      'hide_empty' => 0,
511
-      'empty_zero' => 0,
512
-      'hide_alter_empty' => 1,
513
-      'exclude' => 0,
514
-      'id' => 'country',
515
-      'table' => 'user',
516
-      'field' => 'country',
517
-      'override' => array(
508
+        ),
509
+        'empty' => '',
510
+        'hide_empty' => 0,
511
+        'empty_zero' => 0,
512
+        'hide_alter_empty' => 1,
513
+        'exclude' => 0,
514
+        'id' => 'country',
515
+        'table' => 'user',
516
+        'field' => 'country',
517
+        'override' => array(
518 518
         'button' => 'Use default',
519
-      ),
520
-      'relationship' => 'none',
519
+        ),
520
+        'relationship' => 'none',
521 521
     ),
522 522
     'create_time' => array(
523
-      'label' => 'Member Since',
524
-      'alter' => array(
523
+        'label' => 'Member Since',
524
+        'alter' => array(
525 525
         'alter_text' => 0,
526 526
         'text' => '',
527 527
         'make_link' => 0,
@@ -540,43 +540,43 @@  discard block
 block discarded – undo
540 540
         'ellipsis' => 1,
541 541
         'html' => 0,
542 542
         'strip_tags' => 0,
543
-      ),
544
-      'empty' => '',
545
-      'hide_empty' => 0,
546
-      'empty_zero' => 0,
547
-      'hide_alter_empty' => 1,
548
-      'date_format' => 'custom',
549
-      'custom_date_format' => 'j M Y G:i:s T',
550
-      'exclude' => 0,
551
-      'id' => 'create_time',
552
-      'table' => 'user',
553
-      'field' => 'create_time',
554
-      'relationship' => 'none',
555
-      'override' => array(
543
+        ),
544
+        'empty' => '',
545
+        'hide_empty' => 0,
546
+        'empty_zero' => 0,
547
+        'hide_alter_empty' => 1,
548
+        'date_format' => 'custom',
549
+        'custom_date_format' => 'j M Y G:i:s T',
550
+        'exclude' => 0,
551
+        'id' => 'create_time',
552
+        'table' => 'user',
553
+        'field' => 'create_time',
554
+        'relationship' => 'none',
555
+        'override' => array(
556 556
         'button' => 'Use default',
557
-      ),
557
+        ),
558 558
     ),
559
-  ));
560
-  $handler->override_option('arguments', array(
559
+    ));
560
+    $handler->override_option('arguments', array(
561 561
     'teamid' => array(
562
-      'default_action' => 'empty',
563
-      'style_plugin' => 'default_summary',
564
-      'style_options' => array(),
565
-      'wildcard' => 'all',
566
-      'wildcard_substitution' => 'All',
567
-      'title' => '',
568
-      'breadcrumb' => '',
569
-      'default_argument_type' => 'fixed',
570
-      'default_argument' => '',
571
-      'validate_type' => 'numeric',
572
-      'validate_fail' => 'not found',
573
-      'break_phrase' => 0,
574
-      'not' => 0,
575
-      'id' => 'teamid',
576
-      'table' => 'user',
577
-      'field' => 'teamid',
578
-      'validate_user_argument_type' => 'uid',
579
-      'validate_user_roles' => array(
562
+        'default_action' => 'empty',
563
+        'style_plugin' => 'default_summary',
564
+        'style_options' => array(),
565
+        'wildcard' => 'all',
566
+        'wildcard_substitution' => 'All',
567
+        'title' => '',
568
+        'breadcrumb' => '',
569
+        'default_argument_type' => 'fixed',
570
+        'default_argument' => '',
571
+        'validate_type' => 'numeric',
572
+        'validate_fail' => 'not found',
573
+        'break_phrase' => 0,
574
+        'not' => 0,
575
+        'id' => 'teamid',
576
+        'table' => 'user',
577
+        'field' => 'teamid',
578
+        'validate_user_argument_type' => 'uid',
579
+        'validate_user_roles' => array(
580 580
         2 => 0,
581 581
         3519698132 => 0,
582 582
         1110965548 => 0,
@@ -585,10 +585,10 @@  discard block
 block discarded – undo
585 585
         268174006 => 0,
586 586
         1271379760 => 0,
587 587
         933038561 => 0,
588
-      ),
589
-      'me_redirect' => 0,
590
-      'me_validate_user_argument_type' => 'uid',
591
-      'me_validate_user_roles' => array(
588
+        ),
589
+        'me_redirect' => 0,
590
+        'me_validate_user_argument_type' => 'uid',
591
+        'me_validate_user_roles' => array(
592 592
         2 => 0,
593 593
         3519698132 => 0,
594 594
         1110965548 => 0,
@@ -597,23 +597,23 @@  discard block
 block discarded – undo
597 597
         268174006 => 0,
598 598
         1271379760 => 0,
599 599
         933038561 => 0,
600
-      ),
601
-      'override' => array(
600
+        ),
601
+        'override' => array(
602 602
         'button' => 'Use default',
603
-      ),
604
-      'relationship' => 'none',
605
-      'default_options_div_prefix' => '',
606
-      'default_taxonomy_tid_term_page' => 0,
607
-      'default_taxonomy_tid_node' => 0,
608
-      'default_taxonomy_tid_limit' => 0,
609
-      'default_taxonomy_tid_vids' => array(
603
+        ),
604
+        'relationship' => 'none',
605
+        'default_options_div_prefix' => '',
606
+        'default_taxonomy_tid_term_page' => 0,
607
+        'default_taxonomy_tid_node' => 0,
608
+        'default_taxonomy_tid_limit' => 0,
609
+        'default_taxonomy_tid_vids' => array(
610 610
         1 => 0,
611 611
         2 => 0,
612
-      ),
613
-      'default_argument_user' => 0,
614
-      'default_argument_fixed' => '',
615
-      'default_argument_php' => '',
616
-      'validate_argument_node_type' => array(
612
+        ),
613
+        'default_argument_user' => 0,
614
+        'default_argument_fixed' => '',
615
+        'default_argument_php' => '',
616
+        'validate_argument_node_type' => array(
617 617
         'page' => 0,
618 618
         'news' => 0,
619 619
         'profile' => 0,
@@ -621,82 +621,82 @@  discard block
 block discarded – undo
621 621
         'panel' => 0,
622 622
         'story' => 0,
623 623
         'team' => 0,
624
-      ),
625
-      'validate_argument_node_access' => 0,
626
-      'validate_argument_nid_type' => 'nid',
627
-      'validate_argument_vocabulary' => array(
624
+        ),
625
+        'validate_argument_node_access' => 0,
626
+        'validate_argument_nid_type' => 'nid',
627
+        'validate_argument_vocabulary' => array(
628 628
         1 => 0,
629 629
         2 => 0,
630
-      ),
631
-      'validate_argument_type' => 'tid',
632
-      'validate_argument_transform' => 0,
633
-      'validate_user_restrict_roles' => 0,
634
-      'validate_argument_node_flag_name' => '*relationship*',
635
-      'validate_argument_node_flag_test' => 'flaggable',
636
-      'validate_argument_node_flag_id_type' => 'id',
637
-      'validate_argument_user_flag_name' => '*relationship*',
638
-      'validate_argument_user_flag_test' => 'flaggable',
639
-      'validate_argument_user_flag_id_type' => 'id',
640
-      'validate_argument_php' => '',
641
-      'me_validate_user_restrict_roles' => 0,
642
-    ),
643
-  ));
644
-  $handler->override_option('use_pager', '1');
645
-  $handler->override_option('style_plugin', 'table');
646
-  $handler->override_option('style_options', array(
630
+        ),
631
+        'validate_argument_type' => 'tid',
632
+        'validate_argument_transform' => 0,
633
+        'validate_user_restrict_roles' => 0,
634
+        'validate_argument_node_flag_name' => '*relationship*',
635
+        'validate_argument_node_flag_test' => 'flaggable',
636
+        'validate_argument_node_flag_id_type' => 'id',
637
+        'validate_argument_user_flag_name' => '*relationship*',
638
+        'validate_argument_user_flag_test' => 'flaggable',
639
+        'validate_argument_user_flag_id_type' => 'id',
640
+        'validate_argument_php' => '',
641
+        'me_validate_user_restrict_roles' => 0,
642
+    ),
643
+    ));
644
+    $handler->override_option('use_pager', '1');
645
+    $handler->override_option('style_plugin', 'table');
646
+    $handler->override_option('style_options', array(
647 647
     'grouping' => '',
648 648
     'override' => 1,
649 649
     'sticky' => 1,
650 650
     'order' => 'desc',
651 651
     'summary' => '',
652 652
     'columns' => array(
653
-      'id' => 'id',
654
-      'name' => 'name',
655
-      'email_addr' => 'email_addr',
656
-      'total_credit' => 'total_credit',
657
-      'expavg_credit' => 'expavg_credit',
658
-      'country' => 'country',
659
-      'create_time' => 'create_time',
653
+        'id' => 'id',
654
+        'name' => 'name',
655
+        'email_addr' => 'email_addr',
656
+        'total_credit' => 'total_credit',
657
+        'expavg_credit' => 'expavg_credit',
658
+        'country' => 'country',
659
+        'create_time' => 'create_time',
660 660
     ),
661 661
     'info' => array(
662
-      'id' => array(
662
+        'id' => array(
663 663
         'sortable' => 0,
664 664
         'separator' => '',
665
-      ),
666
-      'name' => array(
665
+        ),
666
+        'name' => array(
667 667
         'sortable' => 1,
668 668
         'separator' => '',
669
-      ),
670
-      'email_addr' => array(
669
+        ),
670
+        'email_addr' => array(
671 671
         'sortable' => 0,
672 672
         'separator' => '',
673
-      ),
674
-      'total_credit' => array(
673
+        ),
674
+        'total_credit' => array(
675 675
         'sortable' => 1,
676 676
         'separator' => '',
677
-      ),
678
-      'expavg_credit' => array(
677
+        ),
678
+        'expavg_credit' => array(
679 679
         'sortable' => 1,
680 680
         'separator' => '',
681
-      ),
682
-      'country' => array(
681
+        ),
682
+        'country' => array(
683 683
         'sortable' => 1,
684 684
         'separator' => '',
685
-      ),
686
-      'create_time' => array(
685
+        ),
686
+        'create_time' => array(
687 687
         'sortable' => 0,
688 688
         'separator' => '',
689
-      ),
689
+        ),
690 690
     ),
691 691
     'default' => 'expavg_credit',
692
-  ));
693
-  $handler->override_option('pane_title', 'Team member list');
694
-  $handler->override_option('pane_description', '');
695
-  $handler->override_option('pane_category', array(
692
+    ));
693
+    $handler->override_option('pane_title', 'Team member list');
694
+    $handler->override_option('pane_description', '');
695
+    $handler->override_option('pane_category', array(
696 696
     'name' => 'View panes',
697 697
     'weight' => 0,
698
-  ));
699
-  $handler->override_option('allow', array(
698
+    ));
699
+    $handler->override_option('allow', array(
700 700
     'use_pager' => 0,
701 701
     'items_per_page' => 'items_per_page',
702 702
     'offset' => 0,
@@ -706,24 +706,24 @@  discard block
 block discarded – undo
706 706
     'title_override' => 'title_override',
707 707
     'exposed_form' => 0,
708 708
     'fields_override' => 0,
709
-  ));
710
-  $handler->override_option('argument_input', array(
709
+    ));
710
+    $handler->override_option('argument_input', array(
711 711
     'teamid' => array(
712
-      'type' => 'panel',
713
-      'context' => 'term.description',
714
-      'context_optional' => 0,
715
-      'panel' => '0',
716
-      'fixed' => '',
717
-      'label' => 'BOINC: Team ID',
718
-    ),
719
-  ));
720
-  $handler->override_option('link_to_view', 0);
721
-  $handler->override_option('inherit_panels_path', 0);
722
-  $handler = $view->new_display('panel_pane', 'Team member list for admin', 'panel_pane_2');
723
-  $handler->override_option('fields', array(
712
+        'type' => 'panel',
713
+        'context' => 'term.description',
714
+        'context_optional' => 0,
715
+        'panel' => '0',
716
+        'fixed' => '',
717
+        'label' => 'BOINC: Team ID',
718
+    ),
719
+    ));
720
+    $handler->override_option('link_to_view', 0);
721
+    $handler->override_option('inherit_panels_path', 0);
722
+    $handler = $view->new_display('panel_pane', 'Team member list for admin', 'panel_pane_2');
723
+    $handler->override_option('fields', array(
724 724
     'rownumber' => array(
725
-      'label' => 'Rank',
726
-      'alter' => array(
725
+        'label' => 'Rank',
726
+        'alter' => array(
727 727
         'alter_text' => 0,
728 728
         'text' => '',
729 729
         'make_link' => 0,
@@ -742,23 +742,23 @@  discard block
 block discarded – undo
742 742
         'ellipsis' => 1,
743 743
         'html' => 0,
744 744
         'strip_tags' => 0,
745
-      ),
746
-      'empty' => '',
747
-      'hide_empty' => 0,
748
-      'empty_zero' => 0,
749
-      'hide_alter_empty' => 1,
750
-      'exclude' => 0,
751
-      'id' => 'rownumber',
752
-      'table' => 'customfield',
753
-      'field' => 'rownumber',
754
-      'override' => array(
745
+        ),
746
+        'empty' => '',
747
+        'hide_empty' => 0,
748
+        'empty_zero' => 0,
749
+        'hide_alter_empty' => 1,
750
+        'exclude' => 0,
751
+        'id' => 'rownumber',
752
+        'table' => 'customfield',
753
+        'field' => 'rownumber',
754
+        'override' => array(
755 755
         'button' => 'Use default',
756
-      ),
757
-      'relationship' => 'none',
756
+        ),
757
+        'relationship' => 'none',
758 758
     ),
759 759
     'id' => array(
760
-      'label' => 'Id',
761
-      'alter' => array(
760
+        'label' => 'Id',
761
+        'alter' => array(
762 762
         'alter_text' => 0,
763 763
         'text' => '',
764 764
         'make_link' => 0,
@@ -777,32 +777,32 @@  discard block
 block discarded – undo
777 777
         'ellipsis' => 1,
778 778
         'html' => 0,
779 779
         'strip_tags' => 0,
780
-      ),
781
-      'empty' => '',
782
-      'hide_empty' => 0,
783
-      'empty_zero' => 0,
784
-      'hide_alter_empty' => 1,
785
-      'set_precision' => FALSE,
786
-      'precision' => 0,
787
-      'decimal' => '.',
788
-      'separator' => '',
789
-      'format_plural' => 0,
790
-      'format_plural_singular' => '1',
791
-      'format_plural_plural' => '@count',
792
-      'prefix' => '',
793
-      'suffix' => '',
794
-      'exclude' => 1,
795
-      'id' => 'id',
796
-      'table' => 'user',
797
-      'field' => 'id',
798
-      'relationship' => 'none',
799
-      'override' => array(
780
+        ),
781
+        'empty' => '',
782
+        'hide_empty' => 0,
783
+        'empty_zero' => 0,
784
+        'hide_alter_empty' => 1,
785
+        'set_precision' => FALSE,
786
+        'precision' => 0,
787
+        'decimal' => '.',
788
+        'separator' => '',
789
+        'format_plural' => 0,
790
+        'format_plural_singular' => '1',
791
+        'format_plural_plural' => '@count',
792
+        'prefix' => '',
793
+        'suffix' => '',
794
+        'exclude' => 1,
795
+        'id' => 'id',
796
+        'table' => 'user',
797
+        'field' => 'id',
798
+        'relationship' => 'none',
799
+        'override' => array(
800 800
         'button' => 'Use default',
801
-      ),
801
+        ),
802 802
     ),
803 803
     'phpcode_2' => array(
804
-      'label' => 'Uid',
805
-      'alter' => array(
804
+        'label' => 'Uid',
805
+        'alter' => array(
806 806
         'alter_text' => 0,
807 807
         'text' => '',
808 808
         'make_link' => 0,
@@ -821,26 +821,26 @@  discard block
 block discarded – undo
821 821
         'ellipsis' => 1,
822 822
         'html' => 0,
823 823
         'strip_tags' => 0,
824
-      ),
825
-      'empty' => '',
826
-      'hide_empty' => 0,
827
-      'empty_zero' => 0,
828
-      'hide_alter_empty' => 1,
829
-      'value' => '<?php
824
+        ),
825
+        'empty' => '',
826
+        'hide_empty' => 0,
827
+        'empty_zero' => 0,
828
+        'hide_alter_empty' => 1,
829
+        'value' => '<?php
830 830
   echo boincuser_lookup_uid($data->id);
831 831
 ?>',
832
-      'exclude' => 1,
833
-      'id' => 'phpcode_2',
834
-      'table' => 'customfield',
835
-      'field' => 'phpcode',
836
-      'override' => array(
832
+        'exclude' => 1,
833
+        'id' => 'phpcode_2',
834
+        'table' => 'customfield',
835
+        'field' => 'phpcode',
836
+        'override' => array(
837 837
         'button' => 'Use default',
838
-      ),
839
-      'relationship' => 'none',
838
+        ),
839
+        'relationship' => 'none',
840 840
     ),
841 841
     'name' => array(
842
-      'label' => 'Name',
843
-      'alter' => array(
842
+        'label' => 'Name',
843
+        'alter' => array(
844 844
         'alter_text' => 0,
845 845
         'text' => '',
846 846
         'make_link' => 1,
@@ -859,23 +859,23 @@  discard block
 block discarded – undo
859 859
         'ellipsis' => 1,
860 860
         'html' => 0,
861 861
         'strip_tags' => 0,
862
-      ),
863
-      'empty' => '',
864
-      'hide_empty' => 0,
865
-      'empty_zero' => 0,
866
-      'hide_alter_empty' => 1,
867
-      'exclude' => 0,
868
-      'id' => 'name',
869
-      'table' => 'user',
870
-      'field' => 'name',
871
-      'relationship' => 'none',
872
-      'override' => array(
862
+        ),
863
+        'empty' => '',
864
+        'hide_empty' => 0,
865
+        'empty_zero' => 0,
866
+        'hide_alter_empty' => 1,
867
+        'exclude' => 0,
868
+        'id' => 'name',
869
+        'table' => 'user',
870
+        'field' => 'name',
871
+        'relationship' => 'none',
872
+        'override' => array(
873 873
         'button' => 'Use default',
874
-      ),
874
+        ),
875 875
     ),
876 876
     'total_credit' => array(
877
-      'label' => 'Total Credit',
878
-      'alter' => array(
877
+        'label' => 'Total Credit',
878
+        'alter' => array(
879 879
         'alter_text' => 0,
880 880
         'text' => '',
881 881
         'make_link' => 0,
@@ -894,32 +894,32 @@  discard block
 block discarded – undo
894 894
         'ellipsis' => 1,
895 895
         'html' => 0,
896 896
         'strip_tags' => 0,
897
-      ),
898
-      'empty' => '',
899
-      'hide_empty' => 0,
900
-      'empty_zero' => 0,
901
-      'hide_alter_empty' => 1,
902
-      'set_precision' => 1,
903
-      'precision' => '0',
904
-      'decimal' => '.',
905
-      'separator' => ',',
906
-      'format_plural' => 0,
907
-      'format_plural_singular' => '1',
908
-      'format_plural_plural' => '@count',
909
-      'prefix' => '',
910
-      'suffix' => '',
911
-      'exclude' => 0,
912
-      'id' => 'total_credit',
913
-      'table' => 'user',
914
-      'field' => 'total_credit',
915
-      'relationship' => 'none',
916
-      'override' => array(
897
+        ),
898
+        'empty' => '',
899
+        'hide_empty' => 0,
900
+        'empty_zero' => 0,
901
+        'hide_alter_empty' => 1,
902
+        'set_precision' => 1,
903
+        'precision' => '0',
904
+        'decimal' => '.',
905
+        'separator' => ',',
906
+        'format_plural' => 0,
907
+        'format_plural_singular' => '1',
908
+        'format_plural_plural' => '@count',
909
+        'prefix' => '',
910
+        'suffix' => '',
911
+        'exclude' => 0,
912
+        'id' => 'total_credit',
913
+        'table' => 'user',
914
+        'field' => 'total_credit',
915
+        'relationship' => 'none',
916
+        'override' => array(
917 917
         'button' => 'Use default',
918
-      ),
918
+        ),
919 919
     ),
920 920
     'expavg_credit' => array(
921
-      'label' => 'Recent average credit',
922
-      'alter' => array(
921
+        'label' => 'Recent average credit',
922
+        'alter' => array(
923 923
         'alter_text' => 0,
924 924
         'text' => '',
925 925
         'make_link' => 0,
@@ -938,29 +938,29 @@  discard block
 block discarded – undo
938 938
         'ellipsis' => 1,
939 939
         'html' => 0,
940 940
         'strip_tags' => 0,
941
-      ),
942
-      'empty' => '',
943
-      'hide_empty' => 0,
944
-      'empty_zero' => 0,
945
-      'hide_alter_empty' => 1,
946
-      'set_precision' => 1,
947
-      'precision' => '2',
948
-      'decimal' => '.',
949
-      'separator' => ',',
950
-      'format_plural' => 0,
951
-      'format_plural_singular' => '1',
952
-      'format_plural_plural' => '@count',
953
-      'prefix' => '',
954
-      'suffix' => '',
955
-      'exclude' => 0,
956
-      'id' => 'expavg_credit',
957
-      'table' => 'user',
958
-      'field' => 'expavg_credit',
959
-      'relationship' => 'none',
941
+        ),
942
+        'empty' => '',
943
+        'hide_empty' => 0,
944
+        'empty_zero' => 0,
945
+        'hide_alter_empty' => 1,
946
+        'set_precision' => 1,
947
+        'precision' => '2',
948
+        'decimal' => '.',
949
+        'separator' => ',',
950
+        'format_plural' => 0,
951
+        'format_plural_singular' => '1',
952
+        'format_plural_plural' => '@count',
953
+        'prefix' => '',
954
+        'suffix' => '',
955
+        'exclude' => 0,
956
+        'id' => 'expavg_credit',
957
+        'table' => 'user',
958
+        'field' => 'expavg_credit',
959
+        'relationship' => 'none',
960 960
     ),
961 961
     'country' => array(
962
-      'label' => 'Country',
963
-      'alter' => array(
962
+        'label' => 'Country',
963
+        'alter' => array(
964 964
         'alter_text' => 0,
965 965
         'text' => '',
966 966
         'make_link' => 0,
@@ -979,23 +979,23 @@  discard block
 block discarded – undo
979 979
         'ellipsis' => 1,
980 980
         'html' => 0,
981 981
         'strip_tags' => 0,
982
-      ),
983
-      'empty' => '',
984
-      'hide_empty' => 0,
985
-      'empty_zero' => 0,
986
-      'hide_alter_empty' => 1,
987
-      'exclude' => 0,
988
-      'id' => 'country',
989
-      'table' => 'user',
990
-      'field' => 'country',
991
-      'override' => array(
982
+        ),
983
+        'empty' => '',
984
+        'hide_empty' => 0,
985
+        'empty_zero' => 0,
986
+        'hide_alter_empty' => 1,
987
+        'exclude' => 0,
988
+        'id' => 'country',
989
+        'table' => 'user',
990
+        'field' => 'country',
991
+        'override' => array(
992 992
         'button' => 'Use default',
993
-      ),
994
-      'relationship' => 'none',
993
+        ),
994
+        'relationship' => 'none',
995 995
     ),
996 996
     'create_time' => array(
997
-      'label' => 'Member Since',
998
-      'alter' => array(
997
+        'label' => 'Member Since',
998
+        'alter' => array(
999 999
         'alter_text' => 0,
1000 1000
         'text' => '',
1001 1001
         'make_link' => 0,
@@ -1014,25 +1014,25 @@  discard block
 block discarded – undo
1014 1014
         'ellipsis' => 1,
1015 1015
         'html' => 0,
1016 1016
         'strip_tags' => 0,
1017
-      ),
1018
-      'empty' => '',
1019
-      'hide_empty' => 0,
1020
-      'empty_zero' => 0,
1021
-      'hide_alter_empty' => 1,
1022
-      'date_format' => 'custom',
1023
-      'custom_date_format' => 'j M Y G:i:s T',
1024
-      'exclude' => 0,
1025
-      'id' => 'create_time',
1026
-      'table' => 'user',
1027
-      'field' => 'create_time',
1028
-      'relationship' => 'none',
1029
-      'override' => array(
1017
+        ),
1018
+        'empty' => '',
1019
+        'hide_empty' => 0,
1020
+        'empty_zero' => 0,
1021
+        'hide_alter_empty' => 1,
1022
+        'date_format' => 'custom',
1023
+        'custom_date_format' => 'j M Y G:i:s T',
1024
+        'exclude' => 0,
1025
+        'id' => 'create_time',
1026
+        'table' => 'user',
1027
+        'field' => 'create_time',
1028
+        'relationship' => 'none',
1029
+        'override' => array(
1030 1030
         'button' => 'Use default',
1031
-      ),
1031
+        ),
1032 1032
     ),
1033 1033
     'phpcode_1' => array(
1034
-      'label' => '',
1035
-      'alter' => array(
1034
+        'label' => '',
1035
+        'alter' => array(
1036 1036
         'alter_text' => 0,
1037 1037
         'text' => '',
1038 1038
         'make_link' => 0,
@@ -1051,12 +1051,12 @@  discard block
 block discarded – undo
1051 1051
         'ellipsis' => 1,
1052 1052
         'html' => 0,
1053 1053
         'strip_tags' => 0,
1054
-      ),
1055
-      'empty' => '',
1056
-      'hide_empty' => 0,
1057
-      'empty_zero' => 0,
1058
-      'hide_alter_empty' => 1,
1059
-      'value' => '<?php
1054
+        ),
1055
+        'empty' => '',
1056
+        'hide_empty' => 0,
1057
+        'empty_zero' => 0,
1058
+        'hide_alter_empty' => 1,
1059
+        'value' => '<?php
1060 1060
   global $user;
1061 1061
   $team_id = arg(2);
1062 1062
   $user_id = boincuser_lookup_uid($data->id);
@@ -1064,36 +1064,36 @@  discard block
 block discarded – undo
1064 1064
     echo l(bts(\'Remove\', array(), NULL, \'boinc:remove-team-member\'), "community/teams/{$team_id}/edit/members/remove/{$user_id}");
1065 1065
   }
1066 1066
 ?>',
1067
-      'exclude' => 1,
1068
-      'id' => 'phpcode_1',
1069
-      'table' => 'customfield',
1070
-      'field' => 'phpcode',
1071
-      'override' => array(
1067
+        'exclude' => 1,
1068
+        'id' => 'phpcode_1',
1069
+        'table' => 'customfield',
1070
+        'field' => 'phpcode',
1071
+        'override' => array(
1072 1072
         'button' => 'Use default',
1073
-      ),
1074
-      'relationship' => 'none',
1073
+        ),
1074
+        'relationship' => 'none',
1075 1075
     ),
1076
-  ));
1077
-  $handler->override_option('arguments', array(
1076
+    ));
1077
+    $handler->override_option('arguments', array(
1078 1078
     'teamid' => array(
1079
-      'default_action' => 'empty',
1080
-      'style_plugin' => 'default_summary',
1081
-      'style_options' => array(),
1082
-      'wildcard' => 'all',
1083
-      'wildcard_substitution' => 'All',
1084
-      'title' => '',
1085
-      'breadcrumb' => '',
1086
-      'default_argument_type' => 'fixed',
1087
-      'default_argument' => '',
1088
-      'validate_type' => 'numeric',
1089
-      'validate_fail' => 'not found',
1090
-      'break_phrase' => 0,
1091
-      'not' => 0,
1092
-      'id' => 'teamid',
1093
-      'table' => 'user',
1094
-      'field' => 'teamid',
1095
-      'validate_user_argument_type' => 'uid',
1096
-      'validate_user_roles' => array(
1079
+        'default_action' => 'empty',
1080
+        'style_plugin' => 'default_summary',
1081
+        'style_options' => array(),
1082
+        'wildcard' => 'all',
1083
+        'wildcard_substitution' => 'All',
1084
+        'title' => '',
1085
+        'breadcrumb' => '',
1086
+        'default_argument_type' => 'fixed',
1087
+        'default_argument' => '',
1088
+        'validate_type' => 'numeric',
1089
+        'validate_fail' => 'not found',
1090
+        'break_phrase' => 0,
1091
+        'not' => 0,
1092
+        'id' => 'teamid',
1093
+        'table' => 'user',
1094
+        'field' => 'teamid',
1095
+        'validate_user_argument_type' => 'uid',
1096
+        'validate_user_roles' => array(
1097 1097
         2 => 0,
1098 1098
         3519698132 => 0,
1099 1099
         1110965548 => 0,
@@ -1102,10 +1102,10 @@  discard block
 block discarded – undo
1102 1102
         268174006 => 0,
1103 1103
         1271379760 => 0,
1104 1104
         933038561 => 0,
1105
-      ),
1106
-      'me_redirect' => 0,
1107
-      'me_validate_user_argument_type' => 'uid',
1108
-      'me_validate_user_roles' => array(
1105
+        ),
1106
+        'me_redirect' => 0,
1107
+        'me_validate_user_argument_type' => 'uid',
1108
+        'me_validate_user_roles' => array(
1109 1109
         2 => 0,
1110 1110
         3519698132 => 0,
1111 1111
         1110965548 => 0,
@@ -1114,23 +1114,23 @@  discard block
 block discarded – undo
1114 1114
         268174006 => 0,
1115 1115
         1271379760 => 0,
1116 1116
         933038561 => 0,
1117
-      ),
1118
-      'override' => array(
1117
+        ),
1118
+        'override' => array(
1119 1119
         'button' => 'Use default',
1120
-      ),
1121
-      'relationship' => 'none',
1122
-      'default_options_div_prefix' => '',
1123
-      'default_taxonomy_tid_term_page' => 0,
1124
-      'default_taxonomy_tid_node' => 0,
1125
-      'default_taxonomy_tid_limit' => 0,
1126
-      'default_taxonomy_tid_vids' => array(
1120
+        ),
1121
+        'relationship' => 'none',
1122
+        'default_options_div_prefix' => '',
1123
+        'default_taxonomy_tid_term_page' => 0,
1124
+        'default_taxonomy_tid_node' => 0,
1125
+        'default_taxonomy_tid_limit' => 0,
1126
+        'default_taxonomy_tid_vids' => array(
1127 1127
         1 => 0,
1128 1128
         2 => 0,
1129
-      ),
1130
-      'default_argument_user' => 0,
1131
-      'default_argument_fixed' => '',
1132
-      'default_argument_php' => '',
1133
-      'validate_argument_node_type' => array(
1129
+        ),
1130
+        'default_argument_user' => 0,
1131
+        'default_argument_fixed' => '',
1132
+        'default_argument_php' => '',
1133
+        'validate_argument_node_type' => array(
1134 1134
         'page' => 0,
1135 1135
         'news' => 0,
1136 1136
         'profile' => 0,
@@ -1138,82 +1138,82 @@  discard block
 block discarded – undo
1138 1138
         'panel' => 0,
1139 1139
         'story' => 0,
1140 1140
         'team' => 0,
1141
-      ),
1142
-      'validate_argument_node_access' => 0,
1143
-      'validate_argument_nid_type' => 'nid',
1144
-      'validate_argument_vocabulary' => array(
1141
+        ),
1142
+        'validate_argument_node_access' => 0,
1143
+        'validate_argument_nid_type' => 'nid',
1144
+        'validate_argument_vocabulary' => array(
1145 1145
         1 => 0,
1146 1146
         2 => 0,
1147
-      ),
1148
-      'validate_argument_type' => 'tid',
1149
-      'validate_argument_transform' => 0,
1150
-      'validate_user_restrict_roles' => 0,
1151
-      'validate_argument_node_flag_name' => '*relationship*',
1152
-      'validate_argument_node_flag_test' => 'flaggable',
1153
-      'validate_argument_node_flag_id_type' => 'id',
1154
-      'validate_argument_user_flag_name' => '*relationship*',
1155
-      'validate_argument_user_flag_test' => 'flaggable',
1156
-      'validate_argument_user_flag_id_type' => 'id',
1157
-      'validate_argument_php' => '',
1158
-      'me_validate_user_restrict_roles' => 0,
1159
-    ),
1160
-  ));
1161
-  $handler->override_option('use_pager', '1');
1162
-  $handler->override_option('style_plugin', 'table');
1163
-  $handler->override_option('style_options', array(
1147
+        ),
1148
+        'validate_argument_type' => 'tid',
1149
+        'validate_argument_transform' => 0,
1150
+        'validate_user_restrict_roles' => 0,
1151
+        'validate_argument_node_flag_name' => '*relationship*',
1152
+        'validate_argument_node_flag_test' => 'flaggable',
1153
+        'validate_argument_node_flag_id_type' => 'id',
1154
+        'validate_argument_user_flag_name' => '*relationship*',
1155
+        'validate_argument_user_flag_test' => 'flaggable',
1156
+        'validate_argument_user_flag_id_type' => 'id',
1157
+        'validate_argument_php' => '',
1158
+        'me_validate_user_restrict_roles' => 0,
1159
+    ),
1160
+    ));
1161
+    $handler->override_option('use_pager', '1');
1162
+    $handler->override_option('style_plugin', 'table');
1163
+    $handler->override_option('style_options', array(
1164 1164
     'grouping' => '',
1165 1165
     'override' => 1,
1166 1166
     'sticky' => 1,
1167 1167
     'order' => 'desc',
1168 1168
     'summary' => '',
1169 1169
     'columns' => array(
1170
-      'id' => 'id',
1171
-      'name' => 'name',
1172
-      'email_addr' => 'email_addr',
1173
-      'total_credit' => 'total_credit',
1174
-      'expavg_credit' => 'expavg_credit',
1175
-      'country' => 'country',
1176
-      'create_time' => 'create_time',
1170
+        'id' => 'id',
1171
+        'name' => 'name',
1172
+        'email_addr' => 'email_addr',
1173
+        'total_credit' => 'total_credit',
1174
+        'expavg_credit' => 'expavg_credit',
1175
+        'country' => 'country',
1176
+        'create_time' => 'create_time',
1177 1177
     ),
1178 1178
     'info' => array(
1179
-      'id' => array(
1179
+        'id' => array(
1180 1180
         'sortable' => 0,
1181 1181
         'separator' => '',
1182
-      ),
1183
-      'name' => array(
1182
+        ),
1183
+        'name' => array(
1184 1184
         'sortable' => 1,
1185 1185
         'separator' => '',
1186
-      ),
1187
-      'email_addr' => array(
1186
+        ),
1187
+        'email_addr' => array(
1188 1188
         'sortable' => 1,
1189 1189
         'separator' => '',
1190
-      ),
1191
-      'total_credit' => array(
1190
+        ),
1191
+        'total_credit' => array(
1192 1192
         'sortable' => 1,
1193 1193
         'separator' => '',
1194
-      ),
1195
-      'expavg_credit' => array(
1194
+        ),
1195
+        'expavg_credit' => array(
1196 1196
         'sortable' => 1,
1197 1197
         'separator' => '',
1198
-      ),
1199
-      'country' => array(
1198
+        ),
1199
+        'country' => array(
1200 1200
         'sortable' => 1,
1201 1201
         'separator' => '',
1202
-      ),
1203
-      'create_time' => array(
1202
+        ),
1203
+        'create_time' => array(
1204 1204
         'sortable' => 0,
1205 1205
         'separator' => '',
1206
-      ),
1206
+        ),
1207 1207
     ),
1208 1208
     'default' => 'expavg_credit',
1209
-  ));
1210
-  $handler->override_option('pane_title', 'Team member list with email');
1211
-  $handler->override_option('pane_description', '');
1212
-  $handler->override_option('pane_category', array(
1209
+    ));
1210
+    $handler->override_option('pane_title', 'Team member list with email');
1211
+    $handler->override_option('pane_description', '');
1212
+    $handler->override_option('pane_category', array(
1213 1213
     'name' => 'View panes',
1214 1214
     'weight' => 0,
1215
-  ));
1216
-  $handler->override_option('allow', array(
1215
+    ));
1216
+    $handler->override_option('allow', array(
1217 1217
     'use_pager' => 0,
1218 1218
     'items_per_page' => 'items_per_page',
1219 1219
     'offset' => 0,
@@ -1223,24 +1223,24 @@  discard block
 block discarded – undo
1223 1223
     'title_override' => 'title_override',
1224 1224
     'exposed_form' => 0,
1225 1225
     'fields_override' => 0,
1226
-  ));
1227
-  $handler->override_option('argument_input', array(
1226
+    ));
1227
+    $handler->override_option('argument_input', array(
1228 1228
     'teamid' => array(
1229
-      'type' => 'panel',
1230
-      'context' => 'term.description',
1231
-      'context_optional' => 0,
1232
-      'panel' => '0',
1233
-      'fixed' => '',
1234
-      'label' => 'BOINC: Team ID',
1235
-    ),
1236
-  ));
1237
-  $handler->override_option('link_to_view', 0);
1238
-  $handler->override_option('inherit_panels_path', 0);
1239
-  $handler = $view->new_display('panel_pane', 'Team email list', 'panel_pane_3');
1240
-  $handler->override_option('fields', array(
1229
+        'type' => 'panel',
1230
+        'context' => 'term.description',
1231
+        'context_optional' => 0,
1232
+        'panel' => '0',
1233
+        'fixed' => '',
1234
+        'label' => 'BOINC: Team ID',
1235
+    ),
1236
+    ));
1237
+    $handler->override_option('link_to_view', 0);
1238
+    $handler->override_option('inherit_panels_path', 0);
1239
+    $handler = $view->new_display('panel_pane', 'Team email list', 'panel_pane_3');
1240
+    $handler->override_option('fields', array(
1241 1241
     'id' => array(
1242
-      'label' => 'Id',
1243
-      'alter' => array(
1242
+        'label' => 'Id',
1243
+        'alter' => array(
1244 1244
         'alter_text' => 0,
1245 1245
         'text' => '',
1246 1246
         'make_link' => 0,
@@ -1259,32 +1259,32 @@  discard block
 block discarded – undo
1259 1259
         'ellipsis' => 1,
1260 1260
         'html' => 0,
1261 1261
         'strip_tags' => 0,
1262
-      ),
1263
-      'empty' => '',
1264
-      'hide_empty' => 0,
1265
-      'empty_zero' => 0,
1266
-      'hide_alter_empty' => 1,
1267
-      'set_precision' => FALSE,
1268
-      'precision' => 0,
1269
-      'decimal' => '.',
1270
-      'separator' => '',
1271
-      'format_plural' => 0,
1272
-      'format_plural_singular' => '1',
1273
-      'format_plural_plural' => '@count',
1274
-      'prefix' => '',
1275
-      'suffix' => '',
1276
-      'exclude' => 1,
1277
-      'id' => 'id',
1278
-      'table' => 'user',
1279
-      'field' => 'id',
1280
-      'relationship' => 'none',
1281
-      'override' => array(
1262
+        ),
1263
+        'empty' => '',
1264
+        'hide_empty' => 0,
1265
+        'empty_zero' => 0,
1266
+        'hide_alter_empty' => 1,
1267
+        'set_precision' => FALSE,
1268
+        'precision' => 0,
1269
+        'decimal' => '.',
1270
+        'separator' => '',
1271
+        'format_plural' => 0,
1272
+        'format_plural_singular' => '1',
1273
+        'format_plural_plural' => '@count',
1274
+        'prefix' => '',
1275
+        'suffix' => '',
1276
+        'exclude' => 1,
1277
+        'id' => 'id',
1278
+        'table' => 'user',
1279
+        'field' => 'id',
1280
+        'relationship' => 'none',
1281
+        'override' => array(
1282 1282
         'button' => 'Use default',
1283
-      ),
1283
+        ),
1284 1284
     ),
1285 1285
     'name' => array(
1286
-      'label' => 'Name',
1287
-      'alter' => array(
1286
+        'label' => 'Name',
1287
+        'alter' => array(
1288 1288
         'alter_text' => 0,
1289 1289
         'text' => '',
1290 1290
         'make_link' => 0,
@@ -1303,23 +1303,23 @@  discard block
 block discarded – undo
1303 1303
         'ellipsis' => 1,
1304 1304
         'html' => 0,
1305 1305
         'strip_tags' => 0,
1306
-      ),
1307
-      'empty' => '',
1308
-      'hide_empty' => 0,
1309
-      'empty_zero' => 0,
1310
-      'hide_alter_empty' => 1,
1311
-      'exclude' => 1,
1312
-      'id' => 'name',
1313
-      'table' => 'user',
1314
-      'field' => 'name',
1315
-      'relationship' => 'none',
1316
-      'override' => array(
1306
+        ),
1307
+        'empty' => '',
1308
+        'hide_empty' => 0,
1309
+        'empty_zero' => 0,
1310
+        'hide_alter_empty' => 1,
1311
+        'exclude' => 1,
1312
+        'id' => 'name',
1313
+        'table' => 'user',
1314
+        'field' => 'name',
1315
+        'relationship' => 'none',
1316
+        'override' => array(
1317 1317
         'button' => 'Use default',
1318
-      ),
1318
+        ),
1319 1319
     ),
1320 1320
     'email_addr' => array(
1321
-      'label' => '',
1322
-      'alter' => array(
1321
+        'label' => '',
1322
+        'alter' => array(
1323 1323
         'alter_text' => 1,
1324 1324
         'text' => '[name] <[email_addr]>',
1325 1325
         'make_link' => 0,
@@ -1338,23 +1338,23 @@  discard block
 block discarded – undo
1338 1338
         'ellipsis' => 1,
1339 1339
         'html' => 0,
1340 1340
         'strip_tags' => 0,
1341
-      ),
1342
-      'empty' => '',
1343
-      'hide_empty' => 0,
1344
-      'empty_zero' => 0,
1345
-      'hide_alter_empty' => 1,
1346
-      'exclude' => 0,
1347
-      'id' => 'email_addr',
1348
-      'table' => 'user',
1349
-      'field' => 'email_addr',
1350
-      'relationship' => 'none',
1351
-      'override' => array(
1341
+        ),
1342
+        'empty' => '',
1343
+        'hide_empty' => 0,
1344
+        'empty_zero' => 0,
1345
+        'hide_alter_empty' => 1,
1346
+        'exclude' => 0,
1347
+        'id' => 'email_addr',
1348
+        'table' => 'user',
1349
+        'field' => 'email_addr',
1350
+        'relationship' => 'none',
1351
+        'override' => array(
1352 1352
         'button' => 'Use default',
1353
-      ),
1353
+        ),
1354 1354
     ),
1355 1355
     'create_time' => array(
1356
-      'label' => 'Member since',
1357
-      'alter' => array(
1356
+        'label' => 'Member since',
1357
+        'alter' => array(
1358 1358
         'alter_text' => 0,
1359 1359
         'text' => '',
1360 1360
         'make_link' => 0,
@@ -1373,43 +1373,43 @@  discard block
 block discarded – undo
1373 1373
         'ellipsis' => 1,
1374 1374
         'html' => 0,
1375 1375
         'strip_tags' => 0,
1376
-      ),
1377
-      'empty' => '',
1378
-      'hide_empty' => 0,
1379
-      'empty_zero' => 0,
1380
-      'hide_alter_empty' => 1,
1381
-      'date_format' => 'small',
1382
-      'custom_date_format' => '',
1383
-      'exclude' => 1,
1384
-      'id' => 'create_time',
1385
-      'table' => 'user',
1386
-      'field' => 'create_time',
1387
-      'relationship' => 'none',
1388
-      'override' => array(
1376
+        ),
1377
+        'empty' => '',
1378
+        'hide_empty' => 0,
1379
+        'empty_zero' => 0,
1380
+        'hide_alter_empty' => 1,
1381
+        'date_format' => 'small',
1382
+        'custom_date_format' => '',
1383
+        'exclude' => 1,
1384
+        'id' => 'create_time',
1385
+        'table' => 'user',
1386
+        'field' => 'create_time',
1387
+        'relationship' => 'none',
1388
+        'override' => array(
1389 1389
         'button' => 'Use default',
1390
-      ),
1390
+        ),
1391 1391
     ),
1392
-  ));
1393
-  $handler->override_option('arguments', array(
1392
+    ));
1393
+    $handler->override_option('arguments', array(
1394 1394
     'teamid' => array(
1395
-      'default_action' => 'empty',
1396
-      'style_plugin' => 'default_summary',
1397
-      'style_options' => array(),
1398
-      'wildcard' => 'all',
1399
-      'wildcard_substitution' => 'All',
1400
-      'title' => '',
1401
-      'breadcrumb' => '',
1402
-      'default_argument_type' => 'fixed',
1403
-      'default_argument' => '',
1404
-      'validate_type' => 'numeric',
1405
-      'validate_fail' => 'not found',
1406
-      'break_phrase' => 0,
1407
-      'not' => 0,
1408
-      'id' => 'teamid',
1409
-      'table' => 'user',
1410
-      'field' => 'teamid',
1411
-      'validate_user_argument_type' => 'uid',
1412
-      'validate_user_roles' => array(
1395
+        'default_action' => 'empty',
1396
+        'style_plugin' => 'default_summary',
1397
+        'style_options' => array(),
1398
+        'wildcard' => 'all',
1399
+        'wildcard_substitution' => 'All',
1400
+        'title' => '',
1401
+        'breadcrumb' => '',
1402
+        'default_argument_type' => 'fixed',
1403
+        'default_argument' => '',
1404
+        'validate_type' => 'numeric',
1405
+        'validate_fail' => 'not found',
1406
+        'break_phrase' => 0,
1407
+        'not' => 0,
1408
+        'id' => 'teamid',
1409
+        'table' => 'user',
1410
+        'field' => 'teamid',
1411
+        'validate_user_argument_type' => 'uid',
1412
+        'validate_user_roles' => array(
1413 1413
         2 => 0,
1414 1414
         3519698132 => 0,
1415 1415
         1110965548 => 0,
@@ -1418,10 +1418,10 @@  discard block
 block discarded – undo
1418 1418
         268174006 => 0,
1419 1419
         1271379760 => 0,
1420 1420
         933038561 => 0,
1421
-      ),
1422
-      'me_redirect' => 0,
1423
-      'me_validate_user_argument_type' => 'uid',
1424
-      'me_validate_user_roles' => array(
1421
+        ),
1422
+        'me_redirect' => 0,
1423
+        'me_validate_user_argument_type' => 'uid',
1424
+        'me_validate_user_roles' => array(
1425 1425
         2 => 0,
1426 1426
         3519698132 => 0,
1427 1427
         1110965548 => 0,
@@ -1430,23 +1430,23 @@  discard block
 block discarded – undo
1430 1430
         268174006 => 0,
1431 1431
         1271379760 => 0,
1432 1432
         933038561 => 0,
1433
-      ),
1434
-      'override' => array(
1433
+        ),
1434
+        'override' => array(
1435 1435
         'button' => 'Use default',
1436
-      ),
1437
-      'relationship' => 'none',
1438
-      'default_options_div_prefix' => '',
1439
-      'default_taxonomy_tid_term_page' => 0,
1440
-      'default_taxonomy_tid_node' => 0,
1441
-      'default_taxonomy_tid_limit' => 0,
1442
-      'default_taxonomy_tid_vids' => array(
1436
+        ),
1437
+        'relationship' => 'none',
1438
+        'default_options_div_prefix' => '',
1439
+        'default_taxonomy_tid_term_page' => 0,
1440
+        'default_taxonomy_tid_node' => 0,
1441
+        'default_taxonomy_tid_limit' => 0,
1442
+        'default_taxonomy_tid_vids' => array(
1443 1443
         1 => 0,
1444 1444
         2 => 0,
1445
-      ),
1446
-      'default_argument_user' => 0,
1447
-      'default_argument_fixed' => '',
1448
-      'default_argument_php' => '',
1449
-      'validate_argument_node_type' => array(
1445
+        ),
1446
+        'default_argument_user' => 0,
1447
+        'default_argument_fixed' => '',
1448
+        'default_argument_php' => '',
1449
+        'validate_argument_node_type' => array(
1450 1450
         'page' => 0,
1451 1451
         'news' => 0,
1452 1452
         'profile' => 0,
@@ -1454,57 +1454,57 @@  discard block
 block discarded – undo
1454 1454
         'panel' => 0,
1455 1455
         'story' => 0,
1456 1456
         'team' => 0,
1457
-      ),
1458
-      'validate_argument_node_access' => 0,
1459
-      'validate_argument_nid_type' => 'nid',
1460
-      'validate_argument_vocabulary' => array(
1457
+        ),
1458
+        'validate_argument_node_access' => 0,
1459
+        'validate_argument_nid_type' => 'nid',
1460
+        'validate_argument_vocabulary' => array(
1461 1461
         1 => 0,
1462 1462
         2 => 0,
1463
-      ),
1464
-      'validate_argument_type' => 'tid',
1465
-      'validate_argument_transform' => 0,
1466
-      'validate_user_restrict_roles' => 0,
1467
-      'validate_argument_node_flag_name' => '*relationship*',
1468
-      'validate_argument_node_flag_test' => 'flaggable',
1469
-      'validate_argument_node_flag_id_type' => 'id',
1470
-      'validate_argument_user_flag_name' => '*relationship*',
1471
-      'validate_argument_user_flag_test' => 'flaggable',
1472
-      'validate_argument_user_flag_id_type' => 'id',
1473
-      'validate_argument_php' => '',
1474
-      'me_validate_user_restrict_roles' => 0,
1475
-    ),
1476
-  ));
1477
-  $handler->override_option('filters', array(
1463
+        ),
1464
+        'validate_argument_type' => 'tid',
1465
+        'validate_argument_transform' => 0,
1466
+        'validate_user_restrict_roles' => 0,
1467
+        'validate_argument_node_flag_name' => '*relationship*',
1468
+        'validate_argument_node_flag_test' => 'flaggable',
1469
+        'validate_argument_node_flag_id_type' => 'id',
1470
+        'validate_argument_user_flag_name' => '*relationship*',
1471
+        'validate_argument_user_flag_test' => 'flaggable',
1472
+        'validate_argument_user_flag_id_type' => 'id',
1473
+        'validate_argument_php' => '',
1474
+        'me_validate_user_restrict_roles' => 0,
1475
+    ),
1476
+    ));
1477
+    $handler->override_option('filters', array(
1478 1478
     'send_email' => array(
1479
-      'operator' => '=',
1480
-      'value' => array(
1479
+        'operator' => '=',
1480
+        'value' => array(
1481 1481
         'value' => '1',
1482 1482
         'min' => '',
1483 1483
         'max' => '',
1484
-      ),
1485
-      'group' => '0',
1486
-      'exposed' => FALSE,
1487
-      'expose' => array(
1484
+        ),
1485
+        'group' => '0',
1486
+        'exposed' => FALSE,
1487
+        'expose' => array(
1488 1488
         'operator' => FALSE,
1489 1489
         'label' => '',
1490
-      ),
1491
-      'id' => 'send_email',
1492
-      'table' => 'user',
1493
-      'field' => 'send_email',
1494
-      'override' => array(
1490
+        ),
1491
+        'id' => 'send_email',
1492
+        'table' => 'user',
1493
+        'field' => 'send_email',
1494
+        'override' => array(
1495 1495
         'button' => 'Use default',
1496
-      ),
1497
-      'relationship' => 'none',
1498
-    ),
1499
-  ));
1500
-  $handler->override_option('use_pager', '1');
1501
-  $handler->override_option('pane_title', 'Team email list');
1502
-  $handler->override_option('pane_description', '');
1503
-  $handler->override_option('pane_category', array(
1496
+        ),
1497
+        'relationship' => 'none',
1498
+    ),
1499
+    ));
1500
+    $handler->override_option('use_pager', '1');
1501
+    $handler->override_option('pane_title', 'Team email list');
1502
+    $handler->override_option('pane_description', '');
1503
+    $handler->override_option('pane_category', array(
1504 1504
     'name' => 'View panes',
1505 1505
     'weight' => 0,
1506
-  ));
1507
-  $handler->override_option('allow', array(
1506
+    ));
1507
+    $handler->override_option('allow', array(
1508 1508
     'use_pager' => 0,
1509 1509
     'items_per_page' => 'items_per_page',
1510 1510
     'offset' => 0,
@@ -1514,24 +1514,24 @@  discard block
 block discarded – undo
1514 1514
     'title_override' => 'title_override',
1515 1515
     'exposed_form' => 0,
1516 1516
     'fields_override' => 0,
1517
-  ));
1518
-  $handler->override_option('argument_input', array(
1517
+    ));
1518
+    $handler->override_option('argument_input', array(
1519 1519
     'teamid' => array(
1520
-      'type' => 'panel',
1521
-      'context' => 'term.description',
1522
-      'context_optional' => 0,
1523
-      'panel' => '0',
1524
-      'fixed' => '',
1525
-      'label' => 'BOINC: Team ID',
1526
-    ),
1527
-  ));
1528
-  $handler->override_option('link_to_view', 0);
1529
-  $handler->override_option('inherit_panels_path', 0);
1530
-  $handler = $view->new_display('panel_pane', 'Team member edit', 'panel_pane_5');
1531
-  $handler->override_option('fields', array(
1520
+        'type' => 'panel',
1521
+        'context' => 'term.description',
1522
+        'context_optional' => 0,
1523
+        'panel' => '0',
1524
+        'fixed' => '',
1525
+        'label' => 'BOINC: Team ID',
1526
+    ),
1527
+    ));
1528
+    $handler->override_option('link_to_view', 0);
1529
+    $handler->override_option('inherit_panels_path', 0);
1530
+    $handler = $view->new_display('panel_pane', 'Team member edit', 'panel_pane_5');
1531
+    $handler->override_option('fields', array(
1532 1532
     'id' => array(
1533
-      'label' => 'Id',
1534
-      'alter' => array(
1533
+        'label' => 'Id',
1534
+        'alter' => array(
1535 1535
         'alter_text' => 0,
1536 1536
         'text' => '',
1537 1537
         'make_link' => 0,
@@ -1550,32 +1550,32 @@  discard block
 block discarded – undo
1550 1550
         'ellipsis' => 1,
1551 1551
         'html' => 0,
1552 1552
         'strip_tags' => 0,
1553
-      ),
1554
-      'empty' => '',
1555
-      'hide_empty' => 0,
1556
-      'empty_zero' => 0,
1557
-      'hide_alter_empty' => 1,
1558
-      'set_precision' => FALSE,
1559
-      'precision' => 0,
1560
-      'decimal' => '.',
1561
-      'separator' => '',
1562
-      'format_plural' => 0,
1563
-      'format_plural_singular' => '1',
1564
-      'format_plural_plural' => '@count',
1565
-      'prefix' => '',
1566
-      'suffix' => '',
1567
-      'exclude' => 1,
1568
-      'id' => 'id',
1569
-      'table' => 'user',
1570
-      'field' => 'id',
1571
-      'relationship' => 'none',
1572
-      'override' => array(
1553
+        ),
1554
+        'empty' => '',
1555
+        'hide_empty' => 0,
1556
+        'empty_zero' => 0,
1557
+        'hide_alter_empty' => 1,
1558
+        'set_precision' => FALSE,
1559
+        'precision' => 0,
1560
+        'decimal' => '.',
1561
+        'separator' => '',
1562
+        'format_plural' => 0,
1563
+        'format_plural_singular' => '1',
1564
+        'format_plural_plural' => '@count',
1565
+        'prefix' => '',
1566
+        'suffix' => '',
1567
+        'exclude' => 1,
1568
+        'id' => 'id',
1569
+        'table' => 'user',
1570
+        'field' => 'id',
1571
+        'relationship' => 'none',
1572
+        'override' => array(
1573 1573
         'button' => 'Use default',
1574
-      ),
1574
+        ),
1575 1575
     ),
1576 1576
     'phpcode' => array(
1577
-      'label' => 'Uid',
1578
-      'alter' => array(
1577
+        'label' => 'Uid',
1578
+        'alter' => array(
1579 1579
         'alter_text' => 0,
1580 1580
         'text' => '',
1581 1581
         'make_link' => 0,
@@ -1594,26 +1594,26 @@  discard block
 block discarded – undo
1594 1594
         'ellipsis' => 1,
1595 1595
         'html' => 0,
1596 1596
         'strip_tags' => 0,
1597
-      ),
1598
-      'empty' => '',
1599
-      'hide_empty' => 0,
1600
-      'empty_zero' => 0,
1601
-      'hide_alter_empty' => 1,
1602
-      'value' => '<?php
1597
+        ),
1598
+        'empty' => '',
1599
+        'hide_empty' => 0,
1600
+        'empty_zero' => 0,
1601
+        'hide_alter_empty' => 1,
1602
+        'value' => '<?php
1603 1603
   echo boincuser_lookup_uid($data->id);
1604 1604
 ?>',
1605
-      'exclude' => 1,
1606
-      'id' => 'phpcode',
1607
-      'table' => 'customfield',
1608
-      'field' => 'phpcode',
1609
-      'override' => array(
1605
+        'exclude' => 1,
1606
+        'id' => 'phpcode',
1607
+        'table' => 'customfield',
1608
+        'field' => 'phpcode',
1609
+        'override' => array(
1610 1610
         'button' => 'Use default',
1611
-      ),
1612
-      'relationship' => 'none',
1611
+        ),
1612
+        'relationship' => 'none',
1613 1613
     ),
1614 1614
     'name' => array(
1615
-      'label' => 'Name',
1616
-      'alter' => array(
1615
+        'label' => 'Name',
1616
+        'alter' => array(
1617 1617
         'alter_text' => 0,
1618 1618
         'text' => '',
1619 1619
         'make_link' => 0,
@@ -1632,20 +1632,20 @@  discard block
 block discarded – undo
1632 1632
         'ellipsis' => 1,
1633 1633
         'html' => 0,
1634 1634
         'strip_tags' => 0,
1635
-      ),
1636
-      'empty' => '',
1637
-      'hide_empty' => 0,
1638
-      'empty_zero' => 0,
1639
-      'hide_alter_empty' => 1,
1640
-      'exclude' => 0,
1641
-      'id' => 'name',
1642
-      'table' => 'user',
1643
-      'field' => 'name',
1644
-      'relationship' => 'none',
1635
+        ),
1636
+        'empty' => '',
1637
+        'hide_empty' => 0,
1638
+        'empty_zero' => 0,
1639
+        'hide_alter_empty' => 1,
1640
+        'exclude' => 0,
1641
+        'id' => 'name',
1642
+        'table' => 'user',
1643
+        'field' => 'name',
1644
+        'relationship' => 'none',
1645 1645
     ),
1646 1646
     'total_credit' => array(
1647
-      'label' => 'Total Credit',
1648
-      'alter' => array(
1647
+        'label' => 'Total Credit',
1648
+        'alter' => array(
1649 1649
         'alter_text' => 0,
1650 1650
         'text' => '',
1651 1651
         'make_link' => 0,
@@ -1664,32 +1664,32 @@  discard block
 block discarded – undo
1664 1664
         'ellipsis' => 1,
1665 1665
         'html' => 0,
1666 1666
         'strip_tags' => 0,
1667
-      ),
1668
-      'empty' => '',
1669
-      'hide_empty' => 0,
1670
-      'empty_zero' => 0,
1671
-      'hide_alter_empty' => 1,
1672
-      'set_precision' => 1,
1673
-      'precision' => '0',
1674
-      'decimal' => '.',
1675
-      'separator' => ',',
1676
-      'format_plural' => 0,
1677
-      'format_plural_singular' => '1',
1678
-      'format_plural_plural' => '@count',
1679
-      'prefix' => '',
1680
-      'suffix' => '',
1681
-      'exclude' => 1,
1682
-      'id' => 'total_credit',
1683
-      'table' => 'user',
1684
-      'field' => 'total_credit',
1685
-      'relationship' => 'none',
1686
-      'override' => array(
1667
+        ),
1668
+        'empty' => '',
1669
+        'hide_empty' => 0,
1670
+        'empty_zero' => 0,
1671
+        'hide_alter_empty' => 1,
1672
+        'set_precision' => 1,
1673
+        'precision' => '0',
1674
+        'decimal' => '.',
1675
+        'separator' => ',',
1676
+        'format_plural' => 0,
1677
+        'format_plural_singular' => '1',
1678
+        'format_plural_plural' => '@count',
1679
+        'prefix' => '',
1680
+        'suffix' => '',
1681
+        'exclude' => 1,
1682
+        'id' => 'total_credit',
1683
+        'table' => 'user',
1684
+        'field' => 'total_credit',
1685
+        'relationship' => 'none',
1686
+        'override' => array(
1687 1687
         'button' => 'Use default',
1688
-      ),
1688
+        ),
1689 1689
     ),
1690 1690
     'expavg_credit' => array(
1691
-      'label' => 'Recent average credit',
1692
-      'alter' => array(
1691
+        'label' => 'Recent average credit',
1692
+        'alter' => array(
1693 1693
         'alter_text' => 0,
1694 1694
         'text' => '',
1695 1695
         'make_link' => 0,
@@ -1708,32 +1708,32 @@  discard block
 block discarded – undo
1708 1708
         'ellipsis' => 1,
1709 1709
         'html' => 0,
1710 1710
         'strip_tags' => 0,
1711
-      ),
1712
-      'empty' => '',
1713
-      'hide_empty' => 0,
1714
-      'empty_zero' => 0,
1715
-      'hide_alter_empty' => 1,
1716
-      'set_precision' => 1,
1717
-      'precision' => '2',
1718
-      'decimal' => '.',
1719
-      'separator' => ',',
1720
-      'format_plural' => 0,
1721
-      'format_plural_singular' => '1',
1722
-      'format_plural_plural' => '@count',
1723
-      'prefix' => '',
1724
-      'suffix' => '',
1725
-      'exclude' => 1,
1726
-      'id' => 'expavg_credit',
1727
-      'table' => 'user',
1728
-      'field' => 'expavg_credit',
1729
-      'relationship' => 'none',
1730
-      'override' => array(
1711
+        ),
1712
+        'empty' => '',
1713
+        'hide_empty' => 0,
1714
+        'empty_zero' => 0,
1715
+        'hide_alter_empty' => 1,
1716
+        'set_precision' => 1,
1717
+        'precision' => '2',
1718
+        'decimal' => '.',
1719
+        'separator' => ',',
1720
+        'format_plural' => 0,
1721
+        'format_plural_singular' => '1',
1722
+        'format_plural_plural' => '@count',
1723
+        'prefix' => '',
1724
+        'suffix' => '',
1725
+        'exclude' => 1,
1726
+        'id' => 'expavg_credit',
1727
+        'table' => 'user',
1728
+        'field' => 'expavg_credit',
1729
+        'relationship' => 'none',
1730
+        'override' => array(
1731 1731
         'button' => 'Use default',
1732
-      ),
1732
+        ),
1733 1733
     ),
1734 1734
     'create_time' => array(
1735
-      'label' => 'Member Since',
1736
-      'alter' => array(
1735
+        'label' => 'Member Since',
1736
+        'alter' => array(
1737 1737
         'alter_text' => 0,
1738 1738
         'text' => '',
1739 1739
         'make_link' => 0,
@@ -1752,25 +1752,25 @@  discard block
 block discarded – undo
1752 1752
         'ellipsis' => 1,
1753 1753
         'html' => 0,
1754 1754
         'strip_tags' => 0,
1755
-      ),
1756
-      'empty' => '',
1757
-      'hide_empty' => 0,
1758
-      'empty_zero' => 0,
1759
-      'hide_alter_empty' => 1,
1760
-      'date_format' => 'custom',
1761
-      'custom_date_format' => 'j M Y G:i:s T',
1762
-      'exclude' => 0,
1763
-      'id' => 'create_time',
1764
-      'table' => 'user',
1765
-      'field' => 'create_time',
1766
-      'override' => array(
1755
+        ),
1756
+        'empty' => '',
1757
+        'hide_empty' => 0,
1758
+        'empty_zero' => 0,
1759
+        'hide_alter_empty' => 1,
1760
+        'date_format' => 'custom',
1761
+        'custom_date_format' => 'j M Y G:i:s T',
1762
+        'exclude' => 0,
1763
+        'id' => 'create_time',
1764
+        'table' => 'user',
1765
+        'field' => 'create_time',
1766
+        'override' => array(
1767 1767
         'button' => 'Use default',
1768
-      ),
1769
-      'relationship' => 'none',
1768
+        ),
1769
+        'relationship' => 'none',
1770 1770
     ),
1771 1771
     'phpcode_1' => array(
1772
-      'label' => '',
1773
-      'alter' => array(
1772
+        'label' => '',
1773
+        'alter' => array(
1774 1774
         'alter_text' => 0,
1775 1775
         'text' => '',
1776 1776
         'make_link' => 0,
@@ -1789,12 +1789,12 @@  discard block
 block discarded – undo
1789 1789
         'ellipsis' => 1,
1790 1790
         'html' => 0,
1791 1791
         'strip_tags' => 0,
1792
-      ),
1793
-      'empty' => '',
1794
-      'hide_empty' => 0,
1795
-      'empty_zero' => 0,
1796
-      'hide_alter_empty' => 1,
1797
-      'value' => '<?php
1792
+        ),
1793
+        'empty' => '',
1794
+        'hide_empty' => 0,
1795
+        'empty_zero' => 0,
1796
+        'hide_alter_empty' => 1,
1797
+        'value' => '<?php
1798 1798
   global $user;
1799 1799
   $team_id = arg(2);
1800 1800
   $user_id = boincuser_lookup_uid($data->id);
@@ -1802,36 +1802,36 @@  discard block
 block discarded – undo
1802 1802
     echo l(bts(\'Remove\', array(), NULL, \'boinc:remove-team-member\'), "community/teams/{$team_id}/edit/members/remove/{$user_id}");
1803 1803
   }
1804 1804
 ?>',
1805
-      'exclude' => 0,
1806
-      'id' => 'phpcode_1',
1807
-      'table' => 'customfield',
1808
-      'field' => 'phpcode',
1809
-      'override' => array(
1805
+        'exclude' => 0,
1806
+        'id' => 'phpcode_1',
1807
+        'table' => 'customfield',
1808
+        'field' => 'phpcode',
1809
+        'override' => array(
1810 1810
         'button' => 'Use default',
1811
-      ),
1812
-      'relationship' => 'none',
1811
+        ),
1812
+        'relationship' => 'none',
1813 1813
     ),
1814
-  ));
1815
-  $handler->override_option('arguments', array(
1814
+    ));
1815
+    $handler->override_option('arguments', array(
1816 1816
     'teamid' => array(
1817
-      'default_action' => 'empty',
1818
-      'style_plugin' => 'default_summary',
1819
-      'style_options' => array(),
1820
-      'wildcard' => 'all',
1821
-      'wildcard_substitution' => 'All',
1822
-      'title' => '',
1823
-      'breadcrumb' => '',
1824
-      'default_argument_type' => 'fixed',
1825
-      'default_argument' => '',
1826
-      'validate_type' => 'numeric',
1827
-      'validate_fail' => 'not found',
1828
-      'break_phrase' => 0,
1829
-      'not' => 0,
1830
-      'id' => 'teamid',
1831
-      'table' => 'user',
1832
-      'field' => 'teamid',
1833
-      'validate_user_argument_type' => 'uid',
1834
-      'validate_user_roles' => array(
1817
+        'default_action' => 'empty',
1818
+        'style_plugin' => 'default_summary',
1819
+        'style_options' => array(),
1820
+        'wildcard' => 'all',
1821
+        'wildcard_substitution' => 'All',
1822
+        'title' => '',
1823
+        'breadcrumb' => '',
1824
+        'default_argument_type' => 'fixed',
1825
+        'default_argument' => '',
1826
+        'validate_type' => 'numeric',
1827
+        'validate_fail' => 'not found',
1828
+        'break_phrase' => 0,
1829
+        'not' => 0,
1830
+        'id' => 'teamid',
1831
+        'table' => 'user',
1832
+        'field' => 'teamid',
1833
+        'validate_user_argument_type' => 'uid',
1834
+        'validate_user_roles' => array(
1835 1835
         2 => 0,
1836 1836
         3519698132 => 0,
1837 1837
         1110965548 => 0,
@@ -1840,10 +1840,10 @@  discard block
 block discarded – undo
1840 1840
         268174006 => 0,
1841 1841
         1271379760 => 0,
1842 1842
         933038561 => 0,
1843
-      ),
1844
-      'me_redirect' => 0,
1845
-      'me_validate_user_argument_type' => 'uid',
1846
-      'me_validate_user_roles' => array(
1843
+        ),
1844
+        'me_redirect' => 0,
1845
+        'me_validate_user_argument_type' => 'uid',
1846
+        'me_validate_user_roles' => array(
1847 1847
         2 => 0,
1848 1848
         3519698132 => 0,
1849 1849
         1110965548 => 0,
@@ -1852,23 +1852,23 @@  discard block
 block discarded – undo
1852 1852
         268174006 => 0,
1853 1853
         1271379760 => 0,
1854 1854
         933038561 => 0,
1855
-      ),
1856
-      'override' => array(
1855
+        ),
1856
+        'override' => array(
1857 1857
         'button' => 'Use default',
1858
-      ),
1859
-      'relationship' => 'none',
1860
-      'default_options_div_prefix' => '',
1861
-      'default_taxonomy_tid_term_page' => 0,
1862
-      'default_taxonomy_tid_node' => 0,
1863
-      'default_taxonomy_tid_limit' => 0,
1864
-      'default_taxonomy_tid_vids' => array(
1858
+        ),
1859
+        'relationship' => 'none',
1860
+        'default_options_div_prefix' => '',
1861
+        'default_taxonomy_tid_term_page' => 0,
1862
+        'default_taxonomy_tid_node' => 0,
1863
+        'default_taxonomy_tid_limit' => 0,
1864
+        'default_taxonomy_tid_vids' => array(
1865 1865
         1 => 0,
1866 1866
         2 => 0,
1867
-      ),
1868
-      'default_argument_user' => 0,
1869
-      'default_argument_fixed' => '',
1870
-      'default_argument_php' => '',
1871
-      'validate_argument_node_type' => array(
1867
+        ),
1868
+        'default_argument_user' => 0,
1869
+        'default_argument_fixed' => '',
1870
+        'default_argument_php' => '',
1871
+        'validate_argument_node_type' => array(
1872 1872
         'page' => 0,
1873 1873
         'news' => 0,
1874 1874
         'profile' => 0,
@@ -1876,90 +1876,90 @@  discard block
 block discarded – undo
1876 1876
         'panel' => 0,
1877 1877
         'story' => 0,
1878 1878
         'team' => 0,
1879
-      ),
1880
-      'validate_argument_node_access' => 0,
1881
-      'validate_argument_nid_type' => 'nid',
1882
-      'validate_argument_vocabulary' => array(
1879
+        ),
1880
+        'validate_argument_node_access' => 0,
1881
+        'validate_argument_nid_type' => 'nid',
1882
+        'validate_argument_vocabulary' => array(
1883 1883
         1 => 0,
1884 1884
         2 => 0,
1885
-      ),
1886
-      'validate_argument_type' => 'tid',
1887
-      'validate_argument_transform' => 0,
1888
-      'validate_user_restrict_roles' => 0,
1889
-      'validate_argument_node_flag_name' => '*relationship*',
1890
-      'validate_argument_node_flag_test' => 'flaggable',
1891
-      'validate_argument_node_flag_id_type' => 'id',
1892
-      'validate_argument_user_flag_name' => '*relationship*',
1893
-      'validate_argument_user_flag_test' => 'flaggable',
1894
-      'validate_argument_user_flag_id_type' => 'id',
1895
-      'validate_argument_php' => '',
1896
-      'me_validate_user_restrict_roles' => 0,
1897
-    ),
1898
-  ));
1899
-  $handler->override_option('use_pager', '1');
1900
-  $handler->override_option('style_plugin', 'table');
1901
-  $handler->override_option('style_options', array(
1885
+        ),
1886
+        'validate_argument_type' => 'tid',
1887
+        'validate_argument_transform' => 0,
1888
+        'validate_user_restrict_roles' => 0,
1889
+        'validate_argument_node_flag_name' => '*relationship*',
1890
+        'validate_argument_node_flag_test' => 'flaggable',
1891
+        'validate_argument_node_flag_id_type' => 'id',
1892
+        'validate_argument_user_flag_name' => '*relationship*',
1893
+        'validate_argument_user_flag_test' => 'flaggable',
1894
+        'validate_argument_user_flag_id_type' => 'id',
1895
+        'validate_argument_php' => '',
1896
+        'me_validate_user_restrict_roles' => 0,
1897
+    ),
1898
+    ));
1899
+    $handler->override_option('use_pager', '1');
1900
+    $handler->override_option('style_plugin', 'table');
1901
+    $handler->override_option('style_options', array(
1902 1902
     'grouping' => '',
1903 1903
     'override' => 1,
1904 1904
     'sticky' => 1,
1905 1905
     'order' => 'asc',
1906 1906
     'summary' => '',
1907 1907
     'columns' => array(
1908
-      'id' => 'id',
1909
-      'name' => 'name',
1910
-      'send_email' => 'send_email',
1911
-      'email_addr' => 'email_addr',
1912
-      'phpcode' => 'phpcode',
1913
-      'total_credit' => 'total_credit',
1914
-      'expavg_credit' => 'expavg_credit',
1915
-      'create_time' => 'create_time',
1916
-      'phpcode_1' => 'phpcode_1',
1908
+        'id' => 'id',
1909
+        'name' => 'name',
1910
+        'send_email' => 'send_email',
1911
+        'email_addr' => 'email_addr',
1912
+        'phpcode' => 'phpcode',
1913
+        'total_credit' => 'total_credit',
1914
+        'expavg_credit' => 'expavg_credit',
1915
+        'create_time' => 'create_time',
1916
+        'phpcode_1' => 'phpcode_1',
1917 1917
     ),
1918 1918
     'info' => array(
1919
-      'id' => array(
1919
+        'id' => array(
1920 1920
         'sortable' => 0,
1921 1921
         'separator' => '',
1922
-      ),
1923
-      'name' => array(
1922
+        ),
1923
+        'name' => array(
1924 1924
         'sortable' => 1,
1925 1925
         'separator' => '',
1926
-      ),
1927
-      'send_email' => array(
1926
+        ),
1927
+        'send_email' => array(
1928 1928
         'sortable' => 0,
1929 1929
         'separator' => '',
1930
-      ),
1931
-      'email_addr' => array(
1930
+        ),
1931
+        'email_addr' => array(
1932 1932
         'sortable' => 1,
1933 1933
         'separator' => '',
1934
-      ),
1935
-      'phpcode' => array(
1934
+        ),
1935
+        'phpcode' => array(
1936 1936
         'separator' => '',
1937
-      ),
1938
-      'total_credit' => array(
1937
+        ),
1938
+        'total_credit' => array(
1939 1939
         'sortable' => 1,
1940 1940
         'separator' => '',
1941
-      ),
1942
-      'expavg_credit' => array(
1941
+        ),
1942
+        'expavg_credit' => array(
1943 1943
         'sortable' => 1,
1944 1944
         'separator' => '',
1945
-      ),
1946
-      'create_time' => array(
1945
+        ),
1946
+        'create_time' => array(
1947 1947
         'sortable' => 1,
1948 1948
         'separator' => '',
1949
-      ),
1950
-      'phpcode_1' => array(
1949
+        ),
1950
+        'phpcode_1' => array(
1951 1951
         'separator' => '',
1952
-      ),
1952
+        ),
1953 1953
     ),
1954 1954
     'default' => 'name',
1955
-  ));
1956
-  $handler->override_option('pane_title', 'Edit team members');
1957
-  $handler->override_option('pane_description', '');
1958
-  $handler->override_option('pane_category', array(
1955
+    ));
1956
+    $handler->override_option('pane_title', 'Edit team members');
1957
+    $handler->override_option('pane_description', '');
1958
+    $handler->override_option('pane_category', array(
1959 1959
     'name' => 'View panes',
1960 1960
     'weight' => 0,
1961
-  ));
1962
-  $handler->override_option('allow', array(
1961
+    ));
1962
+    $handler->override_option('allow', array(
1963 1963
     'use_pager' => 0,
1964 1964
     'items_per_page' => 'items_per_page',
1965 1965
     'offset' => 0,
@@ -1969,24 +1969,24 @@  discard block
 block discarded – undo
1969 1969
     'title_override' => 'title_override',
1970 1970
     'exposed_form' => 0,
1971 1971
     'fields_override' => 0,
1972
-  ));
1973
-  $handler->override_option('argument_input', array(
1972
+    ));
1973
+    $handler->override_option('argument_input', array(
1974 1974
     'teamid' => array(
1975
-      'type' => 'panel',
1976
-      'context' => 'term.description',
1977
-      'context_optional' => 0,
1978
-      'panel' => '0',
1979
-      'fixed' => '',
1980
-      'label' => 'BOINC: Team ID',
1981
-    ),
1982
-  ));
1983
-  $handler->override_option('link_to_view', 0);
1984
-  $handler->override_option('inherit_panels_path', 0);
1985
-  $handler = $view->new_display('panel_pane', 'Team change founder', 'panel_pane_4');
1986
-  $handler->override_option('fields', array(
1975
+        'type' => 'panel',
1976
+        'context' => 'term.description',
1977
+        'context_optional' => 0,
1978
+        'panel' => '0',
1979
+        'fixed' => '',
1980
+        'label' => 'BOINC: Team ID',
1981
+    ),
1982
+    ));
1983
+    $handler->override_option('link_to_view', 0);
1984
+    $handler->override_option('inherit_panels_path', 0);
1985
+    $handler = $view->new_display('panel_pane', 'Team change founder', 'panel_pane_4');
1986
+    $handler->override_option('fields', array(
1987 1987
     'id' => array(
1988
-      'label' => 'Id',
1989
-      'alter' => array(
1988
+        'label' => 'Id',
1989
+        'alter' => array(
1990 1990
         'alter_text' => 0,
1991 1991
         'text' => '',
1992 1992
         'make_link' => 0,
@@ -2005,32 +2005,32 @@  discard block
 block discarded – undo
2005 2005
         'ellipsis' => 1,
2006 2006
         'html' => 0,
2007 2007
         'strip_tags' => 0,
2008
-      ),
2009
-      'empty' => '',
2010
-      'hide_empty' => 0,
2011
-      'empty_zero' => 0,
2012
-      'hide_alter_empty' => 1,
2013
-      'set_precision' => FALSE,
2014
-      'precision' => 0,
2015
-      'decimal' => '.',
2016
-      'separator' => '',
2017
-      'format_plural' => 0,
2018
-      'format_plural_singular' => '1',
2019
-      'format_plural_plural' => '@count',
2020
-      'prefix' => '',
2021
-      'suffix' => '',
2022
-      'exclude' => 1,
2023
-      'id' => 'id',
2024
-      'table' => 'user',
2025
-      'field' => 'id',
2026
-      'relationship' => 'none',
2027
-      'override' => array(
2008
+        ),
2009
+        'empty' => '',
2010
+        'hide_empty' => 0,
2011
+        'empty_zero' => 0,
2012
+        'hide_alter_empty' => 1,
2013
+        'set_precision' => FALSE,
2014
+        'precision' => 0,
2015
+        'decimal' => '.',
2016
+        'separator' => '',
2017
+        'format_plural' => 0,
2018
+        'format_plural_singular' => '1',
2019
+        'format_plural_plural' => '@count',
2020
+        'prefix' => '',
2021
+        'suffix' => '',
2022
+        'exclude' => 1,
2023
+        'id' => 'id',
2024
+        'table' => 'user',
2025
+        'field' => 'id',
2026
+        'relationship' => 'none',
2027
+        'override' => array(
2028 2028
         'button' => 'Use default',
2029
-      ),
2029
+        ),
2030 2030
     ),
2031 2031
     'phpcode' => array(
2032
-      'label' => 'Uid',
2033
-      'alter' => array(
2032
+        'label' => 'Uid',
2033
+        'alter' => array(
2034 2034
         'alter_text' => 0,
2035 2035
         'text' => '',
2036 2036
         'make_link' => 0,
@@ -2049,26 +2049,26 @@  discard block
 block discarded – undo
2049 2049
         'ellipsis' => 1,
2050 2050
         'html' => 0,
2051 2051
         'strip_tags' => 0,
2052
-      ),
2053
-      'empty' => '',
2054
-      'hide_empty' => 0,
2055
-      'empty_zero' => 0,
2056
-      'hide_alter_empty' => 1,
2057
-      'value' => '<?php
2052
+        ),
2053
+        'empty' => '',
2054
+        'hide_empty' => 0,
2055
+        'empty_zero' => 0,
2056
+        'hide_alter_empty' => 1,
2057
+        'value' => '<?php
2058 2058
   echo boincuser_lookup_uid($data->id);
2059 2059
 ?>',
2060
-      'exclude' => 1,
2061
-      'id' => 'phpcode',
2062
-      'table' => 'customfield',
2063
-      'field' => 'phpcode',
2064
-      'override' => array(
2060
+        'exclude' => 1,
2061
+        'id' => 'phpcode',
2062
+        'table' => 'customfield',
2063
+        'field' => 'phpcode',
2064
+        'override' => array(
2065 2065
         'button' => 'Use default',
2066
-      ),
2067
-      'relationship' => 'none',
2066
+        ),
2067
+        'relationship' => 'none',
2068 2068
     ),
2069 2069
     'name' => array(
2070
-      'label' => 'Name',
2071
-      'alter' => array(
2070
+        'label' => 'Name',
2071
+        'alter' => array(
2072 2072
         'alter_text' => 0,
2073 2073
         'text' => '',
2074 2074
         'make_link' => 0,
@@ -2087,20 +2087,20 @@  discard block
 block discarded – undo
2087 2087
         'ellipsis' => 1,
2088 2088
         'html' => 0,
2089 2089
         'strip_tags' => 0,
2090
-      ),
2091
-      'empty' => '',
2092
-      'hide_empty' => 0,
2093
-      'empty_zero' => 0,
2094
-      'hide_alter_empty' => 1,
2095
-      'exclude' => 0,
2096
-      'id' => 'name',
2097
-      'table' => 'user',
2098
-      'field' => 'name',
2099
-      'relationship' => 'none',
2090
+        ),
2091
+        'empty' => '',
2092
+        'hide_empty' => 0,
2093
+        'empty_zero' => 0,
2094
+        'hide_alter_empty' => 1,
2095
+        'exclude' => 0,
2096
+        'id' => 'name',
2097
+        'table' => 'user',
2098
+        'field' => 'name',
2099
+        'relationship' => 'none',
2100 2100
     ),
2101 2101
     'total_credit' => array(
2102
-      'label' => 'Total Credit',
2103
-      'alter' => array(
2102
+        'label' => 'Total Credit',
2103
+        'alter' => array(
2104 2104
         'alter_text' => 0,
2105 2105
         'text' => '',
2106 2106
         'make_link' => 0,
@@ -2119,32 +2119,32 @@  discard block
 block discarded – undo
2119 2119
         'ellipsis' => 1,
2120 2120
         'html' => 0,
2121 2121
         'strip_tags' => 0,
2122
-      ),
2123
-      'empty' => '',
2124
-      'hide_empty' => 0,
2125
-      'empty_zero' => 0,
2126
-      'hide_alter_empty' => 1,
2127
-      'set_precision' => 1,
2128
-      'precision' => '0',
2129
-      'decimal' => '.',
2130
-      'separator' => ',',
2131
-      'format_plural' => 0,
2132
-      'format_plural_singular' => '1',
2133
-      'format_plural_plural' => '@count',
2134
-      'prefix' => '',
2135
-      'suffix' => '',
2136
-      'exclude' => 0,
2137
-      'id' => 'total_credit',
2138
-      'table' => 'user',
2139
-      'field' => 'total_credit',
2140
-      'relationship' => 'none',
2141
-      'override' => array(
2122
+        ),
2123
+        'empty' => '',
2124
+        'hide_empty' => 0,
2125
+        'empty_zero' => 0,
2126
+        'hide_alter_empty' => 1,
2127
+        'set_precision' => 1,
2128
+        'precision' => '0',
2129
+        'decimal' => '.',
2130
+        'separator' => ',',
2131
+        'format_plural' => 0,
2132
+        'format_plural_singular' => '1',
2133
+        'format_plural_plural' => '@count',
2134
+        'prefix' => '',
2135
+        'suffix' => '',
2136
+        'exclude' => 0,
2137
+        'id' => 'total_credit',
2138
+        'table' => 'user',
2139
+        'field' => 'total_credit',
2140
+        'relationship' => 'none',
2141
+        'override' => array(
2142 2142
         'button' => 'Use default',
2143
-      ),
2143
+        ),
2144 2144
     ),
2145 2145
     'expavg_credit' => array(
2146
-      'label' => 'Recent average credit',
2147
-      'alter' => array(
2146
+        'label' => 'Recent average credit',
2147
+        'alter' => array(
2148 2148
         'alter_text' => 0,
2149 2149
         'text' => '',
2150 2150
         'make_link' => 0,
@@ -2163,32 +2163,32 @@  discard block
 block discarded – undo
2163 2163
         'ellipsis' => 1,
2164 2164
         'html' => 0,
2165 2165
         'strip_tags' => 0,
2166
-      ),
2167
-      'empty' => '',
2168
-      'hide_empty' => 0,
2169
-      'empty_zero' => 0,
2170
-      'hide_alter_empty' => 1,
2171
-      'set_precision' => 1,
2172
-      'precision' => '2',
2173
-      'decimal' => '.',
2174
-      'separator' => ',',
2175
-      'format_plural' => 0,
2176
-      'format_plural_singular' => '1',
2177
-      'format_plural_plural' => '@count',
2178
-      'prefix' => '',
2179
-      'suffix' => '',
2180
-      'exclude' => 0,
2181
-      'id' => 'expavg_credit',
2182
-      'table' => 'user',
2183
-      'field' => 'expavg_credit',
2184
-      'relationship' => 'none',
2185
-      'override' => array(
2166
+        ),
2167
+        'empty' => '',
2168
+        'hide_empty' => 0,
2169
+        'empty_zero' => 0,
2170
+        'hide_alter_empty' => 1,
2171
+        'set_precision' => 1,
2172
+        'precision' => '2',
2173
+        'decimal' => '.',
2174
+        'separator' => ',',
2175
+        'format_plural' => 0,
2176
+        'format_plural_singular' => '1',
2177
+        'format_plural_plural' => '@count',
2178
+        'prefix' => '',
2179
+        'suffix' => '',
2180
+        'exclude' => 0,
2181
+        'id' => 'expavg_credit',
2182
+        'table' => 'user',
2183
+        'field' => 'expavg_credit',
2184
+        'relationship' => 'none',
2185
+        'override' => array(
2186 2186
         'button' => 'Use default',
2187
-      ),
2187
+        ),
2188 2188
     ),
2189 2189
     'create_time' => array(
2190
-      'label' => 'Member Since',
2191
-      'alter' => array(
2190
+        'label' => 'Member Since',
2191
+        'alter' => array(
2192 2192
         'alter_text' => 0,
2193 2193
         'text' => '',
2194 2194
         'make_link' => 0,
@@ -2207,25 +2207,25 @@  discard block
 block discarded – undo
2207 2207
         'ellipsis' => 1,
2208 2208
         'html' => 0,
2209 2209
         'strip_tags' => 0,
2210
-      ),
2211
-      'empty' => '',
2212
-      'hide_empty' => 0,
2213
-      'empty_zero' => 0,
2214
-      'hide_alter_empty' => 1,
2215
-      'date_format' => 'custom',
2216
-      'custom_date_format' => 'j M Y G:i:s T',
2217
-      'exclude' => 0,
2218
-      'id' => 'create_time',
2219
-      'table' => 'user',
2220
-      'field' => 'create_time',
2221
-      'override' => array(
2210
+        ),
2211
+        'empty' => '',
2212
+        'hide_empty' => 0,
2213
+        'empty_zero' => 0,
2214
+        'hide_alter_empty' => 1,
2215
+        'date_format' => 'custom',
2216
+        'custom_date_format' => 'j M Y G:i:s T',
2217
+        'exclude' => 0,
2218
+        'id' => 'create_time',
2219
+        'table' => 'user',
2220
+        'field' => 'create_time',
2221
+        'override' => array(
2222 2222
         'button' => 'Use default',
2223
-      ),
2224
-      'relationship' => 'none',
2223
+        ),
2224
+        'relationship' => 'none',
2225 2225
     ),
2226 2226
     'phpcode_1' => array(
2227
-      'label' => '',
2228
-      'alter' => array(
2227
+        'label' => '',
2228
+        'alter' => array(
2229 2229
         'alter_text' => 0,
2230 2230
         'text' => '',
2231 2231
         'make_link' => 0,
@@ -2244,12 +2244,12 @@  discard block
 block discarded – undo
2244 2244
         'ellipsis' => 1,
2245 2245
         'html' => 0,
2246 2246
         'strip_tags' => 0,
2247
-      ),
2248
-      'empty' => '',
2249
-      'hide_empty' => 0,
2250
-      'empty_zero' => 0,
2251
-      'hide_alter_empty' => 1,
2252
-      'value' => '<?php
2247
+        ),
2248
+        'empty' => '',
2249
+        'hide_empty' => 0,
2250
+        'empty_zero' => 0,
2251
+        'hide_alter_empty' => 1,
2252
+        'value' => '<?php
2253 2253
   global $user;
2254 2254
   $team_id = arg(2);
2255 2255
   $user_id = boincuser_lookup_uid($data->id);
@@ -2257,36 +2257,36 @@  discard block
 block discarded – undo
2257 2257
     echo l(bts(\'Make founder\', array(), NULL, \'boinc:team-make-founder\'), "community/teams/{$team_id}/edit/founder/set/{$user_id}");
2258 2258
   }
2259 2259
 ?>',
2260
-      'exclude' => 0,
2261
-      'id' => 'phpcode_1',
2262
-      'table' => 'customfield',
2263
-      'field' => 'phpcode',
2264
-      'override' => array(
2260
+        'exclude' => 0,
2261
+        'id' => 'phpcode_1',
2262
+        'table' => 'customfield',
2263
+        'field' => 'phpcode',
2264
+        'override' => array(
2265 2265
         'button' => 'Use default',
2266
-      ),
2267
-      'relationship' => 'none',
2266
+        ),
2267
+        'relationship' => 'none',
2268 2268
     ),
2269
-  ));
2270
-  $handler->override_option('arguments', array(
2269
+    ));
2270
+    $handler->override_option('arguments', array(
2271 2271
     'teamid' => array(
2272
-      'default_action' => 'empty',
2273
-      'style_plugin' => 'default_summary',
2274
-      'style_options' => array(),
2275
-      'wildcard' => 'all',
2276
-      'wildcard_substitution' => 'All',
2277
-      'title' => '',
2278
-      'breadcrumb' => '',
2279
-      'default_argument_type' => 'fixed',
2280
-      'default_argument' => '',
2281
-      'validate_type' => 'numeric',
2282
-      'validate_fail' => 'not found',
2283
-      'break_phrase' => 0,
2284
-      'not' => 0,
2285
-      'id' => 'teamid',
2286
-      'table' => 'user',
2287
-      'field' => 'teamid',
2288
-      'validate_user_argument_type' => 'uid',
2289
-      'validate_user_roles' => array(
2272
+        'default_action' => 'empty',
2273
+        'style_plugin' => 'default_summary',
2274
+        'style_options' => array(),
2275
+        'wildcard' => 'all',
2276
+        'wildcard_substitution' => 'All',
2277
+        'title' => '',
2278
+        'breadcrumb' => '',
2279
+        'default_argument_type' => 'fixed',
2280
+        'default_argument' => '',
2281
+        'validate_type' => 'numeric',
2282
+        'validate_fail' => 'not found',
2283
+        'break_phrase' => 0,
2284
+        'not' => 0,
2285
+        'id' => 'teamid',
2286
+        'table' => 'user',
2287
+        'field' => 'teamid',
2288
+        'validate_user_argument_type' => 'uid',
2289
+        'validate_user_roles' => array(
2290 2290
         2 => 0,
2291 2291
         3519698132 => 0,
2292 2292
         1110965548 => 0,
@@ -2295,10 +2295,10 @@  discard block
 block discarded – undo
2295 2295
         268174006 => 0,
2296 2296
         1271379760 => 0,
2297 2297
         933038561 => 0,
2298
-      ),
2299
-      'me_redirect' => 0,
2300
-      'me_validate_user_argument_type' => 'uid',
2301
-      'me_validate_user_roles' => array(
2298
+        ),
2299
+        'me_redirect' => 0,
2300
+        'me_validate_user_argument_type' => 'uid',
2301
+        'me_validate_user_roles' => array(
2302 2302
         2 => 0,
2303 2303
         3519698132 => 0,
2304 2304
         1110965548 => 0,
@@ -2307,23 +2307,23 @@  discard block
 block discarded – undo
2307 2307
         268174006 => 0,
2308 2308
         1271379760 => 0,
2309 2309
         933038561 => 0,
2310
-      ),
2311
-      'override' => array(
2310
+        ),
2311
+        'override' => array(
2312 2312
         'button' => 'Use default',
2313
-      ),
2314
-      'relationship' => 'none',
2315
-      'default_options_div_prefix' => '',
2316
-      'default_taxonomy_tid_term_page' => 0,
2317
-      'default_taxonomy_tid_node' => 0,
2318
-      'default_taxonomy_tid_limit' => 0,
2319
-      'default_taxonomy_tid_vids' => array(
2313
+        ),
2314
+        'relationship' => 'none',
2315
+        'default_options_div_prefix' => '',
2316
+        'default_taxonomy_tid_term_page' => 0,
2317
+        'default_taxonomy_tid_node' => 0,
2318
+        'default_taxonomy_tid_limit' => 0,
2319
+        'default_taxonomy_tid_vids' => array(
2320 2320
         1 => 0,
2321 2321
         2 => 0,
2322
-      ),
2323
-      'default_argument_user' => 0,
2324
-      'default_argument_fixed' => '',
2325
-      'default_argument_php' => '',
2326
-      'validate_argument_node_type' => array(
2322
+        ),
2323
+        'default_argument_user' => 0,
2324
+        'default_argument_fixed' => '',
2325
+        'default_argument_php' => '',
2326
+        'validate_argument_node_type' => array(
2327 2327
         'page' => 0,
2328 2328
         'news' => 0,
2329 2329
         'profile' => 0,
@@ -2331,90 +2331,90 @@  discard block
 block discarded – undo
2331 2331
         'panel' => 0,
2332 2332
         'story' => 0,
2333 2333
         'team' => 0,
2334
-      ),
2335
-      'validate_argument_node_access' => 0,
2336
-      'validate_argument_nid_type' => 'nid',
2337
-      'validate_argument_vocabulary' => array(
2334
+        ),
2335
+        'validate_argument_node_access' => 0,
2336
+        'validate_argument_nid_type' => 'nid',
2337
+        'validate_argument_vocabulary' => array(
2338 2338
         1 => 0,
2339 2339
         2 => 0,
2340
-      ),
2341
-      'validate_argument_type' => 'tid',
2342
-      'validate_argument_transform' => 0,
2343
-      'validate_user_restrict_roles' => 0,
2344
-      'validate_argument_node_flag_name' => '*relationship*',
2345
-      'validate_argument_node_flag_test' => 'flaggable',
2346
-      'validate_argument_node_flag_id_type' => 'id',
2347
-      'validate_argument_user_flag_name' => '*relationship*',
2348
-      'validate_argument_user_flag_test' => 'flaggable',
2349
-      'validate_argument_user_flag_id_type' => 'id',
2350
-      'validate_argument_php' => '',
2351
-      'me_validate_user_restrict_roles' => 0,
2352
-    ),
2353
-  ));
2354
-  $handler->override_option('use_pager', '1');
2355
-  $handler->override_option('style_plugin', 'table');
2356
-  $handler->override_option('style_options', array(
2340
+        ),
2341
+        'validate_argument_type' => 'tid',
2342
+        'validate_argument_transform' => 0,
2343
+        'validate_user_restrict_roles' => 0,
2344
+        'validate_argument_node_flag_name' => '*relationship*',
2345
+        'validate_argument_node_flag_test' => 'flaggable',
2346
+        'validate_argument_node_flag_id_type' => 'id',
2347
+        'validate_argument_user_flag_name' => '*relationship*',
2348
+        'validate_argument_user_flag_test' => 'flaggable',
2349
+        'validate_argument_user_flag_id_type' => 'id',
2350
+        'validate_argument_php' => '',
2351
+        'me_validate_user_restrict_roles' => 0,
2352
+    ),
2353
+    ));
2354
+    $handler->override_option('use_pager', '1');
2355
+    $handler->override_option('style_plugin', 'table');
2356
+    $handler->override_option('style_options', array(
2357 2357
     'grouping' => '',
2358 2358
     'override' => 1,
2359 2359
     'sticky' => 1,
2360 2360
     'order' => 'asc',
2361 2361
     'summary' => '',
2362 2362
     'columns' => array(
2363
-      'id' => 'id',
2364
-      'name' => 'name',
2365
-      'send_email' => 'send_email',
2366
-      'email_addr' => 'email_addr',
2367
-      'phpcode' => 'phpcode',
2368
-      'total_credit' => 'total_credit',
2369
-      'expavg_credit' => 'expavg_credit',
2370
-      'create_time' => 'create_time',
2371
-      'phpcode_1' => 'phpcode_1',
2363
+        'id' => 'id',
2364
+        'name' => 'name',
2365
+        'send_email' => 'send_email',
2366
+        'email_addr' => 'email_addr',
2367
+        'phpcode' => 'phpcode',
2368
+        'total_credit' => 'total_credit',
2369
+        'expavg_credit' => 'expavg_credit',
2370
+        'create_time' => 'create_time',
2371
+        'phpcode_1' => 'phpcode_1',
2372 2372
     ),
2373 2373
     'info' => array(
2374
-      'id' => array(
2374
+        'id' => array(
2375 2375
         'sortable' => 0,
2376 2376
         'separator' => '',
2377
-      ),
2378
-      'name' => array(
2377
+        ),
2378
+        'name' => array(
2379 2379
         'sortable' => 1,
2380 2380
         'separator' => '',
2381
-      ),
2382
-      'send_email' => array(
2381
+        ),
2382
+        'send_email' => array(
2383 2383
         'sortable' => 0,
2384 2384
         'separator' => '',
2385
-      ),
2386
-      'email_addr' => array(
2385
+        ),
2386
+        'email_addr' => array(
2387 2387
         'sortable' => 1,
2388 2388
         'separator' => '',
2389
-      ),
2390
-      'phpcode' => array(
2389
+        ),
2390
+        'phpcode' => array(
2391 2391
         'separator' => '',
2392
-      ),
2393
-      'total_credit' => array(
2392
+        ),
2393
+        'total_credit' => array(
2394 2394
         'sortable' => 1,
2395 2395
         'separator' => '',
2396
-      ),
2397
-      'expavg_credit' => array(
2396
+        ),
2397
+        'expavg_credit' => array(
2398 2398
         'sortable' => 1,
2399 2399
         'separator' => '',
2400
-      ),
2401
-      'create_time' => array(
2400
+        ),
2401
+        'create_time' => array(
2402 2402
         'sortable' => 1,
2403 2403
         'separator' => '',
2404
-      ),
2405
-      'phpcode_1' => array(
2404
+        ),
2405
+        'phpcode_1' => array(
2406 2406
         'separator' => '',
2407
-      ),
2407
+        ),
2408 2408
     ),
2409 2409
     'default' => 'name',
2410
-  ));
2411
-  $handler->override_option('pane_title', 'Change team founder');
2412
-  $handler->override_option('pane_description', '');
2413
-  $handler->override_option('pane_category', array(
2410
+    ));
2411
+    $handler->override_option('pane_title', 'Change team founder');
2412
+    $handler->override_option('pane_description', '');
2413
+    $handler->override_option('pane_category', array(
2414 2414
     'name' => 'View panes',
2415 2415
     'weight' => 0,
2416
-  ));
2417
-  $handler->override_option('allow', array(
2416
+    ));
2417
+    $handler->override_option('allow', array(
2418 2418
     'use_pager' => 0,
2419 2419
     'items_per_page' => 'items_per_page',
2420 2420
     'offset' => 0,
@@ -2424,36 +2424,36 @@  discard block
 block discarded – undo
2424 2424
     'title_override' => 'title_override',
2425 2425
     'exposed_form' => 0,
2426 2426
     'fields_override' => 0,
2427
-  ));
2428
-  $handler->override_option('argument_input', array(
2427
+    ));
2428
+    $handler->override_option('argument_input', array(
2429 2429
     'teamid' => array(
2430
-      'type' => 'panel',
2431
-      'context' => 'term.description',
2432
-      'context_optional' => 0,
2433
-      'panel' => '0',
2434
-      'fixed' => '',
2435
-      'label' => 'BOINC: Team ID',
2436
-    ),
2437
-  ));
2438
-  $handler->override_option('link_to_view', 0);
2439
-  $handler->override_option('inherit_panels_path', 0);
2430
+        'type' => 'panel',
2431
+        'context' => 'term.description',
2432
+        'context_optional' => 0,
2433
+        'panel' => '0',
2434
+        'fixed' => '',
2435
+        'label' => 'BOINC: Team ID',
2436
+    ),
2437
+    ));
2438
+    $handler->override_option('link_to_view', 0);
2439
+    $handler->override_option('inherit_panels_path', 0);
2440 2440
 
2441
-  $views[$view->name] = $view;
2441
+    $views[$view->name] = $view;
2442 2442
 
2443
-  // Exported view: boinc_teams
2444
-  $view = new view;
2445
-  $view->name = 'boinc_teams';
2446
-  $view->description = '';
2447
-  $view->tag = '';
2448
-  $view->base_table = 'team';
2449
-  $view->core = 6;
2450
-  $view->api_version = '2';
2451
-  $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
2452
-  $handler = $view->new_display('default', 'Defaults', 'default');
2453
-  $handler->override_option('fields', array(
2443
+    // Exported view: boinc_teams
2444
+    $view = new view;
2445
+    $view->name = 'boinc_teams';
2446
+    $view->description = '';
2447
+    $view->tag = '';
2448
+    $view->base_table = 'team';
2449
+    $view->core = 6;
2450
+    $view->api_version = '2';
2451
+    $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
2452
+    $handler = $view->new_display('default', 'Defaults', 'default');
2453
+    $handler->override_option('fields', array(
2454 2454
     'rownumber' => array(
2455
-      'label' => 'Rank',
2456
-      'alter' => array(
2455
+        'label' => 'Rank',
2456
+        'alter' => array(
2457 2457
         'alter_text' => 0,
2458 2458
         'text' => '',
2459 2459
         'make_link' => 0,
@@ -2472,20 +2472,20 @@  discard block
 block discarded – undo
2472 2472
         'ellipsis' => 1,
2473 2473
         'html' => 0,
2474 2474
         'strip_tags' => 0,
2475
-      ),
2476
-      'empty' => '',
2477
-      'hide_empty' => 0,
2478
-      'empty_zero' => 0,
2479
-      'hide_alter_empty' => 1,
2480
-      'exclude' => 0,
2481
-      'id' => 'rownumber',
2482
-      'table' => 'customfield',
2483
-      'field' => 'rownumber',
2484
-      'relationship' => 'none',
2475
+        ),
2476
+        'empty' => '',
2477
+        'hide_empty' => 0,
2478
+        'empty_zero' => 0,
2479
+        'hide_alter_empty' => 1,
2480
+        'exclude' => 0,
2481
+        'id' => 'rownumber',
2482
+        'table' => 'customfield',
2483
+        'field' => 'rownumber',
2484
+        'relationship' => 'none',
2485 2485
     ),
2486 2486
     'id' => array(
2487
-      'label' => 'Id',
2488
-      'alter' => array(
2487
+        'label' => 'Id',
2488
+        'alter' => array(
2489 2489
         'alter_text' => 0,
2490 2490
         'text' => '',
2491 2491
         'make_link' => 0,
@@ -2504,29 +2504,29 @@  discard block
 block discarded – undo
2504 2504
         'ellipsis' => 1,
2505 2505
         'html' => 0,
2506 2506
         'strip_tags' => 0,
2507
-      ),
2508
-      'empty' => '',
2509
-      'hide_empty' => 0,
2510
-      'empty_zero' => 0,
2511
-      'hide_alter_empty' => 1,
2512
-      'set_precision' => FALSE,
2513
-      'precision' => 0,
2514
-      'decimal' => '.',
2515
-      'separator' => '',
2516
-      'format_plural' => 0,
2517
-      'format_plural_singular' => '1',
2518
-      'format_plural_plural' => '@count',
2519
-      'prefix' => '',
2520
-      'suffix' => '',
2521
-      'exclude' => 1,
2522
-      'id' => 'id',
2523
-      'table' => 'team',
2524
-      'field' => 'id',
2525
-      'relationship' => 'none',
2507
+        ),
2508
+        'empty' => '',
2509
+        'hide_empty' => 0,
2510
+        'empty_zero' => 0,
2511
+        'hide_alter_empty' => 1,
2512
+        'set_precision' => FALSE,
2513
+        'precision' => 0,
2514
+        'decimal' => '.',
2515
+        'separator' => '',
2516
+        'format_plural' => 0,
2517
+        'format_plural_singular' => '1',
2518
+        'format_plural_plural' => '@count',
2519
+        'prefix' => '',
2520
+        'suffix' => '',
2521
+        'exclude' => 1,
2522
+        'id' => 'id',
2523
+        'table' => 'team',
2524
+        'field' => 'id',
2525
+        'relationship' => 'none',
2526 2526
     ),
2527 2527
     'name' => array(
2528
-      'label' => 'Name',
2529
-      'alter' => array(
2528
+        'label' => 'Name',
2529
+        'alter' => array(
2530 2530
         'alter_text' => 0,
2531 2531
         'text' => '',
2532 2532
         'make_link' => 0,
@@ -2545,20 +2545,20 @@  discard block
 block discarded – undo
2545 2545
         'ellipsis' => 1,
2546 2546
         'html' => 0,
2547 2547
         'strip_tags' => 0,
2548
-      ),
2549
-      'empty' => '',
2550
-      'hide_empty' => 0,
2551
-      'empty_zero' => 0,
2552
-      'hide_alter_empty' => 1,
2553
-      'exclude' => 1,
2554
-      'id' => 'name',
2555
-      'table' => 'team',
2556
-      'field' => 'name',
2557
-      'relationship' => 'none',
2548
+        ),
2549
+        'empty' => '',
2550
+        'hide_empty' => 0,
2551
+        'empty_zero' => 0,
2552
+        'hide_alter_empty' => 1,
2553
+        'exclude' => 1,
2554
+        'id' => 'name',
2555
+        'table' => 'team',
2556
+        'field' => 'name',
2557
+        'relationship' => 'none',
2558 2558
     ),
2559 2559
     'phpcode' => array(
2560
-      'label' => 'Name',
2561
-      'alter' => array(
2560
+        'label' => 'Name',
2561
+        'alter' => array(
2562 2562
         'alter_text' => 0,
2563 2563
         'text' => '',
2564 2564
         'make_link' => 0,
@@ -2577,24 +2577,24 @@  discard block
 block discarded – undo
2577 2577
         'ellipsis' => 1,
2578 2578
         'html' => 0,
2579 2579
         'strip_tags' => 0,
2580
-      ),
2581
-      'empty' => '',
2582
-      'hide_empty' => 0,
2583
-      'empty_zero' => 0,
2584
-      'hide_alter_empty' => 1,
2585
-      'value' => '<?php
2580
+        ),
2581
+        'empty' => '',
2582
+        'hide_empty' => 0,
2583
+        'empty_zero' => 0,
2584
+        'hide_alter_empty' => 1,
2585
+        'value' => '<?php
2586 2586
   $team_id = boincteam_lookup_nid($data->id);
2587 2587
   echo l($data->team_name, "community/teams/{$team_id}");
2588 2588
 ?>',
2589
-      'exclude' => 0,
2590
-      'id' => 'phpcode',
2591
-      'table' => 'customfield',
2592
-      'field' => 'phpcode',
2593
-      'relationship' => 'none',
2589
+        'exclude' => 0,
2590
+        'id' => 'phpcode',
2591
+        'table' => 'customfield',
2592
+        'field' => 'phpcode',
2593
+        'relationship' => 'none',
2594 2594
     ),
2595 2595
     'expavg_credit' => array(
2596
-      'label' => 'Recent average credit',
2597
-      'alter' => array(
2596
+        'label' => 'Recent average credit',
2597
+        'alter' => array(
2598 2598
         'alter_text' => 0,
2599 2599
         'text' => '',
2600 2600
         'make_link' => 0,
@@ -2613,29 +2613,29 @@  discard block
 block discarded – undo
2613 2613
         'ellipsis' => 1,
2614 2614
         'html' => 0,
2615 2615
         'strip_tags' => 0,
2616
-      ),
2617
-      'empty' => '',
2618
-      'hide_empty' => 0,
2619
-      'empty_zero' => 0,
2620
-      'hide_alter_empty' => 1,
2621
-      'set_precision' => 1,
2622
-      'precision' => '2',
2623
-      'decimal' => '.',
2624
-      'separator' => ',',
2625
-      'format_plural' => 0,
2626
-      'format_plural_singular' => '1',
2627
-      'format_plural_plural' => '@count',
2628
-      'prefix' => '',
2629
-      'suffix' => '',
2630
-      'exclude' => 0,
2631
-      'id' => 'expavg_credit',
2632
-      'table' => 'team',
2633
-      'field' => 'expavg_credit',
2634
-      'relationship' => 'none',
2616
+        ),
2617
+        'empty' => '',
2618
+        'hide_empty' => 0,
2619
+        'empty_zero' => 0,
2620
+        'hide_alter_empty' => 1,
2621
+        'set_precision' => 1,
2622
+        'precision' => '2',
2623
+        'decimal' => '.',
2624
+        'separator' => ',',
2625
+        'format_plural' => 0,
2626
+        'format_plural_singular' => '1',
2627
+        'format_plural_plural' => '@count',
2628
+        'prefix' => '',
2629
+        'suffix' => '',
2630
+        'exclude' => 0,
2631
+        'id' => 'expavg_credit',
2632
+        'table' => 'team',
2633
+        'field' => 'expavg_credit',
2634
+        'relationship' => 'none',
2635 2635
     ),
2636 2636
     'total_credit' => array(
2637
-      'label' => 'Total Credit',
2638
-      'alter' => array(
2637
+        'label' => 'Total Credit',
2638
+        'alter' => array(
2639 2639
         'alter_text' => 0,
2640 2640
         'text' => '',
2641 2641
         'make_link' => 0,
@@ -2654,57 +2654,57 @@  discard block
 block discarded – undo
2654 2654
         'ellipsis' => 1,
2655 2655
         'html' => 0,
2656 2656
         'strip_tags' => 0,
2657
-      ),
2658
-      'empty' => '',
2659
-      'hide_empty' => 0,
2660
-      'empty_zero' => 0,
2661
-      'hide_alter_empty' => 1,
2662
-      'set_precision' => 1,
2663
-      'precision' => '0',
2664
-      'decimal' => '.',
2665
-      'separator' => ',',
2666
-      'format_plural' => 0,
2667
-      'format_plural_singular' => '1',
2668
-      'format_plural_plural' => '@count',
2669
-      'prefix' => '',
2670
-      'suffix' => '',
2671
-      'exclude' => 0,
2672
-      'id' => 'total_credit',
2673
-      'table' => 'team',
2674
-      'field' => 'total_credit',
2675
-      'relationship' => 'none',
2657
+        ),
2658
+        'empty' => '',
2659
+        'hide_empty' => 0,
2660
+        'empty_zero' => 0,
2661
+        'hide_alter_empty' => 1,
2662
+        'set_precision' => 1,
2663
+        'precision' => '0',
2664
+        'decimal' => '.',
2665
+        'separator' => ',',
2666
+        'format_plural' => 0,
2667
+        'format_plural_singular' => '1',
2668
+        'format_plural_plural' => '@count',
2669
+        'prefix' => '',
2670
+        'suffix' => '',
2671
+        'exclude' => 0,
2672
+        'id' => 'total_credit',
2673
+        'table' => 'team',
2674
+        'field' => 'total_credit',
2675
+        'relationship' => 'none',
2676 2676
     ),
2677 2677
     'country' => array(
2678
-      'id' => 'country',
2679
-      'table' => 'team',
2680
-      'field' => 'country',
2678
+        'id' => 'country',
2679
+        'table' => 'team',
2680
+        'field' => 'country',
2681 2681
     ),
2682 2682
     'nusers' => array(
2683
-      'id' => 'nusers',
2684
-      'table' => 'team',
2685
-      'field' => 'nusers',
2683
+        'id' => 'nusers',
2684
+        'table' => 'team',
2685
+        'field' => 'nusers',
2686 2686
     ),
2687
-  ));
2688
-  $handler->override_option('arguments', array(
2687
+    ));
2688
+    $handler->override_option('arguments', array(
2689 2689
     'id' => array(
2690
-      'default_action' => 'ignore',
2691
-      'style_plugin' => 'default_summary',
2692
-      'style_options' => array(),
2693
-      'wildcard' => 'all',
2694
-      'wildcard_substitution' => 'All',
2695
-      'title' => '',
2696
-      'breadcrumb' => '',
2697
-      'default_argument_type' => 'fixed',
2698
-      'default_argument' => '',
2699
-      'validate_type' => 'numeric',
2700
-      'validate_fail' => 'not found',
2701
-      'break_phrase' => 0,
2702
-      'not' => 0,
2703
-      'id' => 'id',
2704
-      'table' => 'team',
2705
-      'field' => 'id',
2706
-      'validate_user_argument_type' => 'uid',
2707
-      'validate_user_roles' => array(
2690
+        'default_action' => 'ignore',
2691
+        'style_plugin' => 'default_summary',
2692
+        'style_options' => array(),
2693
+        'wildcard' => 'all',
2694
+        'wildcard_substitution' => 'All',
2695
+        'title' => '',
2696
+        'breadcrumb' => '',
2697
+        'default_argument_type' => 'fixed',
2698
+        'default_argument' => '',
2699
+        'validate_type' => 'numeric',
2700
+        'validate_fail' => 'not found',
2701
+        'break_phrase' => 0,
2702
+        'not' => 0,
2703
+        'id' => 'id',
2704
+        'table' => 'team',
2705
+        'field' => 'id',
2706
+        'validate_user_argument_type' => 'uid',
2707
+        'validate_user_roles' => array(
2708 2708
         2 => 0,
2709 2709
         3519698132 => 0,
2710 2710
         1110965548 => 0,
@@ -2713,10 +2713,10 @@  discard block
 block discarded – undo
2713 2713
         268174006 => 0,
2714 2714
         1271379760 => 0,
2715 2715
         933038561 => 0,
2716
-      ),
2717
-      'me_redirect' => 0,
2718
-      'me_validate_user_argument_type' => 'uid',
2719
-      'me_validate_user_roles' => array(
2716
+        ),
2717
+        'me_redirect' => 0,
2718
+        'me_validate_user_argument_type' => 'uid',
2719
+        'me_validate_user_roles' => array(
2720 2720
         2 => 0,
2721 2721
         3519698132 => 0,
2722 2722
         1110965548 => 0,
@@ -2725,20 +2725,20 @@  discard block
 block discarded – undo
2725 2725
         268174006 => 0,
2726 2726
         1271379760 => 0,
2727 2727
         933038561 => 0,
2728
-      ),
2729
-      'relationship' => 'none',
2730
-      'default_options_div_prefix' => '',
2731
-      'default_taxonomy_tid_term_page' => 0,
2732
-      'default_taxonomy_tid_node' => 0,
2733
-      'default_taxonomy_tid_limit' => 0,
2734
-      'default_taxonomy_tid_vids' => array(
2728
+        ),
2729
+        'relationship' => 'none',
2730
+        'default_options_div_prefix' => '',
2731
+        'default_taxonomy_tid_term_page' => 0,
2732
+        'default_taxonomy_tid_node' => 0,
2733
+        'default_taxonomy_tid_limit' => 0,
2734
+        'default_taxonomy_tid_vids' => array(
2735 2735
         1 => 0,
2736 2736
         2 => 0,
2737
-      ),
2738
-      'default_argument_user' => 0,
2739
-      'default_argument_fixed' => '',
2740
-      'default_argument_php' => '',
2741
-      'validate_argument_node_type' => array(
2737
+        ),
2738
+        'default_argument_user' => 0,
2739
+        'default_argument_fixed' => '',
2740
+        'default_argument_php' => '',
2741
+        'validate_argument_node_type' => array(
2742 2742
         'page' => 0,
2743 2743
         'news' => 0,
2744 2744
         'profile' => 0,
@@ -2746,119 +2746,119 @@  discard block
 block discarded – undo
2746 2746
         'panel' => 0,
2747 2747
         'story' => 0,
2748 2748
         'team' => 0,
2749
-      ),
2750
-      'validate_argument_node_access' => 0,
2751
-      'validate_argument_nid_type' => 'nid',
2752
-      'validate_argument_vocabulary' => array(
2749
+        ),
2750
+        'validate_argument_node_access' => 0,
2751
+        'validate_argument_nid_type' => 'nid',
2752
+        'validate_argument_vocabulary' => array(
2753 2753
         1 => 0,
2754 2754
         2 => 0,
2755
-      ),
2756
-      'validate_argument_type' => 'tid',
2757
-      'validate_argument_transform' => 0,
2758
-      'validate_user_restrict_roles' => 0,
2759
-      'validate_argument_node_flag_name' => '*relationship*',
2760
-      'validate_argument_node_flag_test' => 'flaggable',
2761
-      'validate_argument_node_flag_id_type' => 'id',
2762
-      'validate_argument_user_flag_name' => '*relationship*',
2763
-      'validate_argument_user_flag_test' => 'flaggable',
2764
-      'validate_argument_user_flag_id_type' => 'id',
2765
-      'validate_argument_php' => '',
2766
-      'me_validate_user_restrict_roles' => 0,
2767
-    ),
2768
-  ));
2769
-  $handler->override_option('access', array(
2755
+        ),
2756
+        'validate_argument_type' => 'tid',
2757
+        'validate_argument_transform' => 0,
2758
+        'validate_user_restrict_roles' => 0,
2759
+        'validate_argument_node_flag_name' => '*relationship*',
2760
+        'validate_argument_node_flag_test' => 'flaggable',
2761
+        'validate_argument_node_flag_id_type' => 'id',
2762
+        'validate_argument_user_flag_name' => '*relationship*',
2763
+        'validate_argument_user_flag_test' => 'flaggable',
2764
+        'validate_argument_user_flag_id_type' => 'id',
2765
+        'validate_argument_php' => '',
2766
+        'me_validate_user_restrict_roles' => 0,
2767
+    ),
2768
+    ));
2769
+    $handler->override_option('access', array(
2770 2770
     'type' => 'none',
2771
-  ));
2772
-  $handler->override_option('cache', array(
2771
+    ));
2772
+    $handler->override_option('cache', array(
2773 2773
     'type' => 'none',
2774
-  ));
2775
-  $handler->override_option('header_format', '1');
2776
-  $handler->override_option('header_empty', 1);
2777
-  $handler = $view->new_display('panel_pane', 'Top teams overview pane', 'panel_pane_1');
2778
-  $handler->override_option('filters', array(
2774
+    ));
2775
+    $handler->override_option('header_format', '1');
2776
+    $handler->override_option('header_empty', 1);
2777
+    $handler = $view->new_display('panel_pane', 'Top teams overview pane', 'panel_pane_1');
2778
+    $handler->override_option('filters', array(
2779 2779
     'total_credit' => array(
2780
-      'operator' => '>=',
2781
-      'value' => array(
2780
+        'operator' => '>=',
2781
+        'value' => array(
2782 2782
         'value' => '1',
2783 2783
         'min' => '',
2784 2784
         'max' => '',
2785
-      ),
2786
-      'group' => '0',
2787
-      'exposed' => FALSE,
2788
-      'expose' => array(
2785
+        ),
2786
+        'group' => '0',
2787
+        'exposed' => FALSE,
2788
+        'expose' => array(
2789 2789
         'operator' => FALSE,
2790 2790
         'label' => '',
2791
-      ),
2792
-      'id' => 'total_credit',
2793
-      'table' => 'team',
2794
-      'field' => 'total_credit',
2795
-      'override' => array(
2791
+        ),
2792
+        'id' => 'total_credit',
2793
+        'table' => 'team',
2794
+        'field' => 'total_credit',
2795
+        'override' => array(
2796 2796
         'button' => 'Use default',
2797
-      ),
2798
-      'relationship' => 'none',
2799
-    ),
2800
-  ));
2801
-  $handler->override_option('use_more', 1);
2802
-  $handler->override_option('use_more_always', 1);
2803
-  $handler->override_option('use_more_text', 'view more');
2804
-  $handler->override_option('style_plugin', 'table');
2805
-  $handler->override_option('style_options', array(
2797
+        ),
2798
+        'relationship' => 'none',
2799
+    ),
2800
+    ));
2801
+    $handler->override_option('use_more', 1);
2802
+    $handler->override_option('use_more_always', 1);
2803
+    $handler->override_option('use_more_text', 'view more');
2804
+    $handler->override_option('style_plugin', 'table');
2805
+    $handler->override_option('style_options', array(
2806 2806
     'grouping' => '',
2807 2807
     'override' => 1,
2808 2808
     'sticky' => 1,
2809 2809
     'order' => 'desc',
2810 2810
     'summary' => '',
2811 2811
     'columns' => array(
2812
-      'rownumber' => 'rownumber',
2813
-      'id' => 'id',
2814
-      'name' => 'name',
2815
-      'phpcode' => 'phpcode',
2816
-      'expavg_credit' => 'expavg_credit',
2817
-      'total_credit' => 'total_credit',
2818
-      'country' => 'country',
2819
-      'nusers' => 'nusers',
2812
+        'rownumber' => 'rownumber',
2813
+        'id' => 'id',
2814
+        'name' => 'name',
2815
+        'phpcode' => 'phpcode',
2816
+        'expavg_credit' => 'expavg_credit',
2817
+        'total_credit' => 'total_credit',
2818
+        'country' => 'country',
2819
+        'nusers' => 'nusers',
2820 2820
     ),
2821 2821
     'info' => array(
2822
-      'rownumber' => array(
2822
+        'rownumber' => array(
2823 2823
         'separator' => '',
2824
-      ),
2825
-      'id' => array(
2824
+        ),
2825
+        'id' => array(
2826 2826
         'sortable' => 1,
2827 2827
         'separator' => '',
2828
-      ),
2829
-      'name' => array(
2828
+        ),
2829
+        'name' => array(
2830 2830
         'sortable' => 1,
2831 2831
         'separator' => '',
2832
-      ),
2833
-      'phpcode' => array(
2832
+        ),
2833
+        'phpcode' => array(
2834 2834
         'separator' => '',
2835
-      ),
2836
-      'expavg_credit' => array(
2835
+        ),
2836
+        'expavg_credit' => array(
2837 2837
         'sortable' => 1,
2838 2838
         'separator' => '',
2839
-      ),
2840
-      'total_credit' => array(
2839
+        ),
2840
+        'total_credit' => array(
2841 2841
         'sortable' => 1,
2842 2842
         'separator' => '',
2843
-      ),
2844
-      'country' => array(
2843
+        ),
2844
+        'country' => array(
2845 2845
         'sortable' => 0,
2846 2846
         'separator' => '',
2847
-      ),
2848
-      'nusers' => array(
2847
+        ),
2848
+        'nusers' => array(
2849 2849
         'sortable' => 1,
2850 2850
         'separator' => '',
2851
-      ),
2851
+        ),
2852 2852
     ),
2853 2853
     'default' => 'expavg_credit',
2854
-  ));
2855
-  $handler->override_option('pane_title', '');
2856
-  $handler->override_option('pane_description', '');
2857
-  $handler->override_option('pane_category', array(
2854
+    ));
2855
+    $handler->override_option('pane_title', '');
2856
+    $handler->override_option('pane_description', '');
2857
+    $handler->override_option('pane_category', array(
2858 2858
     'name' => 'View panes',
2859 2859
     'weight' => 0,
2860
-  ));
2861
-  $handler->override_option('allow', array(
2860
+    ));
2861
+    $handler->override_option('allow', array(
2862 2862
     'use_pager' => 'use_pager',
2863 2863
     'items_per_page' => 'items_per_page',
2864 2864
     'offset' => 0,
@@ -2868,131 +2868,131 @@  discard block
 block discarded – undo
2868 2868
     'title_override' => 'title_override',
2869 2869
     'exposed_form' => 0,
2870 2870
     'fields_override' => 0,
2871
-  ));
2872
-  $handler->override_option('argument_input', array());
2873
-  $handler->override_option('link_to_view', 0);
2874
-  $handler->override_option('inherit_panels_path', 0);
2875
-  $handler = $view->new_display('page', 'Page', 'page_1');
2876
-  $handler->override_option('filters', array(
2871
+    ));
2872
+    $handler->override_option('argument_input', array());
2873
+    $handler->override_option('link_to_view', 0);
2874
+    $handler->override_option('inherit_panels_path', 0);
2875
+    $handler = $view->new_display('page', 'Page', 'page_1');
2876
+    $handler->override_option('filters', array(
2877 2877
     'total_credit' => array(
2878
-      'operator' => '>=',
2879
-      'value' => array(
2878
+        'operator' => '>=',
2879
+        'value' => array(
2880 2880
         'value' => '1',
2881 2881
         'min' => '',
2882 2882
         'max' => '',
2883
-      ),
2884
-      'group' => '0',
2885
-      'exposed' => FALSE,
2886
-      'expose' => array(
2883
+        ),
2884
+        'group' => '0',
2885
+        'exposed' => FALSE,
2886
+        'expose' => array(
2887 2887
         'operator' => FALSE,
2888 2888
         'label' => '',
2889
-      ),
2890
-      'id' => 'total_credit',
2891
-      'table' => 'team',
2892
-      'field' => 'total_credit',
2893
-      'override' => array(
2889
+        ),
2890
+        'id' => 'total_credit',
2891
+        'table' => 'team',
2892
+        'field' => 'total_credit',
2893
+        'override' => array(
2894 2894
         'button' => 'Use default',
2895
-      ),
2896
-      'relationship' => 'none',
2897
-    ),
2898
-  ));
2899
-  $handler->override_option('items_per_page', 100);
2900
-  $handler->override_option('use_pager', '0');
2901
-  $handler->override_option('style_plugin', 'table');
2902
-  $handler->override_option('style_options', array(
2895
+        ),
2896
+        'relationship' => 'none',
2897
+    ),
2898
+    ));
2899
+    $handler->override_option('items_per_page', 100);
2900
+    $handler->override_option('use_pager', '0');
2901
+    $handler->override_option('style_plugin', 'table');
2902
+    $handler->override_option('style_options', array(
2903 2903
     'grouping' => '',
2904 2904
     'override' => 1,
2905 2905
     'sticky' => 1,
2906 2906
     'order' => 'desc',
2907 2907
     'summary' => '',
2908 2908
     'columns' => array(
2909
-      'rownumber' => 'rownumber',
2910
-      'id' => 'id',
2911
-      'name' => 'name',
2912
-      'phpcode' => 'phpcode',
2913
-      'expavg_credit' => 'expavg_credit',
2914
-      'total_credit' => 'total_credit',
2915
-      'country' => 'country',
2916
-      'nusers' => 'nusers',
2909
+        'rownumber' => 'rownumber',
2910
+        'id' => 'id',
2911
+        'name' => 'name',
2912
+        'phpcode' => 'phpcode',
2913
+        'expavg_credit' => 'expavg_credit',
2914
+        'total_credit' => 'total_credit',
2915
+        'country' => 'country',
2916
+        'nusers' => 'nusers',
2917 2917
     ),
2918 2918
     'info' => array(
2919
-      'rownumber' => array(
2919
+        'rownumber' => array(
2920 2920
         'separator' => '',
2921
-      ),
2922
-      'id' => array(
2921
+        ),
2922
+        'id' => array(
2923 2923
         'sortable' => 1,
2924 2924
         'separator' => '',
2925
-      ),
2926
-      'name' => array(
2925
+        ),
2926
+        'name' => array(
2927 2927
         'sortable' => 1,
2928 2928
         'separator' => '',
2929
-      ),
2930
-      'phpcode' => array(
2929
+        ),
2930
+        'phpcode' => array(
2931 2931
         'separator' => '',
2932
-      ),
2933
-      'expavg_credit' => array(
2932
+        ),
2933
+        'expavg_credit' => array(
2934 2934
         'sortable' => 1,
2935 2935
         'separator' => '',
2936
-      ),
2937
-      'total_credit' => array(
2936
+        ),
2937
+        'total_credit' => array(
2938 2938
         'sortable' => 1,
2939 2939
         'separator' => '',
2940
-      ),
2941
-      'country' => array(
2940
+        ),
2941
+        'country' => array(
2942 2942
         'sortable' => 0,
2943 2943
         'separator' => '',
2944
-      ),
2945
-      'nusers' => array(
2944
+        ),
2945
+        'nusers' => array(
2946 2946
         'sortable' => 1,
2947 2947
         'separator' => '',
2948
-      ),
2948
+        ),
2949 2949
     ),
2950 2950
     'default' => 'expavg_credit',
2951
-  ));
2952
-  $handler->override_option('path', 'community/stats/teams');
2953
-  $handler->override_option('menu', array(
2951
+    ));
2952
+    $handler->override_option('path', 'community/stats/teams');
2953
+    $handler->override_option('menu', array(
2954 2954
     'type' => 'tab',
2955 2955
     'title' => 'Top Teams',
2956 2956
     'description' => '',
2957 2957
     'weight' => '10',
2958 2958
     'name' => 'primary-links',
2959
-  ));
2960
-  $handler->override_option('tab_options', array(
2959
+    ));
2960
+    $handler->override_option('tab_options', array(
2961 2961
     'type' => 'none',
2962 2962
     'title' => '',
2963 2963
     'description' => '',
2964 2964
     'weight' => 0,
2965 2965
     'name' => 'navigation',
2966
-  ));
2967
-  $handler = $view->new_display('panel_pane', 'Team history', 'panel_pane_2');
2968
-  $handler->override_option('relationships', array(
2966
+    ));
2967
+    $handler = $view->new_display('panel_pane', 'Team history', 'panel_pane_2');
2968
+    $handler->override_option('relationships', array(
2969 2969
     'id' => array(
2970
-      'label' => 'Team History',
2971
-      'required' => 0,
2972
-      'id' => 'id',
2973
-      'table' => 'team',
2974
-      'field' => 'id',
2975
-      'override' => array(
2970
+        'label' => 'Team History',
2971
+        'required' => 0,
2972
+        'id' => 'id',
2973
+        'table' => 'team',
2974
+        'field' => 'id',
2975
+        'override' => array(
2976 2976
         'button' => 'Use default',
2977
-      ),
2978
-      'relationship' => 'none',
2977
+        ),
2978
+        'relationship' => 'none',
2979 2979
     ),
2980 2980
     'userid' => array(
2981
-      'label' => 'User (Team History)',
2982
-      'required' => 0,
2983
-      'id' => 'userid',
2984
-      'table' => 'team_delta',
2985
-      'field' => 'userid',
2986
-      'relationship' => 'id',
2987
-      'override' => array(
2981
+        'label' => 'User (Team History)',
2982
+        'required' => 0,
2983
+        'id' => 'userid',
2984
+        'table' => 'team_delta',
2985
+        'field' => 'userid',
2986
+        'relationship' => 'id',
2987
+        'override' => array(
2988 2988
         'button' => 'Use default',
2989
-      ),
2989
+        ),
2990 2990
     ),
2991
-  ));
2992
-  $handler->override_option('fields', array(
2991
+    ));
2992
+    $handler->override_option('fields', array(
2993 2993
     'userid' => array(
2994
-      'label' => 'User ID',
2995
-      'alter' => array(
2994
+        'label' => 'User ID',
2995
+        'alter' => array(
2996 2996
         'alter_text' => 0,
2997 2997
         'text' => '',
2998 2998
         'make_link' => 0,
@@ -3011,32 +3011,32 @@  discard block
 block discarded – undo
3011 3011
         'ellipsis' => 1,
3012 3012
         'html' => 0,
3013 3013
         'strip_tags' => 0,
3014
-      ),
3015
-      'empty' => '',
3016
-      'hide_empty' => 0,
3017
-      'empty_zero' => 0,
3018
-      'hide_alter_empty' => 1,
3019
-      'set_precision' => FALSE,
3020
-      'precision' => 0,
3021
-      'decimal' => '.',
3022
-      'separator' => '',
3023
-      'format_plural' => 0,
3024
-      'format_plural_singular' => '1',
3025
-      'format_plural_plural' => '@count',
3026
-      'prefix' => '',
3027
-      'suffix' => '',
3028
-      'exclude' => 0,
3029
-      'id' => 'userid',
3030
-      'table' => 'team_delta',
3031
-      'field' => 'userid',
3032
-      'override' => array(
3014
+        ),
3015
+        'empty' => '',
3016
+        'hide_empty' => 0,
3017
+        'empty_zero' => 0,
3018
+        'hide_alter_empty' => 1,
3019
+        'set_precision' => FALSE,
3020
+        'precision' => 0,
3021
+        'decimal' => '.',
3022
+        'separator' => '',
3023
+        'format_plural' => 0,
3024
+        'format_plural_singular' => '1',
3025
+        'format_plural_plural' => '@count',
3026
+        'prefix' => '',
3027
+        'suffix' => '',
3028
+        'exclude' => 0,
3029
+        'id' => 'userid',
3030
+        'table' => 'team_delta',
3031
+        'field' => 'userid',
3032
+        'override' => array(
3033 3033
         'button' => 'Use default',
3034
-      ),
3035
-      'relationship' => 'id',
3034
+        ),
3035
+        'relationship' => 'id',
3036 3036
     ),
3037 3037
     'timestamp' => array(
3038
-      'label' => 'Timestamp',
3039
-      'alter' => array(
3038
+        'label' => 'Timestamp',
3039
+        'alter' => array(
3040 3040
         'alter_text' => 0,
3041 3041
         'text' => '',
3042 3042
         'make_link' => 0,
@@ -3055,25 +3055,25 @@  discard block
 block discarded – undo
3055 3055
         'ellipsis' => 1,
3056 3056
         'html' => 0,
3057 3057
         'strip_tags' => 0,
3058
-      ),
3059
-      'empty' => '',
3060
-      'hide_empty' => 0,
3061
-      'empty_zero' => 0,
3062
-      'hide_alter_empty' => 1,
3063
-      'date_format' => 'custom',
3064
-      'custom_date_format' => 'j M Y G:i:s T',
3065
-      'exclude' => 0,
3066
-      'id' => 'timestamp',
3067
-      'table' => 'team_delta',
3068
-      'field' => 'timestamp',
3069
-      'override' => array(
3058
+        ),
3059
+        'empty' => '',
3060
+        'hide_empty' => 0,
3061
+        'empty_zero' => 0,
3062
+        'hide_alter_empty' => 1,
3063
+        'date_format' => 'custom',
3064
+        'custom_date_format' => 'j M Y G:i:s T',
3065
+        'exclude' => 0,
3066
+        'id' => 'timestamp',
3067
+        'table' => 'team_delta',
3068
+        'field' => 'timestamp',
3069
+        'override' => array(
3070 3070
         'button' => 'Use default',
3071
-      ),
3072
-      'relationship' => 'id',
3071
+        ),
3072
+        'relationship' => 'id',
3073 3073
     ),
3074 3074
     'name' => array(
3075
-      'label' => 'Name',
3076
-      'alter' => array(
3075
+        'label' => 'Name',
3076
+        'alter' => array(
3077 3077
         'alter_text' => 0,
3078 3078
         'text' => '',
3079 3079
         'make_link' => 0,
@@ -3092,23 +3092,23 @@  discard block
 block discarded – undo
3092 3092
         'ellipsis' => 1,
3093 3093
         'html' => 0,
3094 3094
         'strip_tags' => 0,
3095
-      ),
3096
-      'empty' => '',
3097
-      'hide_empty' => 0,
3098
-      'empty_zero' => 0,
3099
-      'hide_alter_empty' => 1,
3100
-      'exclude' => 0,
3101
-      'id' => 'name',
3102
-      'table' => 'user',
3103
-      'field' => 'name',
3104
-      'relationship' => 'userid',
3105
-      'override' => array(
3095
+        ),
3096
+        'empty' => '',
3097
+        'hide_empty' => 0,
3098
+        'empty_zero' => 0,
3099
+        'hide_alter_empty' => 1,
3100
+        'exclude' => 0,
3101
+        'id' => 'name',
3102
+        'table' => 'user',
3103
+        'field' => 'name',
3104
+        'relationship' => 'userid',
3105
+        'override' => array(
3106 3106
         'button' => 'Use default',
3107
-      ),
3107
+        ),
3108 3108
     ),
3109 3109
     'joining' => array(
3110
-      'label' => 'User joined',
3111
-      'alter' => array(
3110
+        'label' => 'User joined',
3111
+        'alter' => array(
3112 3112
         'alter_text' => 0,
3113 3113
         'text' => '',
3114 3114
         'make_link' => 0,
@@ -3127,32 +3127,32 @@  discard block
 block discarded – undo
3127 3127
         'ellipsis' => 1,
3128 3128
         'html' => 0,
3129 3129
         'strip_tags' => 0,
3130
-      ),
3131
-      'empty' => '0',
3132
-      'hide_empty' => 0,
3133
-      'empty_zero' => 0,
3134
-      'hide_alter_empty' => 0,
3135
-      'set_precision' => FALSE,
3136
-      'precision' => 0,
3137
-      'decimal' => '.',
3138
-      'separator' => '',
3139
-      'format_plural' => 0,
3140
-      'format_plural_singular' => '1',
3141
-      'format_plural_plural' => '@count',
3142
-      'prefix' => '',
3143
-      'suffix' => '',
3144
-      'exclude' => 0,
3145
-      'id' => 'joining',
3146
-      'table' => 'team_delta',
3147
-      'field' => 'joining',
3148
-      'override' => array(
3130
+        ),
3131
+        'empty' => '0',
3132
+        'hide_empty' => 0,
3133
+        'empty_zero' => 0,
3134
+        'hide_alter_empty' => 0,
3135
+        'set_precision' => FALSE,
3136
+        'precision' => 0,
3137
+        'decimal' => '.',
3138
+        'separator' => '',
3139
+        'format_plural' => 0,
3140
+        'format_plural_singular' => '1',
3141
+        'format_plural_plural' => '@count',
3142
+        'prefix' => '',
3143
+        'suffix' => '',
3144
+        'exclude' => 0,
3145
+        'id' => 'joining',
3146
+        'table' => 'team_delta',
3147
+        'field' => 'joining',
3148
+        'override' => array(
3149 3149
         'button' => 'Use default',
3150
-      ),
3151
-      'relationship' => 'id',
3150
+        ),
3151
+        'relationship' => 'id',
3152 3152
     ),
3153 3153
     'total_credit' => array(
3154
-      'label' => 'Total Credit',
3155
-      'alter' => array(
3154
+        'label' => 'Total Credit',
3155
+        'alter' => array(
3156 3156
         'alter_text' => 0,
3157 3157
         'text' => '',
3158 3158
         'make_link' => 0,
@@ -3171,50 +3171,50 @@  discard block
 block discarded – undo
3171 3171
         'ellipsis' => 1,
3172 3172
         'html' => 0,
3173 3173
         'strip_tags' => 0,
3174
-      ),
3175
-      'empty' => '',
3176
-      'hide_empty' => 0,
3177
-      'empty_zero' => 0,
3178
-      'hide_alter_empty' => 1,
3179
-      'set_precision' => 1,
3180
-      'precision' => '0',
3181
-      'decimal' => '.',
3182
-      'separator' => ',',
3183
-      'format_plural' => 0,
3184
-      'format_plural_singular' => '1',
3185
-      'format_plural_plural' => '@count',
3186
-      'prefix' => '',
3187
-      'suffix' => '',
3188
-      'exclude' => 0,
3189
-      'id' => 'total_credit',
3190
-      'table' => 'team_delta',
3191
-      'field' => 'total_credit',
3192
-      'override' => array(
3174
+        ),
3175
+        'empty' => '',
3176
+        'hide_empty' => 0,
3177
+        'empty_zero' => 0,
3178
+        'hide_alter_empty' => 1,
3179
+        'set_precision' => 1,
3180
+        'precision' => '0',
3181
+        'decimal' => '.',
3182
+        'separator' => ',',
3183
+        'format_plural' => 0,
3184
+        'format_plural_singular' => '1',
3185
+        'format_plural_plural' => '@count',
3186
+        'prefix' => '',
3187
+        'suffix' => '',
3188
+        'exclude' => 0,
3189
+        'id' => 'total_credit',
3190
+        'table' => 'team_delta',
3191
+        'field' => 'total_credit',
3192
+        'override' => array(
3193 3193
         'button' => 'Use default',
3194
-      ),
3195
-      'relationship' => 'id',
3194
+        ),
3195
+        'relationship' => 'id',
3196 3196
     ),
3197
-  ));
3198
-  $handler->override_option('arguments', array(
3197
+    ));
3198
+    $handler->override_option('arguments', array(
3199 3199
     'id' => array(
3200
-      'default_action' => 'not found',
3201
-      'style_plugin' => 'default_summary',
3202
-      'style_options' => array(),
3203
-      'wildcard' => 'all',
3204
-      'wildcard_substitution' => 'All',
3205
-      'title' => '',
3206
-      'breadcrumb' => '',
3207
-      'default_argument_type' => 'fixed',
3208
-      'default_argument' => '',
3209
-      'validate_type' => 'numeric',
3210
-      'validate_fail' => 'not found',
3211
-      'break_phrase' => 0,
3212
-      'not' => 0,
3213
-      'id' => 'id',
3214
-      'table' => 'team',
3215
-      'field' => 'id',
3216
-      'validate_user_argument_type' => 'uid',
3217
-      'validate_user_roles' => array(
3200
+        'default_action' => 'not found',
3201
+        'style_plugin' => 'default_summary',
3202
+        'style_options' => array(),
3203
+        'wildcard' => 'all',
3204
+        'wildcard_substitution' => 'All',
3205
+        'title' => '',
3206
+        'breadcrumb' => '',
3207
+        'default_argument_type' => 'fixed',
3208
+        'default_argument' => '',
3209
+        'validate_type' => 'numeric',
3210
+        'validate_fail' => 'not found',
3211
+        'break_phrase' => 0,
3212
+        'not' => 0,
3213
+        'id' => 'id',
3214
+        'table' => 'team',
3215
+        'field' => 'id',
3216
+        'validate_user_argument_type' => 'uid',
3217
+        'validate_user_roles' => array(
3218 3218
         2 => 0,
3219 3219
         3519698132 => 0,
3220 3220
         1110965548 => 0,
@@ -3223,10 +3223,10 @@  discard block
 block discarded – undo
3223 3223
         268174006 => 0,
3224 3224
         1271379760 => 0,
3225 3225
         933038561 => 0,
3226
-      ),
3227
-      'me_redirect' => 0,
3228
-      'me_validate_user_argument_type' => 'uid',
3229
-      'me_validate_user_roles' => array(
3226
+        ),
3227
+        'me_redirect' => 0,
3228
+        'me_validate_user_argument_type' => 'uid',
3229
+        'me_validate_user_roles' => array(
3230 3230
         2 => 0,
3231 3231
         3519698132 => 0,
3232 3232
         1110965548 => 0,
@@ -3235,23 +3235,23 @@  discard block
 block discarded – undo
3235 3235
         268174006 => 0,
3236 3236
         1271379760 => 0,
3237 3237
         933038561 => 0,
3238
-      ),
3239
-      'override' => array(
3238
+        ),
3239
+        'override' => array(
3240 3240
         'button' => 'Use default',
3241
-      ),
3242
-      'relationship' => 'none',
3243
-      'default_options_div_prefix' => '',
3244
-      'default_taxonomy_tid_term_page' => 0,
3245
-      'default_taxonomy_tid_node' => 0,
3246
-      'default_taxonomy_tid_limit' => 0,
3247
-      'default_taxonomy_tid_vids' => array(
3241
+        ),
3242
+        'relationship' => 'none',
3243
+        'default_options_div_prefix' => '',
3244
+        'default_taxonomy_tid_term_page' => 0,
3245
+        'default_taxonomy_tid_node' => 0,
3246
+        'default_taxonomy_tid_limit' => 0,
3247
+        'default_taxonomy_tid_vids' => array(
3248 3248
         1 => 0,
3249 3249
         2 => 0,
3250
-      ),
3251
-      'default_argument_user' => 0,
3252
-      'default_argument_fixed' => '',
3253
-      'default_argument_php' => '',
3254
-      'validate_argument_node_type' => array(
3250
+        ),
3251
+        'default_argument_user' => 0,
3252
+        'default_argument_fixed' => '',
3253
+        'default_argument_php' => '',
3254
+        'validate_argument_node_type' => array(
3255 3255
         'page' => 0,
3256 3256
         'news' => 0,
3257 3257
         'profile' => 0,
@@ -3259,66 +3259,66 @@  discard block
 block discarded – undo
3259 3259
         'panel' => 0,
3260 3260
         'story' => 0,
3261 3261
         'team' => 0,
3262
-      ),
3263
-      'validate_argument_node_access' => 0,
3264
-      'validate_argument_nid_type' => 'nid',
3265
-      'validate_argument_vocabulary' => array(
3262
+        ),
3263
+        'validate_argument_node_access' => 0,
3264
+        'validate_argument_nid_type' => 'nid',
3265
+        'validate_argument_vocabulary' => array(
3266 3266
         1 => 0,
3267 3267
         2 => 0,
3268
-      ),
3269
-      'validate_argument_type' => 'tid',
3270
-      'validate_argument_transform' => 0,
3271
-      'validate_user_restrict_roles' => 0,
3272
-      'validate_argument_node_flag_name' => '*relationship*',
3273
-      'validate_argument_node_flag_test' => 'flaggable',
3274
-      'validate_argument_node_flag_id_type' => 'id',
3275
-      'validate_argument_user_flag_name' => '*relationship*',
3276
-      'validate_argument_user_flag_test' => 'flaggable',
3277
-      'validate_argument_user_flag_id_type' => 'id',
3278
-      'validate_argument_php' => '',
3279
-      'me_validate_user_restrict_roles' => 0,
3280
-    ),
3281
-  ));
3282
-  $handler->override_option('style_plugin', 'table');
3283
-  $handler->override_option('style_options', array(
3268
+        ),
3269
+        'validate_argument_type' => 'tid',
3270
+        'validate_argument_transform' => 0,
3271
+        'validate_user_restrict_roles' => 0,
3272
+        'validate_argument_node_flag_name' => '*relationship*',
3273
+        'validate_argument_node_flag_test' => 'flaggable',
3274
+        'validate_argument_node_flag_id_type' => 'id',
3275
+        'validate_argument_user_flag_name' => '*relationship*',
3276
+        'validate_argument_user_flag_test' => 'flaggable',
3277
+        'validate_argument_user_flag_id_type' => 'id',
3278
+        'validate_argument_php' => '',
3279
+        'me_validate_user_restrict_roles' => 0,
3280
+    ),
3281
+    ));
3282
+    $handler->override_option('style_plugin', 'table');
3283
+    $handler->override_option('style_options', array(
3284 3284
     'grouping' => '',
3285 3285
     'override' => 1,
3286 3286
     'sticky' => 1,
3287 3287
     'order' => 'asc',
3288 3288
     'summary' => '',
3289 3289
     'columns' => array(
3290
-      'timestamp' => 'timestamp',
3291
-      'total_credit' => 'total_credit',
3292
-      'userid' => 'userid',
3293
-      'joining' => 'joining',
3290
+        'timestamp' => 'timestamp',
3291
+        'total_credit' => 'total_credit',
3292
+        'userid' => 'userid',
3293
+        'joining' => 'joining',
3294 3294
     ),
3295 3295
     'info' => array(
3296
-      'timestamp' => array(
3296
+        'timestamp' => array(
3297 3297
         'sortable' => 0,
3298 3298
         'separator' => '',
3299
-      ),
3300
-      'total_credit' => array(
3299
+        ),
3300
+        'total_credit' => array(
3301 3301
         'sortable' => 0,
3302 3302
         'separator' => '',
3303
-      ),
3304
-      'userid' => array(
3303
+        ),
3304
+        'userid' => array(
3305 3305
         'sortable' => 0,
3306 3306
         'separator' => '',
3307
-      ),
3308
-      'joining' => array(
3307
+        ),
3308
+        'joining' => array(
3309 3309
         'sortable' => 0,
3310 3310
         'separator' => '',
3311
-      ),
3311
+        ),
3312 3312
     ),
3313 3313
     'default' => 'timestamp',
3314
-  ));
3315
-  $handler->override_option('pane_title', 'Team history');
3316
-  $handler->override_option('pane_description', '');
3317
-  $handler->override_option('pane_category', array(
3314
+    ));
3315
+    $handler->override_option('pane_title', 'Team history');
3316
+    $handler->override_option('pane_description', '');
3317
+    $handler->override_option('pane_category', array(
3318 3318
     'name' => 'View panes',
3319 3319
     'weight' => 0,
3320
-  ));
3321
-  $handler->override_option('allow', array(
3320
+    ));
3321
+    $handler->override_option('allow', array(
3322 3322
     'use_pager' => 0,
3323 3323
     'items_per_page' => 'items_per_page',
3324 3324
     'offset' => 0,
@@ -3328,37 +3328,37 @@  discard block
 block discarded – undo
3328 3328
     'title_override' => 'title_override',
3329 3329
     'exposed_form' => 0,
3330 3330
     'fields_override' => 0,
3331
-  ));
3332
-  $handler->override_option('argument_input', array(
3331
+    ));
3332
+    $handler->override_option('argument_input', array(
3333 3333
     'id' => array(
3334
-      'type' => 'panel',
3335
-      'context' => 'term.description',
3336
-      'context_optional' => 0,
3337
-      'panel' => '0',
3338
-      'fixed' => '',
3339
-      'label' => 'BOINC: Id',
3340
-    ),
3341
-  ));
3342
-  $handler->override_option('link_to_view', 0);
3343
-  $handler->override_option('inherit_panels_path', 0);
3344
-  $handler = $view->new_display('panel_pane', 'Team admins', 'panel_pane_3');
3345
-  $handler->override_option('relationships', array(
3334
+        'type' => 'panel',
3335
+        'context' => 'term.description',
3336
+        'context_optional' => 0,
3337
+        'panel' => '0',
3338
+        'fixed' => '',
3339
+        'label' => 'BOINC: Id',
3340
+    ),
3341
+    ));
3342
+    $handler->override_option('link_to_view', 0);
3343
+    $handler->override_option('inherit_panels_path', 0);
3344
+    $handler = $view->new_display('panel_pane', 'Team admins', 'panel_pane_3');
3345
+    $handler->override_option('relationships', array(
3346 3346
     'userid' => array(
3347
-      'label' => 'User',
3348
-      'required' => 0,
3349
-      'id' => 'userid',
3350
-      'table' => 'team_admin',
3351
-      'field' => 'userid',
3352
-      'override' => array(
3347
+        'label' => 'User',
3348
+        'required' => 0,
3349
+        'id' => 'userid',
3350
+        'table' => 'team_admin',
3351
+        'field' => 'userid',
3352
+        'override' => array(
3353 3353
         'button' => 'Use default',
3354
-      ),
3355
-      'relationship' => 'none',
3354
+        ),
3355
+        'relationship' => 'none',
3356 3356
     ),
3357
-  ));
3358
-  $handler->override_option('fields', array(
3357
+    ));
3358
+    $handler->override_option('fields', array(
3359 3359
     'teamid' => array(
3360
-      'label' => 'Id',
3361
-      'alter' => array(
3360
+        'label' => 'Id',
3361
+        'alter' => array(
3362 3362
         'alter_text' => 0,
3363 3363
         'text' => '',
3364 3364
         'make_link' => 0,
@@ -3377,32 +3377,32 @@  discard block
 block discarded – undo
3377 3377
         'ellipsis' => 1,
3378 3378
         'html' => 0,
3379 3379
         'strip_tags' => 0,
3380
-      ),
3381
-      'empty' => '',
3382
-      'hide_empty' => 0,
3383
-      'empty_zero' => 0,
3384
-      'hide_alter_empty' => 1,
3385
-      'set_precision' => FALSE,
3386
-      'precision' => 0,
3387
-      'decimal' => '.',
3388
-      'separator' => '',
3389
-      'format_plural' => 0,
3390
-      'format_plural_singular' => '1',
3391
-      'format_plural_plural' => '@count',
3392
-      'prefix' => '',
3393
-      'suffix' => '',
3394
-      'exclude' => 1,
3395
-      'id' => 'teamid',
3396
-      'table' => 'team_admin',
3397
-      'field' => 'teamid',
3398
-      'override' => array(
3380
+        ),
3381
+        'empty' => '',
3382
+        'hide_empty' => 0,
3383
+        'empty_zero' => 0,
3384
+        'hide_alter_empty' => 1,
3385
+        'set_precision' => FALSE,
3386
+        'precision' => 0,
3387
+        'decimal' => '.',
3388
+        'separator' => '',
3389
+        'format_plural' => 0,
3390
+        'format_plural_singular' => '1',
3391
+        'format_plural_plural' => '@count',
3392
+        'prefix' => '',
3393
+        'suffix' => '',
3394
+        'exclude' => 1,
3395
+        'id' => 'teamid',
3396
+        'table' => 'team_admin',
3397
+        'field' => 'teamid',
3398
+        'override' => array(
3399 3399
         'button' => 'Use default',
3400
-      ),
3401
-      'relationship' => 'none',
3400
+        ),
3401
+        'relationship' => 'none',
3402 3402
     ),
3403 3403
     'userid' => array(
3404
-      'label' => 'User ID',
3405
-      'alter' => array(
3404
+        'label' => 'User ID',
3405
+        'alter' => array(
3406 3406
         'alter_text' => 0,
3407 3407
         'text' => '',
3408 3408
         'make_link' => 0,
@@ -3421,32 +3421,32 @@  discard block
 block discarded – undo
3421 3421
         'ellipsis' => 1,
3422 3422
         'html' => 0,
3423 3423
         'strip_tags' => 0,
3424
-      ),
3425
-      'empty' => '',
3426
-      'hide_empty' => 0,
3427
-      'empty_zero' => 0,
3428
-      'hide_alter_empty' => 1,
3429
-      'set_precision' => FALSE,
3430
-      'precision' => 0,
3431
-      'decimal' => '.',
3432
-      'separator' => '',
3433
-      'format_plural' => 0,
3434
-      'format_plural_singular' => '1',
3435
-      'format_plural_plural' => '@count',
3436
-      'prefix' => '',
3437
-      'suffix' => '',
3438
-      'exclude' => 1,
3439
-      'id' => 'userid',
3440
-      'table' => 'team_admin',
3441
-      'field' => 'userid',
3442
-      'override' => array(
3424
+        ),
3425
+        'empty' => '',
3426
+        'hide_empty' => 0,
3427
+        'empty_zero' => 0,
3428
+        'hide_alter_empty' => 1,
3429
+        'set_precision' => FALSE,
3430
+        'precision' => 0,
3431
+        'decimal' => '.',
3432
+        'separator' => '',
3433
+        'format_plural' => 0,
3434
+        'format_plural_singular' => '1',
3435
+        'format_plural_plural' => '@count',
3436
+        'prefix' => '',
3437
+        'suffix' => '',
3438
+        'exclude' => 1,
3439
+        'id' => 'userid',
3440
+        'table' => 'team_admin',
3441
+        'field' => 'userid',
3442
+        'override' => array(
3443 3443
         'button' => 'Use default',
3444
-      ),
3445
-      'relationship' => 'none',
3444
+        ),
3445
+        'relationship' => 'none',
3446 3446
     ),
3447 3447
     'name' => array(
3448
-      'label' => 'Name',
3449
-      'alter' => array(
3448
+        'label' => 'Name',
3449
+        'alter' => array(
3450 3450
         'alter_text' => 0,
3451 3451
         'text' => '',
3452 3452
         'make_link' => 0,
@@ -3465,23 +3465,23 @@  discard block
 block discarded – undo
3465 3465
         'ellipsis' => 1,
3466 3466
         'html' => 0,
3467 3467
         'strip_tags' => 0,
3468
-      ),
3469
-      'empty' => '',
3470
-      'hide_empty' => 0,
3471
-      'empty_zero' => 0,
3472
-      'hide_alter_empty' => 1,
3473
-      'exclude' => 0,
3474
-      'id' => 'name',
3475
-      'table' => 'user',
3476
-      'field' => 'name',
3477
-      'relationship' => 'userid',
3478
-      'override' => array(
3468
+        ),
3469
+        'empty' => '',
3470
+        'hide_empty' => 0,
3471
+        'empty_zero' => 0,
3472
+        'hide_alter_empty' => 1,
3473
+        'exclude' => 0,
3474
+        'id' => 'name',
3475
+        'table' => 'user',
3476
+        'field' => 'name',
3477
+        'relationship' => 'userid',
3478
+        'override' => array(
3479 3479
         'button' => 'Use default',
3480
-      ),
3480
+        ),
3481 3481
     ),
3482 3482
     'create_time' => array(
3483
-      'label' => 'Admin since',
3484
-      'alter' => array(
3483
+        'label' => 'Admin since',
3484
+        'alter' => array(
3485 3485
         'alter_text' => 0,
3486 3486
         'text' => '',
3487 3487
         'make_link' => 0,
@@ -3500,25 +3500,25 @@  discard block
 block discarded – undo
3500 3500
         'ellipsis' => 1,
3501 3501
         'html' => 0,
3502 3502
         'strip_tags' => 0,
3503
-      ),
3504
-      'empty' => '',
3505
-      'hide_empty' => 0,
3506
-      'empty_zero' => 0,
3507
-      'hide_alter_empty' => 1,
3508
-      'date_format' => 'custom',
3509
-      'custom_date_format' => 'j M Y G:i:s T',
3510
-      'exclude' => 0,
3511
-      'id' => 'create_time',
3512
-      'table' => 'team_admin',
3513
-      'field' => 'create_time',
3514
-      'override' => array(
3503
+        ),
3504
+        'empty' => '',
3505
+        'hide_empty' => 0,
3506
+        'empty_zero' => 0,
3507
+        'hide_alter_empty' => 1,
3508
+        'date_format' => 'custom',
3509
+        'custom_date_format' => 'j M Y G:i:s T',
3510
+        'exclude' => 0,
3511
+        'id' => 'create_time',
3512
+        'table' => 'team_admin',
3513
+        'field' => 'create_time',
3514
+        'override' => array(
3515 3515
         'button' => 'Use default',
3516
-      ),
3517
-      'relationship' => 'none',
3516
+        ),
3517
+        'relationship' => 'none',
3518 3518
     ),
3519 3519
     'phpcode' => array(
3520
-      'label' => '',
3521
-      'alter' => array(
3520
+        'label' => '',
3521
+        'alter' => array(
3522 3522
         'alter_text' => 0,
3523 3523
         'text' => '',
3524 3524
         'make_link' => 0,
@@ -3537,46 +3537,46 @@  discard block
 block discarded – undo
3537 3537
         'ellipsis' => 1,
3538 3538
         'html' => 0,
3539 3539
         'strip_tags' => 0,
3540
-      ),
3541
-      'empty' => '',
3542
-      'hide_empty' => 0,
3543
-      'empty_zero' => 0,
3544
-      'hide_alter_empty' => 1,
3545
-      'value' => '<?php
3540
+        ),
3541
+        'empty' => '',
3542
+        'hide_empty' => 0,
3543
+        'empty_zero' => 0,
3544
+        'hide_alter_empty' => 1,
3545
+        'value' => '<?php
3546 3546
 $team_id = boincteam_lookup_nid($data->id);
3547 3547
 $user_id = get_drupal_id($data->team_admin_userid);
3548 3548
 echo l(bts(\'Remove\', array(), NULL, \'boinc:remove-team-member\'), "community/teams/{$team_id}/edit/admins/remove/{$user_id}");
3549 3549
 ?>',
3550
-      'exclude' => 0,
3551
-      'id' => 'phpcode',
3552
-      'table' => 'customfield',
3553
-      'field' => 'phpcode',
3554
-      'override' => array(
3550
+        'exclude' => 0,
3551
+        'id' => 'phpcode',
3552
+        'table' => 'customfield',
3553
+        'field' => 'phpcode',
3554
+        'override' => array(
3555 3555
         'button' => 'Use default',
3556
-      ),
3557
-      'relationship' => 'none',
3556
+        ),
3557
+        'relationship' => 'none',
3558 3558
     ),
3559
-  ));
3560
-  $handler->override_option('arguments', array(
3559
+    ));
3560
+    $handler->override_option('arguments', array(
3561 3561
     'id' => array(
3562
-      'default_action' => 'not found',
3563
-      'style_plugin' => 'default_summary',
3564
-      'style_options' => array(),
3565
-      'wildcard' => 'all',
3566
-      'wildcard_substitution' => 'All',
3567
-      'title' => '',
3568
-      'breadcrumb' => '',
3569
-      'default_argument_type' => 'fixed',
3570
-      'default_argument' => '',
3571
-      'validate_type' => 'numeric',
3572
-      'validate_fail' => 'not found',
3573
-      'break_phrase' => 0,
3574
-      'not' => 0,
3575
-      'id' => 'id',
3576
-      'table' => 'team',
3577
-      'field' => 'id',
3578
-      'validate_user_argument_type' => 'uid',
3579
-      'validate_user_roles' => array(
3562
+        'default_action' => 'not found',
3563
+        'style_plugin' => 'default_summary',
3564
+        'style_options' => array(),
3565
+        'wildcard' => 'all',
3566
+        'wildcard_substitution' => 'All',
3567
+        'title' => '',
3568
+        'breadcrumb' => '',
3569
+        'default_argument_type' => 'fixed',
3570
+        'default_argument' => '',
3571
+        'validate_type' => 'numeric',
3572
+        'validate_fail' => 'not found',
3573
+        'break_phrase' => 0,
3574
+        'not' => 0,
3575
+        'id' => 'id',
3576
+        'table' => 'team',
3577
+        'field' => 'id',
3578
+        'validate_user_argument_type' => 'uid',
3579
+        'validate_user_roles' => array(
3580 3580
         2 => 0,
3581 3581
         3519698132 => 0,
3582 3582
         1110965548 => 0,
@@ -3585,10 +3585,10 @@  discard block
 block discarded – undo
3585 3585
         268174006 => 0,
3586 3586
         1271379760 => 0,
3587 3587
         933038561 => 0,
3588
-      ),
3589
-      'me_redirect' => 0,
3590
-      'me_validate_user_argument_type' => 'uid',
3591
-      'me_validate_user_roles' => array(
3588
+        ),
3589
+        'me_redirect' => 0,
3590
+        'me_validate_user_argument_type' => 'uid',
3591
+        'me_validate_user_roles' => array(
3592 3592
         2 => 0,
3593 3593
         3519698132 => 0,
3594 3594
         1110965548 => 0,
@@ -3597,23 +3597,23 @@  discard block
 block discarded – undo
3597 3597
         268174006 => 0,
3598 3598
         1271379760 => 0,
3599 3599
         933038561 => 0,
3600
-      ),
3601
-      'override' => array(
3600
+        ),
3601
+        'override' => array(
3602 3602
         'button' => 'Use default',
3603
-      ),
3604
-      'relationship' => 'none',
3605
-      'default_options_div_prefix' => '',
3606
-      'default_taxonomy_tid_term_page' => 0,
3607
-      'default_taxonomy_tid_node' => 0,
3608
-      'default_taxonomy_tid_limit' => 0,
3609
-      'default_taxonomy_tid_vids' => array(
3603
+        ),
3604
+        'relationship' => 'none',
3605
+        'default_options_div_prefix' => '',
3606
+        'default_taxonomy_tid_term_page' => 0,
3607
+        'default_taxonomy_tid_node' => 0,
3608
+        'default_taxonomy_tid_limit' => 0,
3609
+        'default_taxonomy_tid_vids' => array(
3610 3610
         1 => 0,
3611 3611
         2 => 0,
3612
-      ),
3613
-      'default_argument_user' => 0,
3614
-      'default_argument_fixed' => '',
3615
-      'default_argument_php' => '',
3616
-      'validate_argument_node_type' => array(
3612
+        ),
3613
+        'default_argument_user' => 0,
3614
+        'default_argument_fixed' => '',
3615
+        'default_argument_php' => '',
3616
+        'validate_argument_node_type' => array(
3617 3617
         'page' => 0,
3618 3618
         'news' => 0,
3619 3619
         'profile' => 0,
@@ -3621,95 +3621,95 @@  discard block
 block discarded – undo
3621 3621
         'panel' => 0,
3622 3622
         'story' => 0,
3623 3623
         'team' => 0,
3624
-      ),
3625
-      'validate_argument_node_access' => 0,
3626
-      'validate_argument_nid_type' => 'nid',
3627
-      'validate_argument_vocabulary' => array(
3624
+        ),
3625
+        'validate_argument_node_access' => 0,
3626
+        'validate_argument_nid_type' => 'nid',
3627
+        'validate_argument_vocabulary' => array(
3628 3628
         1 => 0,
3629 3629
         2 => 0,
3630
-      ),
3631
-      'validate_argument_type' => 'tid',
3632
-      'validate_argument_transform' => 0,
3633
-      'validate_user_restrict_roles' => 0,
3634
-      'validate_argument_node_flag_name' => '*relationship*',
3635
-      'validate_argument_node_flag_test' => 'flaggable',
3636
-      'validate_argument_node_flag_id_type' => 'id',
3637
-      'validate_argument_user_flag_name' => '*relationship*',
3638
-      'validate_argument_user_flag_test' => 'flaggable',
3639
-      'validate_argument_user_flag_id_type' => 'id',
3640
-      'validate_argument_php' => '',
3641
-      'me_validate_user_restrict_roles' => 0,
3642
-    ),
3643
-  ));
3644
-  $handler->override_option('filters', array(
3630
+        ),
3631
+        'validate_argument_type' => 'tid',
3632
+        'validate_argument_transform' => 0,
3633
+        'validate_user_restrict_roles' => 0,
3634
+        'validate_argument_node_flag_name' => '*relationship*',
3635
+        'validate_argument_node_flag_test' => 'flaggable',
3636
+        'validate_argument_node_flag_id_type' => 'id',
3637
+        'validate_argument_user_flag_name' => '*relationship*',
3638
+        'validate_argument_user_flag_test' => 'flaggable',
3639
+        'validate_argument_user_flag_id_type' => 'id',
3640
+        'validate_argument_php' => '',
3641
+        'me_validate_user_restrict_roles' => 0,
3642
+    ),
3643
+    ));
3644
+    $handler->override_option('filters', array(
3645 3645
     'userid' => array(
3646
-      'operator' => 'not empty',
3647
-      'value' => array(
3646
+        'operator' => 'not empty',
3647
+        'value' => array(
3648 3648
         'value' => '',
3649 3649
         'min' => '',
3650 3650
         'max' => '',
3651
-      ),
3652
-      'group' => '0',
3653
-      'exposed' => FALSE,
3654
-      'expose' => array(
3651
+        ),
3652
+        'group' => '0',
3653
+        'exposed' => FALSE,
3654
+        'expose' => array(
3655 3655
         'operator' => FALSE,
3656 3656
         'label' => '',
3657
-      ),
3658
-      'id' => 'userid',
3659
-      'table' => 'team_admin',
3660
-      'field' => 'userid',
3661
-      'override' => array(
3657
+        ),
3658
+        'id' => 'userid',
3659
+        'table' => 'team_admin',
3660
+        'field' => 'userid',
3661
+        'override' => array(
3662 3662
         'button' => 'Use default',
3663
-      ),
3664
-      'relationship' => 'none',
3665
-    ),
3666
-  ));
3667
-  $handler->override_option('empty', 'There are currently no team admins.');
3668
-  $handler->override_option('empty_format', '5');
3669
-  $handler->override_option('style_plugin', 'table');
3670
-  $handler->override_option('style_options', array(
3663
+        ),
3664
+        'relationship' => 'none',
3665
+    ),
3666
+    ));
3667
+    $handler->override_option('empty', 'There are currently no team admins.');
3668
+    $handler->override_option('empty_format', '5');
3669
+    $handler->override_option('style_plugin', 'table');
3670
+    $handler->override_option('style_options', array(
3671 3671
     'grouping' => '',
3672 3672
     'override' => 1,
3673 3673
     'sticky' => 1,
3674 3674
     'order' => 'asc',
3675 3675
     'summary' => '',
3676 3676
     'columns' => array(
3677
-      'teamid' => 'teamid',
3678
-      'userid' => 'userid',
3679
-      'name' => 'name',
3680
-      'create_time' => 'create_time',
3681
-      'phpcode' => 'phpcode',
3677
+        'teamid' => 'teamid',
3678
+        'userid' => 'userid',
3679
+        'name' => 'name',
3680
+        'create_time' => 'create_time',
3681
+        'phpcode' => 'phpcode',
3682 3682
     ),
3683 3683
     'info' => array(
3684
-      'teamid' => array(
3684
+        'teamid' => array(
3685 3685
         'sortable' => 0,
3686 3686
         'separator' => '',
3687
-      ),
3688
-      'userid' => array(
3687
+        ),
3688
+        'userid' => array(
3689 3689
         'sortable' => 0,
3690 3690
         'separator' => '',
3691
-      ),
3692
-      'name' => array(
3691
+        ),
3692
+        'name' => array(
3693 3693
         'sortable' => 0,
3694 3694
         'separator' => '',
3695
-      ),
3696
-      'create_time' => array(
3695
+        ),
3696
+        'create_time' => array(
3697 3697
         'sortable' => 0,
3698 3698
         'separator' => '',
3699
-      ),
3700
-      'phpcode' => array(
3699
+        ),
3700
+        'phpcode' => array(
3701 3701
         'separator' => '',
3702
-      ),
3702
+        ),
3703 3703
     ),
3704 3704
     'default' => 'create_time',
3705
-  ));
3706
-  $handler->override_option('pane_title', 'Team admins');
3707
-  $handler->override_option('pane_description', '');
3708
-  $handler->override_option('pane_category', array(
3705
+    ));
3706
+    $handler->override_option('pane_title', 'Team admins');
3707
+    $handler->override_option('pane_description', '');
3708
+    $handler->override_option('pane_category', array(
3709 3709
     'name' => 'View panes',
3710 3710
     'weight' => 0,
3711
-  ));
3712
-  $handler->override_option('allow', array(
3711
+    ));
3712
+    $handler->override_option('allow', array(
3713 3713
     'use_pager' => 0,
3714 3714
     'items_per_page' => 'items_per_page',
3715 3715
     'offset' => 0,
@@ -3719,24 +3719,24 @@  discard block
 block discarded – undo
3719 3719
     'title_override' => 'title_override',
3720 3720
     'exposed_form' => 0,
3721 3721
     'fields_override' => 0,
3722
-  ));
3723
-  $handler->override_option('argument_input', array(
3722
+    ));
3723
+    $handler->override_option('argument_input', array(
3724 3724
     'id' => array(
3725
-      'type' => 'panel',
3726
-      'context' => 'term.description',
3727
-      'context_optional' => 0,
3728
-      'panel' => '0',
3729
-      'fixed' => '',
3730
-      'label' => 'BOINC: Id',
3731
-    ),
3732
-  ));
3733
-  $handler->override_option('link_to_view', 0);
3734
-  $handler->override_option('inherit_panels_path', 0);
3735
-  $handler = $view->new_display('panel_pane', 'Top teams pane', 'panel_pane_4');
3736
-  $handler->override_option('fields', array(
3725
+        'type' => 'panel',
3726
+        'context' => 'term.description',
3727
+        'context_optional' => 0,
3728
+        'panel' => '0',
3729
+        'fixed' => '',
3730
+        'label' => 'BOINC: Id',
3731
+    ),
3732
+    ));
3733
+    $handler->override_option('link_to_view', 0);
3734
+    $handler->override_option('inherit_panels_path', 0);
3735
+    $handler = $view->new_display('panel_pane', 'Top teams pane', 'panel_pane_4');
3736
+    $handler->override_option('fields', array(
3737 3737
     'rownumber' => array(
3738
-      'label' => 'Rank',
3739
-      'alter' => array(
3738
+        'label' => 'Rank',
3739
+        'alter' => array(
3740 3740
         'alter_text' => 0,
3741 3741
         'text' => '',
3742 3742
         'make_link' => 0,
@@ -3755,20 +3755,20 @@  discard block
 block discarded – undo
3755 3755
         'ellipsis' => 1,
3756 3756
         'html' => 0,
3757 3757
         'strip_tags' => 0,
3758
-      ),
3759
-      'empty' => '',
3760
-      'hide_empty' => 0,
3761
-      'empty_zero' => 0,
3762
-      'hide_alter_empty' => 1,
3763
-      'exclude' => 0,
3764
-      'id' => 'rownumber',
3765
-      'table' => 'customfield',
3766
-      'field' => 'rownumber',
3767
-      'relationship' => 'none',
3758
+        ),
3759
+        'empty' => '',
3760
+        'hide_empty' => 0,
3761
+        'empty_zero' => 0,
3762
+        'hide_alter_empty' => 1,
3763
+        'exclude' => 0,
3764
+        'id' => 'rownumber',
3765
+        'table' => 'customfield',
3766
+        'field' => 'rownumber',
3767
+        'relationship' => 'none',
3768 3768
     ),
3769 3769
     'id' => array(
3770
-      'label' => 'Id',
3771
-      'alter' => array(
3770
+        'label' => 'Id',
3771
+        'alter' => array(
3772 3772
         'alter_text' => 0,
3773 3773
         'text' => '',
3774 3774
         'make_link' => 0,
@@ -3787,29 +3787,29 @@  discard block
 block discarded – undo
3787 3787
         'ellipsis' => 1,
3788 3788
         'html' => 0,
3789 3789
         'strip_tags' => 0,
3790
-      ),
3791
-      'empty' => '',
3792
-      'hide_empty' => 0,
3793
-      'empty_zero' => 0,
3794
-      'hide_alter_empty' => 1,
3795
-      'set_precision' => FALSE,
3796
-      'precision' => 0,
3797
-      'decimal' => '.',
3798
-      'separator' => '',
3799
-      'format_plural' => 0,
3800
-      'format_plural_singular' => '1',
3801
-      'format_plural_plural' => '@count',
3802
-      'prefix' => '',
3803
-      'suffix' => '',
3804
-      'exclude' => 1,
3805
-      'id' => 'id',
3806
-      'table' => 'team',
3807
-      'field' => 'id',
3808
-      'relationship' => 'none',
3790
+        ),
3791
+        'empty' => '',
3792
+        'hide_empty' => 0,
3793
+        'empty_zero' => 0,
3794
+        'hide_alter_empty' => 1,
3795
+        'set_precision' => FALSE,
3796
+        'precision' => 0,
3797
+        'decimal' => '.',
3798
+        'separator' => '',
3799
+        'format_plural' => 0,
3800
+        'format_plural_singular' => '1',
3801
+        'format_plural_plural' => '@count',
3802
+        'prefix' => '',
3803
+        'suffix' => '',
3804
+        'exclude' => 1,
3805
+        'id' => 'id',
3806
+        'table' => 'team',
3807
+        'field' => 'id',
3808
+        'relationship' => 'none',
3809 3809
     ),
3810 3810
     'name' => array(
3811
-      'label' => 'Name',
3812
-      'alter' => array(
3811
+        'label' => 'Name',
3812
+        'alter' => array(
3813 3813
         'alter_text' => 0,
3814 3814
         'text' => '',
3815 3815
         'make_link' => 0,
@@ -3828,20 +3828,20 @@  discard block
 block discarded – undo
3828 3828
         'ellipsis' => 1,
3829 3829
         'html' => 0,
3830 3830
         'strip_tags' => 0,
3831
-      ),
3832
-      'empty' => '',
3833
-      'hide_empty' => 0,
3834
-      'empty_zero' => 0,
3835
-      'hide_alter_empty' => 1,
3836
-      'exclude' => 1,
3837
-      'id' => 'name',
3838
-      'table' => 'team',
3839
-      'field' => 'name',
3840
-      'relationship' => 'none',
3831
+        ),
3832
+        'empty' => '',
3833
+        'hide_empty' => 0,
3834
+        'empty_zero' => 0,
3835
+        'hide_alter_empty' => 1,
3836
+        'exclude' => 1,
3837
+        'id' => 'name',
3838
+        'table' => 'team',
3839
+        'field' => 'name',
3840
+        'relationship' => 'none',
3841 3841
     ),
3842 3842
     'phpcode' => array(
3843
-      'label' => 'Name',
3844
-      'alter' => array(
3843
+        'label' => 'Name',
3844
+        'alter' => array(
3845 3845
         'alter_text' => 0,
3846 3846
         'text' => '',
3847 3847
         'make_link' => 0,
@@ -3860,34 +3860,34 @@  discard block
 block discarded – undo
3860 3860
         'ellipsis' => 1,
3861 3861
         'html' => 0,
3862 3862
         'strip_tags' => 0,
3863
-      ),
3864
-      'empty' => '',
3865
-      'hide_empty' => 0,
3866
-      'empty_zero' => 0,
3867
-      'hide_alter_empty' => 1,
3868
-      'value' => '<?php
3863
+        ),
3864
+        'empty' => '',
3865
+        'hide_empty' => 0,
3866
+        'empty_zero' => 0,
3867
+        'hide_alter_empty' => 1,
3868
+        'value' => '<?php
3869 3869
   $team_id = boincteam_lookup_nid($data->id);
3870 3870
   echo l($data->team_name, "community/teams/{$team_id}");
3871 3871
 ?>',
3872
-      'exclude' => 0,
3873
-      'id' => 'phpcode',
3874
-      'table' => 'customfield',
3875
-      'field' => 'phpcode',
3876
-      'relationship' => 'none',
3872
+        'exclude' => 0,
3873
+        'id' => 'phpcode',
3874
+        'table' => 'customfield',
3875
+        'field' => 'phpcode',
3876
+        'relationship' => 'none',
3877 3877
     ),
3878 3878
     'nusers' => array(
3879
-      'id' => 'nusers',
3880
-      'table' => 'team',
3881
-      'field' => 'nusers',
3879
+        'id' => 'nusers',
3880
+        'table' => 'team',
3881
+        'field' => 'nusers',
3882 3882
     ),
3883 3883
     'country' => array(
3884
-      'id' => 'country',
3885
-      'table' => 'team',
3886
-      'field' => 'country',
3884
+        'id' => 'country',
3885
+        'table' => 'team',
3886
+        'field' => 'country',
3887 3887
     ),
3888 3888
     'expavg_credit' => array(
3889
-      'label' => 'Recent average credit',
3890
-      'alter' => array(
3889
+        'label' => 'Recent average credit',
3890
+        'alter' => array(
3891 3891
         'alter_text' => 0,
3892 3892
         'text' => '',
3893 3893
         'make_link' => 0,
@@ -3906,29 +3906,29 @@  discard block
 block discarded – undo
3906 3906
         'ellipsis' => 1,
3907 3907
         'html' => 0,
3908 3908
         'strip_tags' => 0,
3909
-      ),
3910
-      'empty' => '',
3911
-      'hide_empty' => 0,
3912
-      'empty_zero' => 0,
3913
-      'hide_alter_empty' => 1,
3914
-      'set_precision' => 1,
3915
-      'precision' => '2',
3916
-      'decimal' => '.',
3917
-      'separator' => ',',
3918
-      'format_plural' => 0,
3919
-      'format_plural_singular' => '1',
3920
-      'format_plural_plural' => '@count',
3921
-      'prefix' => '',
3922
-      'suffix' => '',
3923
-      'exclude' => 0,
3924
-      'id' => 'expavg_credit',
3925
-      'table' => 'team',
3926
-      'field' => 'expavg_credit',
3927
-      'relationship' => 'none',
3909
+        ),
3910
+        'empty' => '',
3911
+        'hide_empty' => 0,
3912
+        'empty_zero' => 0,
3913
+        'hide_alter_empty' => 1,
3914
+        'set_precision' => 1,
3915
+        'precision' => '2',
3916
+        'decimal' => '.',
3917
+        'separator' => ',',
3918
+        'format_plural' => 0,
3919
+        'format_plural_singular' => '1',
3920
+        'format_plural_plural' => '@count',
3921
+        'prefix' => '',
3922
+        'suffix' => '',
3923
+        'exclude' => 0,
3924
+        'id' => 'expavg_credit',
3925
+        'table' => 'team',
3926
+        'field' => 'expavg_credit',
3927
+        'relationship' => 'none',
3928 3928
     ),
3929 3929
     'total_credit' => array(
3930
-      'label' => 'Total Credit',
3931
-      'alter' => array(
3930
+        'label' => 'Total Credit',
3931
+        'alter' => array(
3932 3932
         'alter_text' => 0,
3933 3933
         'text' => '',
3934 3934
         'make_link' => 0,
@@ -3947,115 +3947,115 @@  discard block
 block discarded – undo
3947 3947
         'ellipsis' => 1,
3948 3948
         'html' => 0,
3949 3949
         'strip_tags' => 0,
3950
-      ),
3951
-      'empty' => '',
3952
-      'hide_empty' => 0,
3953
-      'empty_zero' => 0,
3954
-      'hide_alter_empty' => 1,
3955
-      'set_precision' => 1,
3956
-      'precision' => '0',
3957
-      'decimal' => '.',
3958
-      'separator' => ',',
3959
-      'format_plural' => 0,
3960
-      'format_plural_singular' => '1',
3961
-      'format_plural_plural' => '@count',
3962
-      'prefix' => '',
3963
-      'suffix' => '',
3964
-      'exclude' => 0,
3965
-      'id' => 'total_credit',
3966
-      'table' => 'team',
3967
-      'field' => 'total_credit',
3968
-      'relationship' => 'none',
3969
-      'override' => array(
3950
+        ),
3951
+        'empty' => '',
3952
+        'hide_empty' => 0,
3953
+        'empty_zero' => 0,
3954
+        'hide_alter_empty' => 1,
3955
+        'set_precision' => 1,
3956
+        'precision' => '0',
3957
+        'decimal' => '.',
3958
+        'separator' => ',',
3959
+        'format_plural' => 0,
3960
+        'format_plural_singular' => '1',
3961
+        'format_plural_plural' => '@count',
3962
+        'prefix' => '',
3963
+        'suffix' => '',
3964
+        'exclude' => 0,
3965
+        'id' => 'total_credit',
3966
+        'table' => 'team',
3967
+        'field' => 'total_credit',
3968
+        'relationship' => 'none',
3969
+        'override' => array(
3970 3970
         'button' => 'Use default',
3971
-      ),
3971
+        ),
3972 3972
     ),
3973
-  ));
3974
-  $handler->override_option('filters', array(
3973
+    ));
3974
+    $handler->override_option('filters', array(
3975 3975
     'total_credit' => array(
3976
-      'operator' => '>=',
3977
-      'value' => array(
3976
+        'operator' => '>=',
3977
+        'value' => array(
3978 3978
         'value' => '1',
3979 3979
         'min' => '',
3980 3980
         'max' => '',
3981
-      ),
3982
-      'group' => '0',
3983
-      'exposed' => FALSE,
3984
-      'expose' => array(
3981
+        ),
3982
+        'group' => '0',
3983
+        'exposed' => FALSE,
3984
+        'expose' => array(
3985 3985
         'operator' => FALSE,
3986 3986
         'label' => '',
3987
-      ),
3988
-      'id' => 'total_credit',
3989
-      'table' => 'team',
3990
-      'field' => 'total_credit',
3991
-      'override' => array(
3987
+        ),
3988
+        'id' => 'total_credit',
3989
+        'table' => 'team',
3990
+        'field' => 'total_credit',
3991
+        'override' => array(
3992 3992
         'button' => 'Use default',
3993
-      ),
3994
-      'relationship' => 'none',
3995
-    ),
3996
-  ));
3997
-  $handler->override_option('title', 'Top teams');
3998
-  $handler->override_option('use_more', 1);
3999
-  $handler->override_option('use_more_always', 1);
4000
-  $handler->override_option('use_more_text', 'view more');
4001
-  $handler->override_option('style_plugin', 'table');
4002
-  $handler->override_option('style_options', array(
3993
+        ),
3994
+        'relationship' => 'none',
3995
+    ),
3996
+    ));
3997
+    $handler->override_option('title', 'Top teams');
3998
+    $handler->override_option('use_more', 1);
3999
+    $handler->override_option('use_more_always', 1);
4000
+    $handler->override_option('use_more_text', 'view more');
4001
+    $handler->override_option('style_plugin', 'table');
4002
+    $handler->override_option('style_options', array(
4003 4003
     'grouping' => '',
4004 4004
     'override' => 1,
4005 4005
     'sticky' => 0,
4006 4006
     'order' => 'desc',
4007 4007
     'summary' => '',
4008 4008
     'columns' => array(
4009
-      'rownumber' => 'rownumber',
4010
-      'id' => 'id',
4011
-      'name' => 'name',
4012
-      'phpcode' => 'phpcode',
4013
-      'nusers' => 'nusers',
4014
-      'country' => 'country',
4015
-      'expavg_credit' => 'expavg_credit',
4016
-      'total_credit' => 'total_credit',
4009
+        'rownumber' => 'rownumber',
4010
+        'id' => 'id',
4011
+        'name' => 'name',
4012
+        'phpcode' => 'phpcode',
4013
+        'nusers' => 'nusers',
4014
+        'country' => 'country',
4015
+        'expavg_credit' => 'expavg_credit',
4016
+        'total_credit' => 'total_credit',
4017 4017
     ),
4018 4018
     'info' => array(
4019
-      'rownumber' => array(
4019
+        'rownumber' => array(
4020 4020
         'separator' => '',
4021
-      ),
4022
-      'id' => array(
4021
+        ),
4022
+        'id' => array(
4023 4023
         'sortable' => 1,
4024 4024
         'separator' => '',
4025
-      ),
4026
-      'name' => array(
4025
+        ),
4026
+        'name' => array(
4027 4027
         'sortable' => 1,
4028 4028
         'separator' => '',
4029
-      ),
4030
-      'phpcode' => array(
4029
+        ),
4030
+        'phpcode' => array(
4031 4031
         'separator' => '',
4032
-      ),
4033
-      'nusers' => array(
4032
+        ),
4033
+        'nusers' => array(
4034 4034
         'sortable' => 1,
4035 4035
         'separator' => '',
4036
-      ),
4037
-      'country' => array(
4036
+        ),
4037
+        'country' => array(
4038 4038
         'sortable' => 0,
4039 4039
         'separator' => '',
4040
-      ),
4041
-      'expavg_credit' => array(
4040
+        ),
4041
+        'expavg_credit' => array(
4042 4042
         'sortable' => 1,
4043 4043
         'separator' => '',
4044
-      ),
4045
-      'total_credit' => array(
4044
+        ),
4045
+        'total_credit' => array(
4046 4046
         'sortable' => 1,
4047 4047
         'separator' => '',
4048
-      ),
4048
+        ),
4049 4049
     ),
4050 4050
     'default' => 'expavg_credit',
4051
-  ));
4052
-  $handler->override_option('pane_title', '');
4053
-  $handler->override_option('pane_description', '');
4054
-  $handler->override_option('pane_category', array(
4051
+    ));
4052
+    $handler->override_option('pane_title', '');
4053
+    $handler->override_option('pane_description', '');
4054
+    $handler->override_option('pane_category', array(
4055 4055
     'name' => 'View panes',
4056 4056
     'weight' => 0,
4057
-  ));
4058
-  $handler->override_option('allow', array(
4057
+    ));
4058
+    $handler->override_option('allow', array(
4059 4059
     'use_pager' => 'use_pager',
4060 4060
     'items_per_page' => 'items_per_page',
4061 4061
     'offset' => 0,
@@ -4065,12 +4065,12 @@  discard block
 block discarded – undo
4065 4065
     'title_override' => 'title_override',
4066 4066
     'exposed_form' => 0,
4067 4067
     'fields_override' => 0,
4068
-  ));
4069
-  $handler->override_option('argument_input', array());
4070
-  $handler->override_option('link_to_view', 0);
4071
-  $handler->override_option('inherit_panels_path', 0);
4068
+    ));
4069
+    $handler->override_option('argument_input', array());
4070
+    $handler->override_option('link_to_view', 0);
4071
+    $handler->override_option('inherit_panels_path', 0);
4072 4072
 
4073
-  $views[$view->name] = $view;
4073
+    $views[$view->name] = $view;
4074 4074
 
4075
-  return $views;
4075
+    return $views;
4076 4076
 }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincteam/includes/boincteam.helpers.inc 4 patches
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,8 +44,7 @@  discard block
 block discarded – undo
44 44
         $nid = $existing_teams[$boinc_team->id];
45 45
         $success = boincteam_import($boinc_team, $nid);
46 46
       }
47
-    }
48
-    else {
47
+    } else {
49 48
       // Import new teams created by RPC or ops/team_import.php
50 49
       $success = boincteam_import($boinc_team);
51 50
     }
@@ -77,8 +76,7 @@  discard block
 block discarded – undo
77 76
     $node->body = $boincteam->description;
78 77
     $node->teaser = $teaser;
79 78
     $node->uid = boincuser_lookup_uid($boincteam->userid);
80
-  }
81
-  else {
79
+  } else {
82 80
     // Construct the team as a new node
83 81
     $node = array(
84 82
       'type' => 'team',
@@ -132,8 +130,7 @@  discard block
 block discarded – undo
132 130
   }
133 131
   if ($boincid) {
134 132
     return $ids;
135
-  }
136
-  else {
133
+  } else {
137 134
     return array_map('boincuser_lookup_uid', $ids);
138 135
   }
139 136
 }
Please login to merge, or discard this patch.
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -15,41 +15,41 @@  discard block
 block discarded – undo
15 15
  */
16 16
 function boincteam_sync() {
17 17
   
18
-  // Get the list of teams to import
19
-  db_set_active('boinc_rw');
20
-  $boinc_teams = db_query('
18
+    // Get the list of teams to import
19
+    db_set_active('boinc_rw');
20
+    $boinc_teams = db_query('
21 21
     SELECT id, name, description, userid, create_time, seti_id
22 22
     FROM team
23 23
     WHERE mod_time > FROM_UNIXTIME(%d)',
24 24
     variable_get('boincteam_last_sync', 0)
25
-  );
26
-  db_set_active('default');
25
+    );
26
+    db_set_active('default');
27 27
   
28
-  $existing_teams = array();
28
+    $existing_teams = array();
29 29
   
30
-  // Get the list of teams already in Drupal to be sure we're not importing
31
-  // any twice
32
-  $result = db_query('
30
+    // Get the list of teams already in Drupal to be sure we're not importing
31
+    // any twice
32
+    $result = db_query('
33 33
     SELECT nid, team_id FROM {boincteam}'
34
-  );
35
-  while ($row = db_fetch_object($result)) {
34
+    );
35
+    while ($row = db_fetch_object($result)) {
36 36
     $existing_teams[$row->team_id] = $row->nid;
37
-  }
37
+    }
38 38
   
39
-  while ($boinc_team = db_fetch_object($boinc_teams)) {
39
+    while ($boinc_team = db_fetch_object($boinc_teams)) {
40 40
     $success = NULL;
41 41
     if (isset($existing_teams[$boinc_team->id])) {
42
-      if ($boinc_team->seti_id > 0) {
42
+        if ($boinc_team->seti_id > 0) {
43 43
         // Sync BOINC-wide teams
44 44
         $nid = $existing_teams[$boinc_team->id];
45 45
         $success = boincteam_import($boinc_team, $nid);
46
-      }
46
+        }
47 47
     }
48 48
     else {
49
-      // Import new teams created by RPC or ops/team_import.php
50
-      $success = boincteam_import($boinc_team);
49
+        // Import new teams created by RPC or ops/team_import.php
50
+        $success = boincteam_import($boinc_team);
51
+    }
51 52
     }
52
-  }
53 53
 }
54 54
 
55 55
 
@@ -58,58 +58,58 @@  discard block
 block discarded – undo
58 58
  */
59 59
 function boincteam_import($boincteam, $nid = NULL) {
60 60
   
61
-  $input_format = variable_get('boincimport_input_format', 0);
62
-  $team_type_map = variable_get('boincimport_team_types', array()); 
61
+    $input_format = variable_get('boincimport_input_format', 0);
62
+    $team_type_map = variable_get('boincimport_team_types', array()); 
63 63
   
64
-  // Save the team type affiliation
65
-  $team_type_tid = $team_type_map[$boincteam->type];
64
+    // Save the team type affiliation
65
+    $team_type_tid = $team_type_map[$boincteam->type];
66 66
   
67
-  $boincteam->description = html_entity_decode($boincteam->description, ENT_QUOTES, 'utf-8');
68
-  // Be sure the text is filtered for the default input format
69
-  $boincteam->description = check_markup($boincteam->description, $input_format);
67
+    $boincteam->description = html_entity_decode($boincteam->description, ENT_QUOTES, 'utf-8');
68
+    // Be sure the text is filtered for the default input format
69
+    $boincteam->description = check_markup($boincteam->description, $input_format);
70 70
   
71
-  $teaser = node_teaser($boincteam->description);
71
+    $teaser = node_teaser($boincteam->description);
72 72
   
73
-  if ($nid) {
73
+    if ($nid) {
74 74
     // Update an existing node
75 75
     $node = node_load($nid);
76 76
     $node->title = $boincteam->name;
77 77
     $node->body = $boincteam->description;
78 78
     $node->teaser = $teaser;
79 79
     $node->uid = boincuser_lookup_uid($boincteam->userid);
80
-  }
81
-  else {
80
+    }
81
+    else {
82 82
     // Construct the team as a new node
83 83
     $node = array(
84
-      'type' => 'team',
85
-      'title' => $boincteam->name,
86
-      'body' => $boincteam->description,
87
-      'teaser' => $teaser,
88
-      'uid' => boincuser_lookup_uid($boincteam->userid),
89
-      'path' => null,
90
-      'status' => 1,  // published or not - always publish
91
-      'promote' => 0,
92
-      'created' => $boincteam->create_time,
93
-      'comment' => 0,  // comments disabled
94
-      'moderate' => 0,
95
-      'sticky' => 0,
96
-      'format' => $input_format
84
+        'type' => 'team',
85
+        'title' => $boincteam->name,
86
+        'body' => $boincteam->description,
87
+        'teaser' => $teaser,
88
+        'uid' => boincuser_lookup_uid($boincteam->userid),
89
+        'path' => null,
90
+        'status' => 1,  // published or not - always publish
91
+        'promote' => 0,
92
+        'created' => $boincteam->create_time,
93
+        'comment' => 0,  // comments disabled
94
+        'moderate' => 0,
95
+        'sticky' => 0,
96
+        'format' => $input_format
97 97
     );
98 98
     $node = (object) $node; // node_save requires an object form
99
-  }
99
+    }
100 100
   
101
-  $node->taxonomy[] = taxonomy_get_term($team_type_tid);
101
+    $node->taxonomy[] = taxonomy_get_term($team_type_tid);
102 102
   
103
-  // Save the team node
104
-  node_save($node);
105
-  $success = ($node->nid) ? TRUE : FALSE;
103
+    // Save the team node
104
+    node_save($node);
105
+    $success = ($node->nid) ? TRUE : FALSE;
106 106
   
107
-  if (!$nid) {
107
+    if (!$nid) {
108 108
     // Save the team IDs to a BOINC <--> Drupal reference table, if needed
109 109
     db_query('INSERT INTO {boincteam} (team_id, nid) VALUES (%d, %d)', $boincteam->id, $node->nid);
110
-  }
110
+    }
111 111
   
112
-  return $success;
112
+    return $success;
113 113
 }
114 114
 
115 115
 /**
@@ -126,25 +126,25 @@  discard block
 block discarded – undo
126 126
  *   respected. This is useful the list of users are to be contacted.
127 127
  */
128 128
 function _boincteam_userids($boincteamid, $boincid=TRUE, $respectprivacy=TRUE) {
129
-  $sql = 'SELECT user.id as id FROM {user} user WHERE user.teamid=%s';
130
-  if ($respectprivacy) {
129
+    $sql = 'SELECT user.id as id FROM {user} user WHERE user.teamid=%s';
130
+    if ($respectprivacy) {
131 131
     $sql .= ' AND user.send_email=1';
132
-  }
132
+    }
133 133
 
134
-  db_set_active('boinc_ro');
135
-  $dbres = db_query($sql, $boincteamid);
136
-  db_set_active('default');
134
+    db_set_active('boinc_ro');
135
+    $dbres = db_query($sql, $boincteamid);
136
+    db_set_active('default');
137 137
 
138
-  $ids = array();
139
-  while (($result = db_fetch_object($dbres)) != FALSE) {
138
+    $ids = array();
139
+    while (($result = db_fetch_object($dbres)) != FALSE) {
140 140
     $ids[] = $result->id;
141
-  }
142
-  if ($boincid) {
141
+    }
142
+    if ($boincid) {
143 143
     return $ids;
144
-  }
145
-  else {
144
+    }
145
+    else {
146 146
     return array_map('boincuser_lookup_uid', $ids);
147
-  }
147
+    }
148 148
 }
149 149
 
150 150
 /**
@@ -158,18 +158,18 @@  discard block
 block discarded – undo
158 158
  *   respected. This is useful the list of users are to be contacted.
159 159
  */
160 160
 function _boincteam_emails($boincteamid, $respectprivacy=TRUE) {
161
-  $sql = 'SELECT user.email_addr as email_addr FROM {user} user WHERE user.teamid=%s';
162
-  if ($respectprivacy) {
161
+    $sql = 'SELECT user.email_addr as email_addr FROM {user} user WHERE user.teamid=%s';
162
+    if ($respectprivacy) {
163 163
     $sql .= ' AND user.send_email=1';
164
-  }
164
+    }
165 165
 
166
-  db_set_active('boinc_ro');
167
-  $dbres = db_query($sql, $boincteamid);
168
-  db_set_active('default');
166
+    db_set_active('boinc_ro');
167
+    $dbres = db_query($sql, $boincteamid);
168
+    db_set_active('default');
169 169
 
170
-  $emails = array();
171
-  while (($result = db_fetch_object($dbres)) != FALSE) {
170
+    $emails = array();
171
+    while (($result = db_fetch_object($dbres)) != FALSE) {
172 172
     $emails[] = $result->email_addr;
173
-  }
174
-  return $emails;
173
+    }
174
+    return $emails;
175 175
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -87,15 +87,15 @@  discard block
 block discarded – undo
87 87
       'teaser' => $teaser,
88 88
       'uid' => boincuser_lookup_uid($boincteam->userid),
89 89
       'path' => null,
90
-      'status' => 1,  // published or not - always publish
90
+      'status' => 1, // published or not - always publish
91 91
       'promote' => 0,
92 92
       'created' => $boincteam->create_time,
93
-      'comment' => 0,  // comments disabled
93
+      'comment' => 0, // comments disabled
94 94
       'moderate' => 0,
95 95
       'sticky' => 0,
96 96
       'format' => $input_format
97 97
     );
98
-    $node = (object) $node; // node_save requires an object form
98
+    $node = (object)$node; // node_save requires an object form
99 99
   }
100 100
   
101 101
   $node->taxonomy[] = taxonomy_get_term($team_type_tid);
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
  *   flag send_email=1, meaning their notification privacy will be
126 126
  *   respected. This is useful the list of users are to be contacted.
127 127
  */
128
-function _boincteam_userids($boincteamid, $boincid=TRUE, $respectprivacy=TRUE) {
128
+function _boincteam_userids($boincteamid, $boincid = TRUE, $respectprivacy = TRUE) {
129 129
   $sql = 'SELECT user.id as id FROM {user} user WHERE user.teamid=%s';
130 130
   if ($respectprivacy) {
131 131
     $sql .= ' AND user.send_email=1';
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
  *   flag send_email=1, meaning their notification privacy will be
158 158
  *   respected. This is useful the list of users are to be contacted.
159 159
  */
160
-function _boincteam_emails($boincteamid, $respectprivacy=TRUE) {
160
+function _boincteam_emails($boincteamid, $respectprivacy = TRUE) {
161 161
   $sql = 'SELECT user.email_addr as email_addr FROM {user} user WHERE user.teamid=%s';
162 162
   if ($respectprivacy) {
163 163
     $sql .= ' AND user.send_email=1';
Please login to merge, or discard this patch.
Upper-Lower-Casing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
   }
38 38
   
39 39
   while ($boinc_team = db_fetch_object($boinc_teams)) {
40
-    $success = NULL;
40
+    $success = null;
41 41
     if (isset($existing_teams[$boinc_team->id])) {
42 42
       if ($boinc_team->seti_id > 0) {
43 43
         // Sync BOINC-wide teams
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 /**
57 57
  * Import a given BOINC team object into Drupal
58 58
  */
59
-function boincteam_import($boincteam, $nid = NULL) {
59
+function boincteam_import($boincteam, $nid = null) {
60 60
   
61 61
   $input_format = variable_get('boincimport_input_format', 0);
62 62
   $team_type_map = variable_get('boincimport_team_types', array()); 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
   
103 103
   // Save the team node
104 104
   node_save($node);
105
-  $success = ($node->nid) ? TRUE : FALSE;
105
+  $success = ($node->nid) ? true : false;
106 106
   
107 107
   if (!$nid) {
108 108
     // Save the team IDs to a BOINC <--> Drupal reference table, if needed
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
  *   flag send_email=1, meaning their notification privacy will be
126 126
  *   respected. This is useful the list of users are to be contacted.
127 127
  */
128
-function _boincteam_userids($boincteamid, $boincid=TRUE, $respectprivacy=TRUE) {
128
+function _boincteam_userids($boincteamid, $boincid=true, $respectprivacy=true) {
129 129
   $sql = 'SELECT user.id as id FROM {user} user WHERE user.teamid=%s';
130 130
   if ($respectprivacy) {
131 131
     $sql .= ' AND user.send_email=1';
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
   db_set_active('default');
137 137
 
138 138
   $ids = array();
139
-  while (($result = db_fetch_object($dbres)) != FALSE) {
139
+  while (($result = db_fetch_object($dbres)) != false) {
140 140
     $ids[] = $result->id;
141 141
   }
142 142
   if ($boincid) {
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
  *   flag send_email=1, meaning their notification privacy will be
158 158
  *   respected. This is useful the list of users are to be contacted.
159 159
  */
160
-function _boincteam_emails($boincteamid, $respectprivacy=TRUE) {
160
+function _boincteam_emails($boincteamid, $respectprivacy=true) {
161 161
   $sql = 'SELECT user.email_addr as email_addr FROM {user} user WHERE user.teamid=%s';
162 162
   if ($respectprivacy) {
163 163
     $sql .= ' AND user.send_email=1';
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
   db_set_active('default');
169 169
 
170 170
   $emails = array();
171
-  while (($result = db_fetch_object($dbres)) != FALSE) {
171
+  while (($result = db_fetch_object($dbres)) != false) {
172 172
     $emails[] = $result->email_addr;
173 173
   }
174 174
   return $emails;
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincimport/boincimport.pages.inc 3 patches
Indentation   +185 added lines, -185 removed lines patch added patch discarded remove patch
@@ -5,45 +5,45 @@  discard block
 block discarded – undo
5 5
  * Callback admin/boinc/import/settings
6 6
  */
7 7
 function boincimport_admin_settings() {
8
-  global $conf ;
9
-  global $db_url;
10
-  global $base_url;
11
-  $stage = variable_get('boincimport_config_stage', 0); 
8
+    global $conf ;
9
+    global $db_url;
10
+    global $base_url;
11
+    $stage = variable_get('boincimport_config_stage', 0); 
12 12
   
13
-  // Start with a quick sanity check on the BOINC environment
14
-  boinc_get_path();
13
+    // Start with a quick sanity check on the BOINC environment
14
+    boinc_get_path();
15 15
   
16
-  //We'll be checking that the setup is complete.
17
-  //If it is not complete, the migration will not go ahead.
18
-  $ready_for_migration = 1;
16
+    //We'll be checking that the setup is complete.
17
+    //If it is not complete, the migration will not go ahead.
18
+    $ready_for_migration = 1;
19 19
 
20
-  // Checking that the migration has been tested on a copy first.
21
-  $form['test'] = array(
20
+    // Checking that the migration has been tested on a copy first.
21
+    $form['test'] = array(
22 22
     '#type' => 'fieldset',
23 23
     '#title' => t('Test on copy first'),
24 24
     '#collapsible' => TRUE,
25 25
     '#collapsed' => TRUE,
26
-  );
26
+    );
27 27
     
28
-  $output = '';
29
-  if (!variable_get('boincimport_tested', 0)) {
28
+    $output = '';
29
+    if (!variable_get('boincimport_tested', 0)) {
30 30
     $form['test']['#collapsed']= FALSE;
31 31
     $output = '<span class="marker">';
32 32
     $ready_for_migration = 0;
33
-  }
34
-  $output .= '<p>' . t('The migration will modify and even destroy some data. You
33
+    }
34
+    $output .= '<p>' . t('The migration will modify and even destroy some data. You
35 35
     must test this module on a copy of your data first, several times if necessary.
36 36
     Only use this module on your live data when you are familiar with the procedure
37 37
     and you\'re confident everything will run smoothly.') . '</p><p>' . t('Also, you
38 38
     should make a full backup of your database just prior to performing the
39 39
     migration on the live data. It is better to turn off both the BOINC site and the
40 40
     Drupal site during the migration.') . '</p>';
41
-  if (!variable_get('boincimport_tested', 0)) {
41
+    if (!variable_get('boincimport_tested', 0)) {
42 42
     $output .= '</span>';
43
-  }
44
-  $form['test']['intro'] = array('#value' => $output);
43
+    }
44
+    $form['test']['intro'] = array('#value' => $output);
45 45
 
46
-  $form['test']['boincimport_tested'] = array(
46
+    $form['test']['boincimport_tested'] = array(
47 47
     '#type' => 'checkbox',
48 48
     '#title' => t('I am running a trial migration on a disposable copy of the database
49 49
       OR I have already done so and I am running this on my live site, confident that
@@ -51,64 +51,64 @@  discard block
 block discarded – undo
51 51
     '#return_value' => 1,
52 52
     '#default_value' => variable_get('boincimport_tested', 0),
53 53
     '#description' => '',
54
-  );
54
+    );
55 55
   
56
-  // Where is BOINC data?
57
-  $pre = variable_get('boincimport_table_prefix', '');
58
-  $tables = array($pre .'forum', $pre .'post', $pre .'thread', $pre .'user');
59
-  $db = (is_array($db_url) AND isset($db_url['boinc_rw'])) ? 'boinc_rw' : 'default';
60
-  $result = _boincimport_check_tables($tables, $db, 0);
56
+    // Where is BOINC data?
57
+    $pre = variable_get('boincimport_table_prefix', '');
58
+    $tables = array($pre .'forum', $pre .'post', $pre .'thread', $pre .'user');
59
+    $db = (is_array($db_url) AND isset($db_url['boinc_rw'])) ? 'boinc_rw' : 'default';
60
+    $result = _boincimport_check_tables($tables, $db, 0);
61 61
   
62
-  $config_path = conf_path();
63
-  $form['boinc_data'] = array(
62
+    $config_path = conf_path();
63
+    $form['boinc_data'] = array(
64 64
     '#type' => 'fieldset',
65 65
     '#title' => t('Location of BOINC data'),
66 66
     '#collapsible' => TRUE,
67 67
     '#collapsed' => TRUE,
68
-  );
69
-  $form['boinc_data']['boincimport_db_configured'] = array(
68
+    );
69
+    $form['boinc_data']['boincimport_db_configured'] = array(
70 70
     '#type' => 'checkbox',
71 71
     '#title' => t('There is a \'boinc\' database connection string configured in %file',
72
-      array('%file' => "{$config_path}/settings.php")),
72
+        array('%file' => "{$config_path}/settings.php")),
73 73
     '#return_value' => 1,
74 74
     '#default_value' => variable_get('boincimport_db_configured', 1),
75 75
     '#description' => '',
76 76
     '#disabled' => ($result['result']) ? TRUE : FALSE
77
-  );
78
-  if (variable_get('boincimport_db_configured', 1) != 1) {
77
+    );
78
+    if (variable_get('boincimport_db_configured', 1) != 1) {
79 79
     $default_db_url = is_array($db_url) ? end($db_url) : $db_url;
80 80
     $url = variable_get('boincimport_db_url', $default_db_url);
81 81
     if (!preg_match('{(mysql|pgsql):\/\/(.+):(.*?)@(.+)/(\w+)}i', $url)) {
82
-      $output = '<p class="marker">'. t('Set the address of the BOINC database
82
+        $output = '<p class="marker">'. t('Set the address of the BOINC database
83 83
         according to the following format:') . '<br /><pre>
84 84
         mysql://boinc_username:boinc_password@localhost/boinc_database
85 85
         </pre></p>';
86
-      $ready_for_migration = 0;
87
-      $form['boinc_data']['#collapsed'] = FALSE;
88
-      $form['boinc_data']['db_connect_string_note'] = array('#value' => $output);
86
+        $ready_for_migration = 0;
87
+        $form['boinc_data']['#collapsed'] = FALSE;
88
+        $form['boinc_data']['db_connect_string_note'] = array('#value' => $output);
89 89
     }
90 90
 
91 91
     $form['boinc_data']['boincimport_db_url'] = array(
92
-      '#type' => 'textfield',
93
-      '#title' => t('BOINC database location'),
94
-      '#default_value' => variable_get('boincimport_db_url', $default_db_url),
95
-      '#size' => 80,
96
-      '#maxlength' => 255,
97
-      '#description' => '',
92
+        '#type' => 'textfield',
93
+        '#title' => t('BOINC database location'),
94
+        '#default_value' => variable_get('boincimport_db_url', $default_db_url),
95
+        '#size' => 80,
96
+        '#maxlength' => 255,
97
+        '#description' => '',
98 98
     );
99
-  }
99
+    }
100 100
 
101
-  $output = '<p>' . t('Note that due to a limitation within Drupal core, we cannot
101
+    $output = '<p>' . t('Note that due to a limitation within Drupal core, we cannot
102 102
     import messages from one database type to another database type. E.g, we
103 103
     cannot import BOINC from a myqsl DB, to a postgresql DB. You need to import
104 104
     the data into the same type of database first (import all the BOINC data, as is,
105 105
     from mysql to postgresql).') . '</p><p>' . t('If both BOINC and Drupal are on
106 106
     postgresql, see !this_issue.', array('!this_issue' => l(t('this issue'),
107 107
     'http://drupal.org/node/64877', array('attributes' => array('target' => '_blank'))))) . '</p>';
108
-  $form['boinc_data']['note'] = array('#value' => $output);
108
+    $form['boinc_data']['note'] = array('#value' => $output);
109 109
   
110
-  // BOINC table prefix
111
-  $form['boinc_data']['boincimport_table_prefix'] = array(
110
+    // BOINC table prefix
111
+    $form['boinc_data']['boincimport_table_prefix'] = array(
112 112
     '#type' => 'textfield',
113 113
     '#title' => t('BOINC table prefix'),
114 114
     '#default_value' => variable_get('boincimport_table_prefix', ''),
@@ -116,30 +116,30 @@  discard block
 block discarded – undo
116 116
     '#maxlength' => 255,
117 117
     '#description' => t('What prefix is used for your BOINC tables?'),
118 118
     '#disabled' => ($result['result']) ? TRUE : FALSE
119
-  );
119
+    );
120 120
   
121
-  $output = $result['html'];
122
-  if ($result['result'] != 1) {
121
+    $output = $result['html'];
122
+    if ($result['result'] != 1) {
123 123
     $ready_for_migration = 0;
124 124
     $form['boinc_data']['#collapsed']= FALSE;
125 125
     $output .= '<span class="marker">';
126 126
     $output .= t('Some tables couldn\'t be found. Are the database settings correct?
127 127
       Please correct the errors so that the BOINC tables can be accessed.');
128 128
     $output .= '</span>';
129
-  }
129
+    }
130 130
 
131
-  $form['boinc_data']['result'] = array('#value' => $output);
131
+    $form['boinc_data']['result'] = array('#value' => $output);
132 132
   
133
-  // USERS settings
134
-  $form['users'] = array(
133
+    // USERS settings
134
+    $form['users'] = array(
135 135
     '#type' => 'fieldset',
136 136
     '#title' => t('User import'),
137 137
     '#collapsible' => TRUE,
138 138
     '#collapsed' => TRUE,
139
-  );
139
+    );
140 140
 
141
-  // User import batch size
142
-  $form['users']['boincimport_user_batch_size'] = array(
141
+    // User import batch size
142
+    $form['users']['boincimport_user_batch_size'] = array(
143 143
     '#type' => 'textfield',
144 144
     '#title' => t('Number of accounts to process at a time'),
145 145
     '#default_value' => variable_get('boincimport_user_batch_size', 50),
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
     '#description' => t('Due to memory intensive API calls, this value may have to
149 149
       be adjusted to avoid exhausting system resources. The default value is a
150 150
       balance between performance and reliability.')
151
-  );
151
+    );
152 152
 
153
-  // Import users who have never posted?
154
-  $form['users']['boincimport_import_lurkers'] = array(
153
+    // Import users who have never posted?
154
+    $form['users']['boincimport_import_lurkers'] = array(
155 155
     '#type' => 'checkbox',
156 156
     '#title' => t('Import users who have never posted?'),
157 157
     '#return_value' => 1,
@@ -160,199 +160,199 @@  discard block
 block discarded – undo
160 160
       involvement? This may not be desired, as it can take a very long time to
161 161
       import tens or hundreds of thousands of accounts. (note that users who
162 162
       are not imported now will still be imported on-the-fly upon login)'),
163
-  );
163
+    );
164 164
 
165
-  // Input format settings
166
-  $form['input'] = array(
165
+    // Input format settings
166
+    $form['input'] = array(
167 167
     '#type' => 'fieldset',
168 168
     '#title' => t('Input format settings'),
169 169
     '#collapsible' => TRUE,
170 170
     '#collapsed' => TRUE
171
-  );
172
-  $output = '<p>'. t('Select which !input_format should be used for the imported
171
+    );
172
+    $output = '<p>'. t('Select which !input_format should be used for the imported
173 173
     messages. It is highly-recommended that this value be left as it is, as the
174 174
     Full HTML and PHP code formats can be very dangerous!', 
175 175
     array('!input_format' => l(t('input format'), 'admin/settings/filters'))) .'</p>';
176
-  $form['input']['intro'] = array('#value' => $output);
176
+    $form['input']['intro'] = array('#value' => $output);
177 177
   
178
-  $formats = db_query('SELECT format, name FROM {filter_formats}');
179
-  while ($format = db_fetch_array($formats)) {
178
+    $formats = db_query('SELECT format, name FROM {filter_formats}');
179
+    while ($format = db_fetch_array($formats)) {
180 180
     $input_formats[$format['format']]= $format['name'];
181
-  }
181
+    }
182 182
   
183
-  // By default, use the format named "Rich text"; fall back to Filtered HTML
184
-  $default_input_format = db_result(db_query("
183
+    // By default, use the format named "Rich text"; fall back to Filtered HTML
184
+    $default_input_format = db_result(db_query("
185 185
     SELECT format FROM {filter_formats} WHERE name = '%s'", 'Rich text'));
186
-  if (!$default_input_format) $default_input_format = 1;
186
+    if (!$default_input_format) $default_input_format = 1;
187 187
   
188
-  $input_format = variable_get('boincimport_input_format', $default_input_format);
189
-  $form['input']['boincimport_input_format'] = array(
188
+    $input_format = variable_get('boincimport_input_format', $default_input_format);
189
+    $form['input']['boincimport_input_format'] = array(
190 190
     '#type' => 'radios',
191 191
     '#title' => t('Input format'),
192 192
     '#default_value' => $input_format,
193 193
     '#options' => $input_formats
194
-  );
195
-  if (!$input_format) {
194
+    );
195
+    if (!$input_format) {
196 196
     $ready_for_migration = 0;
197 197
     $form['input']['#collapsed']= FALSE;
198
-  }
199
-  $output = '<p><em>'. t('This setting will be applied to all posts and private
198
+    }
199
+    $output = '<p><em>'. t('This setting will be applied to all posts and private
200 200
     messages.') .'</em></p>';
201
-  $form['input']['result'] = array('#value' => $output);
201
+    $form['input']['result'] = array('#value' => $output);
202 202
   
203
-  // BBcode settings
204
-  $form['bbcode'] = array(
203
+    // BBcode settings
204
+    $form['bbcode'] = array(
205 205
     '#type' => 'fieldset',
206 206
     '#title' => t('BBcode settings'),
207 207
     '#collapsible' => TRUE,
208 208
     '#collapsed' => TRUE,
209
-  );
209
+    );
210 210
   
211
-  $output = '<p>' . t('BOINC posts are often formatted in BBcode. During the
211
+    $output = '<p>' . t('BOINC posts are often formatted in BBcode. During the
212 212
     import process, BBcode can be handled in two diffent ways') . ':</p>';
213
-  $output .= '<ul><li>' . t('Leave the BBcode as is and use the !bbcode_module
213
+    $output .= '<ul><li>' . t('Leave the BBcode as is and use the !bbcode_module
214 214
     after the migration to filter the imported posts. In this case, the module
215 215
     is not required during the migration, but will need to be installed and
216 216
     configured later.',
217 217
     array('!bbcode_module' => l(t('bbcode module'), 'http://drupal.org/project/bbcode',
218 218
     array('attributes' => array('target' => '_blank'))))) . '</li>';
219
-  $output .= '<li>' . t('Filter the BBcode now and replace it with plain HTML.
219
+    $output .= '<li>' . t('Filter the BBcode now and replace it with plain HTML.
220 220
     The BBcode module will be required during the migration process, but can
221 221
     be disabled afterwards.') . '</li></ul>';
222
-  $output .= '<p>' . t('An appropriate input filter should be chosen, as well,
222
+    $output .= '<p>' . t('An appropriate input filter should be chosen, as well,
223 223
     as it will affect how the post is displayed. For example, if BBcode is
224 224
     removed and replaced by HTML, some HTML tags will be stripped by the
225 225
     "Filtered HTML" input format unless they are first added to the list of
226 226
     allowed tags in that format. See the !input_formats page.',
227 227
     array('!input_formats' => l(t('input formats'), 'admin/settings/filters'))) . '</p>';
228 228
     
229
-  $form['bbcode']['intro'] = array('#value' => $output);
230
-  $form['bbcode']['boincimport_bbcode'] = array(
229
+    $form['bbcode']['intro'] = array('#value' => $output);
230
+    $form['bbcode']['boincimport_bbcode'] = array(
231 231
     '#type' => 'radios',
232 232
     '#title' => t('BBcode handling'),
233 233
     '#default_value' => variable_get('boincimport_bbcode', 0),
234 234
     '#options' => array(t('Leave BBcode as is.'), t('Transform BBcode into HTML.')),
235 235
     '#description' => '',
236
-  );
236
+    );
237 237
   
238
-  $module_status = _boincimport_check_module('bbcode');
239
-  $bbcode_disabled = ($module_status['result'] == 0) ? true : false;
240
-  $output = $module_status['html'];
238
+    $module_status = _boincimport_check_module('bbcode');
239
+    $bbcode_disabled = ($module_status['result'] == 0) ? true : false;
240
+    $output = $module_status['html'];
241 241
   
242
-  if (variable_get('boincimport_bbcode', 0)) {
242
+    if (variable_get('boincimport_bbcode', 0)) {
243 243
     if ($bbcode_disabled) {
244
-      $ready_for_migration = 0;
245
-      $form['bbcode']['#collapsed'] = FALSE;
246
-      $output .= '<p><span class="marker">';
247
-      $output .= t('The !bbcode_module is required to transform BBcode into HTML.
244
+        $ready_for_migration = 0;
245
+        $form['bbcode']['#collapsed'] = FALSE;
246
+        $output .= '<p><span class="marker">';
247
+        $output .= t('The !bbcode_module is required to transform BBcode into HTML.
248 248
         You first need to !enable_bbcode', array(
249
-          '!bbcode_module' => l(t('bbcode module'), 'http://drupal.org/project/bbcode', array('attributes' => array('target' => '_blank'))),
250
-          '!enable_bbcode' => l(t('enable the bbcode module'), 'admin/build/modules')));
251
-      $output .= '</span></p>';
249
+            '!bbcode_module' => l(t('bbcode module'), 'http://drupal.org/project/bbcode', array('attributes' => array('target' => '_blank'))),
250
+            '!enable_bbcode' => l(t('enable the bbcode module'), 'admin/build/modules')));
251
+        $output .= '</span></p>';
252 252
     }
253 253
     $sql = "SELECT COUNT(*) FROM {filters} WHERE module = 'bbcode' AND format = %d";
254 254
     $result = db_query($sql, $input_format);
255 255
     if (!db_result($result)) {
256
-      $form['bbcode']['#collapsed'] = FALSE;
257
-      $output .= '<p class="marker">'. t('You need to !enable_bbcode_input and
256
+        $form['bbcode']['#collapsed'] = FALSE;
257
+        $output .= '<p class="marker">'. t('You need to !enable_bbcode_input and
258 258
         then !configure_bbcode_options', array(
259
-          '!enable_bbcode_input' =>  l(t('enable BBcode in the selected input format'), "admin/settings/filters/{$input_format}"),
260
-          '!configure_bbcode_options' => l(t('configure BBcode options'), "admin/settings/filters/{$input_format}/configure"))) .'</p>';
259
+            '!enable_bbcode_input' =>  l(t('enable BBcode in the selected input format'), "admin/settings/filters/{$input_format}"),
260
+            '!configure_bbcode_options' => l(t('configure BBcode options'), "admin/settings/filters/{$input_format}/configure"))) .'</p>';
261 261
     }
262 262
     $output .= '<p>'. t('For best results, !disable_all_options', 
263 263
     array('!disable_all_options' => l(t('all four BBcode configure options should be disabled'), "admin/settings/filters/{$input_format}/configure"))) . '.</p>';
264
-  } else {
264
+    } else {
265 265
     if ($bbcode_disabled) {
266
-      $form['bbcode']['#collapsed'] = FALSE;
267
-      $output .= '<p>'. t('The !bbcode_module is recommended, but not required.
266
+        $form['bbcode']['#collapsed'] = FALSE;
267
+        $output .= '<p>'. t('The !bbcode_module is recommended, but not required.
268 268
         You may !enable_bbcode after having installed it.', array(
269
-          '!bbcode_module' => l(t('bbcode module'), 'http://drupal.org/project/bbcode', array('attributes' => array('target' => '_blank'))),
270
-          '!enable_bbcode' => l(t('enable the bbcode module'), 'admin/build/modules'))) .'</p>';
269
+            '!bbcode_module' => l(t('bbcode module'), 'http://drupal.org/project/bbcode', array('attributes' => array('target' => '_blank'))),
270
+            '!enable_bbcode' => l(t('enable the bbcode module'), 'admin/build/modules'))) .'</p>';
271 271
     }
272 272
     $output .= '<p>' . t('Don\'t forget to !enable_bbcode_input and then !configure_bbcode_options.', array(
273
-      '!enable_bbcode_input' =>  l(t('enable BBcode in the selected input format'), "admin/settings/filters/{$input_format}"),
274
-      '!configure_bbcode_options' => l(t('configure BBcode options'), "admin/settings/filters/{$input_format}/configure"))) . '</p>';
273
+        '!enable_bbcode_input' =>  l(t('enable BBcode in the selected input format'), "admin/settings/filters/{$input_format}"),
274
+        '!configure_bbcode_options' => l(t('configure BBcode options'), "admin/settings/filters/{$input_format}/configure"))) . '</p>';
275 275
     $output .= '<p>' . t('You may want to enable it for other input formats, too.') . '</p>';
276
-  }
277
-  $output .= '<p><em>'. t('This setting will be applied to all posts, private
276
+    }
277
+    $output .= '<p><em>'. t('This setting will be applied to all posts, private
278 278
     messages and the users\' signature.') .'</em></p>';
279 279
     
280
-  $form['bbcode']['result'] = array('#value' => $output);
280
+    $form['bbcode']['result'] = array('#value' => $output);
281 281
   
282
-  // URL transform settings
283
-  $form['url_transforms'] = array(
282
+    // URL transform settings
283
+    $form['url_transforms'] = array(
284 284
     '#type' => 'fieldset',
285 285
     '#title' => t('URL transforms'),
286 286
     '#collapsible' => TRUE,
287 287
     '#collapsed' => TRUE,
288
-  );
289
-  if (!variable_get('boincimport_base_url_boinc', 0)) {
288
+    );
289
+    if (!variable_get('boincimport_base_url_boinc', 0)) {
290 290
     $form['url_transforms']['#collapsed']= FALSE;
291 291
     $output = '<span class="marker">';
292 292
     $ready_for_migration = 0;
293
-  }
293
+    }
294 294
 
295
-  // List of BOINC domains possible in URLs to transform
296
-  $form['url_transforms']['boincimport_base_url_boinc'] = array(
295
+    // List of BOINC domains possible in URLs to transform
296
+    $form['url_transforms']['boincimport_base_url_boinc'] = array(
297 297
     '#type' => 'textarea',
298 298
     '#title' => t('BOINC base URLs to transform'),
299 299
     '#default_value' => variable_get('boincimport_base_url_boinc', ''),
300 300
     '#description' => t('List URL bases that should be transformed from
301 301
       BOINC format to Drupal format (enter one domain per line, including http://).'),
302
-  );
302
+    );
303 303
 
304
-  // The Drupal domain to use in URL transform results
305
-  $form['url_transforms']['boincimport_base_url_drupal'] = array(
304
+    // The Drupal domain to use in URL transform results
305
+    $form['url_transforms']['boincimport_base_url_drupal'] = array(
306 306
     '#type' => 'textfield',
307 307
     '#title' => t('Target Drupal base URL'),
308 308
     '#default_value' => variable_get('boincimport_base_url_drupal', ''),
309 309
     '#description' => t('Specify the URL base to use in transform results. If
310 310
       left blank, the base_url configured in this Drupal environment will be
311 311
       used (currently: %url)', array('%url' =>$base_url)),
312
-  );
312
+    );
313 313
   
314
-  // Are we ready for migration?
315
-  $form['migration'] = array(
314
+    // Are we ready for migration?
315
+    $form['migration'] = array(
316 316
     '#type' => 'fieldset',
317 317
     '#title' => 'Migration',
318 318
     '#collapsible' => TRUE,
319 319
     '#collapsed' => FALSE,
320
-  );
321
-  variable_set('boincimport_ready', $ready_for_migration);
322
-  if ($ready_for_migration) {
320
+    );
321
+    variable_set('boincimport_ready', $ready_for_migration);
322
+    if ($ready_for_migration) {
323 323
     $output = '<p>'. t('Check the settings above one more time. If everything
324 324
       is ok, !proceed.', array('!proceed' => l(t('you can now proceed with the migration'), 'admin/boinc/import/process'))) .'</p>';
325
-  } else {
325
+    } else {
326 326
     $output = '<p class="marker">'. t('You are not ready for the migration yet.
327 327
       Please check the settings above.') .'</p>';
328
-  }
328
+    }
329 329
   
330
-  $form['migration']['info'] = array('#value' => $output);
331
-  return system_settings_form($form); 
330
+    $form['migration']['info'] = array('#value' => $output);
331
+    return system_settings_form($form); 
332 332
 }
333 333
 
334 334
 /**
335 335
  * Callback admin/boinc/import/post_configuration
336 336
  */
337 337
 function boincimport_post_configuration() {
338
-  $output = '<p>'. t('This page will help to tie up any loose ends following
338
+    $output = '<p>'. t('This page will help to tie up any loose ends following
339 339
     the BOINC data import process. Before continuing, it may be best to have
340 340
     already:') .'</p>';
341
-  $output .= '<ul>';
342
-  $output .= '<li>'. t('Imported users, teams, and forums using the BOINC
341
+    $output .= '<ul>';
342
+    $output .= '<li>'. t('Imported users, teams, and forums using the BOINC
343 343
     import module') .'</li>';
344
-  $output .= '<li>'. t('Imported any additional data using add on modules if
344
+    $output .= '<li>'. t('Imported any additional data using add on modules if
345 345
     available.') .'</li>';
346
-  $output .= '</ul>';
347
-  //User Set up
348
-  $output .= '<h2>'. t('User settings') .'</h2>';  
349
-  $output .= '<p>'. t('Make sure your !user_settings are correct. Specifically,
346
+    $output .= '</ul>';
347
+    //User Set up
348
+    $output .= '<h2>'. t('User settings') .'</h2>';  
349
+    $output .= '<p>'. t('Make sure your !user_settings are correct. Specifically,
350 350
     you can enable or disable signatures there. ', array(
351
-      '!user_settings' => l(t('user settings'), 'admin/user/settings')
351
+        '!user_settings' => l(t('user settings'), 'admin/user/settings')
352 352
     )) .'</p>'; 
353
-  $output .= '<p>' . t('Note that avatar/picture support is not tied to user
353
+    $output .= '<p>' . t('Note that avatar/picture support is not tied to user
354 354
     settings Picture support at this time.') . '</p>';
355
-  /*$output .= '<p>' . t('In order to activate avatar/picture support, you need to
355
+    /*$output .= '<p>' . t('In order to activate avatar/picture support, you need to
356 356
     enable pictures on this page and also:') . '</p>';
357 357
   $output .= '<ul>';
358 358
   $output .= '<li>'. t('Tick the checkboxes to allow "User pictures in posts" and/or
@@ -365,73 +365,73 @@  discard block
 block discarded – undo
365 365
     )) .'</li>';
366 366
   $output .= '</ul>'; */
367 367
   
368
-  // Forum Set up
369
-  $output .= '<h2>'. t('Forum settings') .'</h2>';
370
-  $output .= '<p>'. t('Check any additional changes to make on the
368
+    // Forum Set up
369
+    $output .= '<h2>'. t('Forum settings') .'</h2>';
370
+    $output .= '<p>'. t('Check any additional changes to make on the
371 371
     !forum_settings page.', array(
372
-      '!forum_settings' =>  l(t('forum settings'), 'admin/content/forum/settings')
372
+        '!forum_settings' =>  l(t('forum settings'), 'admin/content/forum/settings')
373 373
     )) .'</p>';
374
-  $output .= '<p>'. t('It also may be a good idea to look at the !forum_list to
374
+    $output .= '<p>'. t('It also may be a good idea to look at the !forum_list to
375 375
     verify that all necessary containers and forums are in place.', array(
376
-      '!forum_list' =>  l(t('forum list'), 'admin/content/forum')
376
+        '!forum_list' =>  l(t('forum list'), 'admin/content/forum')
377 377
     )) .'</p>';
378
-  /*$output .= '<p>'. t('If need be, set up the private forums as explained in the
378
+    /*$output .= '<p>'. t('If need be, set up the private forums as explained in the
379 379
     !documentation.', array(
380 380
       '!documentation' => l(t('documentation'), 'http://drupal.org/node/58969', array('attributes' => array('target' => '_blank')))
381 381
     )) .'</p>';
382 382
     */
383
-  /*
383
+    /*
384 384
   // Redirection from old URLs:
385 385
   $output .= '<h2>'. t('Redirection from BOINC forum URLs to new Drupal forum URLs') .'</h2>';
386 386
   $output .= '<p>'. t('Enable the boincforum_redirect.module. This way, users
387 387
     accessing URLs from your old BOINC installation will be redirected to your new
388 388
     Drupal forum.') .'</p>';
389 389
   */
390
-  // BBcode
391
-  $bbcode = variable_get('boincimport_bbcode', 0);
392
-  if ($bbcode) {
390
+    // BBcode
391
+    $bbcode = variable_get('boincimport_bbcode', 0);
392
+    if ($bbcode) {
393 393
     $output .= '<h2>'. t('Remove BBcode module') .'</h2>';
394 394
     $output .= '<p>'. t('The BBcode has been cleaned from the posts. You shouldn\'t
395 395
       need the bbcode module anymore. You can disable it.') .'</p>';
396
-  } else {
396
+    } else {
397 397
     $output .= '<h2>'. t('Configure BBcode module') .'</h2>';
398 398
     $output .= '<p>'. t('Most likely, there are many BOINC forum postings
399 399
       formatted in BBcode. It would be a good idea to verify that BBcode is
400 400
       being formatted correctly in the imported posts. Have a look around
401 401
       !the_forum.', array(
402 402
         '!the_forum' =>  l(t('the forum'), 'community')
403
-      )) . '</p>';
404
-  }
403
+        )) . '</p>';
404
+    }
405 405
 
406
-  return $output;
406
+    return $output;
407 407
 }
408 408
 
409 409
 /**
410 410
  * Callback admin/boinc/import
411 411
  */
412 412
 function boincimport_main() {
413
-  // Start with a quick sanity check on the BOINC environment
414
-  boinc_get_path();
415
-  // If that's ok, on with the show
416
-  $output .= t('You may want to !check_documentation before starting.', array(
413
+    // Start with a quick sanity check on the BOINC environment
414
+    boinc_get_path();
415
+    // If that's ok, on with the show
416
+    $output .= t('You may want to !check_documentation before starting.', array(
417 417
     '!check_documentation' => l(t('check the documentation'), 'http://boinc.berkeley.edu/trac/wiki/InstallDrupal', array('attributes' =>array('target' => '_blank')))
418
-  ));
419
-  $output = '<ol><li>';
420
-  $output .= l(t('Configure the migration'), 'admin/boinc/import/settings');
421
-  $output .= '</li>';
422
-  $output .= '<li>';
423
-  $output .= l(t('Execute the migration'), 'admin/boinc/import/process');
424
-  $output .= '</li>';
425
-  $output .= '<li>';
426
-  $output .= l(t('Post migration configuration'), 'admin/boinc/import/post_configuration');
427
-  $output .= '</li>';
428
-  $output .= '<li>';
429
-  $output .= t('!cleanup (Accessing this link will delete all the saved BOINC forum
418
+    ));
419
+    $output = '<ol><li>';
420
+    $output .= l(t('Configure the migration'), 'admin/boinc/import/settings');
421
+    $output .= '</li>';
422
+    $output .= '<li>';
423
+    $output .= l(t('Execute the migration'), 'admin/boinc/import/process');
424
+    $output .= '</li>';
425
+    $output .= '<li>';
426
+    $output .= l(t('Post migration configuration'), 'admin/boinc/import/post_configuration');
427
+    $output .= '</li>';
428
+    $output .= '<li>';
429
+    $output .= t('!cleanup (Accessing this link will delete all the saved BOINC forum
430 430
     conversion settings: click only when you\'re done with all the above.)', array(
431
-      '!cleanup' => l(t('Cleanup'), 'admin/boinc/import/cleanup')
431
+        '!cleanup' => l(t('Cleanup'), 'admin/boinc/import/cleanup')
432 432
     ));
433
-  $output .= '</li>';
434
-  /*$output .= '<li>';
433
+    $output .= '</li>';
434
+    /*$output .= '<li>';
435 435
   $output .= t('Enable the boincforum_redirect module for seamless redirection
436 436
     from the old forums to the new. This module requires !clean_urls to be active.', array(
437 437
       '!clean_urls' => l(t('Clean URLs'), 'admin/settings/clean-urls')
@@ -442,14 +442,14 @@  discard block
 block discarded – undo
442 442
     uninstall BOINC forum - This will delete tables necessary for redirection. You can,
443 443
     however, deactivate the module safely.');
444 444
   $output .= '</li>';*/
445
-  $output .= '</ol>';
445
+    $output .= '</ol>';
446 446
 
447
-  // process will die() if the link to the BOINC database is wrong:
448
-  $output .= '<p>'. t('If the BOINC data is in another database, but you made a
447
+    // process will die() if the link to the BOINC database is wrong:
448
+    $output .= '<p>'. t('If the BOINC data is in another database, but you made a
449 449
     mistake while setting up the data base url, you may be unable to access the
450 450
     setting page due to some limitations of the core of Drupal. !reset_db_url.', array(
451
-      '!reset_db_url' => l(t('Click here to reset the database url'), 'admin/boinc/import/reset')
451
+        '!reset_db_url' => l(t('Click here to reset the database url'), 'admin/boinc/import/reset')
452 452
     )) .'</p>';
453 453
 
454
-  return $output;
454
+    return $output;
455 455
 }
Please login to merge, or discard this patch.
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  * Callback admin/boinc/import/settings
6 6
  */
7 7
 function boincimport_admin_settings() {
8
-  global $conf ;
8
+  global $conf;
9 9
   global $db_url;
10 10
   global $base_url;
11 11
   $stage = variable_get('boincimport_config_stage', 0); 
@@ -27,17 +27,17 @@  discard block
 block discarded – undo
27 27
     
28 28
   $output = '';
29 29
   if (!variable_get('boincimport_tested', 0)) {
30
-    $form['test']['#collapsed']= FALSE;
30
+    $form['test']['#collapsed'] = FALSE;
31 31
     $output = '<span class="marker">';
32 32
     $ready_for_migration = 0;
33 33
   }
34
-  $output .= '<p>' . t('The migration will modify and even destroy some data. You
34
+  $output .= '<p>'.t('The migration will modify and even destroy some data. You
35 35
     must test this module on a copy of your data first, several times if necessary.
36 36
     Only use this module on your live data when you are familiar with the procedure
37
-    and you\'re confident everything will run smoothly.') . '</p><p>' . t('Also, you
37
+    and you\'re confident everything will run smoothly.').'</p><p>'.t('Also, you
38 38
     should make a full backup of your database just prior to performing the
39 39
     migration on the live data. It is better to turn off both the BOINC site and the
40
-    Drupal site during the migration.') . '</p>';
40
+    Drupal site during the migration.').'</p>';
41 41
   if (!variable_get('boincimport_tested', 0)) {
42 42
     $output .= '</span>';
43 43
   }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
   
56 56
   // Where is BOINC data?
57 57
   $pre = variable_get('boincimport_table_prefix', '');
58
-  $tables = array($pre .'forum', $pre .'post', $pre .'thread', $pre .'user');
58
+  $tables = array($pre.'forum', $pre.'post', $pre.'thread', $pre.'user');
59 59
   $db = (is_array($db_url) AND isset($db_url['boinc_rw'])) ? 'boinc_rw' : 'default';
60 60
   $result = _boincimport_check_tables($tables, $db, 0);
61 61
   
@@ -79,8 +79,8 @@  discard block
 block discarded – undo
79 79
     $default_db_url = is_array($db_url) ? end($db_url) : $db_url;
80 80
     $url = variable_get('boincimport_db_url', $default_db_url);
81 81
     if (!preg_match('{(mysql|pgsql):\/\/(.+):(.*?)@(.+)/(\w+)}i', $url)) {
82
-      $output = '<p class="marker">'. t('Set the address of the BOINC database
83
-        according to the following format:') . '<br /><pre>
82
+      $output = '<p class="marker">'.t('Set the address of the BOINC database
83
+        according to the following format:').'<br /><pre>
84 84
         mysql://boinc_username:boinc_password@localhost/boinc_database
85 85
         </pre></p>';
86 86
       $ready_for_migration = 0;
@@ -98,13 +98,13 @@  discard block
 block discarded – undo
98 98
     );
99 99
   }
100 100
 
101
-  $output = '<p>' . t('Note that due to a limitation within Drupal core, we cannot
101
+  $output = '<p>'.t('Note that due to a limitation within Drupal core, we cannot
102 102
     import messages from one database type to another database type. E.g, we
103 103
     cannot import BOINC from a myqsl DB, to a postgresql DB. You need to import
104 104
     the data into the same type of database first (import all the BOINC data, as is,
105
-    from mysql to postgresql).') . '</p><p>' . t('If both BOINC and Drupal are on
105
+    from mysql to postgresql).').'</p><p>'.t('If both BOINC and Drupal are on
106 106
     postgresql, see !this_issue.', array('!this_issue' => l(t('this issue'),
107
-    'http://drupal.org/node/64877', array('attributes' => array('target' => '_blank'))))) . '</p>';
107
+    'http://drupal.org/node/64877', array('attributes' => array('target' => '_blank'))))).'</p>';
108 108
   $form['boinc_data']['note'] = array('#value' => $output);
109 109
   
110 110
   // BOINC table prefix
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
   $output = $result['html'];
122 122
   if ($result['result'] != 1) {
123 123
     $ready_for_migration = 0;
124
-    $form['boinc_data']['#collapsed']= FALSE;
124
+    $form['boinc_data']['#collapsed'] = FALSE;
125 125
     $output .= '<span class="marker">';
126 126
     $output .= t('Some tables couldn\'t be found. Are the database settings correct?
127 127
       Please correct the errors so that the BOINC tables can be accessed.');
@@ -169,15 +169,15 @@  discard block
 block discarded – undo
169 169
     '#collapsible' => TRUE,
170 170
     '#collapsed' => TRUE
171 171
   );
172
-  $output = '<p>'. t('Select which !input_format should be used for the imported
172
+  $output = '<p>'.t('Select which !input_format should be used for the imported
173 173
     messages. It is highly-recommended that this value be left as it is, as the
174 174
     Full HTML and PHP code formats can be very dangerous!', 
175
-    array('!input_format' => l(t('input format'), 'admin/settings/filters'))) .'</p>';
175
+    array('!input_format' => l(t('input format'), 'admin/settings/filters'))).'</p>';
176 176
   $form['input']['intro'] = array('#value' => $output);
177 177
   
178 178
   $formats = db_query('SELECT format, name FROM {filter_formats}');
179 179
   while ($format = db_fetch_array($formats)) {
180
-    $input_formats[$format['format']]= $format['name'];
180
+    $input_formats[$format['format']] = $format['name'];
181 181
   }
182 182
   
183 183
   // By default, use the format named "Rich text"; fall back to Filtered HTML
@@ -194,10 +194,10 @@  discard block
 block discarded – undo
194 194
   );
195 195
   if (!$input_format) {
196 196
     $ready_for_migration = 0;
197
-    $form['input']['#collapsed']= FALSE;
197
+    $form['input']['#collapsed'] = FALSE;
198 198
   }
199
-  $output = '<p><em>'. t('This setting will be applied to all posts and private
200
-    messages.') .'</em></p>';
199
+  $output = '<p><em>'.t('This setting will be applied to all posts and private
200
+    messages.').'</em></p>';
201 201
   $form['input']['result'] = array('#value' => $output);
202 202
   
203 203
   // BBcode settings
@@ -208,23 +208,23 @@  discard block
 block discarded – undo
208 208
     '#collapsed' => TRUE,
209 209
   );
210 210
   
211
-  $output = '<p>' . t('BOINC posts are often formatted in BBcode. During the
212
-    import process, BBcode can be handled in two diffent ways') . ':</p>';
213
-  $output .= '<ul><li>' . t('Leave the BBcode as is and use the !bbcode_module
211
+  $output = '<p>'.t('BOINC posts are often formatted in BBcode. During the
212
+    import process, BBcode can be handled in two diffent ways').':</p>';
213
+  $output .= '<ul><li>'.t('Leave the BBcode as is and use the !bbcode_module
214 214
     after the migration to filter the imported posts. In this case, the module
215 215
     is not required during the migration, but will need to be installed and
216 216
     configured later.',
217 217
     array('!bbcode_module' => l(t('bbcode module'), 'http://drupal.org/project/bbcode',
218
-    array('attributes' => array('target' => '_blank'))))) . '</li>';
219
-  $output .= '<li>' . t('Filter the BBcode now and replace it with plain HTML.
218
+    array('attributes' => array('target' => '_blank'))))).'</li>';
219
+  $output .= '<li>'.t('Filter the BBcode now and replace it with plain HTML.
220 220
     The BBcode module will be required during the migration process, but can
221
-    be disabled afterwards.') . '</li></ul>';
222
-  $output .= '<p>' . t('An appropriate input filter should be chosen, as well,
221
+    be disabled afterwards.').'</li></ul>';
222
+  $output .= '<p>'.t('An appropriate input filter should be chosen, as well,
223 223
     as it will affect how the post is displayed. For example, if BBcode is
224 224
     removed and replaced by HTML, some HTML tags will be stripped by the
225 225
     "Filtered HTML" input format unless they are first added to the list of
226 226
     allowed tags in that format. See the !input_formats page.',
227
-    array('!input_formats' => l(t('input formats'), 'admin/settings/filters'))) . '</p>';
227
+    array('!input_formats' => l(t('input formats'), 'admin/settings/filters'))).'</p>';
228 228
     
229 229
   $form['bbcode']['intro'] = array('#value' => $output);
230 230
   $form['bbcode']['boincimport_bbcode'] = array(
@@ -254,28 +254,28 @@  discard block
 block discarded – undo
254 254
     $result = db_query($sql, $input_format);
255 255
     if (!db_result($result)) {
256 256
       $form['bbcode']['#collapsed'] = FALSE;
257
-      $output .= '<p class="marker">'. t('You need to !enable_bbcode_input and
257
+      $output .= '<p class="marker">'.t('You need to !enable_bbcode_input and
258 258
         then !configure_bbcode_options', array(
259 259
           '!enable_bbcode_input' =>  l(t('enable BBcode in the selected input format'), "admin/settings/filters/{$input_format}"),
260
-          '!configure_bbcode_options' => l(t('configure BBcode options'), "admin/settings/filters/{$input_format}/configure"))) .'</p>';
260
+          '!configure_bbcode_options' => l(t('configure BBcode options'), "admin/settings/filters/{$input_format}/configure"))).'</p>';
261 261
     }
262
-    $output .= '<p>'. t('For best results, !disable_all_options', 
263
-    array('!disable_all_options' => l(t('all four BBcode configure options should be disabled'), "admin/settings/filters/{$input_format}/configure"))) . '.</p>';
262
+    $output .= '<p>'.t('For best results, !disable_all_options', 
263
+    array('!disable_all_options' => l(t('all four BBcode configure options should be disabled'), "admin/settings/filters/{$input_format}/configure"))).'.</p>';
264 264
   } else {
265 265
     if ($bbcode_disabled) {
266 266
       $form['bbcode']['#collapsed'] = FALSE;
267
-      $output .= '<p>'. t('The !bbcode_module is recommended, but not required.
267
+      $output .= '<p>'.t('The !bbcode_module is recommended, but not required.
268 268
         You may !enable_bbcode after having installed it.', array(
269 269
           '!bbcode_module' => l(t('bbcode module'), 'http://drupal.org/project/bbcode', array('attributes' => array('target' => '_blank'))),
270
-          '!enable_bbcode' => l(t('enable the bbcode module'), 'admin/build/modules'))) .'</p>';
270
+          '!enable_bbcode' => l(t('enable the bbcode module'), 'admin/build/modules'))).'</p>';
271 271
     }
272
-    $output .= '<p>' . t('Don\'t forget to !enable_bbcode_input and then !configure_bbcode_options.', array(
272
+    $output .= '<p>'.t('Don\'t forget to !enable_bbcode_input and then !configure_bbcode_options.', array(
273 273
       '!enable_bbcode_input' =>  l(t('enable BBcode in the selected input format'), "admin/settings/filters/{$input_format}"),
274
-      '!configure_bbcode_options' => l(t('configure BBcode options'), "admin/settings/filters/{$input_format}/configure"))) . '</p>';
275
-    $output .= '<p>' . t('You may want to enable it for other input formats, too.') . '</p>';
274
+      '!configure_bbcode_options' => l(t('configure BBcode options'), "admin/settings/filters/{$input_format}/configure"))).'</p>';
275
+    $output .= '<p>'.t('You may want to enable it for other input formats, too.').'</p>';
276 276
   }
277
-  $output .= '<p><em>'. t('This setting will be applied to all posts, private
278
-    messages and the users\' signature.') .'</em></p>';
277
+  $output .= '<p><em>'.t('This setting will be applied to all posts, private
278
+    messages and the users\' signature.').'</em></p>';
279 279
     
280 280
   $form['bbcode']['result'] = array('#value' => $output);
281 281
   
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     '#collapsed' => TRUE,
288 288
   );
289 289
   if (!variable_get('boincimport_base_url_boinc', 0)) {
290
-    $form['url_transforms']['#collapsed']= FALSE;
290
+    $form['url_transforms']['#collapsed'] = FALSE;
291 291
     $output = '<span class="marker">';
292 292
     $ready_for_migration = 0;
293 293
   }
@@ -320,11 +320,11 @@  discard block
 block discarded – undo
320 320
   );
321 321
   variable_set('boincimport_ready', $ready_for_migration);
322 322
   if ($ready_for_migration) {
323
-    $output = '<p>'. t('Check the settings above one more time. If everything
324
-      is ok, !proceed.', array('!proceed' => l(t('you can now proceed with the migration'), 'admin/boinc/import/process'))) .'</p>';
323
+    $output = '<p>'.t('Check the settings above one more time. If everything
324
+      is ok, !proceed.', array('!proceed' => l(t('you can now proceed with the migration'), 'admin/boinc/import/process'))).'</p>';
325 325
   } else {
326
-    $output = '<p class="marker">'. t('You are not ready for the migration yet.
327
-      Please check the settings above.') .'</p>';
326
+    $output = '<p class="marker">'.t('You are not ready for the migration yet.
327
+      Please check the settings above.').'</p>';
328 328
   }
329 329
   
330 330
   $form['migration']['info'] = array('#value' => $output);
@@ -335,23 +335,23 @@  discard block
 block discarded – undo
335 335
  * Callback admin/boinc/import/post_configuration
336 336
  */
337 337
 function boincimport_post_configuration() {
338
-  $output = '<p>'. t('This page will help to tie up any loose ends following
338
+  $output = '<p>'.t('This page will help to tie up any loose ends following
339 339
     the BOINC data import process. Before continuing, it may be best to have
340
-    already:') .'</p>';
340
+    already:').'</p>';
341 341
   $output .= '<ul>';
342
-  $output .= '<li>'. t('Imported users, teams, and forums using the BOINC
343
-    import module') .'</li>';
344
-  $output .= '<li>'. t('Imported any additional data using add on modules if
345
-    available.') .'</li>';
342
+  $output .= '<li>'.t('Imported users, teams, and forums using the BOINC
343
+    import module').'</li>';
344
+  $output .= '<li>'.t('Imported any additional data using add on modules if
345
+    available.').'</li>';
346 346
   $output .= '</ul>';
347 347
   //User Set up
348
-  $output .= '<h2>'. t('User settings') .'</h2>';  
349
-  $output .= '<p>'. t('Make sure your !user_settings are correct. Specifically,
348
+  $output .= '<h2>'.t('User settings').'</h2>';  
349
+  $output .= '<p>'.t('Make sure your !user_settings are correct. Specifically,
350 350
     you can enable or disable signatures there. ', array(
351 351
       '!user_settings' => l(t('user settings'), 'admin/user/settings')
352
-    )) .'</p>'; 
353
-  $output .= '<p>' . t('Note that avatar/picture support is not tied to user
354
-    settings Picture support at this time.') . '</p>';
352
+    )).'</p>'; 
353
+  $output .= '<p>'.t('Note that avatar/picture support is not tied to user
354
+    settings Picture support at this time.').'</p>';
355 355
   /*$output .= '<p>' . t('In order to activate avatar/picture support, you need to
356 356
     enable pictures on this page and also:') . '</p>';
357 357
   $output .= '<ul>';
@@ -366,15 +366,15 @@  discard block
 block discarded – undo
366 366
   $output .= '</ul>'; */
367 367
   
368 368
   // Forum Set up
369
-  $output .= '<h2>'. t('Forum settings') .'</h2>';
370
-  $output .= '<p>'. t('Check any additional changes to make on the
369
+  $output .= '<h2>'.t('Forum settings').'</h2>';
370
+  $output .= '<p>'.t('Check any additional changes to make on the
371 371
     !forum_settings page.', array(
372 372
       '!forum_settings' =>  l(t('forum settings'), 'admin/content/forum/settings')
373
-    )) .'</p>';
374
-  $output .= '<p>'. t('It also may be a good idea to look at the !forum_list to
373
+    )).'</p>';
374
+  $output .= '<p>'.t('It also may be a good idea to look at the !forum_list to
375 375
     verify that all necessary containers and forums are in place.', array(
376 376
       '!forum_list' =>  l(t('forum list'), 'admin/content/forum')
377
-    )) .'</p>';
377
+    )).'</p>';
378 378
   /*$output .= '<p>'. t('If need be, set up the private forums as explained in the
379 379
     !documentation.', array(
380 380
       '!documentation' => l(t('documentation'), 'http://drupal.org/node/58969', array('attributes' => array('target' => '_blank')))
@@ -390,17 +390,17 @@  discard block
 block discarded – undo
390 390
   // BBcode
391 391
   $bbcode = variable_get('boincimport_bbcode', 0);
392 392
   if ($bbcode) {
393
-    $output .= '<h2>'. t('Remove BBcode module') .'</h2>';
394
-    $output .= '<p>'. t('The BBcode has been cleaned from the posts. You shouldn\'t
395
-      need the bbcode module anymore. You can disable it.') .'</p>';
393
+    $output .= '<h2>'.t('Remove BBcode module').'</h2>';
394
+    $output .= '<p>'.t('The BBcode has been cleaned from the posts. You shouldn\'t
395
+      need the bbcode module anymore. You can disable it.').'</p>';
396 396
   } else {
397
-    $output .= '<h2>'. t('Configure BBcode module') .'</h2>';
398
-    $output .= '<p>'. t('Most likely, there are many BOINC forum postings
397
+    $output .= '<h2>'.t('Configure BBcode module').'</h2>';
398
+    $output .= '<p>'.t('Most likely, there are many BOINC forum postings
399 399
       formatted in BBcode. It would be a good idea to verify that BBcode is
400 400
       being formatted correctly in the imported posts. Have a look around
401 401
       !the_forum.', array(
402 402
         '!the_forum' =>  l(t('the forum'), 'community')
403
-      )) . '</p>';
403
+      )).'</p>';
404 404
   }
405 405
 
406 406
   return $output;
@@ -445,11 +445,11 @@  discard block
 block discarded – undo
445 445
   $output .= '</ol>';
446 446
 
447 447
   // process will die() if the link to the BOINC database is wrong:
448
-  $output .= '<p>'. t('If the BOINC data is in another database, but you made a
448
+  $output .= '<p>'.t('If the BOINC data is in another database, but you made a
449 449
     mistake while setting up the data base url, you may be unable to access the
450 450
     setting page due to some limitations of the core of Drupal. !reset_db_url.', array(
451 451
       '!reset_db_url' => l(t('Click here to reset the database url'), 'admin/boinc/import/reset')
452
-    )) .'</p>';
452
+    )).'</p>';
453 453
 
454 454
   return $output;
455 455
 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@  discard block
 block discarded – undo
21 21
   $form['test'] = array(
22 22
     '#type' => 'fieldset',
23 23
     '#title' => t('Test on copy first'),
24
-    '#collapsible' => TRUE,
25
-    '#collapsed' => TRUE,
24
+    '#collapsible' => true,
25
+    '#collapsed' => true,
26 26
   );
27 27
     
28 28
   $output = '';
29 29
   if (!variable_get('boincimport_tested', 0)) {
30
-    $form['test']['#collapsed']= FALSE;
30
+    $form['test']['#collapsed']= false;
31 31
     $output = '<span class="marker">';
32 32
     $ready_for_migration = 0;
33 33
   }
@@ -56,15 +56,15 @@  discard block
 block discarded – undo
56 56
   // Where is BOINC data?
57 57
   $pre = variable_get('boincimport_table_prefix', '');
58 58
   $tables = array($pre .'forum', $pre .'post', $pre .'thread', $pre .'user');
59
-  $db = (is_array($db_url) AND isset($db_url['boinc_rw'])) ? 'boinc_rw' : 'default';
59
+  $db = (is_array($db_url) and isset($db_url['boinc_rw'])) ? 'boinc_rw' : 'default';
60 60
   $result = _boincimport_check_tables($tables, $db, 0);
61 61
   
62 62
   $config_path = conf_path();
63 63
   $form['boinc_data'] = array(
64 64
     '#type' => 'fieldset',
65 65
     '#title' => t('Location of BOINC data'),
66
-    '#collapsible' => TRUE,
67
-    '#collapsed' => TRUE,
66
+    '#collapsible' => true,
67
+    '#collapsed' => true,
68 68
   );
69 69
   $form['boinc_data']['boincimport_db_configured'] = array(
70 70
     '#type' => 'checkbox',
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     '#return_value' => 1,
74 74
     '#default_value' => variable_get('boincimport_db_configured', 1),
75 75
     '#description' => '',
76
-    '#disabled' => ($result['result']) ? TRUE : FALSE
76
+    '#disabled' => ($result['result']) ? true : false
77 77
   );
78 78
   if (variable_get('boincimport_db_configured', 1) != 1) {
79 79
     $default_db_url = is_array($db_url) ? end($db_url) : $db_url;
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
         mysql://boinc_username:boinc_password@localhost/boinc_database
85 85
         </pre></p>';
86 86
       $ready_for_migration = 0;
87
-      $form['boinc_data']['#collapsed'] = FALSE;
87
+      $form['boinc_data']['#collapsed'] = false;
88 88
       $form['boinc_data']['db_connect_string_note'] = array('#value' => $output);
89 89
     }
90 90
 
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
     '#size' => 20,
116 116
     '#maxlength' => 255,
117 117
     '#description' => t('What prefix is used for your BOINC tables?'),
118
-    '#disabled' => ($result['result']) ? TRUE : FALSE
118
+    '#disabled' => ($result['result']) ? true : false
119 119
   );
120 120
   
121 121
   $output = $result['html'];
122 122
   if ($result['result'] != 1) {
123 123
     $ready_for_migration = 0;
124
-    $form['boinc_data']['#collapsed']= FALSE;
124
+    $form['boinc_data']['#collapsed']= false;
125 125
     $output .= '<span class="marker">';
126 126
     $output .= t('Some tables couldn\'t be found. Are the database settings correct?
127 127
       Please correct the errors so that the BOINC tables can be accessed.');
@@ -134,8 +134,8 @@  discard block
 block discarded – undo
134 134
   $form['users'] = array(
135 135
     '#type' => 'fieldset',
136 136
     '#title' => t('User import'),
137
-    '#collapsible' => TRUE,
138
-    '#collapsed' => TRUE,
137
+    '#collapsible' => true,
138
+    '#collapsed' => true,
139 139
   );
140 140
 
141 141
   // User import batch size
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
   $form['input'] = array(
167 167
     '#type' => 'fieldset',
168 168
     '#title' => t('Input format settings'),
169
-    '#collapsible' => TRUE,
170
-    '#collapsed' => TRUE
169
+    '#collapsible' => true,
170
+    '#collapsed' => true
171 171
   );
172 172
   $output = '<p>'. t('Select which !input_format should be used for the imported
173 173
     messages. It is highly-recommended that this value be left as it is, as the
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
   );
195 195
   if (!$input_format) {
196 196
     $ready_for_migration = 0;
197
-    $form['input']['#collapsed']= FALSE;
197
+    $form['input']['#collapsed']= false;
198 198
   }
199 199
   $output = '<p><em>'. t('This setting will be applied to all posts and private
200 200
     messages.') .'</em></p>';
@@ -204,8 +204,8 @@  discard block
 block discarded – undo
204 204
   $form['bbcode'] = array(
205 205
     '#type' => 'fieldset',
206 206
     '#title' => t('BBcode settings'),
207
-    '#collapsible' => TRUE,
208
-    '#collapsed' => TRUE,
207
+    '#collapsible' => true,
208
+    '#collapsed' => true,
209 209
   );
210 210
   
211 211
   $output = '<p>' . t('BOINC posts are often formatted in BBcode. During the
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
   if (variable_get('boincimport_bbcode', 0)) {
243 243
     if ($bbcode_disabled) {
244 244
       $ready_for_migration = 0;
245
-      $form['bbcode']['#collapsed'] = FALSE;
245
+      $form['bbcode']['#collapsed'] = false;
246 246
       $output .= '<p><span class="marker">';
247 247
       $output .= t('The !bbcode_module is required to transform BBcode into HTML.
248 248
         You first need to !enable_bbcode', array(
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
     $sql = "SELECT COUNT(*) FROM {filters} WHERE module = 'bbcode' AND format = %d";
254 254
     $result = db_query($sql, $input_format);
255 255
     if (!db_result($result)) {
256
-      $form['bbcode']['#collapsed'] = FALSE;
256
+      $form['bbcode']['#collapsed'] = false;
257 257
       $output .= '<p class="marker">'. t('You need to !enable_bbcode_input and
258 258
         then !configure_bbcode_options', array(
259 259
           '!enable_bbcode_input' =>  l(t('enable BBcode in the selected input format'), "admin/settings/filters/{$input_format}"),
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
     array('!disable_all_options' => l(t('all four BBcode configure options should be disabled'), "admin/settings/filters/{$input_format}/configure"))) . '.</p>';
264 264
   } else {
265 265
     if ($bbcode_disabled) {
266
-      $form['bbcode']['#collapsed'] = FALSE;
266
+      $form['bbcode']['#collapsed'] = false;
267 267
       $output .= '<p>'. t('The !bbcode_module is recommended, but not required.
268 268
         You may !enable_bbcode after having installed it.', array(
269 269
           '!bbcode_module' => l(t('bbcode module'), 'http://drupal.org/project/bbcode', array('attributes' => array('target' => '_blank'))),
@@ -283,11 +283,11 @@  discard block
 block discarded – undo
283 283
   $form['url_transforms'] = array(
284 284
     '#type' => 'fieldset',
285 285
     '#title' => t('URL transforms'),
286
-    '#collapsible' => TRUE,
287
-    '#collapsed' => TRUE,
286
+    '#collapsible' => true,
287
+    '#collapsed' => true,
288 288
   );
289 289
   if (!variable_get('boincimport_base_url_boinc', 0)) {
290
-    $form['url_transforms']['#collapsed']= FALSE;
290
+    $form['url_transforms']['#collapsed']= false;
291 291
     $output = '<span class="marker">';
292 292
     $ready_for_migration = 0;
293 293
   }
@@ -315,8 +315,8 @@  discard block
 block discarded – undo
315 315
   $form['migration'] = array(
316 316
     '#type' => 'fieldset',
317 317
     '#title' => 'Migration',
318
-    '#collapsible' => TRUE,
319
-    '#collapsed' => FALSE,
318
+    '#collapsible' => true,
319
+    '#collapsed' => false,
320 320
   );
321 321
   variable_set('boincimport_ready', $ready_for_migration);
322 322
   if ($ready_for_migration) {
Please login to merge, or discard this patch.
all/features/private_messages/private_messages.features.user_permission.inc 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -4,48 +4,48 @@
 block discarded – undo
4 4
  * Implementation of hook_user_default_permissions().
5 5
  */
6 6
 function private_messages_user_default_permissions() {
7
-  $permissions = array();
7
+    $permissions = array();
8 8
 
9
-  // Exported permission: administer privatemsg settings
10
-  $permissions['administer privatemsg settings'] = array(
9
+    // Exported permission: administer privatemsg settings
10
+    $permissions['administer privatemsg settings'] = array(
11 11
     'name' => 'administer privatemsg settings',
12 12
     'roles' => array(
13
-      '0' => 'administrator',
13
+        '0' => 'administrator',
14 14
     ),
15
-  );
15
+    );
16 16
 
17
-  // Exported permission: delete privatemsg
18
-  $permissions['delete privatemsg'] = array(
17
+    // Exported permission: delete privatemsg
18
+    $permissions['delete privatemsg'] = array(
19 19
     'name' => 'delete privatemsg',
20 20
     'roles' => array(
21
-      '0' => 'administrator',
22
-      '1' => 'authenticated user',
21
+        '0' => 'administrator',
22
+        '1' => 'authenticated user',
23 23
     ),
24
-  );
24
+    );
25 25
 
26
-  // Exported permission: read all private messages
27
-  $permissions['read all private messages'] = array(
26
+    // Exported permission: read all private messages
27
+    $permissions['read all private messages'] = array(
28 28
     'name' => 'read all private messages',
29 29
     'roles' => array(),
30
-  );
30
+    );
31 31
 
32
-  // Exported permission: read privatemsg
33
-  $permissions['read privatemsg'] = array(
32
+    // Exported permission: read privatemsg
33
+    $permissions['read privatemsg'] = array(
34 34
     'name' => 'read privatemsg',
35 35
     'roles' => array(
36
-      '0' => 'administrator',
37
-      '1' => 'authenticated user',
36
+        '0' => 'administrator',
37
+        '1' => 'authenticated user',
38 38
     ),
39
-  );
39
+    );
40 40
 
41
-  // Exported permission: write privatemsg
42
-  $permissions['write privatemsg'] = array(
41
+    // Exported permission: write privatemsg
42
+    $permissions['write privatemsg'] = array(
43 43
     'name' => 'write privatemsg',
44 44
     'roles' => array(
45
-      '0' => 'administrator',
46
-      '1' => 'community member',
45
+        '0' => 'administrator',
46
+        '1' => 'community member',
47 47
     ),
48
-  );
48
+    );
49 49
 
50
-  return $permissions;
50
+    return $permissions;
51 51
 }
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boincwork/includes/boincwork.helpers.inc 5 patches
Upper-Lower-Casing   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         $preset_prefs['preset'] = array($preset_prefs['preset']);
174 174
       }
175 175
       foreach ($preset_prefs['preset'] as $key => $prefs) {
176
-        if (isset($prefs['@attributes']['name']) AND $prefs['@attributes']['name'] == $preset) {
176
+        if (isset($prefs['@attributes']['name']) and $prefs['@attributes']['name'] == $preset) {
177 177
           return $preset_prefs['preset'][$key];
178 178
         }
179 179
       }
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
     $lines = explode("\r", $raw_config_data);
199 199
     drupal_set_message("{$errors[0]->message} at line {$errors[0]->line}" .
200 200
       ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), 'error');
201
-    return NULL;
201
+    return null;
202 202
   }
203 203
   
204 204
   // Convert XML to array for validation
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
     $xml = $xml['project_specific_preferences'];
218 218
   }
219 219
   foreach ($xml as $type => $elements) {
220
-    if (is_array($elements) AND !is_numeric(key($elements))) {
220
+    if (is_array($elements) and !is_numeric(key($elements))) {
221 221
       $elements = array($elements);
222 222
     }
223 223
     switch ($type) {
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
   }
307 307
   foreach ($xml as $type => $elements) {
308 308
     $structure_data = array();
309
-    if (is_array($elements) AND !is_numeric(key($elements))) {
309
+    if (is_array($elements) and !is_numeric(key($elements))) {
310 310
       $elements = array($elements);
311 311
     }
312 312
     switch ($type) {
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
     case 'boolean':
331 331
       foreach ($elements as $element) {
332 332
         $name = $element['@attributes']['name'];
333
-        if (isset($element['@attributes']['entitytype']) AND $element['@attributes']['entitytype'] == 'attribute') {
333
+        if (isset($element['@attributes']['entitytype']) and $element['@attributes']['entitytype'] == 'attribute') {
334 334
           $defaults['@attributes'][$name] = $values[$name];
335 335
         }
336 336
         else {
@@ -382,7 +382,7 @@  discard block
 block discarded – undo
382 382
         $user_pref = $user_prefs['@attributes'];
383 383
       }
384 384
       if (isset($user_pref[$name])) {
385
-        if (is_array($user_pref[$name]) AND isset($user_pref[$name]['@value'])) {
385
+        if (is_array($user_pref[$name]) and isset($user_pref[$name]['@value'])) {
386 386
           $value = $user_pref[$name]['@value'];
387 387
         }
388 388
         else {
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
         '#type' => 'textfield',
421 421
         '#default_value' => $value,
422 422
         '#size' => 5,
423
-        '#description' => $description . bts(' Default value: @default', array('@default' => $default), NULL, 'boinc:account-preferences-project')
423
+        '#description' => $description . bts(' Default value: @default', array('@default' => $default), null, 'boinc:account-preferences-project')
424 424
       );
425 425
     }
426 426
     break;
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
     foreach ($elements as $element) {
433 433
       $name = $element['@attributes']['name'];
434 434
       $title = is_array($element['title']) ? $element['title']['@value'] : $element['title'];
435
-      $default = (isset($element['@attributes']['selected']) AND $element['@attributes']['selected'] == 'true') ? 1 : 0;
435
+      $default = (isset($element['@attributes']['selected']) and $element['@attributes']['selected'] == 'true') ? 1 : 0;
436 436
       $description = '';
437 437
       if (isset($element['description'])) {
438 438
         $description = is_array($element['description']) ? $element['description']['@value'] : $element['description'];
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
         $user_pref = $user_prefs['@attributes'];
446 446
       }
447 447
       if (isset($user_pref[$name])) {
448
-        if (is_array($user_pref[$name]) AND isset($user_pref[$name]['@value'])) {
448
+        if (is_array($user_pref[$name]) and isset($user_pref[$name]['@value'])) {
449 449
           $value = $user_pref[$name]['@value'];
450 450
         }
451 451
         else {
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
       $form[$name] = array(
467 467
         '#title' => $title,
468 468
         '#type' => 'radios',
469
-        '#options' => array(1 => bts('yes', array(), NULL, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-no'), 0 => bts('no', array(), NULL, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-yes')),
469
+        '#options' => array(1 => bts('yes', array(), null, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-no'), 0 => bts('no', array(), null, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-yes')),
470 470
         '#attributes' => array('class' => 'fancy'),
471 471
         '#default_value' => $value,
472 472
         '#description' => $description
@@ -487,8 +487,8 @@  discard block
 block discarded – undo
487 487
       foreach($element['items']['item'] as $item) {
488 488
         if (is_array($item)) {
489 489
           $value = $item['@value'];
490
-          if ($default === NULL AND
491
-              isset($item['@attributes']) AND
490
+          if ($default === null and
491
+              isset($item['@attributes']) and
492 492
               isset($item['@attributes']['selected'])) {
493 493
             $default = ($item['@attributes']['selected'] == 'true') ? $item['@value'] : null;
494 494
           }
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
         '#options' => $options,
527 527
         '#attributes' => array('class' => 'fancy'),
528 528
         '#default_value' => $value,
529
-        '#description' => $description . bts(' Default value: @default', array('@default' =>$default), NULL, 'boinc:account-preferences-project')
529
+        '#description' => $description . bts(' Default value: @default', array('@default' =>$default), null, 'boinc:account-preferences-project')
530 530
       );
531 531
     }
532 532
     break;
@@ -541,11 +541,11 @@  discard block
 block discarded – undo
541 541
       }
542 542
     
543 543
     $form['applications'] = array(
544
-      '#title' => bts('Applications', array(), NULL, 'boinc:account-preferences'),
544
+      '#title' => bts('Applications', array(), null, 'boinc:account-preferences'),
545 545
       '#type' => 'fieldset',
546 546
       '#description' => $title,
547
-      '#collapsible' => TRUE,
548
-      '#collapsed' => FALSE
547
+      '#collapsible' => true,
548
+      '#collapsed' => false
549 549
     );
550 550
     $applications = array();
551 551
     if (!is_array($user_prefs['app_id'])) {
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
     }
554 554
     foreach ($user_prefs['app_id'] as $app) {
555 555
       if (!$app) continue;
556
-      if (is_array($app) AND isset($app['@value'])) {
556
+      if (is_array($app) and isset($app['@value'])) {
557 557
         $app = $app['@value'];
558 558
       }
559 559
       $applications[] = $app;
@@ -561,18 +561,18 @@  discard block
 block discarded – undo
561 561
     foreach ($elements['app'] as $app) {
562 562
       $app_id = $app['@attributes']['id'];
563 563
       $app_name = $app['@value'];
564
-      $app_enabled = TRUE;
565
-      if (isset($app['@attributes']['enabled']) AND
564
+      $app_enabled = true;
565
+      if (isset($app['@attributes']['enabled']) and
566 566
           $app['@attributes']['enabled'] == 'false') {
567
-        $app_enabled = FALSE;
567
+        $app_enabled = false;
568 568
       }
569 569
       if ($applications) {
570 570
         $checked = in_array($app_id, $applications);
571 571
       } else {
572
-        $checked = TRUE;
573
-        if (isset($app['@attributes']['selected']) AND
572
+        $checked = true;
573
+        if (isset($app['@attributes']['selected']) and
574 574
             $app['@attributes']['selected'] == 'false') {
575
-          $checked = FALSE;
575
+          $checked = false;
576 576
         }
577 577
       }
578 578
       $form['applications']["app_{$app_id}"] = array(
@@ -603,10 +603,10 @@  discard block
 block discarded – undo
603 603
       $form[$name] = array(
604 604
           '#title' => $title,
605 605
           '#type' => 'fieldset',
606
-          '#tree' => FALSE,
606
+          '#tree' => false,
607 607
           //'#description' => t('Notes about this group of fields'),
608
-          '#collapsible' => TRUE,
609
-          '#collapsed' => FALSE
608
+          '#collapsible' => true,
609
+          '#collapsed' => false
610 610
       );
611 611
       // Recursively populate the compound element
612 612
       foreach ($element as $child_type => $child) {
@@ -633,8 +633,8 @@  discard block
 block discarded – undo
633 633
           '#title' => $title,
634 634
           '#type' => 'fieldset',
635 635
           //'#description' => t('Notes about this group of fields'),
636
-          '#collapsible' => TRUE,
637
-          '#collapsed' => FALSE
636
+          '#collapsible' => true,
637
+          '#collapsed' => false
638 638
       );
639 639
       // Recursively populate the compound element
640 640
       foreach ($element['attributes'] as $child_type => $child) {
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
  * Generate a tabular structure out of preferences for use in comparison
654 654
  * views of preference sets
655 655
  */
656
-function boincwork_make_prefs_table($prefs, $top_level = TRUE) {
656
+function boincwork_make_prefs_table($prefs, $top_level = true) {
657 657
 
658 658
   $prefs_table = array();
659 659
   $uncategorized = array();
@@ -662,15 +662,15 @@  discard block
 block discarded – undo
662 662
   foreach ($prefs as $key => $element) {
663 663
     
664 664
     // Determine which type of element this is and act accordingly
665
-    $element_type = NULL;
666
-    if (is_array($element) AND isset($element['#type'])) {
665
+    $element_type = null;
666
+    if (is_array($element) and isset($element['#type'])) {
667 667
       $element_type = $element['#type'];
668 668
     }
669 669
     switch ($element_type) {
670 670
     case 'fieldset':
671 671
       $prefs_table[$key] = array(
672 672
         'name' => $element['#title'],
673
-        'elements' => boincwork_make_prefs_table($element, FALSE),
673
+        'elements' => boincwork_make_prefs_table($element, false),
674 674
       );
675 675
       break;
676 676
     case 'textfield':
@@ -681,10 +681,10 @@  discard block
 block discarded – undo
681 681
       if (in_array($key, array('start_hour', 'net_start_hour'))) {
682 682
         switch ($key) {
683 683
         case 'start_hour':
684
-          $element['#title'] = bts('Compute only between:', array(), NULL, 'boinc:account-preferences-computing');
684
+          $element['#title'] = bts('Compute only between:', array(), null, 'boinc:account-preferences-computing');
685 685
           break;
686 686
         case 'net_start_hour':
687
-          $element['#title'] = bts('Transfer files only between:', array(), NULL, 'boinc:account-preferences-comuting');
687
+          $element['#title'] = bts('Transfer files only between:', array(), null, 'boinc:account-preferences-comuting');
688 688
           break;
689 689
         default:
690 690
         }
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
       $prefs_element = array(
693 693
         'name' => (isset($element['#title'])) ? $element['#title'] : '',
694 694
         'description' => (isset($element['#description'])) ? $element['#description'] : '',
695
-        'default_value' => (isset($element['#default_value'])) ? $element['#default_value'] : NULL,
695
+        'default_value' => (isset($element['#default_value'])) ? $element['#default_value'] : null,
696 696
       );
697 697
       if ($top_level) {
698 698
         $uncategorized[$key] = $prefs_element;
@@ -705,17 +705,17 @@  discard block
 block discarded – undo
705 705
     }
706 706
   }
707 707
   
708
-  if ($prefs_table AND $uncategorized) {
708
+  if ($prefs_table and $uncategorized) {
709 709
     // Throw any settings that don't fit elsewhere into "other"
710 710
     $prefs_table['other'] = array(
711
-      'name' => bts('Other settings', array(), NULL, 'boinc:account-preferences'),
711
+      'name' => bts('Other settings', array(), null, 'boinc:account-preferences'),
712 712
       'elements' => $uncategorized,
713 713
     );
714 714
   }
715 715
   elseif ($uncategorized) {
716 716
     // If nothing is categorized, output all prefs under a general "settings"
717 717
     $prefs_table['settings'] = array(
718
-      'name' => bts('Settings', array(), NULL, 'boinc:account-preferences'),
718
+      'name' => bts('Settings', array(), null, 'boinc:account-preferences'),
719 719
       'elements' => $uncategorized,
720 720
     );
721 721
   }
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
   }
755 755
   
756 756
   // Return general preferences or a subset based on venue
757
-  if (!$venue OR $venue == 'generic') {
757
+  if (!$venue or $venue == 'generic') {
758 758
     unset($main_prefs['venue']);
759 759
     // Use the length of the $main_prefs array as a condition as to
760 760
     // whether the preferences have already been set. This is
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
         $main_prefs['venue'] = array($main_prefs['venue']);
770 770
       }
771 771
       foreach ($main_prefs['venue'] as $key => $prefs_venue) {
772
-        if (isset($prefs_venue['@attributes']['name']) AND $prefs_venue['@attributes']['name'] == $venue) {
772
+        if (isset($prefs_venue['@attributes']['name']) and $prefs_venue['@attributes']['name'] == $venue) {
773 773
           return $main_prefs['venue'][$key];
774 774
         }
775 775
       }
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
   // Save all preferences or a subset based on venue
815 815
   //drupal_set_message('<pre>' . print_r($main_prefs, true) . '</pre>');
816 816
   $new_venue = true;
817
-  if (!$venue OR $venue == 'generic') {
817
+  if (!$venue or $venue == 'generic') {
818 818
     //$main_prefs = $prefs;
819 819
     $main_prefs = $prefs + $main_prefs;
820 820
   }
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
         $main_prefs['venue'] = array($main_prefs['venue']);
825 825
       }
826 826
       foreach ($main_prefs['venue'] as $key => $prefs_venue) {
827
-        if (isset($prefs_venue['@attributes']['name']) AND $prefs_venue['@attributes']['name'] == $venue) {
827
+        if (isset($prefs_venue['@attributes']['name']) and $prefs_venue['@attributes']['name'] == $venue) {
828 828
           if ($prefs) {
829 829
             $main_prefs['venue'][$key] = $prefs;
830 830
           }
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
  *Add another user to the current user's ignore list using a BOINC
900 900
  *username. Called from privacy preference form.
901 901
  */
902
-function boincwork_ignore_user_add_user_username($name = NULL) {
902
+function boincwork_ignore_user_add_user_username($name = null) {
903 903
   global $user;
904 904
 
905 905
   if (isset($name)) {
@@ -911,7 +911,7 @@  discard block
 block discarded – undo
911 911
     $iuid = get_drupal_id($boincid);
912 912
 
913 913
     if ($user->uid == $iuid) {
914
-      drupal_set_message(bts('You can\'t add yourself to your own ignore list.', array(), NULL, 'boinc:ignore-user-error-message'), 'error');
914
+      drupal_set_message(bts('You can\'t add yourself to your own ignore list.', array(), null, 'boinc:ignore-user-error-message'), 'error');
915 915
       drupal_goto('account/prefs/privacy');
916 916
     }
917 917
 
@@ -933,11 +933,11 @@  discard block
 block discarded – undo
933 933
 /**
934 934
  * Add another user's UID to the current user's ignore list.
935 935
  */
936
-function boincwork_ignore_user_add_user($iuid = NULL) {
936
+function boincwork_ignore_user_add_user($iuid = null) {
937 937
   global $user;
938 938
 
939 939
   if ($user->uid == $iuid) {
940
-    drupal_set_message(bts('You can\'t add yourself to your own ignore list.', array(), NULL, 'boinc:ignore-user-error-message'), 'error');
940
+    drupal_set_message(bts('You can\'t add yourself to your own ignore list.', array(), null, 'boinc:ignore-user-error-message'), 'error');
941 941
     drupal_goto();
942 942
   }
943 943
 
@@ -958,9 +958,9 @@  discard block
 block discarded – undo
958 958
       bts('@username has been added to your ignore list. See your !privacy_preferences for more details.',
959 959
         array(
960 960
           '@username' => $otheraccount->boincuser_name,
961
-          '!privacy_preferences' => l(bts('privacy preferences', array(), NULL, 'boinc:ignore-user-add'), 'account/prefs/privacy'),
961
+          '!privacy_preferences' => l(bts('privacy preferences', array(), null, 'boinc:ignore-user-add'), 'account/prefs/privacy'),
962 962
         ),
963
-        NULL, 'boinc:ignore-user-add'),
963
+        null, 'boinc:ignore-user-add'),
964 964
       'status');
965 965
     drupal_goto();
966 966
   }
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
 /**
973 973
  * Remove user from user's ignore list.
974 974
  */
975
-function boincwork_ignore_user_remove_user($iuid = NULL) {
975
+function boincwork_ignore_user_remove_user($iuid = null) {
976 976
   global $user;
977 977
   $otheraccount = user_load($iuid);
978 978
 
@@ -984,9 +984,9 @@  discard block
 block discarded – undo
984 984
     bts('@username has been removed from your ignore list. See your !privacy_preferences for more details.',
985 985
       array(
986 986
         '@username' => $otheraccount->boincuser_name,
987
-        '!privacy_preferences' => l(bts('privacy preferences', array(), NULL, 'boinc:ignore-user-add'), 'account/prefs/privacy'),
987
+        '!privacy_preferences' => l(bts('privacy preferences', array(), null, 'boinc:ignore-user-add'), 'account/prefs/privacy'),
988 988
       ),
989
-      NULL, 'boinc:ignore-user-add'),
989
+      null, 'boinc:ignore-user-add'),
990 990
     'status');
991 991
   drupal_goto('account/prefs/privacy');
992 992
 }
@@ -1038,14 +1038,14 @@  discard block
 block discarded – undo
1038 1038
       else {
1039 1039
         $form_field = $field;
1040 1040
       }
1041
-      if (isset($rules['datatype']) AND !boincwork_validate_datatype($values[$field], $rules['datatype'])) {
1042
-        form_set_error($form_field, bts('Invalid data type for @field', array('@field' => $field), NULL, 'boinc:account-preferences'));
1041
+      if (isset($rules['datatype']) and !boincwork_validate_datatype($values[$field], $rules['datatype'])) {
1042
+        form_set_error($form_field, bts('Invalid data type for @field', array('@field' => $field), null, 'boinc:account-preferences'));
1043 1043
       }
1044
-      if (isset($rules['min']) AND $values[$field] < $rules['min']) {
1045
-        form_set_error($form_field, bts('Minimum value not met for @field', array('@field' => $field), NULL, 'boinc:account-preferences'));
1044
+      if (isset($rules['min']) and $values[$field] < $rules['min']) {
1045
+        form_set_error($form_field, bts('Minimum value not met for @field', array('@field' => $field), null, 'boinc:account-preferences'));
1046 1046
       }
1047
-      if (isset($rules['max']) AND $values[$field] > $rules['max']) {
1048
-        form_set_error($form_field, bts('Maximum value exceeded for @field', array('@field' => $field), NULL, 'boinc:account-preferences'));
1047
+      if (isset($rules['max']) and $values[$field] > $rules['max']) {
1048
+        form_set_error($form_field, bts('Maximum value exceeded for @field', array('@field' => $field), null, 'boinc:account-preferences'));
1049 1049
       }
1050 1050
     }
1051 1051
   }
@@ -1054,25 +1054,25 @@  discard block
 block discarded – undo
1054 1054
 /**
1055 1055
  * Check that numeric data conforms to specifications
1056 1056
  */
1057
-function boincwork_validate_datatype($data, $datatype = NULL) {
1057
+function boincwork_validate_datatype($data, $datatype = null) {
1058 1058
   switch ($datatype) {
1059 1059
   case 'float':
1060 1060
     if (!is_numeric($data)) {
1061
-      return FALSE;
1061
+      return false;
1062 1062
     }
1063 1063
     $data += 0.0;
1064 1064
     if (!is_float($data)) {
1065
-      return FALSE;
1065
+      return false;
1066 1066
     }
1067 1067
     break;
1068 1068
     
1069 1069
   case 'integer':
1070 1070
     if (!is_numeric($data)) {
1071
-      return FALSE;
1071
+      return false;
1072 1072
     }
1073 1073
     $data += 0;
1074 1074
     if (!is_int($data)) {
1075
-      return FALSE;
1075
+      return false;
1076 1076
     }
1077 1077
     break;
1078 1078
   
@@ -1080,7 +1080,7 @@  discard block
 block discarded – undo
1080 1080
   default:
1081 1081
     
1082 1082
   }
1083
-  return TRUE;
1083
+  return true;
1084 1084
 }
1085 1085
 
1086 1086
 /**
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
       if (is_array($value)) {
1159 1159
         if (is_numeric(key($value))) {
1160 1160
           foreach ($value as $item) {
1161
-            if (is_array($item) AND isset($item['@position'])) {
1161
+            if (is_array($item) and isset($item['@position'])) {
1162 1162
               $ordered_array[$item['@position']] = array(
1163 1163
                 $name => $item
1164 1164
               );
@@ -1311,10 +1311,10 @@  discard block
 block discarded – undo
1311 1311
               $sibling = $node->nextSibling;
1312 1312
               
1313 1313
               // Determine if this node forms a set with siblings (share a node name)
1314
-              while (($sibling) AND (($sibling->nodeType != XML_ELEMENT_NODE) OR ($sibling->nodeName != $node->nodeName))) $sibling = $sibling->nextSibling;
1314
+              while (($sibling) and (($sibling->nodeType != XML_ELEMENT_NODE) or ($sibling->nodeName != $node->nodeName))) $sibling = $sibling->nextSibling;
1315 1315
               if (!$sibling) {
1316 1316
                   $sibling = $node->previousSibling;
1317
-                  while (($sibling) AND (($sibling->nodeType != XML_ELEMENT_NODE) OR ($sibling->nodeName != $node->nodeName))) $sibling = $sibling->previousSibling;
1317
+                  while (($sibling) and (($sibling->nodeType != XML_ELEMENT_NODE) or ($sibling->nodeName != $node->nodeName))) $sibling = $sibling->previousSibling;
1318 1318
               }
1319 1319
               
1320 1320
               if ($sibling) {
@@ -1324,7 +1324,7 @@  discard block
 block discarded – undo
1324 1324
                   }
1325 1325
                   if ($node->hasAttributes()) {
1326 1326
                       $attributes = $node->attributes;
1327
-                      if ($result[$node_name][$index] !== '' AND !is_array($result[$node_name][$index])) {
1327
+                      if ($result[$node_name][$index] !== '' and !is_array($result[$node_name][$index])) {
1328 1328
                           $result[$node_name][$index] = array('@value' => $result[$node_name][$index]);
1329 1329
                       }
1330 1330
                       foreach ($attributes as $key => $attribute) {
@@ -1347,7 +1347,7 @@  discard block
 block discarded – undo
1347 1347
                   }
1348 1348
                   if ($node->hasAttributes()) {
1349 1349
                       $attributes = $node->attributes;
1350
-                      if ($result[$node_name] !== '' AND !is_array($result[$node_name])) {
1350
+                      if ($result[$node_name] !== '' and !is_array($result[$node_name])) {
1351 1351
                           $result[$node_name] = array('@value' => $result[$node_name]);
1352 1352
                       }
1353 1353
                       foreach($attributes as $key => $attribute) {
@@ -1378,7 +1378,7 @@  discard block
 block discarded – undo
1378 1378
 /**
1379 1379
   * Determine output for host list views when no hosts are found.
1380 1380
   */
1381
-function boincwork_views_host_list_empty_text($context = NULL) {
1381
+function boincwork_views_host_list_empty_text($context = null) {
1382 1382
   
1383 1383
   // Pull the BOINC user ID from the view arguments to get show_hosts 
1384 1384
   // preference for that user
@@ -1392,28 +1392,28 @@  discard block
 block discarded – undo
1392 1392
   if ($boincuser->show_hosts) {
1393 1393
     switch($context) {
1394 1394
     case 'active':
1395
-      $output .=  '<h2>' . bts('No active computers', array(), NULL, 'boinc:host-list') . '</h2>';
1395
+      $output .=  '<h2>' . bts('No active computers', array(), null, 'boinc:host-list') . '</h2>';
1396 1396
       $output .=  '<p>' . bts('This user has no computers that have been'
1397
-      . ' active in the last 30 days.', array(), NULL, 'boinc:host-list') . '</p>';
1397
+      . ' active in the last 30 days.', array(), null, 'boinc:host-list') . '</p>';
1398 1398
       break;
1399 1399
       
1400 1400
     case 'preferences':
1401
-      $output .=  '<h2>' . bts('No computers', array(), NULL, 'boinc:host-list') . '</h2>';
1401
+      $output .=  '<h2>' . bts('No computers', array(), null, 'boinc:host-list') . '</h2>';
1402 1402
       $output .=  '<p>' . bts('There are no computers assigned to this'
1403
-      . ' preference set.', array(), NULL, 'boinc:host-list') . '</p>';
1403
+      . ' preference set.', array(), null, 'boinc:host-list') . '</p>';
1404 1404
       break;
1405 1405
     
1406 1406
     default:
1407
-      $output .=  '<h2>' . bts('Computers pending', array(), NULL, 'boinc:host-list') . '</h2>';
1407
+      $output .=  '<h2>' . bts('Computers pending', array(), null, 'boinc:host-list') . '</h2>';
1408 1408
       $output .=  '<p>' . bts('This user does not yet have any associated'
1409 1409
       . ' computers. Computers will be displayed when they have earned their'
1410
-      . ' first credits.', array(), NULL, 'boinc:host-list') . '</p>';
1410
+      . ' first credits.', array(), null, 'boinc:host-list') . '</p>';
1411 1411
     }
1412 1412
   }
1413 1413
   else {
1414
-    $output .=  '<h2>' . bts('Computers hidden', array(), NULL, 'boinc:host-list') . '</h2>';
1414
+    $output .=  '<h2>' . bts('Computers hidden', array(), null, 'boinc:host-list') . '</h2>';
1415 1415
     $output .=  '<p>' . bts('This user has chosen not to show information'
1416
-    . ' about their computers.', array(), NULL, 'boinc:host-list') . '</p>';
1416
+    . ' about their computers.', array(), null, 'boinc:host-list') . '</p>';
1417 1417
   }
1418 1418
   return $output;
1419 1419
 }
@@ -1421,15 +1421,15 @@  discard block
 block discarded – undo
1421 1421
 /**
1422 1422
   * Determine output for task list views when no tasks are found.
1423 1423
   */
1424
-function boincwork_views_task_list_empty_text($context = NULL) {
1424
+function boincwork_views_task_list_empty_text($context = null) {
1425 1425
   
1426 1426
   // 
1427 1427
   $output = '';
1428 1428
   switch($context) {
1429 1429
   default:
1430
-    $output .=  '<h2>' . bts('No @type tasks', array('@type' => $context), NULL, 'boinc:task-list')
1430
+    $output .=  '<h2>' . bts('No @type tasks', array('@type' => $context), null, 'boinc:task-list')
1431 1431
     . '</h2>';
1432
-    $output .=  '<p>' . bts('There are no tasks of this type on record', array(), NULL, 'boinc:task-list')
1432
+    $output .=  '<p>' . bts('There are no tasks of this type on record', array(), null, 'boinc:task-list')
1433 1433
     . '</p>';
1434 1434
   }
1435 1435
   return $output;
@@ -1443,18 +1443,18 @@  discard block
 block discarded – undo
1443 1443
   if (boincwork_host_user_is_owner($host_id)) {
1444 1444
     // Show merge hosts option
1445 1445
     $output = '<ul class="tab-list"><li class="first tab">';
1446
-    $output .= l(bts('Merge', array(), NULL, 'boinc:form-merge'), "host/{$host_id}/merge");
1446
+    $output .= l(bts('Merge', array(), null, 'boinc:form-merge'), "host/{$host_id}/merge");
1447 1447
     $output .= '</li>';
1448 1448
     // If host has no tasks, allow the host to be deleted
1449 1449
     if (!boincwork_host_get_task_count($host_id)) {
1450 1450
       $output .= '<li class="tab">';
1451
-      $output .= l(bts('Delete', array(), NULL, 'boinc:form-delete'), "host/{$host_id}/delete",
1451
+      $output .= l(bts('Delete', array(), null, 'boinc:form-delete'), "host/{$host_id}/delete",
1452 1452
         array(
1453 1453
           'attributes' => array(
1454 1454
             'onclick' => 'return confirm(\'' . bts('This will delete host @id'
1455 1455
               . ' from your account forever. Are you sure this is OK?',
1456 1456
               array('@id' => $host_id),
1457
-              NULL, 'boinc:account-host-delete') . '\')'
1457
+              null, 'boinc:account-host-delete') . '\')'
1458 1458
           )
1459 1459
         )
1460 1460
       );
@@ -1494,7 +1494,7 @@  discard block
 block discarded – undo
1494 1494
 /**
1495 1495
  * Check whether a user is the owner of a host
1496 1496
  */
1497
-function boincwork_host_user_is_owner($host_id, $uid = NULL) {
1497
+function boincwork_host_user_is_owner($host_id, $uid = null) {
1498 1498
   if (!$uid) {
1499 1499
     global $user;
1500 1500
     $uid = $user->uid;
@@ -1513,18 +1513,18 @@  discard block
 block discarded – undo
1513 1513
 /**
1514 1514
   * Determine output for host last contact time
1515 1515
   */
1516
-function boincwork_host_last_contact($timestamp, $host_id = NULL, $context = NULL) {
1516
+function boincwork_host_last_contact($timestamp, $host_id = null, $context = null) {
1517 1517
   $output = '---';
1518 1518
   $root_log_dir = variable_get('boinc_host_sched_logs_dir', '');
1519 1519
   $log = '';
1520 1520
   if ($timestamp) {
1521 1521
     $output = date('j M Y G:i:s T', $timestamp);
1522 1522
   }
1523
-  if ($root_log_dir AND $host_id) {
1524
-    $subdir = substr($host_id, 0, -3) OR $subdir = 0;
1523
+  if ($root_log_dir and $host_id) {
1524
+    $subdir = substr($host_id, 0, -3) or $subdir = 0;
1525 1525
     $log = implode('/', array($root_log_dir, $subdir, $host_id));
1526 1526
   }
1527
-  if ($log AND file_exists($log)) {
1527
+  if ($log and file_exists($log)) {
1528 1528
     $output = l($output, "host/{$host_id}/log");
1529 1529
   }
1530 1530
   return $output;
@@ -1538,10 +1538,10 @@  discard block
 block discarded – undo
1538 1538
   if (function_exists('jump_quickly')) {
1539 1539
     $path = "host/{$host_id}/set-venue";
1540 1540
     $venues = array(
1541
-      "{$path}/generic" => bts('Generic', array(), NULL, 'boinc:account-preferences-location'),
1542
-      "{$path}/home" => bts('Home', array(), NULL, 'boinc:account-preferences-location:-1:ignoreoverwrite'),
1543
-      "{$path}/work" => bts('Work', array(), NULL, 'boinc:account-preferences-location'),
1544
-      "{$path}/school" => bts('School', array(), NULL, 'boinc:account-preferences-location')
1541
+      "{$path}/generic" => bts('Generic', array(), null, 'boinc:account-preferences-location'),
1542
+      "{$path}/home" => bts('Home', array(), null, 'boinc:account-preferences-location:-1:ignoreoverwrite'),
1543
+      "{$path}/work" => bts('Work', array(), null, 'boinc:account-preferences-location'),
1544
+      "{$path}/school" => bts('School', array(), null, 'boinc:account-preferences-location')
1545 1545
     );
1546 1546
     variable_set('jump_use_js_venues-Array', 1);
1547 1547
     drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js');
@@ -1561,9 +1561,9 @@  discard block
 block discarded – undo
1561 1561
 /**
1562 1562
   * Determine output for task reported time / deadline
1563 1563
   */
1564
-function boincwork_task_time_reported($received_time = NULL, $deadline = NULL, $context = NULL) {
1564
+function boincwork_task_time_reported($received_time = null, $deadline = null, $context = null) {
1565 1565
   $output = '---';
1566
-  if ($received_time OR $deadline) {
1566
+  if ($received_time or $deadline) {
1567 1567
     $timestamp = ($received_time) ? $received_time : $deadline;
1568 1568
     $output = date('j M Y G:i:s T', $timestamp);
1569 1569
     // Add a wrapper to deadline text
@@ -1606,9 +1606,9 @@  discard block
 block discarded – undo
1606 1606
  * @param int $tablerows
1607 1607
  *   Number of table row to display per page. Defaults to 20.
1608 1608
  */
1609
-function boincwork_tasktable($category = 0, $queryid = 1, $tselect = NULL, $app_id = 0, $tablerows = 20) {
1609
+function boincwork_tasktable($category = 0, $queryid = 1, $tselect = null, $app_id = 0, $tablerows = 20) {
1610 1610
   // Check type parameter, if not (0,2) then return an error.
1611
-  if ( ($category!=0) AND ($category!=1) AND ($category!=2) ) {
1611
+  if ( ($category!=0) and ($category!=1) and ($category!=2) ) {
1612 1612
     watchdog('boincwork', 'task table called with invalid category = %category', array('%category' => $category), WATCHDOG_WARNING);
1613 1613
     return '';
1614 1614
   }
@@ -1681,7 +1681,7 @@  discard block
 block discarded – undo
1681 1681
   if ($dbres_all) {
1682 1682
     while ($result = db_fetch_object($dbres_all)) {
1683 1683
       $mystate = state_num($result);
1684
-      if ( ($result->appid==$app_id) OR ($app_id==0) OR ($app_id==-1) ) {
1684
+      if ( ($result->appid==$app_id) or ($app_id==0) or ($app_id==-1) ) {
1685 1685
         $taskstates[STATE_ALL]++;
1686 1686
         switch ($mystate) {
1687 1687
         case STATE_IN_PROGRESS:
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
 
1705 1705
       //map holds a map between app ids and user friendly names for all applications.
1706 1706
       $application_map[$result->appid] = $result->user_friendly_name;
1707
-      if ( ($mystate == $tselect) OR ($tselect==STATE_ALL) ) {
1707
+      if ( ($mystate == $tselect) or ($tselect==STATE_ALL) ) {
1708 1708
         //count of appids in the results.
1709 1709
         $application_select_count[$result->appid]++;
1710 1710
       }// if mystate
@@ -1716,8 +1716,8 @@  discard block
 block discarded – undo
1716 1716
   
1717 1717
   // Entry for all applications.
1718 1718
   $allcount = $application_select_count ? array_sum($application_select_count) : 0;
1719
-  $applications[-1] = bts('Application', array(), NULL, 'boinc:task-table');
1720
-  $applications[0] = bts('All applications', array(), NULL, 'boinc:task-table') . ' (' . $allcount . ')';
1719
+  $applications[-1] = bts('Application', array(), null, 'boinc:task-table');
1720
+  $applications[0] = bts('All applications', array(), null, 'boinc:task-table') . ' (' . $allcount . ')';
1721 1721
   // Create application filter from application_map and application_select_count.
1722 1722
   foreach($application_map as $akey => $aname) {
1723 1723
     $acount = 0;
@@ -1729,37 +1729,37 @@  discard block
 block discarded – undo
1729 1729
   // Header array for (sub) results table.
1730 1730
   $resultheader = array(
1731 1731
     array(
1732
-      'data' => bts('Task ID', array(), NULL, 'boinc:task-table'),
1732
+      'data' => bts('Task ID', array(), null, 'boinc:task-table'),
1733 1733
       'field' => 'id',
1734 1734
     ),
1735 1735
     array(
1736
-      'data' => bts('Workunit ID', array(), NULL, 'boinc:task-table'),
1736
+      'data' => bts('Workunit ID', array(), null, 'boinc:task-table'),
1737 1737
       'field' => 'workunitid',
1738 1738
     ),
1739 1739
     array(
1740
-      'data' => bts('Computer', array(), NULL, 'boinc:task-table'),
1740
+      'data' => bts('Computer', array(), null, 'boinc:task-table'),
1741 1741
       'field' => 'hostid',
1742 1742
     ),
1743 1743
     array(
1744
-      'data' => bts('Sent', array(), NULL, 'boinc:task-table'),
1744
+      'data' => bts('Sent', array(), null, 'boinc:task-table'),
1745 1745
       'field' => 'sent_time',
1746 1746
     ),
1747 1747
     array(
1748
-      'data' => bts('Time Reported or Deadline', array(), NULL, 'boinc:task-table')
1748
+      'data' => bts('Time Reported or Deadline', array(), null, 'boinc:task-table')
1749 1749
     ),
1750 1750
     array(
1751
-      'data' => bts('Status', array(), NULL, 'boinc:task-table')
1751
+      'data' => bts('Status', array(), null, 'boinc:task-table')
1752 1752
     ),
1753 1753
     array(
1754
-      'data' => bts('Run time', array(), NULL, 'boinc:task-table'),
1754
+      'data' => bts('Run time', array(), null, 'boinc:task-table'),
1755 1755
       'field' => 'elapsed_time',
1756 1756
     ),
1757 1757
     array(
1758
-      'data' => bts('CPU time', array(), NULL, 'boinc:task-table'),
1758
+      'data' => bts('CPU time', array(), null, 'boinc:task-table'),
1759 1759
       'field' => 'cpu_time',
1760 1760
     ),
1761 1761
     array(
1762
-      'data' => bts('Granted Credit', array(), NULL, 'boinc:task-table'),
1762
+      'data' => bts('Granted Credit', array(), null, 'boinc:task-table'),
1763 1763
       'field' => 'granted_credit',
1764 1764
     ),
1765 1765
     // Application is a column, but won't be added until after tablesort_sql().
@@ -1833,14 +1833,14 @@  discard block
 block discarded – undo
1833 1833
   default:
1834 1834
   }
1835 1835
 
1836
-  if (is_numeric($app_id) AND $app_id>0 ) {
1836
+  if (is_numeric($app_id) and $app_id>0 ) {
1837 1837
     $sqlwhere[] = "r.appid = '%s'";
1838 1838
     if ($sqlwhere)  $sqlsub .= " WHERE " . implode(' AND ', $sqlwhere);
1839
-    $dbres_sub = pager_query( $sqlsub . tablesort_sql($resultheader), $tablerows, 0, NULL, $queryid, $app_id);
1839
+    $dbres_sub = pager_query( $sqlsub . tablesort_sql($resultheader), $tablerows, 0, null, $queryid, $app_id);
1840 1840
   }
1841 1841
   else {
1842 1842
     if ($sqlwhere)  $sqlsub .= " WHERE " . implode(' AND ', $sqlwhere);
1843
-    $dbres_sub = pager_query( $sqlsub . tablesort_sql($resultheader), $tablerows, 0, NULL, $queryid);
1843
+    $dbres_sub = pager_query( $sqlsub . tablesort_sql($resultheader), $tablerows, 0, null, $queryid);
1844 1844
   }
1845 1845
   db_set_active('default');
1846 1846
 
@@ -1850,7 +1850,7 @@  discard block
 block discarded – undo
1850 1850
       // state_num() function changes $result object, clone $result
1851 1851
       // object for use in state_num()
1852 1852
       // check if state matches selection
1853
-      if ( (state_num(clone $result) == $tselect) OR ($tselect==STATE_ALL) ) {
1853
+      if ( (state_num(clone $result) == $tselect) or ($tselect==STATE_ALL) ) {
1854 1854
         // create pretty result row
1855 1855
         $prettyresult = array(
1856 1856
           array(
@@ -1889,18 +1889,18 @@  discard block
 block discarded – undo
1889 1889
     $pathprefix = 'host/' . $queryid . '/tasks';
1890 1890
   }
1891 1891
   // Need an "All" tab as well, maps to app_id of zero.
1892
-  $application_map[0] = bts('All', array(), NULL, 'boinc:task-table');
1892
+  $application_map[0] = bts('All', array(), null, 'boinc:task-table');
1893 1893
   $stitems = array();
1894 1894
   foreach ($taskstates as $state => $numstates) {
1895 1895
     $mypath = $pathprefix . '/' . $state . '/' . $app_id;
1896 1896
     if ($state==STATE_ALL) {
1897
-      $ltext = '<span class="tab task-app-name">' . bts('All', array(), NULL, 'boinc:task-table') . ' (' . $numstates . ')</span>';
1897
+      $ltext = '<span class="tab task-app-name">' . bts('All', array(), null, 'boinc:task-table') . ' (' . $numstates . ')</span>';
1898 1898
     }
1899 1899
     else {
1900
-      $ltext = '<span class="tab">' . bts($state_hnames[$state], array(), NULL, 'boinc:task-table') . ' (' . $numstates . ')</span>';
1900
+      $ltext = '<span class="tab">' . bts($state_hnames[$state], array(), null, 'boinc:task-table') . ' (' . $numstates . ')</span>';
1901 1901
     }
1902 1902
     $myitem = array(
1903
-      'data' => l($ltext, $mypath, array('html' => TRUE) ),
1903
+      'data' => l($ltext, $mypath, array('html' => true) ),
1904 1904
     );
1905 1905
     if ($state==$tselect) {
1906 1906
       $myitem['class'] = 'active';
@@ -1909,10 +1909,10 @@  discard block
 block discarded – undo
1909 1909
   }
1910 1910
   // Add reset button
1911 1911
   $mypath = $pathprefix . '/0/0';
1912
-  $ltext = '<span class="tab">' . bts('Reset', array(), NULL, 'boinc:task-table') . '</span>';
1913
-  $stitems[] = array( 'data' => l($ltext, $mypath, array('html' => TRUE) ) );
1912
+  $ltext = '<span class="tab">' . bts('Reset', array(), null, 'boinc:task-table') . '</span>';
1913
+  $stitems[] = array( 'data' => l($ltext, $mypath, array('html' => true) ) );
1914 1914
 
1915
-  $output .= theme_item_list($stitems, NULL, 'ul' . ' class="tabs secondary clearfix"');
1915
+  $output .= theme_item_list($stitems, null, 'ul' . ' class="tabs secondary clearfix"');
1916 1916
 
1917 1917
   // Application select-drop down form
1918 1918
   // Hack to place Application form into header
@@ -1923,10 +1923,10 @@  discard block
 block discarded – undo
1923 1923
   $resultheader[] = drupal_get_form('boincwork_selectapp_form', $applications, $app_id);
1924 1924
 
1925 1925
   // Begin table of results
1926
-  if ( is_array($resultheader) AND is_array($resultdata) ) {
1926
+  if ( is_array($resultheader) and is_array($resultdata) ) {
1927 1927
 
1928 1928
     // Take advantage of the fact that $category is the same as the row/column we want to remove.
1929
-    if ( ($category==1) OR ($category==2) ) {
1929
+    if ( ($category==1) or ($category==2) ) {
1930 1930
       unset($resultheader[$category]);
1931 1931
       delete_col($resultdata, $category);
1932 1932
     }
Please login to merge, or discard this patch.
Spacing   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
   
168 168
   if ($preset) {
169 169
     // Load preset from configuration
170
-    $preset_prefs = (array) $preset_prefs['general_preferences'];
170
+    $preset_prefs = (array)$preset_prefs['general_preferences'];
171 171
     if (isset($preset_prefs['preset'])) {
172 172
       if (!is_numeric(key($preset_prefs['preset']))) {
173 173
         $preset_prefs['preset'] = array($preset_prefs['preset']);
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 function boincwork_get_project_specific_config() {
189 189
   $raw_config_data = variable_get('boinc_project_specific_prefs_config', '');
190 190
   
191
-  $xsd = './' . drupal_get_path('module', 'boincwork') . '/includes/projectprefs.xsd';
191
+  $xsd = './'.drupal_get_path('module', 'boincwork').'/includes/projectprefs.xsd';
192 192
   libxml_use_internal_errors(true);
193 193
   
194 194
   $xml = new DomDocument();
@@ -196,8 +196,8 @@  discard block
 block discarded – undo
196 196
   if (!$xml->schemaValidate($xsd)) {
197 197
     $errors = libxml_get_errors();
198 198
     $lines = explode("\r", $raw_config_data);
199
-    drupal_set_message("{$errors[0]->message} at line {$errors[0]->line}" .
200
-      ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), 'error');
199
+    drupal_set_message("{$errors[0]->message} at line {$errors[0]->line}".
200
+      ': <br/>'.htmlentities($lines[$errors[0]->line - 1]), 'error');
201 201
     return NULL;
202 202
   }
203 203
   
@@ -392,13 +392,13 @@  discard block
 block discarded – undo
392 392
       
393 393
       // Use appropriate datatype
394 394
       if (isset($element['@attributes']['datatype'])) {
395
-        switch($element['@attributes']['datatype']) {
395
+        switch ($element['@attributes']['datatype']) {
396 396
         case 'integer':
397
-          $value = (int) $value;
397
+          $value = (int)$value;
398 398
           break;
399 399
           
400 400
         case 'float':
401
-          $value = number_format((float) $value, 2);
401
+          $value = number_format((float)$value, 2);
402 402
           break;
403 403
         
404 404
         default:
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
         '#type' => 'textfield',
421 421
         '#default_value' => $value,
422 422
         '#size' => 5,
423
-        '#description' => $description . bts(' Default value: @default', array('@default' => $default), NULL, 'boinc:account-preferences-project')
423
+        '#description' => $description.bts(' Default value: @default', array('@default' => $default), NULL, 'boinc:account-preferences-project')
424 424
       );
425 425
     }
426 426
     break;
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
       $name = $element['@attributes']['name'];
485 485
       $default = null;
486 486
       $options = array();
487
-      foreach($element['items']['item'] as $item) {
487
+      foreach ($element['items']['item'] as $item) {
488 488
         if (is_array($item)) {
489 489
           $value = $item['@value'];
490 490
           if ($default === NULL AND
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
         '#options' => $options,
527 527
         '#attributes' => array('class' => 'fancy'),
528 528
         '#default_value' => $value,
529
-        '#description' => $description . bts(' Default value: @default', array('@default' =>$default), NULL, 'boinc:account-preferences-project')
529
+        '#description' => $description.bts(' Default value: @default', array('@default' =>$default), NULL, 'boinc:account-preferences-project')
530 530
       );
531 531
     }
532 532
     break;
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
     }
592 592
     foreach ($elements as $key => $element) {
593 593
       $title = is_array($element['title']) ? $element['title']['@value'] : $element['title'];
594
-      $name = str_replace(' ','_',strtolower($title));
594
+      $name = str_replace(' ', '_', strtolower($title));
595 595
       $name = "group_{$name}";
596 596
       
597 597
       // Translate elements as appropriate
@@ -743,13 +743,13 @@  discard block
 block discarded – undo
743 743
   if ($type == 'project') {
744 744
     if ($boincuser->project_prefs) {
745 745
       $main_prefs = load_configuration($boincuser->project_prefs);
746
-      $main_prefs = (array) $main_prefs['project_preferences'];
746
+      $main_prefs = (array)$main_prefs['project_preferences'];
747 747
     }
748 748
   }
749 749
   else {
750 750
     if ($boincuser->global_prefs) {
751 751
       $main_prefs = load_configuration($boincuser->global_prefs);
752
-      $main_prefs = (array) $main_prefs['global_preferences'];
752
+      $main_prefs = (array)$main_prefs['global_preferences'];
753 753
     }
754 754
   }
755 755
   
@@ -801,13 +801,13 @@  discard block
 block discarded – undo
801 801
   if ($type == 'project') {
802 802
     if ($boincuser->project_prefs) {
803 803
       $main_prefs = load_configuration($boincuser->project_prefs);
804
-      $main_prefs = (array) $main_prefs['project_preferences'];
804
+      $main_prefs = (array)$main_prefs['project_preferences'];
805 805
     }
806 806
   }
807 807
   else {
808 808
     if ($boincuser->global_prefs) {
809 809
       $main_prefs = load_configuration($boincuser->global_prefs);
810
-      $main_prefs = (array) $main_prefs['global_preferences'];
810
+      $main_prefs = (array)$main_prefs['global_preferences'];
811 811
     }
812 812
   }
813 813
   
@@ -1001,11 +1001,11 @@  discard block
 block discarded – undo
1001 1001
   $magnitude = 0;
1002 1002
   $precision = 0;
1003 1003
   if ($digits > $max_digits) {
1004
-    $magnitude = floor(($digits - ($max_digits - 3)) / 3);
1005
-    $precision = $max_digits - ($digits - ($magnitude * 3) + 1);
1006
-    $number = round($number / pow(1000, $magnitude), $precision);
1004
+    $magnitude = floor(($digits - ($max_digits - 3))/3);
1005
+    $precision = $max_digits - ($digits - ($magnitude*3) + 1);
1006
+    $number = round($number/pow(1000, $magnitude), $precision);
1007 1007
   }
1008
-  $number = number_format($number, $precision) . (($magnitude) ? "{$suffix[$magnitude]}" : '');
1008
+  $number = number_format($number, $precision).(($magnitude) ? "{$suffix[$magnitude]}" : '');
1009 1009
   
1010 1010
   return $number;
1011 1011
 }
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
   
1184 1184
   function text_to_xml($text) {
1185 1185
     $xml = new DomDocument();
1186
-    if ( !($xml->loadXML($text)) ) return false;
1186
+    if (!($xml->loadXML($text))) return false;
1187 1187
     return $xml;
1188 1188
   }
1189 1189
   
@@ -1200,7 +1200,7 @@  discard block
 block discarded – undo
1200 1200
       while (!is_null($node)) {
1201 1201
           switch ($node->nodeType) {
1202 1202
           case XML_TEXT_NODE:
1203
-              if (trim($node->nodeValue)  != '') $result = $node->nodeValue;
1203
+              if (trim($node->nodeValue) != '') $result = $node->nodeValue;
1204 1204
               break;
1205 1205
           case XML_ELEMENT_NODE:
1206 1206
               $node_name = $node->nodeName;
@@ -1217,7 +1217,7 @@  discard block
 block discarded – undo
1217 1217
               if ($sibling) {
1218 1218
                   $result[$node_name][$index] = '';
1219 1219
                   if ($node->childNodes) {
1220
-                      $result[$node_name][$index] = xml_to_array($node) ;
1220
+                      $result[$node_name][$index] = xml_to_array($node);
1221 1221
                   }
1222 1222
                   if ($node->hasAttributes()) {
1223 1223
                       $attributes = $node->attributes;
@@ -1240,14 +1240,14 @@  discard block
 block discarded – undo
1240 1240
               } else {
1241 1241
                   $result[$node_name] = '';
1242 1242
                   if ($node->childNodes) {
1243
-                      $result[$node_name] = xml_to_array($node) ;
1243
+                      $result[$node_name] = xml_to_array($node);
1244 1244
                   }
1245 1245
                   if ($node->hasAttributes()) {
1246 1246
                       $attributes = $node->attributes;
1247 1247
                       if ($result[$node_name] !== '' AND !is_array($result[$node_name])) {
1248 1248
                           $result[$node_name] = array('@value' => $result[$node_name]);
1249 1249
                       }
1250
-                      foreach($attributes as $key => $attribute) {
1250
+                      foreach ($attributes as $key => $attribute) {
1251 1251
                           $result[$node_name]['@attributes'][$attribute->name] = $attribute->value;
1252 1252
                       }
1253 1253
                   }
@@ -1287,30 +1287,30 @@  discard block
 block discarded – undo
1287 1287
   // Determine if hosts are associated at all or just hidden
1288 1288
   $output = '';
1289 1289
   if ($boincuser->show_hosts) {
1290
-    switch($context) {
1290
+    switch ($context) {
1291 1291
     case 'active':
1292
-      $output .=  '<h2>' . bts('No active computers', array(), NULL, 'boinc:host-list') . '</h2>';
1293
-      $output .=  '<p>' . bts('This user has no computers that have been'
1294
-      . ' active in the last 30 days.', array(), NULL, 'boinc:host-list') . '</p>';
1292
+      $output .= '<h2>'.bts('No active computers', array(), NULL, 'boinc:host-list').'</h2>';
1293
+      $output .= '<p>'.bts('This user has no computers that have been'
1294
+      . ' active in the last 30 days.', array(), NULL, 'boinc:host-list').'</p>';
1295 1295
       break;
1296 1296
       
1297 1297
     case 'preferences':
1298
-      $output .=  '<h2>' . bts('No computers', array(), NULL, 'boinc:host-list') . '</h2>';
1299
-      $output .=  '<p>' . bts('There are no computers assigned to this'
1300
-      . ' preference set.', array(), NULL, 'boinc:host-list') . '</p>';
1298
+      $output .= '<h2>'.bts('No computers', array(), NULL, 'boinc:host-list').'</h2>';
1299
+      $output .= '<p>'.bts('There are no computers assigned to this'
1300
+      . ' preference set.', array(), NULL, 'boinc:host-list').'</p>';
1301 1301
       break;
1302 1302
     
1303 1303
     default:
1304
-      $output .=  '<h2>' . bts('Computers pending', array(), NULL, 'boinc:host-list') . '</h2>';
1305
-      $output .=  '<p>' . bts('This user does not yet have any associated'
1304
+      $output .= '<h2>'.bts('Computers pending', array(), NULL, 'boinc:host-list').'</h2>';
1305
+      $output .= '<p>'.bts('This user does not yet have any associated'
1306 1306
       . ' computers. Computers will be displayed when they have earned their'
1307
-      . ' first credits.', array(), NULL, 'boinc:host-list') . '</p>';
1307
+      . ' first credits.', array(), NULL, 'boinc:host-list').'</p>';
1308 1308
     }
1309 1309
   }
1310 1310
   else {
1311
-    $output .=  '<h2>' . bts('Computers hidden', array(), NULL, 'boinc:host-list') . '</h2>';
1312
-    $output .=  '<p>' . bts('This user has chosen not to show information'
1313
-    . ' about their computers.', array(), NULL, 'boinc:host-list') . '</p>';
1311
+    $output .= '<h2>'.bts('Computers hidden', array(), NULL, 'boinc:host-list').'</h2>';
1312
+    $output .= '<p>'.bts('This user has chosen not to show information'
1313
+    . ' about their computers.', array(), NULL, 'boinc:host-list').'</p>';
1314 1314
   }
1315 1315
   return $output;
1316 1316
 }
@@ -1322,11 +1322,11 @@  discard block
 block discarded – undo
1322 1322
   
1323 1323
   // 
1324 1324
   $output = '';
1325
-  switch($context) {
1325
+  switch ($context) {
1326 1326
   default:
1327
-    $output .=  '<h2>' . bts('No @type tasks', array('@type' => $context), NULL, 'boinc:task-list')
1327
+    $output .= '<h2>'.bts('No @type tasks', array('@type' => $context), NULL, 'boinc:task-list')
1328 1328
     . '</h2>';
1329
-    $output .=  '<p>' . bts('There are no tasks of this type on record', array(), NULL, 'boinc:task-list')
1329
+    $output .= '<p>'.bts('There are no tasks of this type on record', array(), NULL, 'boinc:task-list')
1330 1330
     . '</p>';
1331 1331
   }
1332 1332
   return $output;
@@ -1348,10 +1348,10 @@  discard block
 block discarded – undo
1348 1348
       $output .= l(bts('Delete', array(), NULL, 'boinc:form-delete'), "host/{$host_id}/delete",
1349 1349
         array(
1350 1350
           'attributes' => array(
1351
-            'onclick' => 'return confirm(\'' . bts('This will delete host @id'
1351
+            'onclick' => 'return confirm(\''.bts('This will delete host @id'
1352 1352
               . ' from your account forever. Are you sure this is OK?',
1353 1353
               array('@id' => $host_id),
1354
-              NULL, 'boinc:account-host-delete') . '\')'
1354
+              NULL, 'boinc:account-host-delete').'\')'
1355 1355
           )
1356 1356
         )
1357 1357
       );
@@ -1441,8 +1441,8 @@  discard block
 block discarded – undo
1441 1441
       "{$path}/school" => bts('School', array(), NULL, 'boinc:account-preferences-location')
1442 1442
     );
1443 1443
     variable_set('jump_use_js_venues-Array', 1);
1444
-    drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js');
1445
-    drupal_add_js(drupal_get_path('theme', 'boinc') . '/js/prefs.js', 'theme');
1444
+    drupal_add_js(drupal_get_path('module', 'jump').'/jump.js');
1445
+    drupal_add_js(drupal_get_path('theme', 'boinc').'/js/prefs.js', 'theme');
1446 1446
     // Get current venue
1447 1447
     db_set_active('boinc_ro');
1448 1448
     $venue = db_result(db_query(
@@ -1466,10 +1466,10 @@  discard block
 block discarded – undo
1466 1466
     // Add a wrapper to deadline text
1467 1467
     if (!$received_time) {
1468 1468
       if (time() < $deadline) {
1469
-        $output = '<span class="on-time">' . $output . '</span>';
1469
+        $output = '<span class="on-time">'.$output.'</span>';
1470 1470
       }
1471 1471
       else {
1472
-        $output = '<span class="past-due">' . $output . '</span>';
1472
+        $output = '<span class="past-due">'.$output.'</span>';
1473 1473
       }
1474 1474
     }
1475 1475
   }
@@ -1505,15 +1505,15 @@  discard block
 block discarded – undo
1505 1505
  */
1506 1506
 function boincwork_tasktable($category = 0, $queryid = 1, $tselect = NULL, $app_id = 0, $tablerows = 20) {
1507 1507
   // Check type parameter, if not (0,2) then return an error.
1508
-  if ( ($category!=0) AND ($category!=1) AND ($category!=2) ) {
1508
+  if (($category != 0) AND ($category != 1) AND ($category != 2)) {
1509 1509
     watchdog('boincwork', 'task table called with invalid category = %category', array('%category' => $category), WATCHDOG_WARNING);
1510 1510
     return '';
1511 1511
   }
1512 1512
 
1513
-  require_boinc( array('util', 'result') );
1513
+  require_boinc(array('util', 'result'));
1514 1514
 
1515 1515
   global $language;
1516
-  $locality=$language->language;
1516
+  $locality = $language->language;
1517 1517
   $nf = new NumberFormatter($locality, NumberFormatter::DECIMAL);
1518 1518
   $nf->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS, 0);
1519 1519
   $nf->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, 0);
@@ -1561,13 +1561,13 @@  discard block
 block discarded – undo
1561 1561
       ."ON r.appid=a.id ";
1562 1562
 
1563 1563
   // Use userid, hostid, or workunitid
1564
-  if ($category==0) {
1564
+  if ($category == 0) {
1565 1565
     $sqlall .= " WHERE r.userid='%s' ";
1566 1566
   }
1567
-  elseif ($category==1) {
1567
+  elseif ($category == 1) {
1568 1568
     $sqlall .= " WHERE r.workunitid='%s' ";
1569 1569
   }
1570
-  elseif ($category==2) {
1570
+  elseif ($category == 2) {
1571 1571
     $sqlall .= " WHERE r.hostid='%s' ";
1572 1572
   }
1573 1573
   $sqlall .= " ORDER BY user_friendly_name";
@@ -1578,7 +1578,7 @@  discard block
 block discarded – undo
1578 1578
   if ($dbres_all) {
1579 1579
     while ($result = db_fetch_object($dbres_all)) {
1580 1580
       $mystate = state_num($result);
1581
-      if ( ($result->appid==$app_id) OR ($app_id==0) OR ($app_id==-1) ) {
1581
+      if (($result->appid == $app_id) OR ($app_id == 0) OR ($app_id == -1)) {
1582 1582
         $taskstates[STATE_ALL]++;
1583 1583
         switch ($mystate) {
1584 1584
         case STATE_IN_PROGRESS:
@@ -1601,7 +1601,7 @@  discard block
 block discarded – undo
1601 1601
 
1602 1602
       //map holds a map between app ids and user friendly names for all applications.
1603 1603
       $application_map[$result->appid] = $result->user_friendly_name;
1604
-      if ( ($mystate == $tselect) OR ($tselect==STATE_ALL) ) {
1604
+      if (($mystate == $tselect) OR ($tselect == STATE_ALL)) {
1605 1605
         //count of appids in the results.
1606 1606
         $application_select_count[$result->appid]++;
1607 1607
       }// if mystate
@@ -1614,14 +1614,14 @@  discard block
 block discarded – undo
1614 1614
   // Entry for all applications.
1615 1615
   $allcount = $application_select_count ? array_sum($application_select_count) : 0;
1616 1616
   $applications[-1] = bts('Application', array(), NULL, 'boinc:task-table');
1617
-  $applications[0] = bts('All applications', array(), NULL, 'boinc:task-table') . ' (' . $allcount . ')';
1617
+  $applications[0] = bts('All applications', array(), NULL, 'boinc:task-table').' ('.$allcount.')';
1618 1618
   // Create application filter from application_map and application_select_count.
1619
-  foreach($application_map as $akey => $aname) {
1619
+  foreach ($application_map as $akey => $aname) {
1620 1620
     $acount = 0;
1621
-    if ( $application_select_count and array_key_exists($akey, $application_select_count) ) {
1621
+    if ($application_select_count and array_key_exists($akey, $application_select_count)) {
1622 1622
       $acount = $application_select_count[$akey];
1623 1623
     }
1624
-    $applications[$akey] = $aname . ' ('. $acount . ')';
1624
+    $applications[$akey] = $aname.' ('.$acount.')';
1625 1625
   }
1626 1626
   // Header array for (sub) results table.
1627 1627
   $resultheader = array(
@@ -1700,13 +1700,13 @@  discard block
 block discarded – undo
1700 1700
   $sqlwhere = array();
1701 1701
 
1702 1702
   // Use userid, hostid, or workunitid
1703
-  if ($category==0) {
1703
+  if ($category == 0) {
1704 1704
     $sqlwhere[] = "r.userid = '%s'";
1705 1705
   }
1706
-  elseif ($category==1) {
1706
+  elseif ($category == 1) {
1707 1707
     $sqlwhere[] = "r.workunitid = '%s'";
1708 1708
   }
1709
-  elseif ($category==2) {
1709
+  elseif ($category == 2) {
1710 1710
     $sqlwhere[] = "r.hostid = '%s'";
1711 1711
   }
1712 1712
 
@@ -1730,14 +1730,14 @@  discard block
 block discarded – undo
1730 1730
   default:
1731 1731
   }
1732 1732
 
1733
-  if (is_numeric($app_id) AND $app_id>0 ) {
1733
+  if (is_numeric($app_id) AND $app_id > 0) {
1734 1734
     $sqlwhere[] = "r.appid = '%s'";
1735
-    if ($sqlwhere)  $sqlsub .= " WHERE " . implode(' AND ', $sqlwhere);
1736
-    $dbres_sub = pager_query( $sqlsub . tablesort_sql($resultheader), $tablerows, 0, NULL, $queryid, $app_id);
1735
+    if ($sqlwhere)  $sqlsub .= " WHERE ".implode(' AND ', $sqlwhere);
1736
+    $dbres_sub = pager_query($sqlsub.tablesort_sql($resultheader), $tablerows, 0, NULL, $queryid, $app_id);
1737 1737
   }
1738 1738
   else {
1739
-    if ($sqlwhere)  $sqlsub .= " WHERE " . implode(' AND ', $sqlwhere);
1740
-    $dbres_sub = pager_query( $sqlsub . tablesort_sql($resultheader), $tablerows, 0, NULL, $queryid);
1739
+    if ($sqlwhere)  $sqlsub .= " WHERE ".implode(' AND ', $sqlwhere);
1740
+    $dbres_sub = pager_query($sqlsub.tablesort_sql($resultheader), $tablerows, 0, NULL, $queryid);
1741 1741
   }
1742 1742
   db_set_active('default');
1743 1743
 
@@ -1747,7 +1747,7 @@  discard block
 block discarded – undo
1747 1747
       // state_num() function changes $result object, clone $result
1748 1748
       // object for use in state_num()
1749 1749
       // check if state matches selection
1750
-      if ( (state_num(clone $result) == $tselect) OR ($tselect==STATE_ALL) ) {
1750
+      if ((state_num(clone $result) == $tselect) OR ($tselect == STATE_ALL)) {
1751 1751
         // create pretty result row
1752 1752
         $prettyresult = array(
1753 1753
           array(
@@ -1763,7 +1763,7 @@  discard block
 block discarded – undo
1763 1763
           $nf->format($result->cpu_time),
1764 1764
           $nf->format($result->granted_credit),
1765 1765
           array(
1766
-            'data' => $result->user_friendly_name . " " . pretty_application_version($result->app_version_id,$result->version_number, $result->plan_class, $result->platform),
1766
+            'data' => $result->user_friendly_name." ".pretty_application_version($result->app_version_id, $result->version_number, $result->plan_class, $result->platform),
1767 1767
             'class' => 'task-app',
1768 1768
           ),
1769 1769
         );
@@ -1776,54 +1776,54 @@  discard block
 block discarded – undo
1776 1776
   // Begin result navigation
1777 1777
 
1778 1778
   // Set pathprefix based on type
1779
-  if ($category==0) {
1779
+  if ($category == 0) {
1780 1780
     $pathprefix = 'account/tasks';
1781 1781
   }
1782
-  elseif ($category==1) {
1783
-    $pathprefix = 'workunit/' . $queryid . '/tasks';
1782
+  elseif ($category == 1) {
1783
+    $pathprefix = 'workunit/'.$queryid.'/tasks';
1784 1784
   }
1785
-  elseif ($category==2) {
1786
-    $pathprefix = 'host/' . $queryid . '/tasks';
1785
+  elseif ($category == 2) {
1786
+    $pathprefix = 'host/'.$queryid.'/tasks';
1787 1787
   }
1788 1788
   // Need an "All" tab as well, maps to app_id of zero.
1789 1789
   $application_map[0] = bts('All', array(), NULL, 'boinc:task-table');
1790 1790
   $stitems = array();
1791 1791
   foreach ($taskstates as $state => $numstates) {
1792
-    $mypath = $pathprefix . '/' . $state . '/' . $app_id;
1793
-    if ($state==STATE_ALL) {
1794
-      $ltext = '<span class="tab task-app-name">' . bts('All', array(), NULL, 'boinc:task-table') . ' (' . $numstates . ')</span>';
1792
+    $mypath = $pathprefix.'/'.$state.'/'.$app_id;
1793
+    if ($state == STATE_ALL) {
1794
+      $ltext = '<span class="tab task-app-name">'.bts('All', array(), NULL, 'boinc:task-table').' ('.$numstates.')</span>';
1795 1795
     }
1796 1796
     else {
1797
-      $ltext = '<span class="tab">' . bts($state_hnames[$state], array(), NULL, 'boinc:task-table') . ' (' . $numstates . ')</span>';
1797
+      $ltext = '<span class="tab">'.bts($state_hnames[$state], array(), NULL, 'boinc:task-table').' ('.$numstates.')</span>';
1798 1798
     }
1799 1799
     $myitem = array(
1800
-      'data' => l($ltext, $mypath, array('html' => TRUE) ),
1800
+      'data' => l($ltext, $mypath, array('html' => TRUE)),
1801 1801
     );
1802
-    if ($state==$tselect) {
1802
+    if ($state == $tselect) {
1803 1803
       $myitem['class'] = 'active';
1804 1804
     }
1805 1805
     $stitems[] = $myitem;
1806 1806
   }
1807 1807
   // Add reset button
1808
-  $mypath = $pathprefix . '/0/0';
1809
-  $ltext = '<span class="tab">' . bts('Reset', array(), NULL, 'boinc:task-table') . '</span>';
1810
-  $stitems[] = array( 'data' => l($ltext, $mypath, array('html' => TRUE) ) );
1808
+  $mypath = $pathprefix.'/0/0';
1809
+  $ltext = '<span class="tab">'.bts('Reset', array(), NULL, 'boinc:task-table').'</span>';
1810
+  $stitems[] = array('data' => l($ltext, $mypath, array('html' => TRUE)));
1811 1811
 
1812
-  $output .= theme_item_list($stitems, NULL, 'ul' . ' class="tabs secondary clearfix"');
1812
+  $output .= theme_item_list($stitems, NULL, 'ul'.' class="tabs secondary clearfix"');
1813 1813
 
1814 1814
   // Application select-drop down form
1815 1815
   // Hack to place Application form into header
1816 1816
   // App ID of zero maps to "-1" for drop-down box.
1817
-  if ($app_id==0) {
1818
-    $app_id=-1;
1817
+  if ($app_id == 0) {
1818
+    $app_id = -1;
1819 1819
   }
1820 1820
   $resultheader[] = drupal_get_form('boincwork_selectapp_form', $applications, $app_id);
1821 1821
 
1822 1822
   // Begin table of results
1823
-  if ( is_array($resultheader) AND is_array($resultdata) ) {
1823
+  if (is_array($resultheader) AND is_array($resultdata)) {
1824 1824
 
1825 1825
     // Take advantage of the fact that $category is the same as the row/column we want to remove.
1826
-    if ( ($category==1) OR ($category==2) ) {
1826
+    if (($category == 1) OR ($category == 2)) {
1827 1827
       unset($resultheader[$category]);
1828 1828
       delete_col($resultdata, $category);
1829 1829
     }
@@ -1840,7 +1840,7 @@  discard block
 block discarded – undo
1840 1840
  * Function to delete a column from an array.
1841 1841
  */
1842 1842
 function delete_col(&$array, $offset) {
1843
-  return array_walk($array, function (&$v) use ($offset) {
1843
+  return array_walk($array, function(&$v) use ($offset) {
1844 1844
      array_splice($v, $offset, 1);
1845 1845
   });
1846 1846
 }
Please login to merge, or discard this patch.
Braces   +41 added lines, -72 removed lines patch added patch discarded remove patch
@@ -332,8 +332,7 @@  discard block
 block discarded – undo
332 332
         $name = $element['@attributes']['name'];
333 333
         if (isset($element['@attributes']['entitytype']) AND $element['@attributes']['entitytype'] == 'attribute') {
334 334
           $defaults['@attributes'][$name] = $values[$name];
335
-        }
336
-        else {
335
+        } else {
337 336
           $defaults[$name] = $values[$name];
338 337
         }
339 338
       }
@@ -384,8 +383,7 @@  discard block
 block discarded – undo
384 383
       if (isset($user_pref[$name])) {
385 384
         if (is_array($user_pref[$name]) AND isset($user_pref[$name]['@value'])) {
386 385
           $value = $user_pref[$name]['@value'];
387
-        }
388
-        else {
386
+        } else {
389 387
           $value = $user_pref[$name];
390 388
         }
391 389
       }
@@ -447,8 +445,7 @@  discard block
 block discarded – undo
447 445
       if (isset($user_pref[$name])) {
448 446
         if (is_array($user_pref[$name]) AND isset($user_pref[$name]['@value'])) {
449 447
           $value = $user_pref[$name]['@value'];
450
-        }
451
-        else {
448
+        } else {
452 449
           $value = $user_pref[$name];
453 450
         }
454 451
       }
@@ -492,8 +489,7 @@  discard block
 block discarded – undo
492 489
               isset($item['@attributes']['selected'])) {
493 490
             $default = ($item['@attributes']['selected'] == 'true') ? $item['@value'] : null;
494 491
           }
495
-        }
496
-        else {
492
+        } else {
497 493
           $value = $item;
498 494
         }
499 495
         $options[$value] = $value;
@@ -696,8 +692,7 @@  discard block
 block discarded – undo
696 692
       );
697 693
       if ($top_level) {
698 694
         $uncategorized[$key] = $prefs_element;
699
-      }
700
-      else {
695
+      } else {
701 696
         $prefs_table[$key] = $prefs_element;
702 697
       }
703 698
       break;
@@ -711,8 +706,7 @@  discard block
 block discarded – undo
711 706
       'name' => bts('Other settings', array(), NULL, 'boinc:account-preferences'),
712 707
       'elements' => $uncategorized,
713 708
     );
714
-  }
715
-  elseif ($uncategorized) {
709
+  } elseif ($uncategorized) {
716 710
     // If nothing is categorized, output all prefs under a general "settings"
717 711
     $prefs_table['settings'] = array(
718 712
       'name' => bts('Settings', array(), NULL, 'boinc:account-preferences'),
@@ -745,8 +739,7 @@  discard block
 block discarded – undo
745 739
       $main_prefs = load_configuration($boincuser->project_prefs);
746 740
       $main_prefs = (array) $main_prefs['project_preferences'];
747 741
     }
748
-  }
749
-  else {
742
+  } else {
750 743
     if ($boincuser->global_prefs) {
751 744
       $main_prefs = load_configuration($boincuser->global_prefs);
752 745
       $main_prefs = (array) $main_prefs['global_preferences'];
@@ -762,8 +755,7 @@  discard block
 block discarded – undo
762 755
     if (count($main_prefs) < 3)
763 756
         $main_prefs['@attributes'] = array('cleared' => 1);
764 757
     return $main_prefs;
765
-  }
766
-  else {
758
+  } else {
767 759
     if (isset($main_prefs['venue'])) {
768 760
       if (!is_numeric(key($main_prefs['venue']))) {
769 761
         $main_prefs['venue'] = array($main_prefs['venue']);
@@ -803,8 +795,7 @@  discard block
 block discarded – undo
803 795
       $main_prefs = load_configuration($boincuser->project_prefs);
804 796
       $main_prefs = (array) $main_prefs['project_preferences'];
805 797
     }
806
-  }
807
-  else {
798
+  } else {
808 799
     if ($boincuser->global_prefs) {
809 800
       $main_prefs = load_configuration($boincuser->global_prefs);
810 801
       $main_prefs = (array) $main_prefs['global_preferences'];
@@ -817,8 +808,7 @@  discard block
 block discarded – undo
817 808
   if (!$venue OR $venue == 'generic') {
818 809
     //$main_prefs = $prefs;
819 810
     $main_prefs = $prefs + $main_prefs;
820
-  }
821
-  else {
811
+  } else {
822 812
     if (isset($main_prefs['venue'])) {
823 813
       if (!is_numeric(key($main_prefs['venue']))) {
824 814
         $main_prefs['venue'] = array($main_prefs['venue']);
@@ -827,8 +817,7 @@  discard block
 block discarded – undo
827 817
         if (isset($prefs_venue['@attributes']['name']) AND $prefs_venue['@attributes']['name'] == $venue) {
828 818
           if ($prefs) {
829 819
             $main_prefs['venue'][$key] = $prefs;
830
-          }
831
-          else {
820
+          } else {
832 821
             // If prefs is null, clear out this preference set
833 822
             unset($main_prefs['venue'][$key]);
834 823
             if (count($main_prefs['venue']) == 0) {
@@ -875,8 +864,7 @@  discard block
 block discarded – undo
875 864
     db_set_active('boinc_rw');
876 865
     $result = db_query("UPDATE user SET project_prefs = '{$boincuser->project_prefs}' WHERE id = '{$boincuser->id}'");
877 866
     db_set_active('default');
878
-  }
879
-  else {
867
+  } else {
880 868
     $main_prefs = array('global_preferences' => $main_prefs);
881 869
     $boincuser->global_prefs = save_configuration($main_prefs);
882 870
     db_set_active('boinc_rw');
@@ -963,8 +951,7 @@  discard block
 block discarded – undo
963 951
         NULL, 'boinc:ignore-user-add'),
964 952
       'status');
965 953
     drupal_goto();
966
-  }
967
-  else {
954
+  } else {
968 955
     drupal_not_found();
969 956
   }// endif iuid
970 957
 }
@@ -1027,15 +1014,13 @@  discard block
 block discarded – undo
1027 1014
       // Process nested form elements
1028 1015
       $parents[] = $field;
1029 1016
       boincwork_validate_form($rules, $values[$field], $parents);
1030
-    }
1031
-    else {
1017
+    } else {
1032 1018
       if ($parents) {
1033 1019
         // form_set_error() identifies nested form elements with '][' as a
1034 1020
         // delimiter between each parent and child element
1035 1021
         $parents[] = $field;
1036 1022
         $form_field = implode('][', $parents);
1037
-      }
1038
-      else {
1023
+      } else {
1039 1024
         $form_field = $field;
1040 1025
       }
1041 1026
       if (isset($rules['datatype']) AND !boincwork_validate_datatype($values[$field], $rules['datatype'])) {
@@ -1118,8 +1103,7 @@  discard block
 block discarded – undo
1118 1103
   //  load_configuration(): Convert structured text/xml to array
1119 1104
   //------------------------------------------------------------------------------------------------
1120 1105
   
1121
-  function load_configuration($text)
1122
-  {
1106
+  function load_configuration($text) {
1123 1107
       if (preg_match('/^\<\?xml .*\?\>$/i', $text)) return null;
1124 1108
       if ($xml = text_to_xml($text)) return xml_to_array($xml);
1125 1109
       return false;
@@ -1129,8 +1113,7 @@  discard block
 block discarded – undo
1129 1113
   //  save_configuration(): Convert array to structured text/xml
1130 1114
   //------------------------------------------------------------------------------------------------
1131 1115
   
1132
-  function save_configuration($array)
1133
-  {
1116
+  function save_configuration($array) {
1134 1117
       if ($xml = array_to_xml($array)) return xml_to_text($xml, false, true);
1135 1118
       return false;
1136 1119
   }
@@ -1162,26 +1145,22 @@  discard block
 block discarded – undo
1162 1145
               $ordered_array[$item['@position']] = array(
1163 1146
                 $name => $item
1164 1147
               );
1165
-            }
1166
-            else {
1148
+            } else {
1167 1149
               $unordered_array[] = array(
1168 1150
                 $name => $item
1169 1151
               );
1170 1152
             }
1171 1153
           }
1172
-        }
1173
-        elseif (isset($value['@position'])) {
1154
+        } elseif (isset($value['@position'])) {
1174 1155
           $ordered_array[$value['@position']] = array(
1175 1156
             $name => $value
1176 1157
           );
1177
-        }
1178
-        else {
1158
+        } else {
1179 1159
           $unordered_array[] = array(
1180 1160
             $name => $value
1181 1161
           );
1182 1162
         }
1183
-      }
1184
-      else {
1163
+      } else {
1185 1164
         $unordered_array[] = array(
1186 1165
           $name => $value
1187 1166
         );
@@ -1267,8 +1246,7 @@  discard block
 block discarded – undo
1267 1246
   //  xml_to_text(): Convert an XML DOM object to string format
1268 1247
   //------------------------------------------------------------------------------------------------
1269 1248
   
1270
-  function xml_to_text($xml, $include_xml_declaration = true, $add_carriage_returns = false)
1271
-  {
1249
+  function xml_to_text($xml, $include_xml_declaration = true, $add_carriage_returns = false) {
1272 1250
       $xml->formatOutput = true;
1273 1251
       $text = $xml->saveXML();
1274 1252
       if (!$include_xml_declaration) {
@@ -1311,10 +1289,14 @@  discard block
 block discarded – undo
1311 1289
               $sibling = $node->nextSibling;
1312 1290
               
1313 1291
               // Determine if this node forms a set with siblings (share a node name)
1314
-              while (($sibling) AND (($sibling->nodeType != XML_ELEMENT_NODE) OR ($sibling->nodeName != $node->nodeName))) $sibling = $sibling->nextSibling;
1292
+              while (($sibling) AND (($sibling->nodeType != XML_ELEMENT_NODE) OR ($sibling->nodeName != $node->nodeName))) {
1293
+                  $sibling = $sibling->nextSibling;
1294
+              }
1315 1295
               if (!$sibling) {
1316 1296
                   $sibling = $node->previousSibling;
1317
-                  while (($sibling) AND (($sibling->nodeType != XML_ELEMENT_NODE) OR ($sibling->nodeName != $node->nodeName))) $sibling = $sibling->previousSibling;
1297
+                  while (($sibling) AND (($sibling->nodeType != XML_ELEMENT_NODE) OR ($sibling->nodeName != $node->nodeName))) {
1298
+                      $sibling = $sibling->previousSibling;
1299
+                  }
1318 1300
               }
1319 1301
               
1320 1302
               if ($sibling) {
@@ -1409,8 +1391,7 @@  discard block
 block discarded – undo
1409 1391
       . ' computers. Computers will be displayed when they have earned their'
1410 1392
       . ' first credits.', array(), NULL, 'boinc:host-list') . '</p>';
1411 1393
     }
1412
-  }
1413
-  else {
1394
+  } else {
1414 1395
     $output .=  '<h2>' . bts('Computers hidden', array(), NULL, 'boinc:host-list') . '</h2>';
1415 1396
     $output .=  '<p>' . bts('This user has chosen not to show information'
1416 1397
     . ' about their computers.', array(), NULL, 'boinc:host-list') . '</p>';
@@ -1570,8 +1551,7 @@  discard block
 block discarded – undo
1570 1551
     if (!$received_time) {
1571 1552
       if (time() < $deadline) {
1572 1553
         $output = '<span class="on-time">' . $output . '</span>';
1573
-      }
1574
-      else {
1554
+      } else {
1575 1555
         $output = '<span class="past-due">' . $output . '</span>';
1576 1556
       }
1577 1557
     }
@@ -1666,11 +1646,9 @@  discard block
 block discarded – undo
1666 1646
   // Use userid, hostid, or workunitid
1667 1647
   if ($category==0) {
1668 1648
     $sqlall .= " WHERE r.userid='%s' ";
1669
-  }
1670
-  elseif ($category==1) {
1649
+  } elseif ($category==1) {
1671 1650
     $sqlall .= " WHERE r.workunitid='%s' ";
1672
-  }
1673
-  elseif ($category==2) {
1651
+  } elseif ($category==2) {
1674 1652
     $sqlall .= " WHERE r.hostid='%s' ";
1675 1653
   }
1676 1654
   $sqlall .= " ORDER BY user_friendly_name";
@@ -1710,8 +1688,7 @@  discard block
 block discarded – undo
1710 1688
       }// if mystate
1711 1689
 
1712 1690
     }// while
1713
-  }
1714
-  else {
1691
+  } else {
1715 1692
   }
1716 1693
   
1717 1694
   // Entry for all applications.
@@ -1805,11 +1782,9 @@  discard block
 block discarded – undo
1805 1782
   // Use userid, hostid, or workunitid
1806 1783
   if ($category==0) {
1807 1784
     $sqlwhere[] = "r.userid = '%s'";
1808
-  }
1809
-  elseif ($category==1) {
1785
+  } elseif ($category==1) {
1810 1786
     $sqlwhere[] = "r.workunitid = '%s'";
1811
-  }
1812
-  elseif ($category==2) {
1787
+  } elseif ($category==2) {
1813 1788
     $sqlwhere[] = "r.hostid = '%s'";
1814 1789
   }
1815 1790
 
@@ -1837,8 +1812,7 @@  discard block
 block discarded – undo
1837 1812
     $sqlwhere[] = "r.appid = '%s'";
1838 1813
     if ($sqlwhere)  $sqlsub .= " WHERE " . implode(' AND ', $sqlwhere);
1839 1814
     $dbres_sub = pager_query( $sqlsub . tablesort_sql($resultheader), $tablerows, 0, NULL, $queryid, $app_id);
1840
-  }
1841
-  else {
1815
+  } else {
1842 1816
     if ($sqlwhere)  $sqlsub .= " WHERE " . implode(' AND ', $sqlwhere);
1843 1817
     $dbres_sub = pager_query( $sqlsub . tablesort_sql($resultheader), $tablerows, 0, NULL, $queryid);
1844 1818
   }
@@ -1873,19 +1847,16 @@  discard block
 block discarded – undo
1873 1847
         $resultdata[] = array_values($prettyresult);
1874 1848
       }
1875 1849
     }// while
1876
-  }
1877
-  else {
1850
+  } else {
1878 1851
   }
1879 1852
   // Begin result navigation
1880 1853
 
1881 1854
   // Set pathprefix based on type
1882 1855
   if ($category==0) {
1883 1856
     $pathprefix = 'account/tasks';
1884
-  }
1885
-  elseif ($category==1) {
1857
+  } elseif ($category==1) {
1886 1858
     $pathprefix = 'workunit/' . $queryid . '/tasks';
1887
-  }
1888
-  elseif ($category==2) {
1859
+  } elseif ($category==2) {
1889 1860
     $pathprefix = 'host/' . $queryid . '/tasks';
1890 1861
   }
1891 1862
   // Need an "All" tab as well, maps to app_id of zero.
@@ -1895,8 +1866,7 @@  discard block
 block discarded – undo
1895 1866
     $mypath = $pathprefix . '/' . $state . '/' . $app_id;
1896 1867
     if ($state==STATE_ALL) {
1897 1868
       $ltext = '<span class="tab task-app-name">' . bts('All', array(), NULL, 'boinc:task-table') . ' (' . $numstates . ')</span>';
1898
-    }
1899
-    else {
1869
+    } else {
1900 1870
       $ltext = '<span class="tab">' . bts($state_hnames[$state], array(), NULL, 'boinc:task-table') . ' (' . $numstates . ')</span>';
1901 1871
     }
1902 1872
     $myitem = array(
@@ -1984,8 +1954,7 @@  discard block
 block discarded – undo
1984 1954
       // that is not handled by the above case statements.
1985 1955
       if ($appverid < 0) {
1986 1956
         return "Unknown Anonymous platform";
1987
-      }
1988
-      else {
1957
+      } else {
1989 1958
         $prettyv = sprintf("%d.%02d", $vernum/100, $vernum%100);
1990 1959
         $prettyc = ($plan_class) ? "($av->plan_class)" : '';
1991 1960
         return "v$prettyv $prettyc $plfm";
Please login to merge, or discard this patch.
Indentation   +863 added lines, -863 removed lines patch added patch discarded remove patch
@@ -11,19 +11,19 @@  discard block
 block discarded – undo
11 11
  * that was selected
12 12
  */
13 13
 function boincwork_ahah_helper_venue_submit($form, &$form_state) {
14
-  $form_state['storage']['prefs']['preset'] = null;
15
-  ahah_helper_generic_submit($form, $form_state);
14
+    $form_state['storage']['prefs']['preset'] = null;
15
+    ahah_helper_generic_submit($form, $form_state);
16 16
 }
17 17
 
18 18
 /**
19 19
  * Get a predetermined set of preferences
20 20
  */
21 21
 function boincwork_get_preset_prefs($preset = null) {
22
-  $saved_state = variable_get('boincwork_preset_prefs', null);
22
+    $saved_state = variable_get('boincwork_preset_prefs', null);
23 23
   
24
-  // If not configured yet, use these values as for inital
25
-  // computing/general preferences.
26
-  if (!$saved_state) {
24
+    // If not configured yet, use these values as for inital
25
+    // computing/general preferences.
26
+    if (!$saved_state) {
27 27
     // Get BOINC project disk space configurations from config.xml to
28 28
     // fill in initial preference values.
29 29
     require_boinc(array('db', 'prefs'));
@@ -160,88 +160,88 @@  discard block
 block discarded – undo
160 160
           <dont_verify_images>0</dont_verify_images>
161 161
         </preset>
162 162
       </general_preferences>';
163
-  }
163
+    }
164 164
   
165
-  // Convert XML data to array format
166
-  $preset_prefs = load_configuration($saved_state);
165
+    // Convert XML data to array format
166
+    $preset_prefs = load_configuration($saved_state);
167 167
   
168
-  if ($preset) {
168
+    if ($preset) {
169 169
     // Load preset from configuration
170 170
     $preset_prefs = (array) $preset_prefs['general_preferences'];
171 171
     if (isset($preset_prefs['preset'])) {
172
-      if (!is_numeric(key($preset_prefs['preset']))) {
172
+        if (!is_numeric(key($preset_prefs['preset']))) {
173 173
         $preset_prefs['preset'] = array($preset_prefs['preset']);
174
-      }
175
-      foreach ($preset_prefs['preset'] as $key => $prefs) {
174
+        }
175
+        foreach ($preset_prefs['preset'] as $key => $prefs) {
176 176
         if (isset($prefs['@attributes']['name']) AND $prefs['@attributes']['name'] == $preset) {
177
-          return $preset_prefs['preset'][$key];
177
+            return $preset_prefs['preset'][$key];
178
+        }
178 179
         }
179
-      }
180 180
     }
181
-  }
182
-  return $preset_prefs;
181
+    }
182
+    return $preset_prefs;
183 183
 }
184 184
 
185 185
 /**
186 186
  * Load (and validate) the project specific configuration XML
187 187
  */
188 188
 function boincwork_get_project_specific_config() {
189
-  $raw_config_data = variable_get('boinc_project_specific_prefs_config', '');
189
+    $raw_config_data = variable_get('boinc_project_specific_prefs_config', '');
190 190
   
191
-  $xsd = './' . drupal_get_path('module', 'boincwork') . '/includes/projectprefs.xsd';
192
-  libxml_use_internal_errors(true);
191
+    $xsd = './' . drupal_get_path('module', 'boincwork') . '/includes/projectprefs.xsd';
192
+    libxml_use_internal_errors(true);
193 193
   
194
-  $xml = new DomDocument();
195
-  $xml->loadXML($raw_config_data, LIBXML_NOBLANKS);
196
-  if (!$xml->schemaValidate($xsd)) {
194
+    $xml = new DomDocument();
195
+    $xml->loadXML($raw_config_data, LIBXML_NOBLANKS);
196
+    if (!$xml->schemaValidate($xsd)) {
197 197
     $errors = libxml_get_errors();
198 198
     $lines = explode("\r", $raw_config_data);
199 199
     drupal_set_message("{$errors[0]->message} at line {$errors[0]->line}" .
200
-      ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), 'error');
200
+        ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), 'error');
201 201
     return NULL;
202
-  }
202
+    }
203 203
   
204
-  // Convert XML to array for validation
205
-  $xml = load_configuration($raw_config_data);
206
-  return $xml;
204
+    // Convert XML to array for validation
205
+    $xml = load_configuration($raw_config_data);
206
+    return $xml;
207 207
 }
208 208
 
209 209
 /**
210 210
  * Get rules by which to validate project specific data
211 211
  */
212 212
 function boincwork_get_project_specific_config_validation_rules($xml = array()) {
213
-  $rules = array();
214
-  if (!$xml) {
213
+    $rules = array();
214
+    if (!$xml) {
215 215
     // Read the config XML
216 216
     $xml = boincwork_get_project_specific_config();
217 217
     $xml = $xml['project_specific_preferences'];
218
-  }
219
-  foreach ($xml as $type => $elements) {
218
+    }
219
+    foreach ($xml as $type => $elements) {
220 220
     if (is_array($elements) AND !is_numeric(key($elements))) {
221
-      $elements = array($elements);
221
+        $elements = array($elements);
222 222
     }
223 223
     switch ($type) {
224 224
     case 'compound':
225 225
       foreach ($elements as $element) {
226 226
         $name = $element['@attributes']['name'];
227 227
         $rules[$name] = boincwork_get_project_specific_config_validation_rules($element['attributes']);
228
-      }
229
-      break;
228
+        }
229
+        break;
230 230
       
231 231
     case 'text':
232 232
       foreach ($elements as $element) {
233 233
         $name = $element['@attributes']['name'];
234 234
         $rules[$name] = array(
235
-          'datatype' => $element['@attributes']['datatype']
235
+            'datatype' => $element['@attributes']['datatype']
236 236
         );
237 237
         if (isset($element['@attributes']['min'])) {
238
-          $rules[$name]['min'] = $element['@attributes']['min'];
238
+            $rules[$name]['min'] = $element['@attributes']['min'];
239 239
         }
240 240
         if (isset($element['@attributes']['max'])) {
241
-          $rules[$name]['max'] = $element['@attributes']['max'];
241
+            $rules[$name]['max'] = $element['@attributes']['max'];
242 242
         }
243
-      }
244
-      break;
243
+        }
244
+        break;
245 245
     /*
246 246
     case 'radio':
247 247
     case 'dropdown':
@@ -265,24 +265,24 @@  discard block
 block discarded – undo
265 265
       $rules['apps'] = array(
266 266
         'minimum selected' => 1,
267 267
         'list' => array()
268
-      );
269
-      foreach ($elements as $element) {
268
+        );
269
+        foreach ($elements as $element) {
270 270
         foreach ($element['app'] as $app) {
271
-          $name = "app_{$app['@attributes']['id']}";
272
-          $rules['apps']['list'][] = $name;
273
-          //$rules[$name] = array(
274
-          //  'options' => $options
275
-          //);
271
+            $name = "app_{$app['@attributes']['id']}";
272
+            $rules['apps']['list'][] = $name;
273
+            //$rules[$name] = array(
274
+            //  'options' => $options
275
+            //);
276 276
         }
277
-      }
278
-      break;
277
+        }
278
+        break;
279 279
       
280 280
     case 'group':
281 281
       foreach ($elements as $element) {
282 282
         $name = $element['@attributes']['name'];
283 283
         $rules += boincwork_get_project_specific_config_validation_rules($element);
284
-      }
285
-      break;
284
+        }
285
+        break;
286 286
     /*
287 287
     case 'boolean':
288 288
       // Shouldn't need to validate boolean...
@@ -290,39 +290,39 @@  discard block
 block discarded – undo
290 290
       */
291 291
     default:
292 292
     }
293
-  }
294
-  return $rules;
293
+    }
294
+    return $rules;
295 295
 }
296 296
 
297 297
 /**
298 298
  * Define how project specific settings should be saved
299 299
  */
300 300
 function boincwork_format_project_specific_prefs_data($values, $xml = array()) {
301
-  $defaults = array();
302
-  if (!$xml) {
301
+    $defaults = array();
302
+    if (!$xml) {
303 303
     // Read the config XML
304 304
     $xml = boincwork_get_project_specific_config();
305 305
     $xml = $xml['project_specific_preferences'];
306
-  }
307
-  foreach ($xml as $type => $elements) {
306
+    }
307
+    foreach ($xml as $type => $elements) {
308 308
     $structure_data = array();
309 309
     if (is_array($elements) AND !is_numeric(key($elements))) {
310
-      $elements = array($elements);
310
+        $elements = array($elements);
311 311
     }
312 312
     switch ($type) {
313 313
     case 'compound':
314 314
       foreach ($elements as $element) {
315 315
         $name = $element['@attributes']['name'];
316 316
         $default[$name]['@attributes'] = boincwork_format_project_specific_prefs_data($values[$name], $element['attributes']);
317
-      }
318
-      $defaults += $default;
319
-      break;
317
+        }
318
+        $defaults += $default;
319
+        break;
320 320
       
321 321
     case 'group':
322 322
       foreach ($elements as $element) {
323 323
         $defaults += boincwork_format_project_specific_prefs_data($values, $element);
324
-      }
325
-      break;
324
+        }
325
+        break;
326 326
       
327 327
     case 'text':
328 328
     case 'radio':
@@ -331,315 +331,315 @@  discard block
 block discarded – undo
331 331
       foreach ($elements as $element) {
332 332
         $name = $element['@attributes']['name'];
333 333
         if (isset($element['@attributes']['entitytype']) AND $element['@attributes']['entitytype'] == 'attribute') {
334
-          $defaults['@attributes'][$name] = $values[$name];
334
+            $defaults['@attributes'][$name] = $values[$name];
335 335
         }
336 336
         else {
337
-          $defaults[$name] = $values[$name];
337
+            $defaults[$name] = $values[$name];
338 338
         }
339
-      }
340
-      break;
339
+        }
340
+        break;
341 341
     
342 342
     case 'apps':
343 343
       foreach ($elements as $element) {
344 344
         $defaults['app_id'] = array();
345 345
         foreach ($element['app'] as $app) {
346
-          $app_id = $app['@attributes']['id'];
347
-          if ($values['applications']["app_{$app_id}"]) {
346
+            $app_id = $app['@attributes']['id'];
347
+            if ($values['applications']["app_{$app_id}"]) {
348 348
             $defaults['app_id'][] = $app_id;
349
-          }
349
+            }
350 350
         }
351
-      }
352
-      break;
351
+        }
352
+        break;
353 353
       
354 354
     default:
355 355
     }
356
-  }
357
-  return $defaults;
356
+    }
357
+    return $defaults;
358 358
 }
359 359
 
360 360
 /**
361 361
  * Add an element to the form based on its definition
362 362
  */
363 363
 function boincwork_generate_prefs_element(&$form, $type, $elements, $user_prefs = null) {
364
-  switch ($type) {
365
-  case 'text':
364
+    switch ($type) {
365
+    case 'text':
366 366
     if (!is_numeric(key($elements))) {
367
-      $elements = array($elements);
367
+        $elements = array($elements);
368 368
     }
369 369
     foreach ($elements as $element) {
370
-      $name = $element['@attributes']['name'];
371
-      $default = $element['@attributes']['default'];
372
-      $title = is_array($element['title']) ? $element['title']['@value'] : $element['title'];
373
-      $description = '';
374
-      if (isset($element['description'])) {
370
+        $name = $element['@attributes']['name'];
371
+        $default = $element['@attributes']['default'];
372
+        $title = is_array($element['title']) ? $element['title']['@value'] : $element['title'];
373
+        $description = '';
374
+        if (isset($element['description'])) {
375 375
         $description = is_array($element['description']) ? $element['description']['@value'] : $element['description'];
376
-      }
376
+        }
377 377
       
378
-      $value = $default;
379
-      $user_pref = $user_prefs;
380
-      $entitytype = isset($element['@attributes']['entitytype']) ? $element['@attributes']['entitytype'] : 'element';
381
-      if ($entitytype == 'attribute') {
378
+        $value = $default;
379
+        $user_pref = $user_prefs;
380
+        $entitytype = isset($element['@attributes']['entitytype']) ? $element['@attributes']['entitytype'] : 'element';
381
+        if ($entitytype == 'attribute') {
382 382
         $user_pref = $user_prefs['@attributes'];
383
-      }
384
-      if (isset($user_pref[$name])) {
383
+        }
384
+        if (isset($user_pref[$name])) {
385 385
         if (is_array($user_pref[$name]) AND isset($user_pref[$name]['@value'])) {
386
-          $value = $user_pref[$name]['@value'];
386
+            $value = $user_pref[$name]['@value'];
387 387
         }
388 388
         else {
389
-          $value = $user_pref[$name];
389
+            $value = $user_pref[$name];
390
+        }
390 391
         }
391
-      }
392 392
       
393
-      // Use appropriate datatype
394
-      if (isset($element['@attributes']['datatype'])) {
393
+        // Use appropriate datatype
394
+        if (isset($element['@attributes']['datatype'])) {
395 395
         switch($element['@attributes']['datatype']) {
396 396
         case 'integer':
397 397
           $value = (int) $value;
398
-          break;
398
+            break;
399 399
           
400 400
         case 'float':
401 401
           $value = number_format((float) $value, 2);
402
-          break;
402
+            break;
403 403
         
404 404
         default:
405 405
         }
406
-      }
406
+        }
407 407
       
408
-      // Translate elements as appropriate
409
-      if ($title) {
408
+        // Translate elements as appropriate
409
+        if ($title) {
410 410
         i18nstrings_update('project:prefs_xml', _boinctranslate_supertrim($title));
411 411
         $title = i18nstrings('project:prefs_xml', _boinctranslate_supertrim($title));
412
-      }
413
-      if ($description) {
412
+        }
413
+        if ($description) {
414 414
         i18nstrings_update('project:prefs_xml', _boinctranslate_supertrim($description));
415 415
         $description = i18nstrings('project:prefs_xml', _boinctranslate_supertrim($description));
416
-      }
416
+        }
417 417
       
418
-      $form[$name] = array(
418
+        $form[$name] = array(
419 419
         '#title' => $title,
420 420
         '#type' => 'textfield',
421 421
         '#default_value' => $value,
422 422
         '#size' => 5,
423 423
         '#description' => $description . bts(' Default value: @default', array('@default' => $default), NULL, 'boinc:account-preferences-project')
424
-      );
424
+        );
425 425
     }
426 426
     break;
427 427
     
428
-  case 'boolean':
428
+    case 'boolean':
429 429
     if (!is_numeric(key($elements))) {
430
-      $elements = array($elements);
430
+        $elements = array($elements);
431 431
     }
432 432
     foreach ($elements as $element) {
433
-      $name = $element['@attributes']['name'];
434
-      $title = is_array($element['title']) ? $element['title']['@value'] : $element['title'];
435
-      $default = (isset($element['@attributes']['selected']) AND $element['@attributes']['selected'] == 'true') ? 1 : 0;
436
-      $description = '';
437
-      if (isset($element['description'])) {
433
+        $name = $element['@attributes']['name'];
434
+        $title = is_array($element['title']) ? $element['title']['@value'] : $element['title'];
435
+        $default = (isset($element['@attributes']['selected']) AND $element['@attributes']['selected'] == 'true') ? 1 : 0;
436
+        $description = '';
437
+        if (isset($element['description'])) {
438 438
         $description = is_array($element['description']) ? $element['description']['@value'] : $element['description'];
439
-      }
439
+        }
440 440
       
441
-      $value = $default;
442
-      $user_pref = $user_prefs;
443
-      $entitytype = isset($element['@attributes']['entitytype']) ? $element['@attributes']['entitytype'] : 'element';
444
-      if ($entitytype == 'attribute') {
441
+        $value = $default;
442
+        $user_pref = $user_prefs;
443
+        $entitytype = isset($element['@attributes']['entitytype']) ? $element['@attributes']['entitytype'] : 'element';
444
+        if ($entitytype == 'attribute') {
445 445
         $user_pref = $user_prefs['@attributes'];
446
-      }
447
-      if (isset($user_pref[$name])) {
446
+        }
447
+        if (isset($user_pref[$name])) {
448 448
         if (is_array($user_pref[$name]) AND isset($user_pref[$name]['@value'])) {
449
-          $value = $user_pref[$name]['@value'];
449
+            $value = $user_pref[$name]['@value'];
450 450
         }
451 451
         else {
452
-          $value = $user_pref[$name];
452
+            $value = $user_pref[$name];
453
+        }
453 454
         }
454
-      }
455 455
       
456
-      // Translate elements as appropriate
457
-      if ($title) {
456
+        // Translate elements as appropriate
457
+        if ($title) {
458 458
         i18nstrings_update('project:prefs_xml', _boinctranslate_supertrim($title));
459 459
         $title = i18nstrings('project:prefs_xml', _boinctranslate_supertrim($title));
460
-      }
461
-      if ($description) {
460
+        }
461
+        if ($description) {
462 462
         i18nstrings_update('project:prefs_xml', _boinctranslate_supertrim($description));
463 463
         $description = i18nstrings('project:prefs_xml', _boinctranslate_supertrim($description));
464
-      }
464
+        }
465 465
       
466
-      $form[$name] = array(
466
+        $form[$name] = array(
467 467
         '#title' => $title,
468 468
         '#type' => 'radios',
469 469
         '#options' => array(1 => bts('yes', array(), NULL, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-no'), 0 => bts('no', array(), NULL, 'boinc:form-yes-no:-1:binary-form-option-pairs-with-yes')),
470 470
         '#attributes' => array('class' => 'fancy'),
471 471
         '#default_value' => $value,
472 472
         '#description' => $description
473
-      );
473
+        );
474 474
     }
475 475
     break;
476 476
     
477
-  case 'radio':
477
+    case 'radio':
478 478
   case 'dropdown':
479 479
     
480 480
     if (!is_numeric(key($elements))) {
481
-      $elements = array($elements);
481
+        $elements = array($elements);
482 482
     }
483 483
     foreach ($elements as $element) {
484
-      $name = $element['@attributes']['name'];
485
-      $default = null;
486
-      $options = array();
487
-      foreach($element['items']['item'] as $item) {
484
+        $name = $element['@attributes']['name'];
485
+        $default = null;
486
+        $options = array();
487
+        foreach($element['items']['item'] as $item) {
488 488
         if (is_array($item)) {
489
-          $value = $item['@value'];
490
-          if ($default === NULL AND
489
+            $value = $item['@value'];
490
+            if ($default === NULL AND
491 491
               isset($item['@attributes']) AND
492 492
               isset($item['@attributes']['selected'])) {
493 493
             $default = ($item['@attributes']['selected'] == 'true') ? $item['@value'] : null;
494
-          }
494
+            }
495 495
         }
496 496
         else {
497
-          $value = $item;
497
+            $value = $item;
498 498
         }
499 499
         $options[$value] = $value;
500
-      }
501
-      $title = is_array($element['title']) ? $element['title']['@value'] : $element['title'];
502
-      $description = '';
503
-      if (isset($element['description'])) {
500
+        }
501
+        $title = is_array($element['title']) ? $element['title']['@value'] : $element['title'];
502
+        $description = '';
503
+        if (isset($element['description'])) {
504 504
         $description = is_array($element['description']) ? $element['description']['@value'] : $element['description'];
505
-      }
506
-      $user_pref = $user_prefs;
507
-      $entitytype = isset($element['@attributes']['entitytype']) ? $element['@attributes']['entitytype'] : 'element';
508
-      if ($entitytype == 'attribute') {
505
+        }
506
+        $user_pref = $user_prefs;
507
+        $entitytype = isset($element['@attributes']['entitytype']) ? $element['@attributes']['entitytype'] : 'element';
508
+        if ($entitytype == 'attribute') {
509 509
         $user_pref = $user_prefs['@attributes'];
510
-      }
511
-      $value = isset($user_pref[$name]) ? $user_pref[$name] : $default;
510
+        }
511
+        $value = isset($user_pref[$name]) ? $user_pref[$name] : $default;
512 512
       
513
-      // Translate elements as appropriate
514
-      if ($title) {
513
+        // Translate elements as appropriate
514
+        if ($title) {
515 515
         i18nstrings_update('project:prefs_xml', _boinctranslate_supertrim($title));
516 516
         $title = i18nstrings('project:prefs_xml', _boinctranslate_supertrim($title));
517
-      }
518
-      if ($description) {
517
+        }
518
+        if ($description) {
519 519
         i18nstrings_update('project:prefs_xml', _boinctranslate_supertrim($description));
520 520
         $description = i18nstrings('project:prefs_xml', _boinctranslate_supertrim($description));
521
-      }
521
+        }
522 522
       
523
-      $form[$name] = array(
523
+        $form[$name] = array(
524 524
         '#title' => $title,
525 525
         '#type' => ($type == 'radio') ? 'radios' : 'select',
526 526
         '#options' => $options,
527 527
         '#attributes' => array('class' => 'fancy'),
528 528
         '#default_value' => $value,
529 529
         '#description' => $description . bts(' Default value: @default', array('@default' =>$default), NULL, 'boinc:account-preferences-project')
530
-      );
530
+        );
531 531
     }
532 532
     break;
533 533
     
534
-  case 'apps':
534
+    case 'apps':
535 535
     $title = is_array($elements['title']) ? $elements['title']['@value'] : $elements['title'];
536 536
     
537
-      // Translate elements as appropriate
538
-      if ($title) {
537
+        // Translate elements as appropriate
538
+        if ($title) {
539 539
         i18nstrings_update('project:prefs_xml', _boinctranslate_supertrim($title));
540 540
         $title = i18nstrings('project:prefs_xml', _boinctranslate_supertrim($title));
541
-      }
541
+        }
542 542
     
543 543
     $form['applications'] = array(
544
-      '#title' => bts('Applications', array(), NULL, 'boinc:account-preferences'),
545
-      '#type' => 'fieldset',
546
-      '#description' => $title,
547
-      '#collapsible' => TRUE,
548
-      '#collapsed' => FALSE
544
+        '#title' => bts('Applications', array(), NULL, 'boinc:account-preferences'),
545
+        '#type' => 'fieldset',
546
+        '#description' => $title,
547
+        '#collapsible' => TRUE,
548
+        '#collapsed' => FALSE
549 549
     );
550 550
     $applications = array();
551 551
     if (!is_array($user_prefs['app_id'])) {
552
-      $user_prefs['app_id'] = array($user_prefs['app_id']);
552
+        $user_prefs['app_id'] = array($user_prefs['app_id']);
553 553
     }
554 554
     foreach ($user_prefs['app_id'] as $app) {
555
-      if (!$app) continue;
556
-      if (is_array($app) AND isset($app['@value'])) {
555
+        if (!$app) continue;
556
+        if (is_array($app) AND isset($app['@value'])) {
557 557
         $app = $app['@value'];
558
-      }
559
-      $applications[] = $app;
558
+        }
559
+        $applications[] = $app;
560 560
     }
561 561
     foreach ($elements['app'] as $app) {
562
-      $app_id = $app['@attributes']['id'];
563
-      $app_name = $app['@value'];
564
-      $app_enabled = TRUE;
565
-      if (isset($app['@attributes']['enabled']) AND
562
+        $app_id = $app['@attributes']['id'];
563
+        $app_name = $app['@value'];
564
+        $app_enabled = TRUE;
565
+        if (isset($app['@attributes']['enabled']) AND
566 566
           $app['@attributes']['enabled'] == 'false') {
567 567
         $app_enabled = FALSE;
568
-      }
569
-      if ($applications) {
568
+        }
569
+        if ($applications) {
570 570
         $checked = in_array($app_id, $applications);
571
-      } else {
571
+        } else {
572 572
         $checked = TRUE;
573 573
         if (isset($app['@attributes']['selected']) AND
574 574
             $app['@attributes']['selected'] == 'false') {
575
-          $checked = FALSE;
575
+            $checked = FALSE;
576 576
         }
577
-      }
578
-      $form['applications']["app_{$app_id}"] = array(
577
+        }
578
+        $form['applications']["app_{$app_id}"] = array(
579 579
         '#title' => $app_name,
580 580
         '#type' => 'checkbox',
581 581
         '#default_value' => ($checked) ? 'x' : false,
582 582
         '#disabled' => !$app_enabled
583
-      );
583
+        );
584 584
     }
585 585
     
586 586
     break;
587 587
     
588
-  case 'group':
588
+    case 'group':
589 589
     if (!is_numeric(key($elements))) {
590
-      $elements = array($elements);
590
+        $elements = array($elements);
591 591
     }
592 592
     foreach ($elements as $key => $element) {
593
-      $title = is_array($element['title']) ? $element['title']['@value'] : $element['title'];
594
-      $name = str_replace(' ','_',strtolower($title));
595
-      $name = "group_{$name}";
593
+        $title = is_array($element['title']) ? $element['title']['@value'] : $element['title'];
594
+        $name = str_replace(' ','_',strtolower($title));
595
+        $name = "group_{$name}";
596 596
       
597
-      // Translate elements as appropriate
598
-      if ($title) {
597
+        // Translate elements as appropriate
598
+        if ($title) {
599 599
         i18nstrings_update('project:prefs_xml', _boinctranslate_supertrim($title));
600 600
         $title = i18nstrings('project:prefs_xml', _boinctranslate_supertrim($title));
601
-      }
601
+        }
602 602
       
603
-      $form[$name] = array(
604
-          '#title' => $title,
605
-          '#type' => 'fieldset',
606
-          '#tree' => FALSE,
607
-          //'#description' => t('Notes about this group of fields'),
608
-          '#collapsible' => TRUE,
609
-          '#collapsed' => FALSE
610
-      );
611
-      // Recursively populate the compound element
612
-      foreach ($element as $child_type => $child) {
603
+        $form[$name] = array(
604
+            '#title' => $title,
605
+            '#type' => 'fieldset',
606
+            '#tree' => FALSE,
607
+            //'#description' => t('Notes about this group of fields'),
608
+            '#collapsible' => TRUE,
609
+            '#collapsed' => FALSE
610
+        );
611
+        // Recursively populate the compound element
612
+        foreach ($element as $child_type => $child) {
613 613
         boincwork_generate_prefs_element($form[$name], $child_type, $child, $user_prefs);
614
-      }
614
+        }
615 615
     }
616 616
     break;
617 617
     
618
-  case 'compound':
618
+    case 'compound':
619 619
     if (!is_numeric(key($elements))) {
620
-      $elements = array($elements);
620
+        $elements = array($elements);
621 621
     }
622 622
     foreach ($elements as $element) {
623
-      $name = $element['@attributes']['name'];
624
-      $title = is_array($element['title']) ? $element['title']['@value'] : $element['title'];
623
+        $name = $element['@attributes']['name'];
624
+        $title = is_array($element['title']) ? $element['title']['@value'] : $element['title'];
625 625
       
626
-      // Translate elements as appropriate
627
-      if ($title) {
626
+        // Translate elements as appropriate
627
+        if ($title) {
628 628
         i18nstrings_update('project:prefs_xml', _boinctranslate_supertrim($title));
629 629
         $title = i18nstrings('project:prefs_xml', _boinctranslate_supertrim($title));
630
-      }
630
+        }
631 631
       
632
-      $form[$name] = array(
633
-          '#title' => $title,
634
-          '#type' => 'fieldset',
635
-          //'#description' => t('Notes about this group of fields'),
636
-          '#collapsible' => TRUE,
637
-          '#collapsed' => FALSE
638
-      );
639
-      // Recursively populate the compound element
640
-      foreach ($element['attributes'] as $child_type => $child) {
632
+        $form[$name] = array(
633
+            '#title' => $title,
634
+            '#type' => 'fieldset',
635
+            //'#description' => t('Notes about this group of fields'),
636
+            '#collapsible' => TRUE,
637
+            '#collapsed' => FALSE
638
+        );
639
+        // Recursively populate the compound element
640
+        foreach ($element['attributes'] as $child_type => $child) {
641 641
         boincwork_generate_prefs_element($form[$name], $child_type, $child, $user_prefs[$name]['@attributes']);
642
-      }
642
+        }
643 643
     }
644 644
     break;
645 645
     
@@ -655,24 +655,24 @@  discard block
 block discarded – undo
655 655
  */
656 656
 function boincwork_make_prefs_table($prefs, $top_level = TRUE) {
657 657
 
658
-  $prefs_table = array();
659
-  $uncategorized = array();
658
+    $prefs_table = array();
659
+    $uncategorized = array();
660 660
   
661
-  // Parse the project preferences form
662
-  foreach ($prefs as $key => $element) {
661
+    // Parse the project preferences form
662
+    foreach ($prefs as $key => $element) {
663 663
     
664 664
     // Determine which type of element this is and act accordingly
665 665
     $element_type = NULL;
666 666
     if (is_array($element) AND isset($element['#type'])) {
667
-      $element_type = $element['#type'];
667
+        $element_type = $element['#type'];
668 668
     }
669 669
     switch ($element_type) {
670 670
     case 'fieldset':
671 671
       $prefs_table[$key] = array(
672 672
         'name' => $element['#title'],
673 673
         'elements' => boincwork_make_prefs_table($element, FALSE),
674
-      );
675
-      break;
674
+        );
675
+        break;
676 676
     case 'textfield':
677 677
     case 'radios':
678 678
     case 'checkbox':
@@ -682,45 +682,45 @@  discard block
 block discarded – undo
682 682
         switch ($key) {
683 683
         case 'start_hour':
684 684
           $element['#title'] = bts('Compute only between:', array(), NULL, 'boinc:account-preferences-computing');
685
-          break;
685
+            break;
686 686
         case 'net_start_hour':
687 687
           $element['#title'] = bts('Transfer files only between:', array(), NULL, 'boinc:account-preferences-comuting');
688
-          break;
688
+            break;
689 689
         default:
690 690
         }
691
-      }
692
-      $prefs_element = array(
691
+        }
692
+        $prefs_element = array(
693 693
         'name' => (isset($element['#title'])) ? $element['#title'] : '',
694 694
         'description' => (isset($element['#description'])) ? $element['#description'] : '',
695 695
         'default_value' => (isset($element['#default_value'])) ? $element['#default_value'] : NULL,
696
-      );
697
-      if ($top_level) {
696
+        );
697
+        if ($top_level) {
698 698
         $uncategorized[$key] = $prefs_element;
699
-      }
700
-      else {
699
+        }
700
+        else {
701 701
         $prefs_table[$key] = $prefs_element;
702
-      }
703
-      break;
702
+        }
703
+        break;
704 704
     default:
705 705
     }
706
-  }
706
+    }
707 707
   
708
-  if ($prefs_table AND $uncategorized) {
708
+    if ($prefs_table AND $uncategorized) {
709 709
     // Throw any settings that don't fit elsewhere into "other"
710 710
     $prefs_table['other'] = array(
711
-      'name' => bts('Other settings', array(), NULL, 'boinc:account-preferences'),
712
-      'elements' => $uncategorized,
711
+        'name' => bts('Other settings', array(), NULL, 'boinc:account-preferences'),
712
+        'elements' => $uncategorized,
713 713
     );
714
-  }
715
-  elseif ($uncategorized) {
714
+    }
715
+    elseif ($uncategorized) {
716 716
     // If nothing is categorized, output all prefs under a general "settings"
717 717
     $prefs_table['settings'] = array(
718
-      'name' => bts('Settings', array(), NULL, 'boinc:account-preferences'),
719
-      'elements' => $uncategorized,
718
+        'name' => bts('Settings', array(), NULL, 'boinc:account-preferences'),
719
+        'elements' => $uncategorized,
720 720
     );
721
-  }
721
+    }
722 722
   
723
-  return $prefs_table;
723
+    return $prefs_table;
724 724
 }
725 725
  
726 726
 /**
@@ -728,33 +728,33 @@  discard block
 block discarded – undo
728 728
  */
729 729
 function boincwork_load_prefs($type = 'general', $venue = null, $account = null) {
730 730
   
731
-  require_boinc(array('user'));
731
+    require_boinc(array('user'));
732 732
   
733
-  // Load the BOINC user object
734
-  if (!$account) {
733
+    // Load the BOINC user object
734
+    if (!$account) {
735 735
     global $user;
736 736
     $account = $user;
737
-  }
738
-  $account = user_load($account->uid);
739
-  $boincuser = BoincUser::lookup_id($account->boincuser_id);
737
+    }
738
+    $account = user_load($account->uid);
739
+    $boincuser = BoincUser::lookup_id($account->boincuser_id);
740 740
   
741
-  // Load the desired preferences for the user
742
-  $main_prefs = array();
743
-  if ($type == 'project') {
741
+    // Load the desired preferences for the user
742
+    $main_prefs = array();
743
+    if ($type == 'project') {
744 744
     if ($boincuser->project_prefs) {
745
-      $main_prefs = load_configuration($boincuser->project_prefs);
746
-      $main_prefs = (array) $main_prefs['project_preferences'];
745
+        $main_prefs = load_configuration($boincuser->project_prefs);
746
+        $main_prefs = (array) $main_prefs['project_preferences'];
747 747
     }
748
-  }
749
-  else {
748
+    }
749
+    else {
750 750
     if ($boincuser->global_prefs) {
751
-      $main_prefs = load_configuration($boincuser->global_prefs);
752
-      $main_prefs = (array) $main_prefs['global_preferences'];
751
+        $main_prefs = load_configuration($boincuser->global_prefs);
752
+        $main_prefs = (array) $main_prefs['global_preferences'];
753
+    }
753 754
     }
754
-  }
755 755
   
756
-  // Return general preferences or a subset based on venue
757
-  if (!$venue OR $venue == 'generic') {
756
+    // Return general preferences or a subset based on venue
757
+    if (!$venue OR $venue == 'generic') {
758 758
     unset($main_prefs['venue']);
759 759
     // Use the length of the $main_prefs array as a condition as to
760 760
     // whether the preferences have already been set. This is
@@ -762,23 +762,23 @@  discard block
 block discarded – undo
762 762
     if (count($main_prefs) < 3)
763 763
         $main_prefs['@attributes'] = array('cleared' => 1);
764 764
     return $main_prefs;
765
-  }
766
-  else {
765
+    }
766
+    else {
767 767
     if (isset($main_prefs['venue'])) {
768
-      if (!is_numeric(key($main_prefs['venue']))) {
768
+        if (!is_numeric(key($main_prefs['venue']))) {
769 769
         $main_prefs['venue'] = array($main_prefs['venue']);
770
-      }
771
-      foreach ($main_prefs['venue'] as $key => $prefs_venue) {
770
+        }
771
+        foreach ($main_prefs['venue'] as $key => $prefs_venue) {
772 772
         if (isset($prefs_venue['@attributes']['name']) AND $prefs_venue['@attributes']['name'] == $venue) {
773
-          return $main_prefs['venue'][$key];
773
+            return $main_prefs['venue'][$key];
774
+        }
774 775
         }
775
-      }
776 776
     }
777
-  }
777
+    }
778 778
 
779
-  return array(
779
+    return array(
780 780
     '@attributes' => array('name' => $venue, 'cleared' => 1)
781
-  );
781
+    );
782 782
 }
783 783
 
784 784
 /**
@@ -786,104 +786,104 @@  discard block
 block discarded – undo
786 786
  */
787 787
 function boincwork_save_prefs($prefs, $type = 'general', $venue = null, $account = null) {
788 788
   
789
-  require_boinc(array('user'));
789
+    require_boinc(array('user'));
790 790
   
791
-  // Load existing project prefs from the BOINC user object
792
-  if (!$account) {
791
+    // Load existing project prefs from the BOINC user object
792
+    if (!$account) {
793 793
     global $user;
794 794
     $account = $user;
795
-  }
796
-  $account = user_load($account->uid);
797
-  $boincuser = BoincUser::lookup_id($account->boincuser_id);
795
+    }
796
+    $account = user_load($account->uid);
797
+    $boincuser = BoincUser::lookup_id($account->boincuser_id);
798 798
   
799
-  // Load the specified preferences for the user
800
-  $main_prefs = array();
801
-  if ($type == 'project') {
799
+    // Load the specified preferences for the user
800
+    $main_prefs = array();
801
+    if ($type == 'project') {
802 802
     if ($boincuser->project_prefs) {
803
-      $main_prefs = load_configuration($boincuser->project_prefs);
804
-      $main_prefs = (array) $main_prefs['project_preferences'];
803
+        $main_prefs = load_configuration($boincuser->project_prefs);
804
+        $main_prefs = (array) $main_prefs['project_preferences'];
805 805
     }
806
-  }
807
-  else {
806
+    }
807
+    else {
808 808
     if ($boincuser->global_prefs) {
809
-      $main_prefs = load_configuration($boincuser->global_prefs);
810
-      $main_prefs = (array) $main_prefs['global_preferences'];
809
+        $main_prefs = load_configuration($boincuser->global_prefs);
810
+        $main_prefs = (array) $main_prefs['global_preferences'];
811
+    }
811 812
     }
812
-  }
813 813
   
814
-  // Save all preferences or a subset based on venue
815
-  //drupal_set_message('<pre>' . print_r($main_prefs, true) . '</pre>');
816
-  $new_venue = true;
817
-  if (!$venue OR $venue == 'generic') {
814
+    // Save all preferences or a subset based on venue
815
+    //drupal_set_message('<pre>' . print_r($main_prefs, true) . '</pre>');
816
+    $new_venue = true;
817
+    if (!$venue OR $venue == 'generic') {
818 818
     //$main_prefs = $prefs;
819 819
     $main_prefs = $prefs + $main_prefs;
820
-  }
821
-  else {
820
+    }
821
+    else {
822 822
     if (isset($main_prefs['venue'])) {
823
-      if (!is_numeric(key($main_prefs['venue']))) {
823
+        if (!is_numeric(key($main_prefs['venue']))) {
824 824
         $main_prefs['venue'] = array($main_prefs['venue']);
825
-      }
826
-      foreach ($main_prefs['venue'] as $key => $prefs_venue) {
825
+        }
826
+        foreach ($main_prefs['venue'] as $key => $prefs_venue) {
827 827
         if (isset($prefs_venue['@attributes']['name']) AND $prefs_venue['@attributes']['name'] == $venue) {
828
-          if ($prefs) {
828
+            if ($prefs) {
829 829
             $main_prefs['venue'][$key] = $prefs;
830
-          }
831
-          else {
830
+            }
831
+            else {
832 832
             // If prefs is null, clear out this preference set
833 833
             unset($main_prefs['venue'][$key]);
834 834
             if (count($main_prefs['venue']) == 0) {
835
-              // If that was the only preference set configured, unset the
836
-              // venue tag altogether
837
-              unset($main_prefs['venue']);
835
+                // If that was the only preference set configured, unset the
836
+                // venue tag altogether
837
+                unset($main_prefs['venue']);
838 838
             }
839
-          }
840
-          $new_venue = false;
841
-          break;
839
+            }
840
+            $new_venue = false;
841
+            break;
842
+        }
842 843
         }
843
-      }
844 844
     }
845 845
     if ($new_venue) {
846
-      $main_prefs['venue'][] = $prefs;
846
+        $main_prefs['venue'][] = $prefs;
847
+    }
847 848
     }
848
-  }
849 849
 
850
-  // Set modified time
851
-  if ($type == 'project') {
850
+    // Set modified time
851
+    if ($type == 'project') {
852 852
     if (!isset($main_prefs['modified'])) {
853
-      $main_prefs = array_merge(array('modified' => 0), $main_prefs);
853
+        $main_prefs = array_merge(array('modified' => 0), $main_prefs);
854 854
     }
855 855
     $main_prefs['modified'] = time();
856
-  } else {
856
+    } else {
857 857
     if (!isset($main_prefs['mod_time'])) {
858
-      $main_prefs = array_merge(array('mod_time' => 0), $main_prefs);
858
+        $main_prefs = array_merge(array('mod_time' => 0), $main_prefs);
859 859
     }
860 860
     $main_prefs['mod_time'] = time();
861 861
     // unset source information, the Client will fill this in again
862 862
     if (isset($main_prefs['source_project'])) {
863
-      unset($main_prefs['source_project']);
863
+        unset($main_prefs['source_project']);
864 864
     }
865 865
     if (isset($main_prefs['source_scheduler'])) {
866
-      unset($main_prefs['source_scheduler']);
866
+        unset($main_prefs['source_scheduler']);
867
+    }
867 868
     }
868
-  }
869 869
 
870
-  // Convert prefs back to XML and save to database
871
-  $result = null;
872
-  if ($type == 'project') {
870
+    // Convert prefs back to XML and save to database
871
+    $result = null;
872
+    if ($type == 'project') {
873 873
     $main_prefs = array('project_preferences' => $main_prefs);
874 874
     $boincuser->project_prefs = save_configuration($main_prefs);
875 875
     db_set_active('boinc_rw');
876 876
     $result = db_query("UPDATE user SET project_prefs = '{$boincuser->project_prefs}' WHERE id = '{$boincuser->id}'");
877 877
     db_set_active('default');
878
-  }
879
-  else {
878
+    }
879
+    else {
880 880
     $main_prefs = array('global_preferences' => $main_prefs);
881 881
     $boincuser->global_prefs = save_configuration($main_prefs);
882 882
     db_set_active('boinc_rw');
883 883
     $result = db_query("UPDATE user SET global_prefs = '{$boincuser->global_prefs}' WHERE id = '{$boincuser->id}'");
884 884
     db_set_active('default');
885
-  }
886
-  return $result;
885
+    }
886
+    return $result;
887 887
 }
888 888
 
889 889
 
@@ -900,9 +900,9 @@  discard block
 block discarded – undo
900 900
  *username. Called from privacy preference form.
901 901
  */
902 902
 function boincwork_ignore_user_add_user_username($name = NULL) {
903
-  global $user;
903
+    global $user;
904 904
 
905
-  if (isset($name)) {
905
+    if (isset($name)) {
906 906
     // Get the BOINC ID from the name string, and lookup the
907 907
     // corresponding drupal user.
908 908
     $boincname = substr($name, 0, strrpos($name, '_'));
@@ -911,84 +911,84 @@  discard block
 block discarded – undo
911 911
     $iuid = get_drupal_id($boincid);
912 912
 
913 913
     if ($user->uid == $iuid) {
914
-      drupal_set_message(bts('You can\'t add yourself to your own ignore list.', array(), NULL, 'boinc:ignore-user-error-message'), 'error');
915
-      drupal_goto('account/prefs/privacy');
914
+        drupal_set_message(bts('You can\'t add yourself to your own ignore list.', array(), NULL, 'boinc:ignore-user-error-message'), 'error');
915
+        drupal_goto('account/prefs/privacy');
916 916
     }
917 917
 
918 918
     if (is_numeric($iuid) && $iuid > 0) {
919
-      if (!db_result(db_query('SELECT COUNT(iuid) FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $iuid))) {
919
+        if (!db_result(db_query('SELECT COUNT(iuid) FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $iuid))) {
920 920
         db_query('INSERT INTO {ignore_user} (uid, iuid) VALUES (%d, %d)', $user->uid, $iuid);
921
-      }// endif db_result
921
+        }// endif db_result
922 922
 
923
-      if (module_exists('pm_block_user')) {
923
+        if (module_exists('pm_block_user')) {
924 924
         if (!db_result(db_query('SELECT COUNT(recipient) FROM {pm_block_user} WHERE author = %d AND recipient = %d', $iuid, $user->uid))) {
925
-          db_query('INSERT INTO {pm_block_user} (author, recipient) VALUES (%d, %d)', $iuid, $user->uid);
925
+            db_query('INSERT INTO {pm_block_user} (author, recipient) VALUES (%d, %d)', $iuid, $user->uid);
926 926
         }// endif db_result
927
-      }// endif module_exists('pm_block_user')
927
+        }// endif module_exists('pm_block_user')
928 928
 
929 929
     }// endif $iuid
930
-  }
930
+    }
931 931
 }
932 932
 
933 933
 /**
934 934
  * Add another user's UID to the current user's ignore list.
935 935
  */
936 936
 function boincwork_ignore_user_add_user($iuid = NULL) {
937
-  global $user;
937
+    global $user;
938 938
 
939
-  if ($user->uid == $iuid) {
939
+    if ($user->uid == $iuid) {
940 940
     drupal_set_message(bts('You can\'t add yourself to your own ignore list.', array(), NULL, 'boinc:ignore-user-error-message'), 'error');
941 941
     drupal_goto();
942
-  }
942
+    }
943 943
 
944
-  $otheraccount = user_load($iuid);
944
+    $otheraccount = user_load($iuid);
945 945
 
946
-  if (is_numeric($iuid) && $iuid > 0) {
946
+    if (is_numeric($iuid) && $iuid > 0) {
947 947
     if (!db_result(db_query('SELECT COUNT(iuid) FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $iuid))) {
948
-      db_query('INSERT INTO {ignore_user} (uid, iuid) VALUES (%d, %d)', $user->uid, $iuid);
948
+        db_query('INSERT INTO {ignore_user} (uid, iuid) VALUES (%d, %d)', $user->uid, $iuid);
949 949
     }// endif db_result
950 950
 
951 951
     if (module_exists('pm_block_user')) {
952
-      if (!db_result(db_query('SELECT COUNT(recipient) FROM {pm_block_user} WHERE author = %d AND recipient = %d', $iuid, $user->uid))) {
952
+        if (!db_result(db_query('SELECT COUNT(recipient) FROM {pm_block_user} WHERE author = %d AND recipient = %d', $iuid, $user->uid))) {
953 953
         db_query('INSERT INTO {pm_block_user} (author, recipient) VALUES (%d, %d)', $iuid, $user->uid);
954
-      }// endif db_result
954
+        }// endif db_result
955 955
     }// endif module_exists('pm_block_user')
956 956
 
957 957
     drupal_set_message(
958
-      bts('@username has been added to your ignore list. See your !privacy_preferences for more details.',
958
+        bts('@username has been added to your ignore list. See your !privacy_preferences for more details.',
959 959
         array(
960
-          '@username' => $otheraccount->boincuser_name,
961
-          '!privacy_preferences' => l(bts('privacy preferences', array(), NULL, 'boinc:ignore-user-add'), 'account/prefs/privacy'),
960
+            '@username' => $otheraccount->boincuser_name,
961
+            '!privacy_preferences' => l(bts('privacy preferences', array(), NULL, 'boinc:ignore-user-add'), 'account/prefs/privacy'),
962 962
         ),
963 963
         NULL, 'boinc:ignore-user-add'),
964
-      'status');
964
+        'status');
965 965
     drupal_goto();
966
-  }
967
-  else {
966
+    }
967
+    else {
968 968
     drupal_not_found();
969
-  }// endif iuid
969
+    }// endif iuid
970 970
 }
971 971
 
972 972
 /**
973 973
  * Remove user from user's ignore list.
974 974
  */
975 975
 function boincwork_ignore_user_remove_user($iuid = NULL) {
976
-  global $user;
977
-  $otheraccount = user_load($iuid);
976
+    global $user;
977
+    $otheraccount = user_load($iuid);
978 978
 
979
-  db_query('DELETE FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $iuid);
980
-  if (module_exists('pm_block_user')) {
979
+    db_query('DELETE FROM {ignore_user} WHERE uid = %d AND iuid = %d', $user->uid, $iuid);
980
+    if (module_exists('pm_block_user')) {
981 981
     db_query('DELETE FROM {pm_block_user} WHERE author = %d AND recipient = %d', $iuid, $user->uid);
982
-  }// endif module_exists
983
-  drupal_set_message(
982
+    }// endif module_exists
983
+    drupal_set_message(
984 984
     bts('@username has been removed from your ignore list. See your !privacy_preferences for more details.',
985
-      array(
985
+        array(
986 986
         '@username' => $otheraccount->boincuser_name,
987 987
         '!privacy_preferences' => l(bts('privacy preferences', array(), NULL, 'boinc:ignore-user-add'), 'account/prefs/privacy'),
988
-      ),
989
-      NULL, 'boinc:ignore-user-add'),
988
+        ),
989
+        NULL, 'boinc:ignore-user-add'),
990 990
     'status');
991
-  drupal_goto('account/prefs/privacy');
991
+    drupal_goto('account/prefs/privacy');
992 992
 }
993 993
 
994 994
 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
@@ -1002,18 +1002,18 @@  discard block
 block discarded – undo
1002 1002
  */
1003 1003
 function boincwork_load_privacyconsenttypes() {
1004 1004
 
1005
-  db_set_active('boinc_rw');
1006
-  $db_result = db_query("SELECT id,shortname,description FROM consent_type WHERE enabled=1 AND privacypref=1 ORDER by project_specific ASC");
1007
-  db_set_active('drupal');
1005
+    db_set_active('boinc_rw');
1006
+    $db_result = db_query("SELECT id,shortname,description FROM consent_type WHERE enabled=1 AND privacypref=1 ORDER by project_specific ASC");
1007
+    db_set_active('drupal');
1008 1008
 
1009
-  if ($db_result) {
1009
+    if ($db_result) {
1010 1010
     $consent_types = array();
1011 1011
     while ($result = db_fetch_array($db_result)) {
1012
-      $consent_types[] = $result;
1012
+        $consent_types[] = $result;
1013 1013
     }
1014 1014
     return $consent_types;
1015
-  }
1016
-  return array();
1015
+    }
1016
+    return array();
1017 1017
 }
1018 1018
 
1019 1019
 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
@@ -1025,94 +1025,94 @@  discard block
 block discarded – undo
1025 1025
  */ 
1026 1026
 function boincwork_set_default_venue($venue = '') {
1027 1027
   
1028
-  global $user;
1029
-  $account = user_load($user->uid);
1028
+    global $user;
1029
+    $account = user_load($user->uid);
1030 1030
   
1031
-  if ($venue == 'generic') {
1031
+    if ($venue == 'generic') {
1032 1032
     $venue = '';
1033
-  }
1033
+    }
1034 1034
   
1035
-  db_set_active('boinc_rw');
1036
-  db_query("
1035
+    db_set_active('boinc_rw');
1036
+    db_query("
1037 1037
     UPDATE user
1038 1038
     SET venue = '%s'
1039 1039
     WHERE id = %d",
1040 1040
     $venue, $account->boincuser_id
1041
-  );
1042
-  db_set_active('default');
1041
+    );
1042
+    db_set_active('default');
1043 1043
 }
1044 1044
 
1045 1045
 /**
1046 1046
  * Recursively validate submitted form values against a set of rules
1047 1047
  */ 
1048 1048
 function boincwork_validate_form($validation_rules, $values, $path = array()) {
1049
-  foreach ($validation_rules as $field => $rules) {
1049
+    foreach ($validation_rules as $field => $rules) {
1050 1050
     $parents = $path;
1051 1051
     if (is_array($values[$field])) {
1052
-      // Process nested form elements
1053
-      $parents[] = $field;
1054
-      boincwork_validate_form($rules, $values[$field], $parents);
1052
+        // Process nested form elements
1053
+        $parents[] = $field;
1054
+        boincwork_validate_form($rules, $values[$field], $parents);
1055 1055
     }
1056 1056
     else {
1057
-      if ($parents) {
1057
+        if ($parents) {
1058 1058
         // form_set_error() identifies nested form elements with '][' as a
1059 1059
         // delimiter between each parent and child element
1060 1060
         $parents[] = $field;
1061 1061
         $form_field = implode('][', $parents);
1062
-      }
1063
-      else {
1062
+        }
1063
+        else {
1064 1064
         $form_field = $field;
1065
-      }
1066
-      if (isset($rules['datatype']) AND !boincwork_validate_datatype($values[$field], $rules['datatype'])) {
1065
+        }
1066
+        if (isset($rules['datatype']) AND !boincwork_validate_datatype($values[$field], $rules['datatype'])) {
1067 1067
         form_set_error($form_field, bts('Invalid data type for @field', array('@field' => $field), NULL, 'boinc:account-preferences'));
1068
-      }
1069
-      if (isset($rules['min']) AND $values[$field] < $rules['min']) {
1068
+        }
1069
+        if (isset($rules['min']) AND $values[$field] < $rules['min']) {
1070 1070
         form_set_error($form_field, bts('Minimum value not met for @field', array('@field' => $field), NULL, 'boinc:account-preferences'));
1071
-      }
1072
-      if (isset($rules['max']) AND $values[$field] > $rules['max']) {
1071
+        }
1072
+        if (isset($rules['max']) AND $values[$field] > $rules['max']) {
1073 1073
         form_set_error($form_field, bts('Maximum value exceeded for @field', array('@field' => $field), NULL, 'boinc:account-preferences'));
1074
-      }
1074
+        }
1075
+    }
1075 1076
     }
1076
-  }
1077 1077
 }
1078 1078
 
1079 1079
 /**
1080 1080
  * Check that numeric data conforms to specifications
1081 1081
  */
1082 1082
 function boincwork_validate_datatype($data, $datatype = NULL) {
1083
-  switch ($datatype) {
1084
-  case 'float':
1083
+    switch ($datatype) {
1084
+    case 'float':
1085 1085
     if (!is_numeric($data)) {
1086
-      return FALSE;
1086
+        return FALSE;
1087 1087
     }
1088 1088
     $data += 0.0;
1089 1089
     if (!is_float($data)) {
1090
-      return FALSE;
1090
+        return FALSE;
1091 1091
     }
1092 1092
     break;
1093 1093
     
1094
-  case 'integer':
1094
+    case 'integer':
1095 1095
     if (!is_numeric($data)) {
1096
-      return FALSE;
1096
+        return FALSE;
1097 1097
     }
1098 1098
     $data += 0;
1099 1099
     if (!is_int($data)) {
1100
-      return FALSE;
1100
+        return FALSE;
1101 1101
     }
1102 1102
     break;
1103 1103
   
1104
-  case 'text':
1104
+    case 'text':
1105 1105
   default:
1106 1106
     
1107 1107
   }
1108
-  return TRUE;
1108
+    return TRUE;
1109 1109
 }
1110 1110
 
1111 1111
 /**
1112 1112
  * Format a number to be displayed using a maximum number of digits
1113 1113
  */ 
1114 1114
 function boincwork_format_stats($number, $max_digits = 4) {
1115
-  $suffix = array(
1115
+    $suffix = array(
1116 1116
     0 => '',
1117 1117
     1 => 'k',
1118 1118
     2 => 'M',
@@ -1122,94 +1122,94 @@  discard block
 block discarded – undo
1122 1122
     6 => 'E',
1123 1123
     7 => 'Z',
1124 1124
     8 => 'Y'
1125
-  );
1126
-  if (!is_numeric($number)) $number = 0;
1125
+    );
1126
+    if (!is_numeric($number)) $number = 0;
1127 1127
   
1128
-  $digits = floor(log($number, 10)) + 1;
1129
-  $magnitude = 0;
1130
-  $precision = 0;
1131
-  if ($digits > $max_digits) {
1128
+    $digits = floor(log($number, 10)) + 1;
1129
+    $magnitude = 0;
1130
+    $precision = 0;
1131
+    if ($digits > $max_digits) {
1132 1132
     $magnitude = floor(($digits - ($max_digits - 3)) / 3);
1133 1133
     $precision = $max_digits - ($digits - ($magnitude * 3) + 1);
1134 1134
     $number = round($number / pow(1000, $magnitude), $precision);
1135
-  }
1136
-  $number = number_format($number, $precision) . (($magnitude) ? "{$suffix[$magnitude]}" : '');
1135
+    }
1136
+    $number = number_format($number, $precision) . (($magnitude) ? "{$suffix[$magnitude]}" : '');
1137 1137
   
1138
-  return $number;
1138
+    return $number;
1139 1139
 }
1140 1140
 
1141
-  //------------------------------------------------------------------------------------------------
1142
-  //  load_configuration(): Convert structured text/xml to array
1143
-  //------------------------------------------------------------------------------------------------
1141
+    //------------------------------------------------------------------------------------------------
1142
+    //  load_configuration(): Convert structured text/xml to array
1143
+    //------------------------------------------------------------------------------------------------
1144 1144
   
1145
-  function load_configuration($text)
1146
-  {
1147
-      if (preg_match('/^\<\?xml .*\?\>$/i', $text)) return null;
1148
-      if ($xml = text_to_xml($text)) return xml_to_array($xml);
1149
-      return false;
1150
-  }
1145
+    function load_configuration($text)
1146
+    {
1147
+        if (preg_match('/^\<\?xml .*\?\>$/i', $text)) return null;
1148
+        if ($xml = text_to_xml($text)) return xml_to_array($xml);
1149
+        return false;
1150
+    }
1151 1151
   
1152
-  //------------------------------------------------------------------------------------------------
1153
-  //  save_configuration(): Convert array to structured text/xml
1154
-  //------------------------------------------------------------------------------------------------
1152
+    //------------------------------------------------------------------------------------------------
1153
+    //  save_configuration(): Convert array to structured text/xml
1154
+    //------------------------------------------------------------------------------------------------
1155 1155
   
1156
-  function save_configuration($array)
1157
-  {
1158
-      if ($xml = array_to_xml($array)) return xml_to_text($xml, false, true);
1159
-      return false;
1160
-  }
1156
+    function save_configuration($array)
1157
+    {
1158
+        if ($xml = array_to_xml($array)) return xml_to_text($xml, false, true);
1159
+        return false;
1160
+    }
1161 1161
   
1162
-  //------------------------------------------------------------------------------------------------
1163
-  //  array_to_xml(): Take a multidimensional array and convert it to a structured
1164
-  //  DOM XML object
1165
-  //------------------------------------------------------------------------------------------------
1162
+    //------------------------------------------------------------------------------------------------
1163
+    //  array_to_xml(): Take a multidimensional array and convert it to a structured
1164
+    //  DOM XML object
1165
+    //------------------------------------------------------------------------------------------------
1166 1166
   
1167
-  function array_to_xml($array, $dom = false, $parent_node = false) {
1167
+    function array_to_xml($array, $dom = false, $parent_node = false) {
1168 1168
     $is_root = false;
1169 1169
     if (!$dom) $dom = new DomDocument('1.0');
1170 1170
     if (!$parent_node) {
1171
-      $parent_node = $dom;
1172
-      $is_root = true;
1171
+        $parent_node = $dom;
1172
+        $is_root = true;
1173 1173
     }
1174 1174
     // Created an intermediate array to attempt to sort by @position
1175 1175
     $ordered_array = array();
1176 1176
     $unordered_array = array();
1177 1177
     foreach ($array as $name => $value) {
1178
-      if ($is_root) {
1178
+        if ($is_root) {
1179 1179
         $unordered_array[] = $array;
1180 1180
         break;
1181
-      }
1182
-      if (is_array($value)) {
1181
+        }
1182
+        if (is_array($value)) {
1183 1183
         if (is_numeric(key($value))) {
1184
-          foreach ($value as $item) {
1184
+            foreach ($value as $item) {
1185 1185
             if (is_array($item) AND isset($item['@position'])) {
1186
-              $ordered_array[$item['@position']] = array(
1186
+                $ordered_array[$item['@position']] = array(
1187 1187
                 $name => $item
1188
-              );
1188
+                );
1189 1189
             }
1190 1190
             else {
1191
-              $unordered_array[] = array(
1191
+                $unordered_array[] = array(
1192 1192
                 $name => $item
1193
-              );
1193
+                );
1194
+            }
1194 1195
             }
1195
-          }
1196 1196
         }
1197 1197
         elseif (isset($value['@position'])) {
1198
-          $ordered_array[$value['@position']] = array(
1198
+            $ordered_array[$value['@position']] = array(
1199 1199
             $name => $value
1200
-          );
1200
+            );
1201 1201
         }
1202 1202
         else {
1203
-          $unordered_array[] = array(
1203
+            $unordered_array[] = array(
1204 1204
             $name => $value
1205
-          );
1205
+            );
1206 1206
         }
1207
-      }
1208
-      else {
1207
+        }
1208
+        else {
1209 1209
         $unordered_array[] = array(
1210
-          $name => $value
1210
+            $name => $value
1211 1211
         );
1212
-      }
1212
+        }
1213 1213
     }
1214 1214
     
1215 1215
     // Now append items without explicit positions at the end
@@ -1217,39 +1217,39 @@  discard block
 block discarded – undo
1217 1217
     
1218 1218
     // Convert to XML...
1219 1219
     foreach ($primed_array as $item) {
1220
-      list($name, $value) = each($item);
1221
-      if (strcmp($name, '@attributes') == 0) {
1220
+        list($name, $value) = each($item);
1221
+        if (strcmp($name, '@attributes') == 0) {
1222 1222
         if (!is_array($value)) continue;
1223 1223
         foreach ($value as $attributeName => $attributeValue) {
1224
-          $parent_node->setAttribute($attributeName, $attributeValue);
1224
+            $parent_node->setAttribute($attributeName, $attributeValue);
1225 1225
         }
1226
-      } elseif (strcmp($name, '@value') == 0) {
1226
+        } elseif (strcmp($name, '@value') == 0) {
1227 1227
         if (isset($value)) $parent_node->nodeValue = $value;
1228
-      } elseif (strcmp($name, '@position') == 0) {
1228
+        } elseif (strcmp($name, '@position') == 0) {
1229 1229
         continue;
1230
-      } else {
1230
+        } else {
1231 1231
         if (is_numeric($name)) {
1232
-          $name = $parent_node->tagName;
1232
+            $name = $parent_node->tagName;
1233 1233
         }
1234 1234
         $current_item = $dom->createElement($name);
1235 1235
         if (is_array($value)) {
1236
-          if (is_numeric(key($value))) {
1236
+            if (is_numeric(key($value))) {
1237 1237
             $current_node = $parent_node->appendChild($current_item);
1238 1238
             $current_node = array_to_xml($value, $dom, $current_node);
1239 1239
             $child_count = $current_node->childNodes->length;
1240 1240
             for ($i = 0; $i < $child_count; $i++) {
1241
-              $parent_node->appendChild($current_node->childNodes->item(0));
1241
+                $parent_node->appendChild($current_node->childNodes->item(0));
1242 1242
             }
1243 1243
             $parent_node->removeChild($current_node);
1244
-          } else {
1244
+            } else {
1245 1245
             $current_node = $dom->appendChild($current_item);
1246 1246
             $parent_node->appendChild(array_to_xml($value, $dom, $current_node));
1247
-          }
1247
+            }
1248 1248
         } else {
1249
-          if (isset($value)) $current_item->nodeValue = $value;
1250
-          $parent_node->appendChild($current_item);
1249
+            if (isset($value)) $current_item->nodeValue = $value;
1250
+            $parent_node->appendChild($current_item);
1251
+        }
1251 1252
         }
1252
-      }
1253 1253
     }
1254 1254
     /*
1255 1255
     foreach ($array as $name => $value) {
@@ -1285,114 +1285,114 @@  discard block
 block discarded – undo
1285 1285
       }
1286 1286
     }*/
1287 1287
     return $parent_node;
1288
-  }
1288
+    }
1289 1289
   
1290
-  //------------------------------------------------------------------------------------------------
1291
-  //  xml_to_text(): Convert an XML DOM object to string format
1292
-  //------------------------------------------------------------------------------------------------
1290
+    //------------------------------------------------------------------------------------------------
1291
+    //  xml_to_text(): Convert an XML DOM object to string format
1292
+    //------------------------------------------------------------------------------------------------
1293 1293
   
1294
-  function xml_to_text($xml, $include_xml_declaration = true, $add_carriage_returns = false)
1295
-  {
1296
-      $xml->formatOutput = true;
1297
-      $text = $xml->saveXML();
1298
-      if (!$include_xml_declaration) {
1294
+    function xml_to_text($xml, $include_xml_declaration = true, $add_carriage_returns = false)
1295
+    {
1296
+        $xml->formatOutput = true;
1297
+        $text = $xml->saveXML();
1298
+        if (!$include_xml_declaration) {
1299 1299
         $text = preg_replace('/<\?xml version=.*\?>\s*/i', '', $text, 1);
1300
-      }
1301
-      if ($add_carriage_returns) {;
1300
+        }
1301
+        if ($add_carriage_returns) {;
1302 1302
         $text = preg_replace('/\n/i', "\r\n", $text);
1303
-      }
1304
-      return trim($text);
1305
-  }
1303
+        }
1304
+        return trim($text);
1305
+    }
1306 1306
   
1307
-  //------------------------------------------------------------------------------------------------
1308
-  //  text_to_xml(): Convert an XML DOM object to string format
1309
-  //------------------------------------------------------------------------------------------------
1307
+    //------------------------------------------------------------------------------------------------
1308
+    //  text_to_xml(): Convert an XML DOM object to string format
1309
+    //------------------------------------------------------------------------------------------------
1310 1310
   
1311
-  function text_to_xml($text) {
1311
+    function text_to_xml($text) {
1312 1312
     $xml = new DomDocument();
1313 1313
     if ( !($xml->loadXML($text)) ) return false;
1314 1314
     return $xml;
1315
-  }
1315
+    }
1316 1316
   
1317 1317
   
1318
-  //------------------------------------------------------------------------------------------------
1319
-  //  xml_to_array(): Convert an XML DOM object to array format
1320
-  //------------------------------------------------------------------------------------------------
1318
+    //------------------------------------------------------------------------------------------------
1319
+    //  xml_to_array(): Convert an XML DOM object to array format
1320
+    //------------------------------------------------------------------------------------------------
1321 1321
   
1322
-  function xml_to_array($xml) {
1323
-      $node = $xml->firstChild; //$xml->first_child();
1324
-      $result = '';
1325
-      $index = 1;
1326
-      $position = 0;
1327
-      while (!is_null($node)) {
1328
-          switch ($node->nodeType) {
1329
-          case XML_TEXT_NODE:
1322
+    function xml_to_array($xml) {
1323
+        $node = $xml->firstChild; //$xml->first_child();
1324
+        $result = '';
1325
+        $index = 1;
1326
+        $position = 0;
1327
+        while (!is_null($node)) {
1328
+            switch ($node->nodeType) {
1329
+            case XML_TEXT_NODE:
1330 1330
               if (trim($node->nodeValue)  != '') $result = $node->nodeValue;
1331
-              break;
1332
-          case XML_ELEMENT_NODE:
1331
+                break;
1332
+            case XML_ELEMENT_NODE:
1333 1333
               $node_name = $node->nodeName;
1334
-              $parent = $node->parentNode;
1335
-              $sibling = $node->nextSibling;
1334
+                $parent = $node->parentNode;
1335
+                $sibling = $node->nextSibling;
1336 1336
               
1337
-              // Determine if this node forms a set with siblings (share a node name)
1338
-              while (($sibling) AND (($sibling->nodeType != XML_ELEMENT_NODE) OR ($sibling->nodeName != $node->nodeName))) $sibling = $sibling->nextSibling;
1339
-              if (!$sibling) {
1340
-                  $sibling = $node->previousSibling;
1341
-                  while (($sibling) AND (($sibling->nodeType != XML_ELEMENT_NODE) OR ($sibling->nodeName != $node->nodeName))) $sibling = $sibling->previousSibling;
1342
-              }
1337
+                // Determine if this node forms a set with siblings (share a node name)
1338
+                while (($sibling) AND (($sibling->nodeType != XML_ELEMENT_NODE) OR ($sibling->nodeName != $node->nodeName))) $sibling = $sibling->nextSibling;
1339
+                if (!$sibling) {
1340
+                    $sibling = $node->previousSibling;
1341
+                    while (($sibling) AND (($sibling->nodeType != XML_ELEMENT_NODE) OR ($sibling->nodeName != $node->nodeName))) $sibling = $sibling->previousSibling;
1342
+                }
1343 1343
               
1344
-              if ($sibling) {
1345
-                  $result[$node_name][$index] = '';
1346
-                  if ($node->childNodes) {
1347
-                      $result[$node_name][$index] = xml_to_array($node) ;
1348
-                  }
1349
-                  if ($node->hasAttributes()) {
1350
-                      $attributes = $node->attributes;
1351
-                      if ($result[$node_name][$index] !== '' AND !is_array($result[$node_name][$index])) {
1352
-                          $result[$node_name][$index] = array('@value' => $result[$node_name][$index]);
1353
-                      }
1354
-                      foreach ($attributes as $key => $attribute) {
1355
-                          $result[$node_name][$index]['@attributes'][$attribute->name] = $attribute->value;
1356
-                      }
1357
-                  }
1358
-                  // Retain the position of the element
1359
-                  if (!is_array($result[$node_name][$index])) {
1344
+                if ($sibling) {
1345
+                    $result[$node_name][$index] = '';
1346
+                    if ($node->childNodes) {
1347
+                        $result[$node_name][$index] = xml_to_array($node) ;
1348
+                    }
1349
+                    if ($node->hasAttributes()) {
1350
+                        $attributes = $node->attributes;
1351
+                        if ($result[$node_name][$index] !== '' AND !is_array($result[$node_name][$index])) {
1352
+                            $result[$node_name][$index] = array('@value' => $result[$node_name][$index]);
1353
+                        }
1354
+                        foreach ($attributes as $key => $attribute) {
1355
+                            $result[$node_name][$index]['@attributes'][$attribute->name] = $attribute->value;
1356
+                        }
1357
+                    }
1358
+                    // Retain the position of the element
1359
+                    if (!is_array($result[$node_name][$index])) {
1360 1360
                     $result[$node_name][$index] = array(
1361
-                      '@value' => $result[$node_name][$index]
1361
+                        '@value' => $result[$node_name][$index]
1362 1362
                     );
1363
-                  }
1364
-                  $result[$node_name][$index]['@position'] = $position;
1365
-                  $position++;
1366
-                  $index++;
1367
-              } else {
1368
-                  $result[$node_name] = '';
1369
-                  if ($node->childNodes) {
1370
-                      $result[$node_name] = xml_to_array($node) ;
1371
-                  }
1372
-                  if ($node->hasAttributes()) {
1373
-                      $attributes = $node->attributes;
1374
-                      if ($result[$node_name] !== '' AND !is_array($result[$node_name])) {
1375
-                          $result[$node_name] = array('@value' => $result[$node_name]);
1376
-                      }
1377
-                      foreach($attributes as $key => $attribute) {
1378
-                          $result[$node_name]['@attributes'][$attribute->name] = $attribute->value;
1379
-                      }
1380
-                  }
1381
-                  // Retain the position of the element
1382
-                  if (!is_array($result[$node_name])) {
1363
+                    }
1364
+                    $result[$node_name][$index]['@position'] = $position;
1365
+                    $position++;
1366
+                    $index++;
1367
+                } else {
1368
+                    $result[$node_name] = '';
1369
+                    if ($node->childNodes) {
1370
+                        $result[$node_name] = xml_to_array($node) ;
1371
+                    }
1372
+                    if ($node->hasAttributes()) {
1373
+                        $attributes = $node->attributes;
1374
+                        if ($result[$node_name] !== '' AND !is_array($result[$node_name])) {
1375
+                            $result[$node_name] = array('@value' => $result[$node_name]);
1376
+                        }
1377
+                        foreach($attributes as $key => $attribute) {
1378
+                            $result[$node_name]['@attributes'][$attribute->name] = $attribute->value;
1379
+                        }
1380
+                    }
1381
+                    // Retain the position of the element
1382
+                    if (!is_array($result[$node_name])) {
1383 1383
                     $result[$node_name] = array(
1384
-                      '@value' => $result[$node_name]
1384
+                        '@value' => $result[$node_name]
1385 1385
                     );
1386
-                  }
1387
-                  $result[$node_name]['@position'] = $position;
1388
-                  $position++;
1389
-              }
1390
-              break;
1391
-          }
1392
-          $node = $node->nextSibling;
1393
-      }
1394
-      return $result;
1395
-  }
1386
+                    }
1387
+                    $result[$node_name]['@position'] = $position;
1388
+                    $position++;
1389
+                }
1390
+                break;
1391
+            }
1392
+            $node = $node->nextSibling;
1393
+        }
1394
+        return $result;
1395
+    }
1396 1396
   
1397 1397
 
1398 1398
 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
@@ -1400,172 +1400,172 @@  discard block
 block discarded – undo
1400 1400
  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  */
1401 1401
 
1402 1402
 /**
1403
-  * Determine output for host list views when no hosts are found.
1404
-  */
1403
+ * Determine output for host list views when no hosts are found.
1404
+ */
1405 1405
 function boincwork_views_host_list_empty_text($context = NULL) {
1406 1406
   
1407
-  // Pull the BOINC user ID from the view arguments to get show_hosts 
1408
-  // preference for that user
1409
-  require_boinc('boinc_db');
1410
-  $view = views_get_current_view();
1411
-  $account = user_load($view->args[0]);
1412
-  $boincuser = BoincUser::lookup_id($account->boincuser_id);
1407
+    // Pull the BOINC user ID from the view arguments to get show_hosts 
1408
+    // preference for that user
1409
+    require_boinc('boinc_db');
1410
+    $view = views_get_current_view();
1411
+    $account = user_load($view->args[0]);
1412
+    $boincuser = BoincUser::lookup_id($account->boincuser_id);
1413 1413
   
1414
-  // Determine if hosts are associated at all or just hidden
1415
-  $output = '';
1416
-  if ($boincuser->show_hosts) {
1414
+    // Determine if hosts are associated at all or just hidden
1415
+    $output = '';
1416
+    if ($boincuser->show_hosts) {
1417 1417
     switch($context) {
1418 1418
     case 'active':
1419 1419
       $output .=  '<h2>' . bts('No active computers', array(), NULL, 'boinc:host-list') . '</h2>';
1420
-      $output .=  '<p>' . bts('This user has no computers that have been'
1421
-      . ' active in the last 30 days.', array(), NULL, 'boinc:host-list') . '</p>';
1422
-      break;
1420
+        $output .=  '<p>' . bts('This user has no computers that have been'
1421
+        . ' active in the last 30 days.', array(), NULL, 'boinc:host-list') . '</p>';
1422
+        break;
1423 1423
       
1424 1424
     case 'preferences':
1425 1425
       $output .=  '<h2>' . bts('No computers', array(), NULL, 'boinc:host-list') . '</h2>';
1426
-      $output .=  '<p>' . bts('There are no computers assigned to this'
1427
-      . ' preference set.', array(), NULL, 'boinc:host-list') . '</p>';
1428
-      break;
1426
+        $output .=  '<p>' . bts('There are no computers assigned to this'
1427
+        . ' preference set.', array(), NULL, 'boinc:host-list') . '</p>';
1428
+        break;
1429 1429
     
1430 1430
     default:
1431 1431
       $output .=  '<h2>' . bts('Computers pending', array(), NULL, 'boinc:host-list') . '</h2>';
1432
-      $output .=  '<p>' . bts('This user does not yet have any associated'
1433
-      . ' computers. Computers will be displayed when they have earned their'
1434
-      . ' first credits.', array(), NULL, 'boinc:host-list') . '</p>';
1432
+        $output .=  '<p>' . bts('This user does not yet have any associated'
1433
+        . ' computers. Computers will be displayed when they have earned their'
1434
+        . ' first credits.', array(), NULL, 'boinc:host-list') . '</p>';
1435 1435
     }
1436
-  }
1437
-  else {
1436
+    }
1437
+    else {
1438 1438
     $output .=  '<h2>' . bts('Computers hidden', array(), NULL, 'boinc:host-list') . '</h2>';
1439 1439
     $output .=  '<p>' . bts('This user has chosen not to show information'
1440 1440
     . ' about their computers.', array(), NULL, 'boinc:host-list') . '</p>';
1441
-  }
1442
-  return $output;
1441
+    }
1442
+    return $output;
1443 1443
 }
1444 1444
 
1445 1445
 /**
1446
-  * Determine output for task list views when no tasks are found.
1447
-  */
1446
+ * Determine output for task list views when no tasks are found.
1447
+ */
1448 1448
 function boincwork_views_task_list_empty_text($context = NULL) {
1449 1449
   
1450
-  // 
1451
-  $output = '';
1452
-  switch($context) {
1453
-  default:
1450
+    // 
1451
+    $output = '';
1452
+    switch($context) {
1453
+    default:
1454 1454
     $output .=  '<h2>' . bts('No @type tasks', array('@type' => $context), NULL, 'boinc:task-list')
1455 1455
     . '</h2>';
1456 1456
     $output .=  '<p>' . bts('There are no tasks of this type on record', array(), NULL, 'boinc:task-list')
1457 1457
     . '</p>';
1458
-  }
1459
-  return $output;
1458
+    }
1459
+    return $output;
1460 1460
 }
1461 1461
 
1462 1462
 /**
1463
-  * Output links to perform host actions
1464
-  */
1463
+ * Output links to perform host actions
1464
+ */
1465 1465
 function boincwork_host_action_links($host_id) {
1466
-  $output = '';
1467
-  if (boincwork_host_user_is_owner($host_id)) {
1466
+    $output = '';
1467
+    if (boincwork_host_user_is_owner($host_id)) {
1468 1468
     // Show merge hosts option
1469 1469
     $output = '<ul class="tab-list"><li class="first tab">';
1470 1470
     $output .= l(bts('Merge', array(), NULL, 'boinc:form-merge'), "host/{$host_id}/merge");
1471 1471
     $output .= '</li>';
1472 1472
     // If host has no tasks, allow the host to be deleted
1473 1473
     if (!boincwork_host_get_task_count($host_id)) {
1474
-      $output .= '<li class="tab">';
1475
-      $output .= l(bts('Delete', array(), NULL, 'boinc:form-delete'), "host/{$host_id}/delete",
1474
+        $output .= '<li class="tab">';
1475
+        $output .= l(bts('Delete', array(), NULL, 'boinc:form-delete'), "host/{$host_id}/delete",
1476 1476
         array(
1477
-          'attributes' => array(
1477
+            'attributes' => array(
1478 1478
             'onclick' => 'return confirm(\'' . bts('This will delete host @id'
1479
-              . ' from your account forever. Are you sure this is OK?',
1480
-              array('@id' => $host_id),
1481
-              NULL, 'boinc:account-host-delete') . '\')'
1482
-          )
1479
+                . ' from your account forever. Are you sure this is OK?',
1480
+                array('@id' => $host_id),
1481
+                NULL, 'boinc:account-host-delete') . '\')'
1482
+            )
1483 1483
         )
1484
-      );
1485
-      $output .= '</li>';
1484
+        );
1485
+        $output .= '</li>';
1486 1486
     }
1487 1487
     $output .= '</ul>';
1488
-  }
1489
-  return $output;
1488
+    }
1489
+    return $output;
1490 1490
 }
1491 1491
 
1492 1492
 /**
1493 1493
  * Get details for a given host
1494 1494
  */
1495 1495
 function boincwork_host_get_info($host_id) {
1496
-  db_set_active('boinc_ro');
1497
-  $host = db_fetch_object(db_query(
1496
+    db_set_active('boinc_ro');
1497
+    $host = db_fetch_object(db_query(
1498 1498
     "SELECT * FROM {host} WHERE id = '%d'",
1499 1499
     $host_id
1500
-  ));
1501
-  db_set_active('default');
1502
-  return $host;
1500
+    ));
1501
+    db_set_active('default');
1502
+    return $host;
1503 1503
 }
1504 1504
 
1505 1505
 /**
1506 1506
  * Get the number of tasks associated with a given host
1507 1507
  */
1508 1508
 function boincwork_host_get_task_count($host_id) {
1509
-  db_set_active('boinc_ro');
1510
-  $count = db_result(db_query(
1509
+    db_set_active('boinc_ro');
1510
+    $count = db_result(db_query(
1511 1511
     "SELECT COUNT(*) FROM {result} WHERE hostid = '%d'",
1512 1512
     $host_id
1513
-  ));
1514
-  db_set_active('default');
1515
-  return $count;
1513
+    ));
1514
+    db_set_active('default');
1515
+    return $count;
1516 1516
 }
1517 1517
 
1518 1518
 /**
1519 1519
  * Check whether a user is the owner of a host
1520 1520
  */
1521 1521
 function boincwork_host_user_is_owner($host_id, $uid = NULL) {
1522
-  if (!$uid) {
1522
+    if (!$uid) {
1523 1523
     global $user;
1524 1524
     $uid = $user->uid;
1525
-  }
1526
-  $account = user_load($uid);
1527
-  // Get host owner
1528
-  db_set_active('boinc_ro');
1529
-  $owner = db_result(db_query(
1525
+    }
1526
+    $account = user_load($uid);
1527
+    // Get host owner
1528
+    db_set_active('boinc_ro');
1529
+    $owner = db_result(db_query(
1530 1530
     "SELECT userid FROM {host} WHERE id = '%d'",
1531 1531
     $host_id
1532
-  ));
1533
-  db_set_active('default');
1534
-  return ($account->boincuser_id === $owner);
1532
+    ));
1533
+    db_set_active('default');
1534
+    return ($account->boincuser_id === $owner);
1535 1535
 }
1536 1536
 
1537 1537
 /**
1538
-  * Determine output for host last contact time
1539
-  */
1538
+ * Determine output for host last contact time
1539
+ */
1540 1540
 function boincwork_host_last_contact($timestamp, $host_id = NULL, $context = NULL) {
1541
-  $output = '---';
1542
-  $root_log_dir = variable_get('boinc_host_sched_logs_dir', '');
1543
-  $log = '';
1544
-  if ($timestamp) {
1541
+    $output = '---';
1542
+    $root_log_dir = variable_get('boinc_host_sched_logs_dir', '');
1543
+    $log = '';
1544
+    if ($timestamp) {
1545 1545
     $output = date('j M Y G:i:s T', $timestamp);
1546
-  }
1547
-  if ($root_log_dir AND $host_id) {
1546
+    }
1547
+    if ($root_log_dir AND $host_id) {
1548 1548
     $subdir = substr($host_id, 0, -3) OR $subdir = 0;
1549 1549
     $log = implode('/', array($root_log_dir, $subdir, $host_id));
1550
-  }
1551
-  if ($log AND file_exists($log)) {
1550
+    }
1551
+    if ($log AND file_exists($log)) {
1552 1552
     $output = l($output, "host/{$host_id}/log");
1553
-  }
1554
-  return $output;
1553
+    }
1554
+    return $output;
1555 1555
 }
1556 1556
 
1557 1557
 /**
1558 1558
  * 
1559 1559
  */
1560 1560
 function boincwork_host_venue_selector($host_id) {
1561
-  $output = '';
1562
-  if (function_exists('jump_quickly')) {
1561
+    $output = '';
1562
+    if (function_exists('jump_quickly')) {
1563 1563
     $path = "host/{$host_id}/set-venue";
1564 1564
     $venues = array(
1565
-      "{$path}/generic" => bts('Generic', array(), NULL, 'boinc:account-preferences-location'),
1566
-      "{$path}/home" => bts('Home', array(), NULL, 'boinc:account-preferences-location:-1:ignoreoverwrite'),
1567
-      "{$path}/work" => bts('Work', array(), NULL, 'boinc:account-preferences-location'),
1568
-      "{$path}/school" => bts('School', array(), NULL, 'boinc:account-preferences-location')
1565
+        "{$path}/generic" => bts('Generic', array(), NULL, 'boinc:account-preferences-location'),
1566
+        "{$path}/home" => bts('Home', array(), NULL, 'boinc:account-preferences-location:-1:ignoreoverwrite'),
1567
+        "{$path}/work" => bts('Work', array(), NULL, 'boinc:account-preferences-location'),
1568
+        "{$path}/school" => bts('School', array(), NULL, 'boinc:account-preferences-location')
1569 1569
     );
1570 1570
     variable_set('jump_use_js_venues-Array', 1);
1571 1571
     drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js');
@@ -1573,34 +1573,34 @@  discard block
 block discarded – undo
1573 1573
     // Get current venue
1574 1574
     db_set_active('boinc_ro');
1575 1575
     $venue = db_result(db_query(
1576
-      "SELECT venue FROM {host} WHERE id = '%d'",
1577
-      $host_id
1576
+        "SELECT venue FROM {host} WHERE id = '%d'",
1577
+        $host_id
1578 1578
     ));
1579 1579
     db_set_active('default');
1580 1580
     $output .= jump_quickly($venues, 'venues', 1, "{$path}/{$venue}");
1581
-  }
1582
-  return $output;
1581
+    }
1582
+    return $output;
1583 1583
 }
1584 1584
 
1585 1585
 /**
1586
-  * Determine output for task reported time / deadline
1587
-  */
1586
+ * Determine output for task reported time / deadline
1587
+ */
1588 1588
 function boincwork_task_time_reported($received_time = NULL, $deadline = NULL, $context = NULL) {
1589
-  $output = '---';
1590
-  if ($received_time OR $deadline) {
1589
+    $output = '---';
1590
+    if ($received_time OR $deadline) {
1591 1591
     $timestamp = ($received_time) ? $received_time : $deadline;
1592 1592
     $output = date('j M Y G:i:s T', $timestamp);
1593 1593
     // Add a wrapper to deadline text
1594 1594
     if (!$received_time) {
1595
-      if (time() < $deadline) {
1595
+        if (time() < $deadline) {
1596 1596
         $output = '<span class="on-time">' . $output . '</span>';
1597
-      }
1598
-      else {
1597
+        }
1598
+        else {
1599 1599
         $output = '<span class="past-due">' . $output . '</span>';
1600
-      }
1600
+        }
1601 1601
     }
1602
-  }
1603
-  return $output;
1602
+    }
1603
+    return $output;
1604 1604
 }
1605 1605
 
1606 1606
 /*  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *
@@ -1631,345 +1631,345 @@  discard block
 block discarded – undo
1631 1631
  *   Number of table row to display per page. Defaults to 20.
1632 1632
  */
1633 1633
 function boincwork_tasktable($category = 0, $queryid = 1, $tselect = NULL, $app_id = 0, $tablerows = 20) {
1634
-  // Check type parameter, if not (0,2) then return an error.
1635
-  if ( ($category!=0) AND ($category!=1) AND ($category!=2) ) {
1634
+    // Check type parameter, if not (0,2) then return an error.
1635
+    if ( ($category!=0) AND ($category!=1) AND ($category!=2) ) {
1636 1636
     watchdog('boincwork', 'task table called with invalid category = %category', array('%category' => $category), WATCHDOG_WARNING);
1637 1637
     return '';
1638
-  }
1638
+    }
1639 1639
 
1640
-  require_boinc( array('util', 'result') );
1640
+    require_boinc( array('util', 'result') );
1641 1641
 
1642
-  global $language;
1643
-  $locality=$language->language;
1644
-  $nf = new NumberFormatter($locality, NumberFormatter::DECIMAL);
1645
-  $nf->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS, 0);
1646
-  $nf->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, 0);
1642
+    global $language;
1643
+    $locality=$language->language;
1644
+    $nf = new NumberFormatter($locality, NumberFormatter::DECIMAL);
1645
+    $nf->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS, 0);
1646
+    $nf->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, 0);
1647 1647
 
1648
-  $output = '';
1648
+    $output = '';
1649 1649
 
1650
-  $state_hnames = array(
1650
+    $state_hnames = array(
1651 1651
     STATE_ALL => 'All',
1652 1652
     STATE_IN_PROGRESS => 'In progress',
1653 1653
     STATE_PENDING => 'Pending',
1654 1654
     STATE_VALID => 'Valid',
1655 1655
     STATE_INVALID => 'Invalid',
1656 1656
     STATE_ERROR => 'Error',
1657
-  );
1658
-  // Array (hash) to count total number of results/tasks, and their states.
1659
-  $taskstates = array(
1657
+    );
1658
+    // Array (hash) to count total number of results/tasks, and their states.
1659
+    $taskstates = array(
1660 1660
     STATE_ALL => 0,
1661 1661
     STATE_IN_PROGRESS => 0,
1662 1662
     STATE_PENDING => 0,
1663 1663
     STATE_VALID => 0,
1664 1664
     STATE_INVALID => 0,
1665 1665
     STATE_ERROR => 0,
1666
-  );
1667
-  // Array to hold pretty-print result data to be displayed in a table.
1668
-  $resultdata = array();
1669
-  // Arrays for applications. Form below uses $applications as parameter.
1670
-  $application_map = array();
1671
-  $application_select_count = array();
1672
-  $applications = array();
1673
-
1674
-  // BOINC DB queries for results, application names
1675
-  db_set_active('boinc_ro');
1676
-
1677
-  // Query to retreive all results, in order to calculate status for a
1678
-  // host with application names for each result.
1679
-  $sqlall = "SELECT user_friendly_name,"
1680
-      ."r.appid as appid,"
1681
-      ."r.server_state AS server_state,"
1682
-      ."r.outcome AS outcome,"
1683
-      ."r.client_state AS client_state,"
1684
-      ."r.validate_state AS validate_state,"
1685
-      ."r.exit_status AS exit_status "
1686
-      ."FROM {result} AS r "
1687
-      ."INNER JOIN {app} AS a "
1688
-      ."ON r.appid=a.id ";
1689
-
1690
-  // Use userid, hostid, or workunitid
1691
-  if ($category==0) {
1666
+    );
1667
+    // Array to hold pretty-print result data to be displayed in a table.
1668
+    $resultdata = array();
1669
+    // Arrays for applications. Form below uses $applications as parameter.
1670
+    $application_map = array();
1671
+    $application_select_count = array();
1672
+    $applications = array();
1673
+
1674
+    // BOINC DB queries for results, application names
1675
+    db_set_active('boinc_ro');
1676
+
1677
+    // Query to retreive all results, in order to calculate status for a
1678
+    // host with application names for each result.
1679
+    $sqlall = "SELECT user_friendly_name,"
1680
+        ."r.appid as appid,"
1681
+        ."r.server_state AS server_state,"
1682
+        ."r.outcome AS outcome,"
1683
+        ."r.client_state AS client_state,"
1684
+        ."r.validate_state AS validate_state,"
1685
+        ."r.exit_status AS exit_status "
1686
+        ."FROM {result} AS r "
1687
+        ."INNER JOIN {app} AS a "
1688
+        ."ON r.appid=a.id ";
1689
+
1690
+    // Use userid, hostid, or workunitid
1691
+    if ($category==0) {
1692 1692
     $sqlall .= " WHERE r.userid='%s' ";
1693
-  }
1694
-  elseif ($category==1) {
1693
+    }
1694
+    elseif ($category==1) {
1695 1695
     $sqlall .= " WHERE r.workunitid='%s' ";
1696
-  }
1697
-  elseif ($category==2) {
1696
+    }
1697
+    elseif ($category==2) {
1698 1698
     $sqlall .= " WHERE r.hostid='%s' ";
1699
-  }
1700
-  $sqlall .= " ORDER BY user_friendly_name";
1701
-  $dbres_all = db_query($sqlall, $queryid);
1702
-  db_set_active('default');
1699
+    }
1700
+    $sqlall .= " ORDER BY user_friendly_name";
1701
+    $dbres_all = db_query($sqlall, $queryid);
1702
+    db_set_active('default');
1703 1703
 
1704
-  // Loop 1 of DB results
1705
-  if ($dbres_all) {
1704
+    // Loop 1 of DB results
1705
+    if ($dbres_all) {
1706 1706
     while ($result = db_fetch_object($dbres_all)) {
1707
-      $mystate = state_num($result);
1708
-      if ( ($result->appid==$app_id) OR ($app_id==0) OR ($app_id==-1) ) {
1707
+        $mystate = state_num($result);
1708
+        if ( ($result->appid==$app_id) OR ($app_id==0) OR ($app_id==-1) ) {
1709 1709
         $taskstates[STATE_ALL]++;
1710 1710
         switch ($mystate) {
1711 1711
         case STATE_IN_PROGRESS:
1712 1712
           $taskstates[STATE_IN_PROGRESS]++;
1713
-          break;
1713
+            break;
1714 1714
         case STATE_PENDING:
1715 1715
           $taskstates[STATE_PENDING]++;
1716
-          break;
1716
+            break;
1717 1717
         case STATE_VALID:
1718 1718
           $taskstates[STATE_VALID]++;
1719
-          break;
1719
+            break;
1720 1720
         case STATE_INVALID:
1721 1721
           $taskstates[STATE_INVALID]++;
1722
-          break;
1722
+            break;
1723 1723
         case STATE_ERROR:
1724 1724
           $taskstates[STATE_ERROR]++;
1725
-          break;
1725
+            break;
1726 1726
         }
1727
-      }// if app_id
1727
+        }// if app_id
1728 1728
 
1729
-      //map holds a map between app ids and user friendly names for all applications.
1730
-      $application_map[$result->appid] = $result->user_friendly_name;
1731
-      if ( ($mystate == $tselect) OR ($tselect==STATE_ALL) ) {
1729
+        //map holds a map between app ids and user friendly names for all applications.
1730
+        $application_map[$result->appid] = $result->user_friendly_name;
1731
+        if ( ($mystate == $tselect) OR ($tselect==STATE_ALL) ) {
1732 1732
         //count of appids in the results.
1733 1733
         $application_select_count[$result->appid]++;
1734
-      }// if mystate
1734
+        }// if mystate
1735 1735
 
1736 1736
     }// while
1737
-  }
1738
-  else {
1739
-  }
1737
+    }
1738
+    else {
1739
+    }
1740 1740
   
1741
-  // Entry for all applications.
1742
-  $allcount = $application_select_count ? array_sum($application_select_count) : 0;
1743
-  $applications[-1] = bts('Application', array(), NULL, 'boinc:task-table');
1744
-  $applications[0] = bts('All applications', array(), NULL, 'boinc:task-table') . ' (' . $allcount . ')';
1745
-  // Create application filter from application_map and application_select_count.
1746
-  foreach($application_map as $akey => $aname) {
1741
+    // Entry for all applications.
1742
+    $allcount = $application_select_count ? array_sum($application_select_count) : 0;
1743
+    $applications[-1] = bts('Application', array(), NULL, 'boinc:task-table');
1744
+    $applications[0] = bts('All applications', array(), NULL, 'boinc:task-table') . ' (' . $allcount . ')';
1745
+    // Create application filter from application_map and application_select_count.
1746
+    foreach($application_map as $akey => $aname) {
1747 1747
     $acount = 0;
1748 1748
     if ( $application_select_count and array_key_exists($akey, $application_select_count) ) {
1749
-      $acount = $application_select_count[$akey];
1749
+        $acount = $application_select_count[$akey];
1750 1750
     }
1751 1751
     $applications[$akey] = $aname . ' ('. $acount . ')';
1752
-  }
1753
-  // Header array for (sub) results table.
1754
-  $resultheader = array(
1752
+    }
1753
+    // Header array for (sub) results table.
1754
+    $resultheader = array(
1755 1755
     array(
1756
-      'data' => bts('Task ID', array(), NULL, 'boinc:task-table'),
1757
-      'field' => 'id',
1756
+        'data' => bts('Task ID', array(), NULL, 'boinc:task-table'),
1757
+        'field' => 'id',
1758 1758
     ),
1759 1759
     array(
1760
-      'data' => bts('Workunit ID', array(), NULL, 'boinc:task-table'),
1761
-      'field' => 'workunitid',
1760
+        'data' => bts('Workunit ID', array(), NULL, 'boinc:task-table'),
1761
+        'field' => 'workunitid',
1762 1762
     ),
1763 1763
     array(
1764
-      'data' => bts('Computer', array(), NULL, 'boinc:task-table'),
1765
-      'field' => 'hostid',
1764
+        'data' => bts('Computer', array(), NULL, 'boinc:task-table'),
1765
+        'field' => 'hostid',
1766 1766
     ),
1767 1767
     array(
1768
-      'data' => bts('Sent', array(), NULL, 'boinc:task-table'),
1769
-      'field' => 'sent_time',
1768
+        'data' => bts('Sent', array(), NULL, 'boinc:task-table'),
1769
+        'field' => 'sent_time',
1770 1770
     ),
1771 1771
     array(
1772
-      'data' => bts('Time Reported or Deadline', array(), NULL, 'boinc:task-table')
1772
+        'data' => bts('Time Reported or Deadline', array(), NULL, 'boinc:task-table')
1773 1773
     ),
1774 1774
     array(
1775
-      'data' => bts('Status', array(), NULL, 'boinc:task-table')
1775
+        'data' => bts('Status', array(), NULL, 'boinc:task-table')
1776 1776
     ),
1777 1777
     array(
1778
-      'data' => bts('Run time', array(), NULL, 'boinc:task-table'),
1779
-      'field' => 'elapsed_time',
1778
+        'data' => bts('Run time', array(), NULL, 'boinc:task-table'),
1779
+        'field' => 'elapsed_time',
1780 1780
     ),
1781 1781
     array(
1782
-      'data' => bts('CPU time', array(), NULL, 'boinc:task-table'),
1783
-      'field' => 'cpu_time',
1782
+        'data' => bts('CPU time', array(), NULL, 'boinc:task-table'),
1783
+        'field' => 'cpu_time',
1784 1784
     ),
1785 1785
     array(
1786
-      'data' => bts('Granted Credit', array(), NULL, 'boinc:task-table'),
1787
-      'field' => 'granted_credit',
1786
+        'data' => bts('Granted Credit', array(), NULL, 'boinc:task-table'),
1787
+        'field' => 'granted_credit',
1788 1788
     ),
1789 1789
     // Application is a column, but won't be added until after tablesort_sql().
1790
-  );
1791
-
1792
-  // Query to retreive a subset of the total results for the results table.
1793
-  db_set_active('boinc_ro');
1794
-  $sqlsub = "SELECT r.id AS id,"
1795
-      ."r.name AS name,"
1796
-      ."r.workunitid AS workunitid,"
1797
-      ."r.hostid as hostid,"
1798
-      ."r.sent_time AS sent_time,"
1799
-      ."r.received_time AS received_time,"
1800
-      ."r.report_deadline AS report_deadline,"
1801
-      ."r.server_state AS server_state,"
1802
-      ."r.outcome AS outcome,"
1803
-      ."r.client_state AS client_state,"
1804
-      ."r.validate_state AS validate_state,"
1805
-      ."r.exit_status AS exit_status,"
1806
-      ."r.elapsed_time AS elapsed_time,"
1807
-      ."r.cpu_time AS cpu_time,"
1808
-      ."r.granted_credit AS granted_credit,"
1809
-      ."r.appid AS appid,"
1810
-      ."r.app_version_id AS app_version_id,"
1811
-      ."a.user_friendly_name,"
1812
-      ."av.version_num AS version_number,"
1813
-      ."av.plan_class AS plan_class,"
1814
-      ."pl.name AS platform "
1815
-      ."FROM {result} AS r "
1816
-      ."INNER JOIN {app} AS a "
1817
-      ."ON r.appid=a.id "
1818
-      ."LEFT JOIN {app_version} AS av "
1819
-      ."ON r.app_version_id=av.id "
1820
-      ."LEFT JOIN {platform} AS pl "
1821
-      ."ON av.platformid=pl.id ";
1822
-
1823
-  // Build an array for the WHERE clauses. The individual clauses are
1824
-  // placed into an array, and implode() is used to combine them into
1825
-  // a WHERE statement for the sql query. If no such clauses are added
1826
-  // to the array, then no WHERE statement will be included.
1827
-  $sqlwhere = array();
1828
-
1829
-  // Use userid, hostid, or workunitid
1830
-  if ($category==0) {
1790
+    );
1791
+
1792
+    // Query to retreive a subset of the total results for the results table.
1793
+    db_set_active('boinc_ro');
1794
+    $sqlsub = "SELECT r.id AS id,"
1795
+        ."r.name AS name,"
1796
+        ."r.workunitid AS workunitid,"
1797
+        ."r.hostid as hostid,"
1798
+        ."r.sent_time AS sent_time,"
1799
+        ."r.received_time AS received_time,"
1800
+        ."r.report_deadline AS report_deadline,"
1801
+        ."r.server_state AS server_state,"
1802
+        ."r.outcome AS outcome,"
1803
+        ."r.client_state AS client_state,"
1804
+        ."r.validate_state AS validate_state,"
1805
+        ."r.exit_status AS exit_status,"
1806
+        ."r.elapsed_time AS elapsed_time,"
1807
+        ."r.cpu_time AS cpu_time,"
1808
+        ."r.granted_credit AS granted_credit,"
1809
+        ."r.appid AS appid,"
1810
+        ."r.app_version_id AS app_version_id,"
1811
+        ."a.user_friendly_name,"
1812
+        ."av.version_num AS version_number,"
1813
+        ."av.plan_class AS plan_class,"
1814
+        ."pl.name AS platform "
1815
+        ."FROM {result} AS r "
1816
+        ."INNER JOIN {app} AS a "
1817
+        ."ON r.appid=a.id "
1818
+        ."LEFT JOIN {app_version} AS av "
1819
+        ."ON r.app_version_id=av.id "
1820
+        ."LEFT JOIN {platform} AS pl "
1821
+        ."ON av.platformid=pl.id ";
1822
+
1823
+    // Build an array for the WHERE clauses. The individual clauses are
1824
+    // placed into an array, and implode() is used to combine them into
1825
+    // a WHERE statement for the sql query. If no such clauses are added
1826
+    // to the array, then no WHERE statement will be included.
1827
+    $sqlwhere = array();
1828
+
1829
+    // Use userid, hostid, or workunitid
1830
+    if ($category==0) {
1831 1831
     $sqlwhere[] = "r.userid = '%s'";
1832
-  }
1833
-  elseif ($category==1) {
1832
+    }
1833
+    elseif ($category==1) {
1834 1834
     $sqlwhere[] = "r.workunitid = '%s'";
1835
-  }
1836
-  elseif ($category==2) {
1835
+    }
1836
+    elseif ($category==2) {
1837 1837
     $sqlwhere[] = "r.hostid = '%s'";
1838
-  }
1838
+    }
1839 1839
 
1840
-  // Append additional where clauses based on task selection.
1841
-  switch ($tselect) {
1842
-  case STATE_IN_PROGRESS:
1840
+    // Append additional where clauses based on task selection.
1841
+    switch ($tselect) {
1842
+    case STATE_IN_PROGRESS:
1843 1843
     $sqlwhere[] = "r.server_state = 4";
1844 1844
     break;
1845
-  case STATE_PENDING:
1845
+    case STATE_PENDING:
1846 1846
     $sqlwhere[] = "(r.server_state = 5) AND (r.outcome = 1) AND (r.validate_state >= 0) AND (r.validate_state <= 0 OR r.validate_state >= 4) AND (r.validate_state <= 4)";
1847 1847
     break;
1848
-  case STATE_VALID:
1848
+    case STATE_VALID:
1849 1849
     $sqlwhere[] = "(r.server_state = 5) AND (r.outcome = 1) AND (r.validate_state = 1)";
1850 1850
     break;
1851
-  case STATE_INVALID:
1851
+    case STATE_INVALID:
1852 1852
     $sqlwhere[] = "(r.server_state = 5) AND ((r.outcome = 6) OR ((r.outcome = 1) AND ((r.validate_state = 2) OR (r.validate_state = 3) OR (r.validate_state = 5))))";
1853 1853
     break;
1854
-  case STATE_ERROR:
1854
+    case STATE_ERROR:
1855 1855
     $sqlwhere[] = "(r.server_state = 5) AND (r.outcome >= 3) AND (r.outcome <= 4 OR r.outcome >= 7) AND (r.outcome <= 7)";
1856 1856
     break;
1857
-  default:
1857
+    default:
1858 1858
   }
1859 1859
 
1860
-  if (is_numeric($app_id) AND $app_id>0 ) {
1860
+    if (is_numeric($app_id) AND $app_id>0 ) {
1861 1861
     $sqlwhere[] = "r.appid = '%s'";
1862 1862
     if ($sqlwhere)  $sqlsub .= " WHERE " . implode(' AND ', $sqlwhere);
1863 1863
     $dbres_sub = pager_query( $sqlsub . tablesort_sql($resultheader), $tablerows, 0, NULL, $queryid, $app_id);
1864
-  }
1865
-  else {
1864
+    }
1865
+    else {
1866 1866
     if ($sqlwhere)  $sqlsub .= " WHERE " . implode(' AND ', $sqlwhere);
1867 1867
     $dbres_sub = pager_query( $sqlsub . tablesort_sql($resultheader), $tablerows, 0, NULL, $queryid);
1868
-  }
1869
-  db_set_active('default');
1868
+    }
1869
+    db_set_active('default');
1870 1870
 
1871
-  // Loop 2 over DB results.
1872
-  if ($dbres_sub) {
1871
+    // Loop 2 over DB results.
1872
+    if ($dbres_sub) {
1873 1873
     while ($result = db_fetch_object($dbres_sub)) {
1874
-      // state_num() function changes $result object, clone $result
1875
-      // object for use in state_num()
1876
-      // check if state matches selection
1877
-      if ( (state_num(clone $result) == $tselect) OR ($tselect==STATE_ALL) ) {
1874
+        // state_num() function changes $result object, clone $result
1875
+        // object for use in state_num()
1876
+        // check if state matches selection
1877
+        if ( (state_num(clone $result) == $tselect) OR ($tselect==STATE_ALL) ) {
1878 1878
         // create pretty result row
1879 1879
         $prettyresult = array(
1880
-          array(
1880
+            array(
1881 1881
             'data' => l($result->name, "task/{$result->id}"),
1882 1882
             'class' => 'task-name',
1883
-          ),
1884
-          l($result->workunitid, "workunit/{$result->workunitid}"),
1885
-          l($result->hostid, "host/{$result->hostid}"),
1886
-          date('j M Y G:i:s T', $result->sent_time),
1887
-          boincwork_task_time_reported($result->received_time, $result->report_deadline),
1888
-          state_string($result),
1889
-          $nf->format($result->elapsed_time),
1890
-          $nf->format($result->cpu_time),
1891
-          $nf->format($result->granted_credit),
1892
-          array(
1883
+            ),
1884
+            l($result->workunitid, "workunit/{$result->workunitid}"),
1885
+            l($result->hostid, "host/{$result->hostid}"),
1886
+            date('j M Y G:i:s T', $result->sent_time),
1887
+            boincwork_task_time_reported($result->received_time, $result->report_deadline),
1888
+            state_string($result),
1889
+            $nf->format($result->elapsed_time),
1890
+            $nf->format($result->cpu_time),
1891
+            $nf->format($result->granted_credit),
1892
+            array(
1893 1893
             'data' => $result->user_friendly_name . " " . pretty_application_version($result->app_version_id,$result->version_number, $result->plan_class, $result->platform),
1894 1894
             'class' => 'task-app',
1895
-          ),
1895
+            ),
1896 1896
         );
1897 1897
         $resultdata[] = array_values($prettyresult);
1898
-      }
1898
+        }
1899 1899
     }// while
1900
-  }
1901
-  else {
1902
-  }
1903
-  // Begin result navigation
1900
+    }
1901
+    else {
1902
+    }
1903
+    // Begin result navigation
1904 1904
 
1905
-  // Set pathprefix based on type
1906
-  if ($category==0) {
1905
+    // Set pathprefix based on type
1906
+    if ($category==0) {
1907 1907
     $pathprefix = 'account/tasks';
1908
-  }
1909
-  elseif ($category==1) {
1908
+    }
1909
+    elseif ($category==1) {
1910 1910
     $pathprefix = 'workunit/' . $queryid . '/tasks';
1911
-  }
1912
-  elseif ($category==2) {
1911
+    }
1912
+    elseif ($category==2) {
1913 1913
     $pathprefix = 'host/' . $queryid . '/tasks';
1914
-  }
1915
-  // Need an "All" tab as well, maps to app_id of zero.
1916
-  $application_map[0] = bts('All', array(), NULL, 'boinc:task-table');
1917
-  $stitems = array();
1918
-  foreach ($taskstates as $state => $numstates) {
1914
+    }
1915
+    // Need an "All" tab as well, maps to app_id of zero.
1916
+    $application_map[0] = bts('All', array(), NULL, 'boinc:task-table');
1917
+    $stitems = array();
1918
+    foreach ($taskstates as $state => $numstates) {
1919 1919
     $mypath = $pathprefix . '/' . $state . '/' . $app_id;
1920 1920
     if ($state==STATE_ALL) {
1921
-      $ltext = '<span class="tab task-app-name">' . bts('All', array(), NULL, 'boinc:task-table') . ' (' . $numstates . ')</span>';
1921
+        $ltext = '<span class="tab task-app-name">' . bts('All', array(), NULL, 'boinc:task-table') . ' (' . $numstates . ')</span>';
1922 1922
     }
1923 1923
     else {
1924
-      $ltext = '<span class="tab">' . bts($state_hnames[$state], array(), NULL, 'boinc:task-table') . ' (' . $numstates . ')</span>';
1924
+        $ltext = '<span class="tab">' . bts($state_hnames[$state], array(), NULL, 'boinc:task-table') . ' (' . $numstates . ')</span>';
1925 1925
     }
1926 1926
     $myitem = array(
1927
-      'data' => l($ltext, $mypath, array('html' => TRUE) ),
1927
+        'data' => l($ltext, $mypath, array('html' => TRUE) ),
1928 1928
     );
1929 1929
     if ($state==$tselect) {
1930
-      $myitem['class'] = 'active';
1930
+        $myitem['class'] = 'active';
1931 1931
     }
1932 1932
     $stitems[] = $myitem;
1933
-  }
1934
-  // Add reset button
1935
-  $mypath = $pathprefix . '/0/0';
1936
-  $ltext = '<span class="tab">' . bts('Reset', array(), NULL, 'boinc:task-table') . '</span>';
1937
-  $stitems[] = array( 'data' => l($ltext, $mypath, array('html' => TRUE) ) );
1933
+    }
1934
+    // Add reset button
1935
+    $mypath = $pathprefix . '/0/0';
1936
+    $ltext = '<span class="tab">' . bts('Reset', array(), NULL, 'boinc:task-table') . '</span>';
1937
+    $stitems[] = array( 'data' => l($ltext, $mypath, array('html' => TRUE) ) );
1938 1938
 
1939
-  $output .= theme_item_list($stitems, NULL, 'ul' . ' class="tabs secondary clearfix"');
1939
+    $output .= theme_item_list($stitems, NULL, 'ul' . ' class="tabs secondary clearfix"');
1940 1940
 
1941
-  // Application select-drop down form
1942
-  // Hack to place Application form into header
1943
-  // App ID of zero maps to "-1" for drop-down box.
1944
-  if ($app_id==0) {
1941
+    // Application select-drop down form
1942
+    // Hack to place Application form into header
1943
+    // App ID of zero maps to "-1" for drop-down box.
1944
+    if ($app_id==0) {
1945 1945
     $app_id=-1;
1946
-  }
1947
-  $resultheader[] = drupal_get_form('boincwork_selectapp_form', $applications, $app_id);
1946
+    }
1947
+    $resultheader[] = drupal_get_form('boincwork_selectapp_form', $applications, $app_id);
1948 1948
 
1949
-  // Begin table of results
1950
-  if ( is_array($resultheader) AND is_array($resultdata) ) {
1949
+    // Begin table of results
1950
+    if ( is_array($resultheader) AND is_array($resultdata) ) {
1951 1951
 
1952 1952
     // Take advantage of the fact that $category is the same as the row/column we want to remove.
1953 1953
     if ( ($category==1) OR ($category==2) ) {
1954
-      unset($resultheader[$category]);
1955
-      delete_col($resultdata, $category);
1954
+        unset($resultheader[$category]);
1955
+        delete_col($resultdata, $category);
1956 1956
     }
1957 1957
 
1958 1958
     $output .= theme_table($resultheader, $resultdata);
1959 1959
     if (count($resultdata) > 0) {
1960
-      $output .= theme('pager');
1960
+        $output .= theme('pager');
1961 1961
     }
1962
-  }
1963
-  return $output;
1962
+    }
1963
+    return $output;
1964 1964
 }
1965 1965
 
1966 1966
 /**
1967 1967
  * Function to delete a column from an array.
1968 1968
  */
1969 1969
 function delete_col(&$array, $offset) {
1970
-  return array_walk($array, function (&$v) use ($offset) {
1971
-     array_splice($v, $offset, 1);
1972
-  });
1970
+    return array_walk($array, function (&$v) use ($offset) {
1971
+        array_splice($v, $offset, 1);
1972
+    });
1973 1973
 }
1974 1974
 
1975 1975
 /**
@@ -1989,7 +1989,7 @@  discard block
 block discarded – undo
1989 1989
  *  platform name, may be NULL
1990 1990
  */
1991 1991
 function pretty_application_version($appverid, $vernum, $plan_class, $plfm) {
1992
-  switch ($appverid) {
1992
+    switch ($appverid) {
1993 1993
     case ANON_PLATFORM_UNKNOWN:
1994 1994
       return "Anonymous platform";
1995 1995
     case ANON_PLATFORM_CPU:
@@ -2008,11 +2008,11 @@  discard block
 block discarded – undo
2008 2008
       // that is not handled by the above case statements.
2009 2009
       if ($appverid < 0) {
2010 2010
         return "Unknown Anonymous platform";
2011
-      }
2012
-      else {
2011
+        }
2012
+        else {
2013 2013
         $prettyv = sprintf("%d.%02d", $vernum/100, $vernum%100);
2014 2014
         $prettyc = ($plan_class) ? "($av->plan_class)" : '';
2015 2015
         return "v$prettyv $prettyc $plfm";
2016
-      }
2017
-  }
2016
+        }
2017
+    }
2018 2018
 }
Please login to merge, or discard this patch.
Switch Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -643,9 +643,9 @@  discard block
 block discarded – undo
643 643
     }
644 644
     break;
645 645
     
646
-    default:
647
-      // Don't generate form elements for things that aren't explicitly form
648
-      // elements (i.e. 'title', '@attributes' keys, and the like)
646
+  default:
647
+    // Don't generate form elements for things that aren't explicitly form
648
+    // elements (i.e. 'title', '@attributes' keys, and the like)
649 649
   }
650 650
 }
651 651
 
@@ -1990,29 +1990,29 @@  discard block
 block discarded – undo
1990 1990
  */
1991 1991
 function pretty_application_version($appverid, $vernum, $plan_class, $plfm) {
1992 1992
   switch ($appverid) {
1993
-    case ANON_PLATFORM_UNKNOWN:
1994
-      return "Anonymous platform";
1995
-    case ANON_PLATFORM_CPU:
1996
-      return "Anonymous platform CPU";
1997
-    case ANON_PLATFORM_NVIDIA:
1998
-      return "Anonymous platform NVIDIA GPU";
1999
-    case ANON_PLATFORM_ATI:
2000
-      return "Anonymous platform AMD GPU";
2001
-    case ANON_PLATFORM_INTEL:
2002
-      return "Anonymous platform Intel GPU";
2003
-    case 0:
2004
-      return "---";
2005
-    default:
2006
-      // Handle the case where the appversid is still negative. This
2007
-      // may be cause BOINC has introduced a new anonymous platform
2008
-      // that is not handled by the above case statements.
2009
-      if ($appverid < 0) {
2010
-        return "Unknown Anonymous platform";
2011
-      }
2012
-      else {
2013
-        $prettyv = sprintf("%d.%02d", $vernum/100, $vernum%100);
2014
-        $prettyc = ($plan_class) ? "($av->plan_class)" : '';
2015
-        return "v$prettyv $prettyc $plfm";
2016
-      }
1993
+  case ANON_PLATFORM_UNKNOWN:
1994
+    return "Anonymous platform";
1995
+  case ANON_PLATFORM_CPU:
1996
+    return "Anonymous platform CPU";
1997
+  case ANON_PLATFORM_NVIDIA:
1998
+    return "Anonymous platform NVIDIA GPU";
1999
+  case ANON_PLATFORM_ATI:
2000
+    return "Anonymous platform AMD GPU";
2001
+  case ANON_PLATFORM_INTEL:
2002
+    return "Anonymous platform Intel GPU";
2003
+  case 0:
2004
+    return "---";
2005
+  default:
2006
+    // Handle the case where the appversid is still negative. This
2007
+    // may be cause BOINC has introduced a new anonymous platform
2008
+    // that is not handled by the above case statements.
2009
+    if ($appverid < 0) {
2010
+      return "Unknown Anonymous platform";
2011
+    }
2012
+    else {
2013
+      $prettyv = sprintf("%d.%02d", $vernum/100, $vernum%100);
2014
+      $prettyc = ($plan_class) ? "($av->plan_class)" : '';
2015
+      return "v$prettyv $prettyc $plfm";
2016
+    }
2017 2017
   }
2018 2018
 }
Please login to merge, or discard this patch.
html/ops/errorwus.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -176,8 +176,8 @@
 block discarded – undo
176 176
 echo "<tr><th>WU ID</th><th>WU name</th><th>App ID</th><th>Quorum</th><th>Unsent</th><th>In Progress</th><th>Success</th>";
177 177
 echo "<th>Download Errors</th><th>Compute Errors</th><th>Validate Errors</th><th>Error mask</th></tr>\n";
178 178
 
179
-$hidden=0;
180
-foreach($row_array as $row) {
179
+$hidden = 0;
180
+foreach ($row_array as $row) {
181 181
     if ($hide_canceled == 'on' && (($row->error_mask & WU_ERROR_CANCELLED) == WU_ERROR_CANCELLED)) {
182 182
         $hidden++;
183 183
         continue;
Please login to merge, or discard this patch.
html/user/bolt_sched.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 }
78 78
 
79 79
 function default_mode($item) {
80
-    return $item->is_exercise()?BOLT_MODE_SHOW:BOLT_MODE_LESSON;
80
+    return $item->is_exercise() ?BOLT_MODE_SHOW:BOLT_MODE_LESSON;
81 81
 }
82 82
 
83 83
 // A page is being shown to the user; make a record of it
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
 // show an item (lesson, exercise, answer page)
172 172
 //
173
-function show_item($iter, $view_id, $prev_view_id, $mode, $repeat=null) {
173
+function show_item($iter, $view_id, $prev_view_id, $mode, $repeat = null) {
174 174
     global $user;
175 175
     global $course;
176 176
     global $bolt_ex;
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
     $bolt_ex->score = 0;
463 463
     $bolt_query_string = $item->query_string;
464 464
     srand($view_id);
465
-    ob_start();     // buffer output to avoid showing exercise text
465
+    ob_start(); // buffer output to avoid showing exercise text
466 466
     require($item->filename);
467 467
     ob_end_clean();
468 468
 
Please login to merge, or discard this patch.
html/inc/util.inc 3 patches
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 // with an existing web framework can more easily do so.
208 208
 // To do so, define page_head() in the project include file.
209 209
 //
210
-if (!function_exists("page_head")){
210
+if (!function_exists("page_head")) {
211 211
 function page_head(
212 212
     $title,
213 213
         // page title. Put in <title>, used as title for browser tab.
@@ -293,7 +293,8 @@  discard block
 block discarded – undo
293 293
     echo '<div class="container-fluid">
294 294
     ';
295 295
 
296
-    switch($title) {    //kludge
296
+    switch($title) {
297
+//kludge
297 298
     case tra("Log in"):
298 299
     case tra("Create an account"):
299 300
     case tra("Server status page"):
@@ -309,7 +310,7 @@  discard block
 block discarded – undo
309 310
 
310 311
 // See the comments for page_head()
311 312
 //
312
-if (!function_exists("page_tail")){
313
+if (!function_exists("page_tail")) {
313 314
 function page_tail(
314 315
     $show_date=false,
315 316
         // true for pages that are generated periodically rather than on the fly
@@ -330,7 +331,7 @@  discard block
 block discarded – undo
330 331
 }
331 332
 }
332 333
 
333
-function display_cvs_versions(){
334
+function display_cvs_versions() {
334 335
     global $cvs_version_tracker;
335 336
     echo "\n<!-- SVN VERSIONS -->\n";
336 337
     for ($i=0;$i<sizeof($cvs_version_tracker);$i++) {
@@ -816,7 +817,7 @@  discard block
 block discarded – undo
816 817
     return $str;
817 818
 }
818 819
 
819
-function strip_bbcode($string){
820
+function strip_bbcode($string) {
820 821
     return preg_replace("/((\[.+\])+?)(.+?)((\[\/.+\])+?)/","",$string);
821 822
 }
822 823
 
@@ -1047,7 +1048,7 @@  discard block
 block discarded – undo
1047 1048
 // Otherwise return 0.
1048 1049
 // Format of user agent string is "BOINC client (windows_x86_64 7.3.17)"
1049 1050
 //
1050
-function boinc_client_version(){
1051
+function boinc_client_version() {
1051 1052
     if (!array_key_exists('HTTP_USER_AGENT', $_SERVER)) return 0;
1052 1053
     $x = $_SERVER['HTTP_USER_AGENT'];
1053 1054
     $e =  "/BOINC client [^ ]* (\d+).(\d+).(\d+)\)/";
Please login to merge, or discard this patch.
Spacing   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -38,17 +38,17 @@  discard block
 block discarded – undo
38 38
 //
39 39
 $config = get_config();
40 40
 global $master_url;
41
-$master_url = parse_config($config , "<master_url>");
41
+$master_url = parse_config($config, "<master_url>");
42 42
 $recaptcha_public_key = parse_config($config, "<recaptcha_public_key>");
43 43
 $recaptcha_private_key = parse_config($config, "<recaptcha_private_key>");
44 44
 
45 45
 // the following default to on
46 46
 //
47 47
 $x = parse_config($config, "<user_country>");
48
-define('USER_COUNTRY', ($x===null)?1:(int)$x);
48
+define('USER_COUNTRY', ($x === null) ? 1 : (int)$x);
49 49
 
50 50
 $x = parse_config($config, "<user_url>");
51
-define('USER_URL', ($x===null)?1:(int)$x);
51
+define('USER_URL', ($x === null) ? 1 : (int)$x);
52 52
 
53 53
 // don't allow /... at the end of URL
54 54
 //
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
 }
136 136
 
137 137
 function url_base() {
138
-    return is_https()?secure_url_base():URL_BASE;
138
+    return is_https() ?secure_url_base() : URL_BASE;
139 139
 }
140 140
 
141
-function send_cookie($name, $value, $permanent, $ops=false) {
141
+function send_cookie($name, $value, $permanent, $ops = false) {
142 142
     global $master_url;
143 143
 
144 144
     // the following allows independent login for projects on the same server
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
         $path = substr($path, 0, -1);
150 150
         $path .= "_ops/";
151 151
     }
152
-    $expire = $permanent?time()+3600*24*365:0;
152
+    $expire = $permanent ?time() + 3600*24*365 : 0;
153 153
     setcookie($name, $value, $expire, $path);
154 154
 }
155 155
 
156
-function clear_cookie($name, $ops=false) {
156
+function clear_cookie($name, $ops = false) {
157 157
     global $master_url;
158 158
     $url = parse_url($master_url);
159 159
     $path = $url['path'];
@@ -161,13 +161,13 @@  discard block
 block discarded – undo
161 161
         $path = substr($path, 0, -1);
162 162
         $path .= "_ops/";
163 163
     }
164
-    setcookie($name, '', time()-3600, $path);
164
+    setcookie($name, '', time() - 3600, $path);
165 165
 }
166 166
 
167 167
 $g_logged_in_user = null;
168 168
 $got_logged_in_user = false;
169 169
 
170
-function get_logged_in_user($must_be_logged_in=true) {
170
+function get_logged_in_user($must_be_logged_in = true) {
171 171
     global $g_logged_in_user, $got_logged_in_user;
172 172
     if ($got_logged_in_user) return $g_logged_in_user;
173 173
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
             $next_url = $_SERVER['REQUEST_URI'];
187 187
             $n = strrpos($next_url, "/");
188 188
             if ($n) {
189
-                $next_url = substr($next_url, $n+1);
189
+                $next_url = substr($next_url, $n + 1);
190 190
             }
191 191
         }
192 192
         $next_url = urlencode($next_url);
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
     return $g_logged_in_user;
198 198
 }
199 199
 
200
-function show_login_info($prefix="") {
200
+function show_login_info($prefix = "") {
201 201
     $user = get_logged_in_user(false);
202 202
     if ($user) {
203 203
         $url_tokens = url_tokens($user->authenticator);
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
     }
208 208
 }
209 209
 
210
-$cache_control_extra="";
210
+$cache_control_extra = "";
211 211
 $is_login_page = false;
212 212
 
213 213
 // Call this to start pages.
@@ -219,11 +219,11 @@  discard block
 block discarded – undo
219 219
 // with an existing web framework can more easily do so.
220 220
 // To do so, define page_head() in the project include file.
221 221
 //
222
-if (!function_exists("page_head")){
222
+if (!function_exists("page_head")) {
223 223
 function page_head(
224 224
     $title,
225 225
         // page title. Put in <title>, used as title for browser tab.
226
-    $body_attrs=null,
226
+    $body_attrs = null,
227 227
         // <body XXXX>
228 228
         // e.g. Javascript to put focus in an input field
229 229
         // (onload="document.form.foo.focus()")
@@ -232,10 +232,10 @@  discard block
 block discarded – undo
232 232
         // if set, include schedulers.txt.
233 233
         // also pass to project_banner() in case you want a different
234 234
         // header for your main page.
235
-    $url_prefix="",
235
+    $url_prefix = "",
236 236
         // prepend this to links.
237 237
         // Use for web pages not in the top directory
238
-    $head_extra=null
238
+    $head_extra = null
239 239
         // extra stuff to put in <head>. E.g.:
240 240
         // reCAPTCHA code (create_profile.php)
241 241
         // bbcode javascript (forums)
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
         header("Content-type: text/html; charset=utf-8");
254 254
         header("Expires: Mon, 26 Jul 1997 05:00:00 UTC");
255 255
             // Date in the past
256
-        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " UTC");
256
+        header("Last-Modified: ".gmdate("D, d M Y H:i:s")." UTC");
257 257
             // always modified
258 258
         header("Cache-Control: $cache_control_extra no-cache, must-revalidate, post-check=0, pre-check=0");
259 259
             // for HTTP/1.1
@@ -274,11 +274,11 @@  discard block
 block discarded – undo
274 274
     if ($head_extra) {
275 275
         echo "\n$head_extra\n";
276 276
     }
277
-    if ($is_main && (!defined('NO_COMPUTING')||!NO_COMPUTING)) {
277
+    if ($is_main && (!defined('NO_COMPUTING') || !NO_COMPUTING)) {
278 278
         readfile("schedulers.txt");
279 279
     }
280 280
 
281
-    $t = $title?$title:PROJECT;
281
+    $t = $title ? $title : PROJECT;
282 282
     echo "<title>$t</title>\n";
283 283
     echo '
284 284
         <meta charset="utf-8">
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
     echo '<div class="container-fluid">
315 315
     ';
316 316
 
317
-    switch($title) {    //kludge
317
+    switch ($title) {    //kludge
318 318
     case tra("Log in"):
319 319
     case tra("Create an account"):
320 320
     case tra("Server status page"):
@@ -329,13 +329,13 @@  discard block
 block discarded – undo
329 329
 
330 330
 // See the comments for page_head()
331 331
 //
332
-if (!function_exists("page_tail")){
332
+if (!function_exists("page_tail")) {
333 333
 function page_tail(
334
-    $show_date=false,
334
+    $show_date = false,
335 335
         // true for pages that are generated periodically rather than on the fly
336
-    $url_prefix="",
336
+    $url_prefix = "",
337 337
         // use for pages not at top level
338
-    $is_main=false
338
+    $is_main = false
339 339
         // passed to project_footer;
340 340
 ) {
341 341
     echo "<br>\n";
@@ -350,10 +350,10 @@  discard block
 block discarded – undo
350 350
 }
351 351
 }
352 352
 
353
-function display_cvs_versions(){
353
+function display_cvs_versions() {
354 354
     global $cvs_version_tracker;
355 355
     echo "\n<!-- SVN VERSIONS -->\n";
356
-    for ($i=0;$i<sizeof($cvs_version_tracker);$i++) {
356
+    for ($i = 0; $i < sizeof($cvs_version_tracker); $i++) {
357 357
         echo "<!-- ".$cvs_version_tracker[$i]." -->\n";
358 358
     }
359 359
 }
@@ -378,23 +378,23 @@  discard block
 block discarded – undo
378 378
 // takes argument in second and returns a human formatted time string
379 379
 // in the form D days + h Hours + m Min + s sec.
380 380
 
381
-function time_diff($x, $res=3) {
381
+function time_diff($x, $res = 3) {
382 382
     $days    = (int)($x/86400);
383
-    $hours   = (int)(($x-$days*86400)/3600);
384
-    $minutes = (int)(($x-$days*86400-$hours*3600)/60);
385
-    $seconds = (int)($x % 60);
383
+    $hours   = (int)(($x - $days*86400)/3600);
384
+    $minutes = (int)(($x - $days*86400 - $hours*3600)/60);
385
+    $seconds = (int)($x%60);
386 386
 
387 387
     $datestring = "";
388 388
     if ($days) {
389 389
         $datestring .= "$days ".tra("days")." ";
390 390
     }
391
-    if ($res>0 && ($hours || strlen($datestring))) {
391
+    if ($res > 0 && ($hours || strlen($datestring))) {
392 392
         $datestring .= "$hours ".tra("hours")." ";
393 393
     }
394
-    if ($res>1 && ($minutes || strlen($datestring))) {
394
+    if ($res > 1 && ($minutes || strlen($datestring))) {
395 395
         $datestring .= "$minutes ".tra("min")." ";
396 396
     }
397
-    if ($res>2 && ($seconds)) {
397
+    if ($res > 2 && ($seconds)) {
398 398
         $datestring .= "$seconds ".tra("sec")." ";
399 399
     }
400 400
 
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 
410 410
 function time_str($x) {
411 411
     if ($x == 0) return "---";
412
-    return gmdate('j M Y, G:i:s', $x) . " UTC";
412
+    return gmdate('j M Y, G:i:s', $x)." UTC";
413 413
 }
414 414
 
415 415
 function local_time_str($x) {
@@ -421,14 +421,14 @@  discard block
 block discarded – undo
421 421
     return time_str($x);
422 422
 }
423 423
 
424
-function start_table_str($class="", $style="") {
425
-    $s = $style?'style="'.$style.'"':'';
424
+function start_table_str($class = "", $style = "") {
425
+    $s = $style ? 'style="'.$style.'"' : '';
426 426
     return '<div class="table">
427 427
       <table '.$s.' width="100%" class="table table-condensed '.$class.'" >
428 428
     ';
429 429
 }
430 430
 
431
-function start_table($class="", $style="") {
431
+function start_table($class = "", $style = "") {
432 432
     echo start_table_str($class, $style);
433 433
 }
434 434
 
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
     echo "</tr>\n";
474 474
 }
475 475
 
476
-function row1($x, $ncols=2, $class="heading") {
476
+function row1($x, $ncols = 2, $class = "heading") {
477 477
     if ($class == "heading") {
478 478
         echo "<tr><th class=\"bg-primary\" colspan=\"$ncols\">$x</th></tr>\n";
479 479
     } else {
@@ -485,10 +485,10 @@  discard block
 block discarded – undo
485 485
 define('VALUE_ATTRS', 'style="padding-left:12px"');
486 486
 define('VALUE_ATTRS_ERR', 'class="danger" style="padding-left:12px"');
487 487
 
488
-function row2($x, $y, $show_error=false, $lwidth='40%') {
489
-    if ($x==="") $x="<br>";
490
-    if ($y==="") $y="<br>";
491
-    $attrs = $show_error?VALUE_ATTRS_ERR:VALUE_ATTRS;
488
+function row2($x, $y, $show_error = false, $lwidth = '40%') {
489
+    if ($x === "") $x = "<br>";
490
+    if ($y === "") $y = "<br>";
491
+    $attrs = $show_error ?VALUE_ATTRS_ERR:VALUE_ATTRS;
492 492
     echo "<tr>
493 493
         <td width=\"$lwidth\" ".NAME_ATTRS.">$x</td>
494 494
         <td $attrs >$y</td>
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
     ";
497 497
 }
498 498
 
499
-function row2_init($x, $y, $lwidth='40%') {
499
+function row2_init($x, $y, $lwidth = '40%') {
500 500
     echo '<tr>
501 501
         <td class="text-right " width="'.$lwidth.'"  style="padding-right: 20px;">'.$x.'</td>
502 502
         <td '.VALUE_ATTRS.'>'.$y.'
@@ -519,20 +519,20 @@  discard block
 block discarded – undo
519 519
     echo "</tr>\n";
520 520
 }
521 521
 
522
-define ('ALIGN_RIGHT', 'style="text-align:right;"');
522
+define('ALIGN_RIGHT', 'style="text-align:right;"');
523 523
 
524
-function row_heading_array($x, $attrs=null, $class='bg-primary') {
524
+function row_heading_array($x, $attrs = null, $class = 'bg-primary') {
525 525
     echo "<tr>";
526 526
     $i = 0;
527 527
     foreach ($x as $h) {
528
-        $a = $attrs?$attrs[$i]:"";
528
+        $a = $attrs ? $attrs[$i] : "";
529 529
         echo "<th $a class=\"$class\">$h</th>";
530 530
         $i++;
531 531
     }
532 532
     echo "</tr>\n";
533 533
 }
534 534
 
535
-function row_heading($x, $class='bg-primary') {
535
+function row_heading($x, $class = 'bg-primary') {
536 536
     echo sprintf('<tr><th class="%s" colspan=99>%s</th></tr>
537 537
         ', $class, $x
538 538
     );
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 // If $ellipsis is true, then an ellipsis is added to any sentence which
589 589
 // is cut short.
590 590
 
591
-function sub_sentence($sentence, $delimiter, $max_chars, $ellipsis=false) {
591
+function sub_sentence($sentence, $delimiter, $max_chars, $ellipsis = false) {
592 592
     $words = explode($delimiter, $sentence);
593 593
     $total_chars = 0;
594 594
     $trunc = false;
@@ -671,8 +671,8 @@  discard block
 block discarded – undo
671 671
 
672 672
 // returns null if the arg is optional and missing
673 673
 //
674
-function get_int($name, $optional=false) {
675
-    $x=null;
674
+function get_int($name, $optional = false) {
675
+    $x = null;
676 676
     if (isset($_GET[$name])) $x = $_GET[$name];
677 677
     if (!is_numeric($x)) {
678 678
         if ($optional) {
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
 
692 692
 // returns null if the arg is optional and missing
693 693
 //
694
-function post_num($name, $optional=false) {
694
+function post_num($name, $optional = false) {
695 695
     $x = null;
696 696
     if (isset($_POST[$name])) $x = $_POST[$name];
697 697
     if (!is_numeric($x)) {
@@ -706,7 +706,7 @@  discard block
 block discarded – undo
706 706
 
707 707
 // returns null if the arg is optional and missing
708 708
 //
709
-function post_int($name, $optional=false) {
709
+function post_int($name, $optional = false) {
710 710
     $x = post_num($name, $optional);
711 711
     if (is_null($x)) return null;
712 712
     $y = (int)$x;
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
     }
725 725
 }
726 726
 
727
-function get_str($name, $optional=false) {
727
+function get_str($name, $optional = false) {
728 728
     if (isset($_GET[$name])) {
729 729
         $x = $_GET[$name];
730 730
     } else {
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
     return undo_magic_quotes($x);
737 737
 }
738 738
 
739
-function post_str($name, $optional=false) {
739
+function post_str($name, $optional = false) {
740 740
     if (isset($_POST[$name])) {
741 741
         $x = $_POST[$name];
742 742
     } else {
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
     return undo_magic_quotes($x);
749 749
 }
750 750
 
751
-function post_arr($name, $optional=false) {
751
+function post_arr($name, $optional = false) {
752 752
     if (isset($_POST[$name]) && is_array($_POST[$name])) {
753 753
         $x = $_POST[$name];
754 754
     } else {
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
     // the mb_* functions are not included by default
765 765
     // return (mb_detect_encoding($passwd) -= 'ASCII');
766 766
 
767
-    for ($i=0; $i<strlen($str); $i++) {
767
+    for ($i = 0; $i < strlen($str); $i++) {
768 768
         $c = ord(substr($str, $i));
769 769
         if ($c < 32 || $c > 127) return false;
770 770
     }
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
     $number = str_replace(',', '.', $number); // replace the german decimal separator
789 789
     // if no value was entered and this is ok
790 790
     //
791
-    if ($number=='' && !$low) return true;
791
+    if ($number == '' && !$low) return true;
792 792
 
793 793
     // the supplied value contains alphabetic characters
794 794
     //
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 
806 806
 // Generate a "select" element from an array of values
807 807
 //
808
-function select_from_array($name, $array, $selection=null, $width=240) {
808
+function select_from_array($name, $array, $selection = null, $width = 240) {
809 809
     $out = '<select style="color:#000;"class="form-control input-sm" style="width:'.$width.'px" name="'.$name.'">"';
810 810
 
811 811
     foreach ($array as $key => $value) {
@@ -830,8 +830,8 @@  discard block
 block discarded – undo
830 830
     return $str;
831 831
 }
832 832
 
833
-function strip_bbcode($string){
834
-    return preg_replace("/((\[.+\])+?)(.+?)((\[\/.+\])+?)/","",$string);
833
+function strip_bbcode($string) {
834
+    return preg_replace("/((\[.+\])+?)(.+?)((\[\/.+\])+?)/", "", $string);
835 835
 }
836 836
 
837 837
 function current_url() {
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
 // @param class The optional CSS class of the button. Defaults to a standard button
860 860
 //
861 861
 
862
-function button_text($url, $text, $desc=null, $class="btn-success btn-sm") {
862
+function button_text($url, $text, $desc = null, $class = "btn-success btn-sm") {
863 863
     if (!$desc) {
864 864
         $desc = $text;
865 865
     }
@@ -868,19 +868,19 @@  discard block
 block discarded – undo
868 868
     );
869 869
 }
870 870
 
871
-function show_button($url, $text, $desc=null, $class="btn-success btn-sm") {
872
-    echo button_text($url, $text, $desc=null, $class);
871
+function show_button($url, $text, $desc = null, $class = "btn-success btn-sm") {
872
+    echo button_text($url, $text, $desc = null, $class);
873 873
 }
874 874
 
875 875
 // for places with a bunch of buttons, like forum posts
876 876
 //
877
-function show_button_small($url, $text, $desc=null) {
877
+function show_button_small($url, $text, $desc = null) {
878 878
     echo button_text($url, $text, $desc, "btn-primary btn-xs");
879 879
 }
880 880
 
881 881
 // used for showing icons
882 882
 //
883
-function show_image($src, $title, $alt, $height=null) {
883
+function show_image($src, $title, $alt, $height = null) {
884 884
     $h = "";
885 885
     if ($height) {
886 886
         $h = "height=\"$height\"";
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
 // tries instead to connect to <replica_db_host> if tag exists.
918 918
 // DEPRECATED - use boinc_db.inc
919 919
 //
920
-function db_init($try_replica=false) {
920
+function db_init($try_replica = false) {
921 921
     check_web_stopped();
922 922
     $retval = db_init_aux($try_replica);
923 923
     if ($retval == 1) {
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
 function sanitize_numeric($x) {
989 989
     if (is_numeric($x)) {
990 990
         return $x;
991
-    } else if (trim($x) == '' ) {
991
+    } else if (trim($x) == '') {
992 992
         return '';
993 993
     } else {
994 994
         return "not numeric";
@@ -1011,9 +1011,9 @@  discard block
 block discarded – undo
1011 1011
     return $c/(200/24);
1012 1012
 }
1013 1013
 
1014
-function do_download($path,$name="") {
1015
-    if (strcmp($name,"") == 0) {
1016
-        $name=basename($path);
1014
+function do_download($path, $name = "") {
1015
+    if (strcmp($name, "") == 0) {
1016
+        $name = basename($path);
1017 1017
     }
1018 1018
     header('Content-Description: File Transfer');
1019 1019
     header('Content-Type: application/octet-stream');
@@ -1022,7 +1022,7 @@  discard block
 block discarded – undo
1022 1022
     header('Expires: 0');
1023 1023
     header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
1024 1024
     header('Pragma: public');
1025
-    header('Content-Length: ' . filesize($path));
1025
+    header('Content-Length: '.filesize($path));
1026 1026
     flush();
1027 1027
     readfile($path);
1028 1028
 }
@@ -1071,10 +1071,10 @@  discard block
 block discarded – undo
1071 1071
 // Otherwise return 0.
1072 1072
 // Format of user agent string is "BOINC client (windows_x86_64 7.3.17)"
1073 1073
 //
1074
-function boinc_client_version(){
1074
+function boinc_client_version() {
1075 1075
     if (!array_key_exists('HTTP_USER_AGENT', $_SERVER)) return 0;
1076 1076
     $x = $_SERVER['HTTP_USER_AGENT'];
1077
-    $e =  "/BOINC client [^ ]* (\d+).(\d+).(\d+)\)/";
1077
+    $e = "/BOINC client [^ ]* (\d+).(\d+).(\d+)\)/";
1078 1078
     if (preg_match($e, $x, $matches)) {
1079 1079
         return $matches[1]*10000 + $matches[2]*100 + $matches[3];
1080 1080
     }
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
     $rem_name = $name."_remaining";
1104 1104
     return "<textarea name=\"$name\" class=\"form-control\" rows=3 id=\"$name\" onkeydown=\"text_counter(this.form.$name, this.form.$rem_name, $maxlen);\"
1105 1105
         onkeyup=\"text_counter(this.form.$name, this.form.$rem_name, $maxlen);\">".$text."</textarea>
1106
-        <br><input name=\"$rem_name\" type=\"text\" id=\"$rem_name\" value=\"".($maxlen-strlen($text))."\" size=\"3\" maxlength=\"3\" readonly> ".tra("characters remaining")
1106
+        <br><input name=\"$rem_name\" type=\"text\" id=\"$rem_name\" value=\"".($maxlen - strlen($text))."\" size=\"3\" maxlength=\"3\" readonly> ".tra("characters remaining")
1107 1107
     ;
1108 1108
 }
1109 1109
 
@@ -1133,7 +1133,7 @@  discard block
 block discarded – undo
1133 1133
 // use the following around text with long lines,
1134 1134
 // to limit the width and make it more readable.
1135 1135
 //
1136
-function text_start($width=640) {
1136
+function text_start($width = 640) {
1137 1137
     echo sprintf("<div style=\"max-width: %dpx;\">\n", $width);
1138 1138
 }
1139 1139
 function text_end() {
@@ -1146,9 +1146,9 @@  discard block
 block discarded – undo
1146 1146
 }
1147 1147
 
1148 1148
 function cert_filename() {
1149
-    return defined("CERT_FILENAME")?CERT_FILENAME:"cert1.php";
1149
+    return defined("CERT_FILENAME") ?CERT_FILENAME:"cert1.php";
1150 1150
 }
1151 1151
 
1152
-$cvs_version_tracker[]="\$Id$";  //Generated automatically - do not edit
1152
+$cvs_version_tracker[] = "\$Id$"; //Generated automatically - do not edit
1153 1153
 
1154 1154
 ?>
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -556,14 +556,14 @@
 block discarded – undo
556 556
     $tnow = get_str('tnow', true);
557 557
     $ttok = get_str('ttok', true);
558 558
     if (!$tnow) {
559
-      if (isset($_POST['tnow'])) {
560
-          $tnow = $_POST['tnow'];
561
-      }
559
+        if (isset($_POST['tnow'])) {
560
+            $tnow = $_POST['tnow'];
561
+        }
562 562
     }
563 563
     if (!$ttok) {
564
-      if (isset($_POST['ttok'])) {
565
-          $ttok = $_POST['ttok'];
566
-      }
564
+        if (isset($_POST['ttok'])) {
565
+            $ttok = $_POST['ttok'];
566
+        }
567 567
     }
568 568
     if (!$tnow) return false;
569 569
     if (!$ttok) return false;
Please login to merge, or discard this patch.
drupal/sites/default/boinc/modules/boinccore/includes/boinccore.rules.inc 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 function boinccore_rules_event_info() {
19 19
   return array(
20 20
     'boinccore_comment_convert' => array(
21
-      'label' => bts('A comment was converted to a new forum topic.', array(), NULL, 'boinc:rule-event'),
21
+      'label' => bts('A comment was converted to a new forum topic.', array(), null, 'boinc:rule-event'),
22 22
       'module' => 'BOINCcore',
23 23
       'arguments' => rules_events_hook_comment_arguments(t('converted comment')),
24 24
     ),
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -16,16 +16,16 @@
 block discarded – undo
16 16
  */
17 17
 
18 18
 function boinccore_rules_event_info() {
19
-  return array(
19
+    return array(
20 20
     'boinccore_comment_convert' => array(
21
-      'label' => bts('A comment was converted to a new forum topic.', array(), NULL, 'boinc:rule-event'),
22
-      'module' => 'BOINCcore',
23
-      'arguments' => rules_events_hook_comment_arguments(t('converted comment')),
21
+        'label' => bts('A comment was converted to a new forum topic.', array(), NULL, 'boinc:rule-event'),
22
+        'module' => 'BOINCcore',
23
+        'arguments' => rules_events_hook_comment_arguments(t('converted comment')),
24 24
     ),
25 25
     'boinccore_comment_unhidden' => array(
26
-      'label' => bts('A comment was unhidden.', array(), 'boinc:rule-event'),
27
-      'module' => 'BOINCcore',
28
-      'arguments' => rules_events_hook_comment_arguments(t('unhidden comment')),
26
+        'label' => bts('A comment was unhidden.', array(), 'boinc:rule-event'),
27
+        'module' => 'BOINCcore',
28
+        'arguments' => rules_events_hook_comment_arguments(t('unhidden comment')),
29 29
     ),
30
-  );
30
+    );
31 31
 }
32 32
\ No newline at end of file
Please login to merge, or discard this patch.