@@ -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 |
@@ -551,12 +551,12 @@ discard block |
||
551 | 551 | */ |
552 | 552 | function boinccore_locale($op = 'groups', $group = NULL) { |
553 | 553 | switch ($op) { |
554 | - case 'groups': |
|
555 | - return array('boinc' => bts('BOINC')); |
|
556 | - case 'info': |
|
557 | - //$info['boinc']['refresh callback'] = 'boinccore_locale_refresh'; |
|
558 | - $info['boinc']['format'] = FALSE; |
|
559 | - return $info; |
|
554 | + case 'groups': |
|
555 | + return array('boinc' => bts('BOINC')); |
|
556 | + case 'info': |
|
557 | + //$info['boinc']['refresh callback'] = 'boinccore_locale_refresh'; |
|
558 | + $info['boinc']['format'] = FALSE; |
|
559 | + return $info; |
|
560 | 560 | } |
561 | 561 | } |
562 | 562 | |
@@ -1853,19 +1853,19 @@ discard block |
||
1853 | 1853 | // Transform arguments before inserting them. |
1854 | 1854 | foreach ($args as $key => $value) { |
1855 | 1855 | switch ($key [0]) { |
1856 | - case '@': |
|
1857 | - // Escaped only. |
|
1858 | - $args [$key] = check_plain($value); |
|
1859 | - break; |
|
1856 | + case '@': |
|
1857 | + // Escaped only. |
|
1858 | + $args [$key] = check_plain($value); |
|
1859 | + break; |
|
1860 | 1860 | |
1861 | - case '%': |
|
1862 | - default: |
|
1863 | - // Escaped and placeholder. |
|
1864 | - $args [$key] = theme('placeholder', $value); |
|
1865 | - break; |
|
1861 | + case '%': |
|
1862 | + default: |
|
1863 | + // Escaped and placeholder. |
|
1864 | + $args [$key] = theme('placeholder', $value); |
|
1865 | + break; |
|
1866 | 1866 | |
1867 | - case '!': |
|
1868 | - // Pass-through. |
|
1867 | + case '!': |
|
1868 | + // Pass-through. |
|
1869 | 1869 | } |
1870 | 1870 | } |
1871 | 1871 | return strtr($string, $args); |
@@ -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 | } |
@@ -221,28 +221,28 @@ discard block |
||
221 | 221 | return; |
222 | 222 | } |
223 | 223 | switch ($this->Debugoutput) { |
224 | - case 'error_log': |
|
225 | - //Don't output, just log |
|
226 | - error_log($str); |
|
227 | - break; |
|
228 | - case 'html': |
|
229 | - //Cleans up output a bit for a better looking, HTML-safe output |
|
230 | - echo htmlentities( |
|
231 | - preg_replace('/[\r\n]+/', '', $str), |
|
232 | - ENT_QUOTES, |
|
233 | - 'UTF-8' |
|
234 | - ) |
|
235 | - . "<br>\n"; |
|
236 | - break; |
|
237 | - case 'echo': |
|
238 | - default: |
|
239 | - //Normalize line breaks |
|
240 | - $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str); |
|
241 | - echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( |
|
242 | - "\n", |
|
243 | - "\n \t ", |
|
244 | - trim($str) |
|
245 | - )."\n"; |
|
224 | + case 'error_log': |
|
225 | + //Don't output, just log |
|
226 | + error_log($str); |
|
227 | + break; |
|
228 | + case 'html': |
|
229 | + //Cleans up output a bit for a better looking, HTML-safe output |
|
230 | + echo htmlentities( |
|
231 | + preg_replace('/[\r\n]+/', '', $str), |
|
232 | + ENT_QUOTES, |
|
233 | + 'UTF-8' |
|
234 | + ) |
|
235 | + . "<br>\n"; |
|
236 | + break; |
|
237 | + case 'echo': |
|
238 | + default: |
|
239 | + //Normalize line breaks |
|
240 | + $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str); |
|
241 | + echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( |
|
242 | + "\n", |
|
243 | + "\n \t ", |
|
244 | + trim($str) |
|
245 | + )."\n"; |
|
246 | 246 | } |
247 | 247 | } |
248 | 248 | |
@@ -435,48 +435,48 @@ discard block |
||
435 | 435 | $authtype = 'LOGIN'; |
436 | 436 | } |
437 | 437 | switch ($authtype) { |
438 | - case 'PLAIN': |
|
439 | - // Start authentication |
|
440 | - if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) { |
|
441 | - return false; |
|
442 | - } |
|
443 | - // Send encoded username and password |
|
444 | - if (!$this->sendCommand( |
|
445 | - 'User & Password', |
|
446 | - base64_encode("\0" . $username . "\0" . $password), |
|
447 | - 235 |
|
448 | - ) |
|
449 | - ) { |
|
450 | - return false; |
|
451 | - } |
|
452 | - break; |
|
453 | - case 'LOGIN': |
|
454 | - // Start authentication |
|
455 | - if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) { |
|
456 | - return false; |
|
457 | - } |
|
458 | - if (!$this->sendCommand("Username", base64_encode($username), 334)) { |
|
459 | - return false; |
|
460 | - } |
|
461 | - if (!$this->sendCommand("Password", base64_encode($password), 235)) { |
|
462 | - return false; |
|
463 | - } |
|
464 | - break; |
|
465 | - case 'XOAUTH2': |
|
466 | - //If the OAuth Instance is not set. Can be a case when PHPMailer is used |
|
467 | - //instead of PHPMailerOAuth |
|
468 | - if (is_null($OAuth)) { |
|
469 | - return false; |
|
470 | - } |
|
471 | - $oauth = $OAuth->getOauth64(); |
|
438 | + case 'PLAIN': |
|
439 | + // Start authentication |
|
440 | + if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) { |
|
441 | + return false; |
|
442 | + } |
|
443 | + // Send encoded username and password |
|
444 | + if (!$this->sendCommand( |
|
445 | + 'User & Password', |
|
446 | + base64_encode("\0" . $username . "\0" . $password), |
|
447 | + 235 |
|
448 | + ) |
|
449 | + ) { |
|
450 | + return false; |
|
451 | + } |
|
452 | + break; |
|
453 | + case 'LOGIN': |
|
454 | + // Start authentication |
|
455 | + if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) { |
|
456 | + return false; |
|
457 | + } |
|
458 | + if (!$this->sendCommand("Username", base64_encode($username), 334)) { |
|
459 | + return false; |
|
460 | + } |
|
461 | + if (!$this->sendCommand("Password", base64_encode($password), 235)) { |
|
462 | + return false; |
|
463 | + } |
|
464 | + break; |
|
465 | + case 'XOAUTH2': |
|
466 | + //If the OAuth Instance is not set. Can be a case when PHPMailer is used |
|
467 | + //instead of PHPMailerOAuth |
|
468 | + if (is_null($OAuth)) { |
|
469 | + return false; |
|
470 | + } |
|
471 | + $oauth = $OAuth->getOauth64(); |
|
472 | 472 | |
473 | - // Start authentication |
|
474 | - if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { |
|
475 | - return false; |
|
476 | - } |
|
477 | - break; |
|
478 | - case 'NTLM': |
|
479 | - /* |
|
473 | + // Start authentication |
|
474 | + if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { |
|
475 | + return false; |
|
476 | + } |
|
477 | + break; |
|
478 | + case 'NTLM': |
|
479 | + /* |
|
480 | 480 | * ntlm_sasl_client.php |
481 | 481 | * Bundled with Permission |
482 | 482 | * |
@@ -484,63 +484,63 @@ discard block |
||
484 | 484 | * http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx |
485 | 485 | * PROTOCOL Docs http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication |
486 | 486 | */ |
487 | - require_once 'extras/ntlm_sasl_client.php'; |
|
488 | - $temp = new stdClass; |
|
489 | - $ntlm_client = new ntlm_sasl_client_class; |
|
490 | - //Check that functions are available |
|
491 | - if (!$ntlm_client->initialize($temp)) { |
|
492 | - $this->setError($temp->error); |
|
493 | - $this->edebug( |
|
494 | - 'You need to enable some modules in your php.ini file: ' |
|
495 | - . $this->error['error'], |
|
496 | - self::DEBUG_CLIENT |
|
497 | - ); |
|
498 | - return false; |
|
499 | - } |
|
500 | - //msg1 |
|
501 | - $msg1 = $ntlm_client->typeMsg1($realm, $workstation); //msg1 |
|
502 | - |
|
503 | - if (!$this->sendCommand( |
|
504 | - 'AUTH NTLM', |
|
505 | - 'AUTH NTLM ' . base64_encode($msg1), |
|
506 | - 334 |
|
507 | - ) |
|
508 | - ) { |
|
509 | - return false; |
|
510 | - } |
|
511 | - //Though 0 based, there is a white space after the 3 digit number |
|
512 | - //msg2 |
|
513 | - $challenge = substr($this->last_reply, 3); |
|
514 | - $challenge = base64_decode($challenge); |
|
515 | - $ntlm_res = $ntlm_client->NTLMResponse( |
|
516 | - substr($challenge, 24, 8), |
|
517 | - $password |
|
518 | - ); |
|
519 | - //msg3 |
|
520 | - $msg3 = $ntlm_client->typeMsg3( |
|
521 | - $ntlm_res, |
|
522 | - $username, |
|
523 | - $realm, |
|
524 | - $workstation |
|
487 | + require_once 'extras/ntlm_sasl_client.php'; |
|
488 | + $temp = new stdClass; |
|
489 | + $ntlm_client = new ntlm_sasl_client_class; |
|
490 | + //Check that functions are available |
|
491 | + if (!$ntlm_client->initialize($temp)) { |
|
492 | + $this->setError($temp->error); |
|
493 | + $this->edebug( |
|
494 | + 'You need to enable some modules in your php.ini file: ' |
|
495 | + . $this->error['error'], |
|
496 | + self::DEBUG_CLIENT |
|
525 | 497 | ); |
526 | - // send encoded username |
|
527 | - return $this->sendCommand('Username', base64_encode($msg3), 235); |
|
528 | - case 'CRAM-MD5': |
|
529 | - // Start authentication |
|
530 | - if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) { |
|
531 | - return false; |
|
532 | - } |
|
533 | - // Get the challenge |
|
534 | - $challenge = base64_decode(substr($this->last_reply, 4)); |
|
498 | + return false; |
|
499 | + } |
|
500 | + //msg1 |
|
501 | + $msg1 = $ntlm_client->typeMsg1($realm, $workstation); //msg1 |
|
502 | + |
|
503 | + if (!$this->sendCommand( |
|
504 | + 'AUTH NTLM', |
|
505 | + 'AUTH NTLM ' . base64_encode($msg1), |
|
506 | + 334 |
|
507 | + ) |
|
508 | + ) { |
|
509 | + return false; |
|
510 | + } |
|
511 | + //Though 0 based, there is a white space after the 3 digit number |
|
512 | + //msg2 |
|
513 | + $challenge = substr($this->last_reply, 3); |
|
514 | + $challenge = base64_decode($challenge); |
|
515 | + $ntlm_res = $ntlm_client->NTLMResponse( |
|
516 | + substr($challenge, 24, 8), |
|
517 | + $password |
|
518 | + ); |
|
519 | + //msg3 |
|
520 | + $msg3 = $ntlm_client->typeMsg3( |
|
521 | + $ntlm_res, |
|
522 | + $username, |
|
523 | + $realm, |
|
524 | + $workstation |
|
525 | + ); |
|
526 | + // send encoded username |
|
527 | + return $this->sendCommand('Username', base64_encode($msg3), 235); |
|
528 | + case 'CRAM-MD5': |
|
529 | + // Start authentication |
|
530 | + if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) { |
|
531 | + return false; |
|
532 | + } |
|
533 | + // Get the challenge |
|
534 | + $challenge = base64_decode(substr($this->last_reply, 4)); |
|
535 | 535 | |
536 | - // Build the response |
|
537 | - $response = $username . ' ' . $this->hmac($challenge, $password); |
|
536 | + // Build the response |
|
537 | + $response = $username . ' ' . $this->hmac($challenge, $password); |
|
538 | 538 | |
539 | - // send encoded credentials |
|
540 | - return $this->sendCommand('Username', base64_encode($response), 235); |
|
541 | - default: |
|
542 | - $this->setError("Authentication method \"$authtype\" is not supported"); |
|
543 | - return false; |
|
539 | + // send encoded credentials |
|
540 | + return $this->sendCommand('Username', base64_encode($response), 235); |
|
541 | + default: |
|
542 | + $this->setError("Authentication method \"$authtype\" is not supported"); |
|
543 | + return false; |
|
544 | 544 | } |
545 | 545 | return true; |
546 | 546 | } |
@@ -777,16 +777,16 @@ discard block |
||
777 | 777 | } else { |
778 | 778 | $name = array_shift($fields); |
779 | 779 | switch ($name) { |
780 | - case 'SIZE': |
|
781 | - $fields = ($fields ? $fields[0] : 0); |
|
782 | - break; |
|
783 | - case 'AUTH': |
|
784 | - if (!is_array($fields)) { |
|
785 | - $fields = array(); |
|
786 | - } |
|
787 | - break; |
|
788 | - default: |
|
789 | - $fields = true; |
|
780 | + case 'SIZE': |
|
781 | + $fields = ($fields ? $fields[0] : 0); |
|
782 | + break; |
|
783 | + case 'AUTH': |
|
784 | + if (!is_array($fields)) { |
|
785 | + $fields = array(); |
|
786 | + } |
|
787 | + break; |
|
788 | + default: |
|
789 | + $fields = true; |
|
790 | 790 | } |
791 | 791 | } |
792 | 792 | $this->server_caps[$name] = $fields; |