@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | */ |
21 | 21 | function pm_block_user_help($path) { |
22 | 22 | switch ($path) { |
23 | - case 'admin/settings/messages/block': |
|
24 | - return '<p>' . t('This area is used to define user blocking rules for the Privatemsg module. Rules allow control of who may block messages from whom. By default all users are allowed to block messages from anyone else. However, a site may have groups of users that need to contact or get information to others, for example: the site may have administrative staff or be a forum with moderators. Groups of users are defined by roles, which can be managed on the <a href="@roles">roles configuration page</a>.', array('@roles' => url('admin/user/roles'))) . '</p>'; |
|
23 | + case 'admin/settings/messages/block': |
|
24 | + return '<p>' . t('This area is used to define user blocking rules for the Privatemsg module. Rules allow control of who may block messages from whom. By default all users are allowed to block messages from anyone else. However, a site may have groups of users that need to contact or get information to others, for example: the site may have administrative staff or be a forum with moderators. Groups of users are defined by roles, which can be managed on the <a href="@roles">roles configuration page</a>.', array('@roles' => url('admin/user/roles'))) . '</p>'; |
|
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
@@ -485,14 +485,14 @@ discard block |
||
485 | 485 | function pm_block_user_form_submit($form, &$form_state) { |
486 | 486 | if ($form_state['values']['confirm']) { |
487 | 487 | switch ($form_state['values']['block_action']) { |
488 | - case 'block_user': |
|
489 | - db_query('INSERT INTO {pm_block_user} (author, recipient) VALUES (%d, %d)', $form_state['values']['author'], $form_state['values']['recipient']); |
|
490 | - drupal_set_message(t('@author has been blocked from sending you any further messages.', array('@author' => $form_state['values']['author_name']))); |
|
491 | - break; |
|
492 | - case 'unblock_user': |
|
493 | - db_query('DELETE FROM {pm_block_user} WHERE author = %d AND recipient = %d', $form_state['values']['author'], $form_state['values']['recipient']); |
|
494 | - drupal_set_message(t('@author is now allowed to send you new messages.', array('@author' => $form_state['values']['author_name']))); |
|
495 | - break; |
|
488 | + case 'block_user': |
|
489 | + db_query('INSERT INTO {pm_block_user} (author, recipient) VALUES (%d, %d)', $form_state['values']['author'], $form_state['values']['recipient']); |
|
490 | + drupal_set_message(t('@author has been blocked from sending you any further messages.', array('@author' => $form_state['values']['author_name']))); |
|
491 | + break; |
|
492 | + case 'unblock_user': |
|
493 | + db_query('DELETE FROM {pm_block_user} WHERE author = %d AND recipient = %d', $form_state['values']['author'], $form_state['values']['recipient']); |
|
494 | + drupal_set_message(t('@author is now allowed to send you new messages.', array('@author' => $form_state['values']['author_name']))); |
|
495 | + break; |
|
496 | 496 | } |
497 | 497 | } |
498 | 498 | $form_state['redirect'] = $form_state['values']['destination']; |
@@ -576,9 +576,9 @@ discard block |
||
576 | 576 | */ |
577 | 577 | function pm_block_user_user($op, &$edit, &$account, $category = NULL) { |
578 | 578 | switch ($op) { |
579 | - case 'delete': |
|
580 | - // Delete blocking rules which involve this user. |
|
581 | - db_query("DELETE FROM {pm_block_user} WHERE author = %d OR recipient = %d", $account->uid, $account->uid); |
|
582 | - break; |
|
579 | + case 'delete': |
|
580 | + // Delete blocking rules which involve this user. |
|
581 | + db_query("DELETE FROM {pm_block_user} WHERE author = %d OR recipient = %d", $account->uid, $account->uid); |
|
582 | + break; |
|
583 | 583 | } |
584 | 584 | } |
@@ -280,12 +280,12 @@ discard block |
||
280 | 280 | } |
281 | 281 | |
282 | 282 | switch ($op) { |
283 | - case 'delete': |
|
284 | - // Only call delete function on certain node types |
|
285 | - if (in_array( $node->type, $node_types)) { |
|
286 | - boinc_solr_comments_delete($node); |
|
287 | - } |
|
288 | - break; |
|
283 | + case 'delete': |
|
284 | + // Only call delete function on certain node types |
|
285 | + if (in_array( $node->type, $node_types)) { |
|
286 | + boinc_solr_comments_delete($node); |
|
287 | + } |
|
288 | + break; |
|
289 | 289 | } //switch |
290 | 290 | } |
291 | 291 | |
@@ -335,13 +335,13 @@ discard block |
||
335 | 335 | */ |
336 | 336 | function boinc_solr_comments_comment(&$a1, $op) { |
337 | 337 | switch ($op) { |
338 | - case 'view': |
|
339 | - case 'update': |
|
340 | - break; |
|
341 | - case 'delete': |
|
342 | - // $a1 should be a comment object |
|
343 | - boinc_solr_comments_deletecomment($a1); |
|
344 | - break; |
|
338 | + case 'view': |
|
339 | + case 'update': |
|
340 | + break; |
|
341 | + case 'delete': |
|
342 | + // $a1 should be a comment object |
|
343 | + boinc_solr_comments_deletecomment($a1); |
|
344 | + break; |
|
345 | 345 | }// switch |
346 | 346 | } |
347 | 347 |
@@ -19,10 +19,10 @@ |
||
19 | 19 | foreach (content_types() as $key => $info) { |
20 | 20 | // Exclude node types profile, team, and panel |
21 | 21 | switch ($key) { |
22 | - case 'profile': |
|
23 | - case 'team': |
|
24 | - case 'panel': |
|
25 | - continue 2; |
|
22 | + case 'profile': |
|
23 | + case 'team': |
|
24 | + case 'panel': |
|
25 | + continue 2; |
|
26 | 26 | }// switch key |
27 | 27 | $options[$key] = $info['name']; |
28 | 28 | } |
@@ -1066,42 +1066,42 @@ |
||
1066 | 1066 | $R=$StartR;$G=$StartG;$B=$StartB; |
1067 | 1067 | switch($Direction) |
1068 | 1068 | { |
1069 | - case DIRECTION_VERTICAL: |
|
1070 | - $StartY = $Y1; $EndY = floor($Y2)+1; $LastY2 = $StartY; |
|
1071 | - for($i=0;$i<=$Step;$i++) |
|
1069 | + case DIRECTION_VERTICAL: |
|
1070 | + $StartY = $Y1; $EndY = floor($Y2)+1; $LastY2 = $StartY; |
|
1071 | + for($i=0;$i<=$Step;$i++) |
|
1072 | + { |
|
1073 | + $Y2 = floor($StartY + ($i * $StepSize)); |
|
1074 | + |
|
1075 | + if ($Y2 > $EndY) { $Y2 = $EndY; } |
|
1076 | + if (($Y1 != $Y2 && $Y1 < $Y2) || $Y2 == $EndY) |
|
1072 | 1077 | { |
1073 | - $Y2 = floor($StartY + ($i * $StepSize)); |
|
1074 | - |
|
1075 | - if ($Y2 > $EndY) { $Y2 = $EndY; } |
|
1076 | - if (($Y1 != $Y2 && $Y1 < $Y2) || $Y2 == $EndY) |
|
1077 | - { |
|
1078 | - $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha); |
|
1079 | - $this->drawFilledRectangle($X1,$Y1,$X2,$Y2,$Color); |
|
1080 | - $LastY2 = max($LastY2,$Y2); |
|
1081 | - $Y1 = $Y2+1; |
|
1082 | - } |
|
1083 | - $R = $R + $RStep; $G = $G + $GStep; $B = $B + $BStep; |
|
1078 | + $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha); |
|
1079 | + $this->drawFilledRectangle($X1,$Y1,$X2,$Y2,$Color); |
|
1080 | + $LastY2 = max($LastY2,$Y2); |
|
1081 | + $Y1 = $Y2+1; |
|
1084 | 1082 | } |
1085 | - if ( $LastY2 < $EndY && isset($Color)) { for ($i=$LastY2+1;$i<=$EndY;$i++) { $this->drawLine($X1,$i,$X2,$i,$Color); } } |
|
1086 | - break; |
|
1087 | - |
|
1088 | - case DIRECTION_HORIZONTAL: |
|
1089 | - $StartX = $X1; $EndX = $X2; |
|
1090 | - for($i=0;$i<=$Step;$i++) |
|
1083 | + $R = $R + $RStep; $G = $G + $GStep; $B = $B + $BStep; |
|
1084 | + } |
|
1085 | + if ( $LastY2 < $EndY && isset($Color)) { for ($i=$LastY2+1;$i<=$EndY;$i++) { $this->drawLine($X1,$i,$X2,$i,$Color); } } |
|
1086 | + break; |
|
1087 | + |
|
1088 | + case DIRECTION_HORIZONTAL: |
|
1089 | + $StartX = $X1; $EndX = $X2; |
|
1090 | + for($i=0;$i<=$Step;$i++) |
|
1091 | + { |
|
1092 | + $X2 = floor($StartX + ($i * $StepSize)); |
|
1093 | + |
|
1094 | + if ($X2 > $EndX) { $X2 = $EndX; } |
|
1095 | + if (($X1 != $X2 && $X1 < $X2) || $X2 == $EndX) |
|
1091 | 1096 | { |
1092 | - $X2 = floor($StartX + ($i * $StepSize)); |
|
1093 | - |
|
1094 | - if ($X2 > $EndX) { $X2 = $EndX; } |
|
1095 | - if (($X1 != $X2 && $X1 < $X2) || $X2 == $EndX) |
|
1096 | - { |
|
1097 | - $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha); |
|
1098 | - $this->drawFilledRectangle($X1,$Y1,$X2,$Y2,$Color); |
|
1099 | - $X1 = $X2+1; |
|
1100 | - } |
|
1101 | - $R = $R + $RStep; $G = $G + $GStep; $B = $B + $BStep; |
|
1097 | + $Color = array("R"=>$R,"G"=>$G,"B"=>$B,"Alpha"=>$Alpha); |
|
1098 | + $this->drawFilledRectangle($X1,$Y1,$X2,$Y2,$Color); |
|
1099 | + $X1 = $X2+1; |
|
1102 | 1100 | } |
1103 | - if ( $X2 < $EndX && isset($Color)) { $this->drawFilledRectangle($X2,$Y1,$EndX,$Y2,$Color); } |
|
1104 | - break; |
|
1101 | + $R = $R + $RStep; $G = $G + $GStep; $B = $B + $BStep; |
|
1102 | + } |
|
1103 | + if ( $X2 < $EndX && isset($Color)) { $this->drawFilledRectangle($X2,$Y1,$EndX,$Y2,$Color); } |
|
1104 | + break; |
|
1105 | 1105 | } |
1106 | 1106 | |
1107 | 1107 | $this->Shadow = $Shadow; |
@@ -643,9 +643,9 @@ |
||
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 |
@@ -180,12 +180,12 @@ |
||
180 | 180 | */ |
181 | 181 | function boincwork_locale($op = 'groups', $group = NULL) { |
182 | 182 | switch ($op) { |
183 | - case 'groups': |
|
184 | - return array('project' => bts('Project')); |
|
185 | - case 'info': |
|
186 | - $info['project']['refresh callback'] = 'boincwork_locale_refresh'; |
|
187 | - $info['project']['format'] = FALSE; |
|
188 | - return $info; |
|
183 | + case 'groups': |
|
184 | + return array('project' => bts('Project')); |
|
185 | + case 'info': |
|
186 | + $info['project']['refresh callback'] = 'boincwork_locale_refresh'; |
|
187 | + $info['project']['format'] = FALSE; |
|
188 | + return $info; |
|
189 | 189 | } |
190 | 190 | } |
191 | 191 |
@@ -300,125 +300,125 @@ |
||
300 | 300 | } |
301 | 301 | |
302 | 302 | switch ($form_state['values']['import']) { |
303 | - case 'users': |
|
304 | - boincimport_users(); |
|
305 | - break; |
|
306 | - |
|
307 | - case 'teams': |
|
308 | - boincimport_teams(); |
|
309 | - if (!variable_get('boincimport_import_team_successful', 0)) { |
|
310 | - $_SESSION['boincimport_stage_selected'] = 'teams'; |
|
311 | - } |
|
312 | - else { |
|
313 | - $_SESSION['boincimport_stage_selected'] = 'friends'; |
|
314 | - } |
|
315 | - break; |
|
303 | + case 'users': |
|
304 | + boincimport_users(); |
|
305 | + break; |
|
316 | 306 | |
317 | - case 'friends': |
|
318 | - boincimport_friends(); |
|
319 | - if (!variable_get('boincimport_import_friend_successful', 0)) { |
|
320 | - $_SESSION['boincimport_stage_selected'] = 'friends'; |
|
321 | - } |
|
322 | - else { |
|
323 | - $_SESSION['boincimport_stage_selected'] = 'preferences'; |
|
324 | - } |
|
325 | - break; |
|
307 | + case 'teams': |
|
308 | + boincimport_teams(); |
|
309 | + if (!variable_get('boincimport_import_team_successful', 0)) { |
|
310 | + $_SESSION['boincimport_stage_selected'] = 'teams'; |
|
311 | + } |
|
312 | + else { |
|
313 | + $_SESSION['boincimport_stage_selected'] = 'friends'; |
|
314 | + } |
|
315 | + break; |
|
326 | 316 | |
327 | - case 'preferences': |
|
328 | - boincimport_preferences(); |
|
329 | - if (!variable_get('boincimport_import_preferences_successful', 0)) { |
|
330 | - $_SESSION['boincimport_stage_selected'] = 'preferences'; |
|
331 | - } |
|
332 | - else { |
|
333 | - $_SESSION['boincimport_stage_selected'] = 'private messages'; |
|
334 | - } |
|
335 | - break; |
|
317 | + case 'friends': |
|
318 | + boincimport_friends(); |
|
319 | + if (!variable_get('boincimport_import_friend_successful', 0)) { |
|
320 | + $_SESSION['boincimport_stage_selected'] = 'friends'; |
|
321 | + } |
|
322 | + else { |
|
323 | + $_SESSION['boincimport_stage_selected'] = 'preferences'; |
|
324 | + } |
|
325 | + break; |
|
336 | 326 | |
337 | - case 'private messages': |
|
338 | - boincimport_private_msgs(); |
|
339 | - if (!variable_get('boincimport_import_private_msg_successful', 0)) { |
|
340 | - $_SESSION['boincimport_stage_selected'] = 'private messages'; |
|
341 | - } |
|
342 | - else { |
|
343 | - $_SESSION['boincimport_stage_selected'] = 'categories'; |
|
344 | - } |
|
345 | - break; |
|
327 | + case 'preferences': |
|
328 | + boincimport_preferences(); |
|
329 | + if (!variable_get('boincimport_import_preferences_successful', 0)) { |
|
330 | + $_SESSION['boincimport_stage_selected'] = 'preferences'; |
|
331 | + } |
|
332 | + else { |
|
333 | + $_SESSION['boincimport_stage_selected'] = 'private messages'; |
|
334 | + } |
|
335 | + break; |
|
346 | 336 | |
347 | - case 'categories': |
|
348 | - boincimport_forum_categories(); |
|
349 | - if (!variable_get('boincimport_import_category_successful', 0)) { |
|
350 | - $_SESSION['boincimport_stage_selected'] = 'categories'; |
|
351 | - } |
|
352 | - else { |
|
353 | - $_SESSION['boincimport_stage_selected'] = 'topics'; |
|
354 | - } |
|
355 | - break; |
|
337 | + case 'private messages': |
|
338 | + boincimport_private_msgs(); |
|
339 | + if (!variable_get('boincimport_import_private_msg_successful', 0)) { |
|
340 | + $_SESSION['boincimport_stage_selected'] = 'private messages'; |
|
341 | + } |
|
342 | + else { |
|
343 | + $_SESSION['boincimport_stage_selected'] = 'categories'; |
|
344 | + } |
|
345 | + break; |
|
356 | 346 | |
357 | - case 'topics': |
|
358 | - boincimport_forum_topics(); |
|
359 | - if (!variable_get('boincimport_import_topic_successful', 0)) { |
|
360 | - $_SESSION['boincimport_stage_selected'] = 'topics'; |
|
361 | - } |
|
362 | - else { |
|
363 | - $_SESSION['boincimport_stage_selected'] = 'posts'; |
|
364 | - } |
|
365 | - break; |
|
347 | + case 'categories': |
|
348 | + boincimport_forum_categories(); |
|
349 | + if (!variable_get('boincimport_import_category_successful', 0)) { |
|
350 | + $_SESSION['boincimport_stage_selected'] = 'categories'; |
|
351 | + } |
|
352 | + else { |
|
353 | + $_SESSION['boincimport_stage_selected'] = 'topics'; |
|
354 | + } |
|
355 | + break; |
|
356 | + |
|
357 | + case 'topics': |
|
358 | + boincimport_forum_topics(); |
|
359 | + if (!variable_get('boincimport_import_topic_successful', 0)) { |
|
360 | + $_SESSION['boincimport_stage_selected'] = 'topics'; |
|
361 | + } |
|
362 | + else { |
|
363 | + $_SESSION['boincimport_stage_selected'] = 'posts'; |
|
364 | + } |
|
365 | + break; |
|
366 | 366 | |
367 | - case 'posts': |
|
368 | - boincimport_forum_posts(); |
|
369 | - if (!variable_get('boincimport_import_post_successful', 0)) { |
|
370 | - $_SESSION['boincimport_stage_selected'] = 'posts'; |
|
371 | - } |
|
372 | - else { |
|
373 | - $_SESSION['boincimport_stage_selected'] = 'url'; |
|
374 | - } |
|
375 | - break; |
|
367 | + case 'posts': |
|
368 | + boincimport_forum_posts(); |
|
369 | + if (!variable_get('boincimport_import_post_successful', 0)) { |
|
370 | + $_SESSION['boincimport_stage_selected'] = 'posts'; |
|
371 | + } |
|
372 | + else { |
|
373 | + $_SESSION['boincimport_stage_selected'] = 'url'; |
|
374 | + } |
|
375 | + break; |
|
376 | 376 | |
377 | - case 'team forums': |
|
378 | - boincimport_team_forums(); |
|
379 | - if (!variable_get('boincimport_team_forum_successful', 0)) { |
|
380 | - $_SESSION['boincimport_stage_selected'] = 'team forums'; |
|
381 | - } |
|
382 | - else { |
|
383 | - $_SESSION['boincimport_stage_selected'] = 'team topics'; |
|
384 | - } |
|
385 | - break; |
|
377 | + case 'team forums': |
|
378 | + boincimport_team_forums(); |
|
379 | + if (!variable_get('boincimport_team_forum_successful', 0)) { |
|
380 | + $_SESSION['boincimport_stage_selected'] = 'team forums'; |
|
381 | + } |
|
382 | + else { |
|
383 | + $_SESSION['boincimport_stage_selected'] = 'team topics'; |
|
384 | + } |
|
385 | + break; |
|
386 | 386 | |
387 | - case 'team topics': |
|
388 | - boincimport_team_forum_topics(); |
|
389 | - if (!variable_get('boincimport_team_topic_successful', 0)) { |
|
390 | - $_SESSION['boincimport_stage_selected'] = 'team topics'; |
|
391 | - } |
|
392 | - else { |
|
393 | - $_SESSION['boincimport_stage_selected'] = 'team posts'; |
|
394 | - } |
|
395 | - break; |
|
387 | + case 'team topics': |
|
388 | + boincimport_team_forum_topics(); |
|
389 | + if (!variable_get('boincimport_team_topic_successful', 0)) { |
|
390 | + $_SESSION['boincimport_stage_selected'] = 'team topics'; |
|
391 | + } |
|
392 | + else { |
|
393 | + $_SESSION['boincimport_stage_selected'] = 'team posts'; |
|
394 | + } |
|
395 | + break; |
|
396 | 396 | |
397 | - case 'team posts': |
|
398 | - boincimport_team_forum_posts(); |
|
399 | - if (!variable_get('boincimport_team_post_successful', 0)) { |
|
400 | - $_SESSION['boincimport_stage_selected'] = 'team posts'; |
|
401 | - } |
|
402 | - else { |
|
403 | - $_SESSION['boincimport_stage_selected'] = 'url'; |
|
404 | - } |
|
405 | - break; |
|
397 | + case 'team posts': |
|
398 | + boincimport_team_forum_posts(); |
|
399 | + if (!variable_get('boincimport_team_post_successful', 0)) { |
|
400 | + $_SESSION['boincimport_stage_selected'] = 'team posts'; |
|
401 | + } |
|
402 | + else { |
|
403 | + $_SESSION['boincimport_stage_selected'] = 'url'; |
|
404 | + } |
|
405 | + break; |
|
406 | 406 | |
407 | - case 'url': |
|
408 | - boincimport_replace_urls(); |
|
409 | - if (!variable_get('boincimport_replace_url_successful', 0)) { |
|
410 | - $_SESSION['boincimport_stage_selected'] = 'url'; |
|
411 | - } |
|
412 | - else { |
|
413 | - drupal_set_message('Congratulations. Import Finished'); |
|
414 | - drupal_set_message('Please visit the '. l('Post migration configuration', 'admin/boinc/import/post_configuration') .' page'); |
|
415 | - watchdog('boincimport', 'Import process is complete', array(), WATCHDOG_INFO); |
|
416 | - unset($_SESSION['boincimport_stage_selected']); |
|
417 | - } |
|
418 | - break; |
|
419 | - default: |
|
420 | - $_SESSION['boincimport_stage_selected'] = 'users'; |
|
421 | - break; |
|
407 | + case 'url': |
|
408 | + boincimport_replace_urls(); |
|
409 | + if (!variable_get('boincimport_replace_url_successful', 0)) { |
|
410 | + $_SESSION['boincimport_stage_selected'] = 'url'; |
|
411 | + } |
|
412 | + else { |
|
413 | + drupal_set_message('Congratulations. Import Finished'); |
|
414 | + drupal_set_message('Please visit the '. l('Post migration configuration', 'admin/boinc/import/post_configuration') .' page'); |
|
415 | + watchdog('boincimport', 'Import process is complete', array(), WATCHDOG_INFO); |
|
416 | + unset($_SESSION['boincimport_stage_selected']); |
|
417 | + } |
|
418 | + break; |
|
419 | + default: |
|
420 | + $_SESSION['boincimport_stage_selected'] = 'users'; |
|
421 | + break; |
|
422 | 422 | } |
423 | 423 | } |
424 | 424 |
@@ -1377,72 +1377,72 @@ |
||
1377 | 1377 | |
1378 | 1378 | switch ($op) { |
1379 | 1379 | // Return stored strings |
1380 | - case 'mem-report': |
|
1381 | - return $strings; |
|
1380 | + case 'mem-report': |
|
1381 | + return $strings; |
|
1382 | 1382 | |
1383 | - // Store string in memory (only supports single strings) |
|
1384 | - case 'mem-store': |
|
1385 | - $strings[$value['msgid']] = $value['msgstr']; |
|
1386 | - return; |
|
1383 | + // Store string in memory (only supports single strings) |
|
1384 | + case 'mem-store': |
|
1385 | + $strings[$value['msgid']] = $value['msgstr']; |
|
1386 | + return; |
|
1387 | 1387 | |
1388 | - // Called at end of import to inform the user |
|
1389 | - case 'db-report': |
|
1390 | - return array( |
|
1391 | - $headerdone, |
|
1392 | - $report['additions'], |
|
1393 | - $report['updates'], |
|
1394 | - $report['deletes'], |
|
1395 | - $report['skips'], |
|
1396 | - ); |
|
1388 | + // Called at end of import to inform the user |
|
1389 | + case 'db-report': |
|
1390 | + return array( |
|
1391 | + $headerdone, |
|
1392 | + $report['additions'], |
|
1393 | + $report['updates'], |
|
1394 | + $report['deletes'], |
|
1395 | + $report['skips'], |
|
1396 | + ); |
|
1397 | 1397 | |
1398 | - // Store the string we got in the database. |
|
1399 | - case 'db-store': |
|
1400 | - // We got header information. |
|
1401 | - if ($value['msgid'] == '') { |
|
1402 | - $languages = language_list(); |
|
1403 | - if (($mode != LOCALE_IMPORT_KEEP) || empty($languages[$lang]->plurals)) { |
|
1404 | - // Since we only need to parse the header if we ought to update the |
|
1405 | - // plural formula, only run this if we don't need to keep existing |
|
1406 | - // data untouched or if we don't have an existing plural formula. |
|
1407 | - $header = _locale_import_parse_header($value['msgstr']); |
|
1398 | + // Store the string we got in the database. |
|
1399 | + case 'db-store': |
|
1400 | + // We got header information. |
|
1401 | + if ($value['msgid'] == '') { |
|
1402 | + $languages = language_list(); |
|
1403 | + if (($mode != LOCALE_IMPORT_KEEP) || empty($languages[$lang]->plurals)) { |
|
1404 | + // Since we only need to parse the header if we ought to update the |
|
1405 | + // plural formula, only run this if we don't need to keep existing |
|
1406 | + // data untouched or if we don't have an existing plural formula. |
|
1407 | + $header = _locale_import_parse_header($value['msgstr']); |
|
1408 | 1408 | |
1409 | - // Get and store the plural formula if available. |
|
1410 | - if (isset($header["Plural-Forms"]) && $p = _locale_import_parse_plural_forms($header["Plural-Forms"], $file->filename)) { |
|
1411 | - list($nplurals, $plural) = $p; |
|
1412 | - db_query("UPDATE {languages} SET plurals = %d, formula = '%s' WHERE language = '%s'", $nplurals, $plural, $lang); |
|
1413 | - } |
|
1409 | + // Get and store the plural formula if available. |
|
1410 | + if (isset($header["Plural-Forms"]) && $p = _locale_import_parse_plural_forms($header["Plural-Forms"], $file->filename)) { |
|
1411 | + list($nplurals, $plural) = $p; |
|
1412 | + db_query("UPDATE {languages} SET plurals = %d, formula = '%s' WHERE language = '%s'", $nplurals, $plural, $lang); |
|
1414 | 1413 | } |
1415 | - $headerdone = TRUE; |
|
1416 | 1414 | } |
1415 | + $headerdone = TRUE; |
|
1416 | + } |
|
1417 | 1417 | |
1418 | - else { |
|
1419 | - // Some real string to import. |
|
1420 | - $comments = _locale_import_shorten_comments(empty($value['#']) ? array() : $value['#']); |
|
1418 | + else { |
|
1419 | + // Some real string to import. |
|
1420 | + $comments = _locale_import_shorten_comments(empty($value['#']) ? array() : $value['#']); |
|
1421 | 1421 | |
1422 | - if (strpos($value['msgid'], "\0")) { |
|
1423 | - // This string has plural versions. |
|
1424 | - $english = explode("\0", $value['msgid'], 2); |
|
1425 | - $entries = array_keys($value['msgstr']); |
|
1426 | - for ($i = 3; $i <= count($entries); $i++) { |
|
1427 | - $english[] = $english[1]; |
|
1428 | - } |
|
1429 | - $translation = array_map('_locale_import_append_plural', $value['msgstr'], $entries); |
|
1430 | - $english = array_map('_locale_import_append_plural', $english, $entries); |
|
1431 | - foreach ($translation as $key => $trans) { |
|
1432 | - if ($key == 0) { |
|
1433 | - $plid = 0; |
|
1434 | - } |
|
1435 | - $plid = _boinctranslate_locale_import_one_string_db($report, $lang, $english[$key], $trans, $group, $comments, $mode, $plid, $key); |
|
1422 | + if (strpos($value['msgid'], "\0")) { |
|
1423 | + // This string has plural versions. |
|
1424 | + $english = explode("\0", $value['msgid'], 2); |
|
1425 | + $entries = array_keys($value['msgstr']); |
|
1426 | + for ($i = 3; $i <= count($entries); $i++) { |
|
1427 | + $english[] = $english[1]; |
|
1428 | + } |
|
1429 | + $translation = array_map('_locale_import_append_plural', $value['msgstr'], $entries); |
|
1430 | + $english = array_map('_locale_import_append_plural', $english, $entries); |
|
1431 | + foreach ($translation as $key => $trans) { |
|
1432 | + if ($key == 0) { |
|
1433 | + $plid = 0; |
|
1436 | 1434 | } |
1435 | + $plid = _boinctranslate_locale_import_one_string_db($report, $lang, $english[$key], $trans, $group, $comments, $mode, $plid, $key); |
|
1437 | 1436 | } |
1437 | + } |
|
1438 | 1438 | |
1439 | - else { |
|
1440 | - // A simple string to import. |
|
1441 | - $english = $value['msgid']; |
|
1442 | - $translation = $value['msgstr']; |
|
1443 | - _boinctranslate_locale_import_one_string_db($report, $lang, $english, $translation, $group, $comments, $mode); |
|
1444 | - } |
|
1439 | + else { |
|
1440 | + // A simple string to import. |
|
1441 | + $english = $value['msgid']; |
|
1442 | + $translation = $value['msgstr']; |
|
1443 | + _boinctranslate_locale_import_one_string_db($report, $lang, $english, $translation, $group, $comments, $mode); |
|
1445 | 1444 | } |
1445 | + } |
|
1446 | 1446 | } // end of db-store operation |
1447 | 1447 | } |
1448 | 1448 |
@@ -578,13 +578,13 @@ discard block |
||
578 | 578 | $sender = user_load($sender->uid); |
579 | 579 | |
580 | 580 | switch ($status) { |
581 | - case FLAG_FRIEND_FLAGGED: |
|
582 | - // Sender accepted recipient's friend request |
|
583 | - $email['subject'] = bts('!name accepted your friend request [!site]', array( |
|
584 | - '!name' => $sender->boincuser_name, |
|
585 | - '!site' => variable_get('site_name', ''), |
|
586 | - )); |
|
587 | - $email['body'] = bts('!name confirmed you as a friend on !site. |
|
581 | + case FLAG_FRIEND_FLAGGED: |
|
582 | + // Sender accepted recipient's friend request |
|
583 | + $email['subject'] = bts('!name accepted your friend request [!site]', array( |
|
584 | + '!name' => $sender->boincuser_name, |
|
585 | + '!site' => variable_get('site_name', ''), |
|
586 | + )); |
|
587 | + $email['body'] = bts('!name confirmed you as a friend on !site. |
|
588 | 588 | |
589 | 589 | Follow this link to view his or her profile: |
590 | 590 | !link |
@@ -593,17 +593,17 @@ discard block |
||
593 | 593 | |
594 | 594 | Thanks, |
595 | 595 | The !site team', array( |
596 | - '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
597 | - '!site' => variable_get('site_name', ''), |
|
598 | - '!message' => $flag->friend_message ? bts('Message') . ': ' . $flag->friend_message : '', |
|
599 | - '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
600 | - )); |
|
601 | - break; |
|
596 | + '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
597 | + '!site' => variable_get('site_name', ''), |
|
598 | + '!message' => $flag->friend_message ? bts('Message') . ': ' . $flag->friend_message : '', |
|
599 | + '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
600 | + )); |
|
601 | + break; |
|
602 | 602 | |
603 | - case FLAG_FRIEND_PENDING: |
|
604 | - // Sender is requesting to be recipient's friend |
|
605 | - $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', ''))); |
|
606 | - $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts. |
|
603 | + case FLAG_FRIEND_PENDING: |
|
604 | + // Sender is requesting to be recipient's friend |
|
605 | + $email['subject'] = bts('Friend request from !name [!site]', array('!name' => $sender->boincuser_name, '!site' => variable_get('site_name', ''))); |
|
606 | + $email['body'] = bts('!name added you as a friend on !site. You can approve or deny this request. Denying a request will not send a notification, but will remove the request from both of your accounts. |
|
607 | 607 | |
608 | 608 | Follow the link below to view this request: |
609 | 609 | !link |
@@ -612,12 +612,12 @@ discard block |
||
612 | 612 | |
613 | 613 | Thanks, |
614 | 614 | The !site team', array( |
615 | - '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
616 | - '!site' => variable_get('site_name', ''), |
|
617 | - '!message' => $flag->friend_message ? bts('Message') . ': ' . $flag->friend_message : '', |
|
618 | - '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
|
619 | - )); |
|
620 | - break; |
|
615 | + '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
|
616 | + '!site' => variable_get('site_name', ''), |
|
617 | + '!message' => $flag->friend_message ? bts('Message') . ': ' . $flag->friend_message : '', |
|
618 | + '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
|
619 | + )); |
|
620 | + break; |
|
621 | 621 | } |
622 | 622 | return $email; |
623 | 623 | } |