@@ -167,7 +167,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -1129,11 +1129,11 @@ discard block |
||
| 1129 | 1129 | $magnitude = 0; |
| 1130 | 1130 | $precision = 0; |
| 1131 | 1131 | if ($digits > $max_digits) { |
| 1132 | - $magnitude = floor(($digits - ($max_digits - 3)) / 3); |
|
| 1133 | - $precision = $max_digits - ($digits - ($magnitude * 3) + 1); |
|
| 1134 | - $number = round($number / pow(1000, $magnitude), $precision); |
|
| 1132 | + $magnitude = floor(($digits - ($max_digits - 3))/3); |
|
| 1133 | + $precision = $max_digits - ($digits - ($magnitude*3) + 1); |
|
| 1134 | + $number = round($number/pow(1000, $magnitude), $precision); |
|
| 1135 | 1135 | } |
| 1136 | - $number = number_format($number, $precision) . (($magnitude) ? "{$suffix[$magnitude]}" : ''); |
|
| 1136 | + $number = number_format($number, $precision).(($magnitude) ? "{$suffix[$magnitude]}" : ''); |
|
| 1137 | 1137 | |
| 1138 | 1138 | return $number; |
| 1139 | 1139 | } |
@@ -1310,7 +1310,7 @@ discard block |
||
| 1310 | 1310 | |
| 1311 | 1311 | function text_to_xml($text) { |
| 1312 | 1312 | $xml = new DomDocument(); |
| 1313 | - if ( !($xml->loadXML($text)) ) return false; |
|
| 1313 | + if (!($xml->loadXML($text))) return false; |
|
| 1314 | 1314 | return $xml; |
| 1315 | 1315 | } |
| 1316 | 1316 | |
@@ -1327,7 +1327,7 @@ discard block |
||
| 1327 | 1327 | while (!is_null($node)) { |
| 1328 | 1328 | switch ($node->nodeType) { |
| 1329 | 1329 | case XML_TEXT_NODE: |
| 1330 | - if (trim($node->nodeValue) != '') $result = $node->nodeValue; |
|
| 1330 | + if (trim($node->nodeValue) != '') $result = $node->nodeValue; |
|
| 1331 | 1331 | break; |
| 1332 | 1332 | case XML_ELEMENT_NODE: |
| 1333 | 1333 | $node_name = $node->nodeName; |
@@ -1344,7 +1344,7 @@ discard block |
||
| 1344 | 1344 | if ($sibling) { |
| 1345 | 1345 | $result[$node_name][$index] = ''; |
| 1346 | 1346 | if ($node->childNodes) { |
| 1347 | - $result[$node_name][$index] = xml_to_array($node) ; |
|
| 1347 | + $result[$node_name][$index] = xml_to_array($node); |
|
| 1348 | 1348 | } |
| 1349 | 1349 | if ($node->hasAttributes()) { |
| 1350 | 1350 | $attributes = $node->attributes; |
@@ -1367,14 +1367,14 @@ discard block |
||
| 1367 | 1367 | } else { |
| 1368 | 1368 | $result[$node_name] = ''; |
| 1369 | 1369 | if ($node->childNodes) { |
| 1370 | - $result[$node_name] = xml_to_array($node) ; |
|
| 1370 | + $result[$node_name] = xml_to_array($node); |
|
| 1371 | 1371 | } |
| 1372 | 1372 | if ($node->hasAttributes()) { |
| 1373 | 1373 | $attributes = $node->attributes; |
| 1374 | 1374 | if ($result[$node_name] !== '' AND !is_array($result[$node_name])) { |
| 1375 | 1375 | $result[$node_name] = array('@value' => $result[$node_name]); |
| 1376 | 1376 | } |
| 1377 | - foreach($attributes as $key => $attribute) { |
|
| 1377 | + foreach ($attributes as $key => $attribute) { |
|
| 1378 | 1378 | $result[$node_name]['@attributes'][$attribute->name] = $attribute->value; |
| 1379 | 1379 | } |
| 1380 | 1380 | } |
@@ -1414,30 +1414,30 @@ discard block |
||
| 1414 | 1414 | // Determine if hosts are associated at all or just hidden |
| 1415 | 1415 | $output = ''; |
| 1416 | 1416 | if ($boincuser->show_hosts) { |
| 1417 | - switch($context) { |
|
| 1417 | + switch ($context) { |
|
| 1418 | 1418 | case 'active': |
| 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>'; |
|
| 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 | 1422 | break; |
| 1423 | 1423 | |
| 1424 | 1424 | case 'preferences': |
| 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>'; |
|
| 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 | 1428 | break; |
| 1429 | 1429 | |
| 1430 | 1430 | default: |
| 1431 | - $output .= '<h2>' . bts('Computers pending', array(), NULL, 'boinc:host-list') . '</h2>'; |
|
| 1432 | - $output .= '<p>' . bts('This user does not yet have any associated' |
|
| 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 | 1433 | . ' computers. Computers will be displayed when they have earned their' |
| 1434 | - . ' first credits.', array(), NULL, 'boinc:host-list') . '</p>'; |
|
| 1434 | + . ' first credits.', array(), NULL, 'boinc:host-list').'</p>'; |
|
| 1435 | 1435 | } |
| 1436 | 1436 | } |
| 1437 | 1437 | else { |
| 1438 | - $output .= '<h2>' . bts('Computers hidden', array(), NULL, 'boinc:host-list') . '</h2>'; |
|
| 1439 | - $output .= '<p>' . bts('This user has chosen not to show information' |
|
| 1440 | - . ' about their computers.', array(), NULL, 'boinc:host-list') . '</p>'; |
|
| 1438 | + $output .= '<h2>'.bts('Computers hidden', array(), NULL, 'boinc:host-list').'</h2>'; |
|
| 1439 | + $output .= '<p>'.bts('This user has chosen not to show information' |
|
| 1440 | + . ' about their computers.', array(), NULL, 'boinc:host-list').'</p>'; |
|
| 1441 | 1441 | } |
| 1442 | 1442 | return $output; |
| 1443 | 1443 | } |
@@ -1449,11 +1449,11 @@ discard block |
||
| 1449 | 1449 | |
| 1450 | 1450 | // |
| 1451 | 1451 | $output = ''; |
| 1452 | - switch($context) { |
|
| 1452 | + switch ($context) { |
|
| 1453 | 1453 | default: |
| 1454 | - $output .= '<h2>' . bts('No @type tasks', array('@type' => $context), NULL, 'boinc:task-list') |
|
| 1454 | + $output .= '<h2>'.bts('No @type tasks', array('@type' => $context), NULL, 'boinc:task-list') |
|
| 1455 | 1455 | . '</h2>'; |
| 1456 | - $output .= '<p>' . bts('There are no tasks of this type on record', array(), NULL, 'boinc:task-list') |
|
| 1456 | + $output .= '<p>'.bts('There are no tasks of this type on record', array(), NULL, 'boinc:task-list') |
|
| 1457 | 1457 | . '</p>'; |
| 1458 | 1458 | } |
| 1459 | 1459 | return $output; |
@@ -1475,10 +1475,10 @@ discard block |
||
| 1475 | 1475 | $output .= l(bts('Delete', array(), NULL, 'boinc:form-delete'), "host/{$host_id}/delete", |
| 1476 | 1476 | array( |
| 1477 | 1477 | 'attributes' => array( |
| 1478 | - 'onclick' => 'return confirm(\'' . bts('This will delete host @id' |
|
| 1478 | + 'onclick' => 'return confirm(\''.bts('This will delete host @id' |
|
| 1479 | 1479 | . ' from your account forever. Are you sure this is OK?', |
| 1480 | 1480 | array('@id' => $host_id), |
| 1481 | - NULL, 'boinc:account-host-delete') . '\')' |
|
| 1481 | + NULL, 'boinc:account-host-delete').'\')' |
|
| 1482 | 1482 | ) |
| 1483 | 1483 | ) |
| 1484 | 1484 | ); |
@@ -1568,8 +1568,8 @@ discard block |
||
| 1568 | 1568 | "{$path}/school" => bts('School', array(), NULL, 'boinc:account-preferences-location') |
| 1569 | 1569 | ); |
| 1570 | 1570 | variable_set('jump_use_js_venues-Array', 1); |
| 1571 | - drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js'); |
|
| 1572 | - drupal_add_js(drupal_get_path('theme', 'boinc') . '/js/prefs.js', 'theme'); |
|
| 1571 | + drupal_add_js(drupal_get_path('module', 'jump').'/jump.js'); |
|
| 1572 | + drupal_add_js(drupal_get_path('theme', 'boinc').'/js/prefs.js', 'theme'); |
|
| 1573 | 1573 | // Get current venue |
| 1574 | 1574 | db_set_active('boinc_ro'); |
| 1575 | 1575 | $venue = db_result(db_query( |
@@ -1593,10 +1593,10 @@ discard block |
||
| 1593 | 1593 | // Add a wrapper to deadline text |
| 1594 | 1594 | if (!$received_time) { |
| 1595 | 1595 | if (time() < $deadline) { |
| 1596 | - $output = '<span class="on-time">' . $output . '</span>'; |
|
| 1596 | + $output = '<span class="on-time">'.$output.'</span>'; |
|
| 1597 | 1597 | } |
| 1598 | 1598 | else { |
| 1599 | - $output = '<span class="past-due">' . $output . '</span>'; |
|
| 1599 | + $output = '<span class="past-due">'.$output.'</span>'; |
|
| 1600 | 1600 | } |
| 1601 | 1601 | } |
| 1602 | 1602 | } |
@@ -1632,15 +1632,15 @@ discard block |
||
| 1632 | 1632 | */ |
| 1633 | 1633 | function boincwork_tasktable($category = 0, $queryid = 1, $tselect = NULL, $app_id = 0, $tablerows = 20) { |
| 1634 | 1634 | // Check type parameter, if not (0,2) then return an error. |
| 1635 | - if ( ($category!=0) AND ($category!=1) AND ($category!=2) ) { |
|
| 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 | 1642 | global $language; |
| 1643 | - $locality=$language->language; |
|
| 1643 | + $locality = $language->language; |
|
| 1644 | 1644 | $nf = new NumberFormatter($locality, NumberFormatter::DECIMAL); |
| 1645 | 1645 | $nf->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS, 0); |
| 1646 | 1646 | $nf->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, 0); |
@@ -1688,13 +1688,13 @@ discard block |
||
| 1688 | 1688 | ."ON r.appid=a.id "; |
| 1689 | 1689 | |
| 1690 | 1690 | // Use userid, hostid, or workunitid |
| 1691 | - if ($category==0) { |
|
| 1691 | + if ($category == 0) { |
|
| 1692 | 1692 | $sqlall .= " WHERE r.userid='%s' "; |
| 1693 | 1693 | } |
| 1694 | - elseif ($category==1) { |
|
| 1694 | + elseif ($category == 1) { |
|
| 1695 | 1695 | $sqlall .= " WHERE r.workunitid='%s' "; |
| 1696 | 1696 | } |
| 1697 | - elseif ($category==2) { |
|
| 1697 | + elseif ($category == 2) { |
|
| 1698 | 1698 | $sqlall .= " WHERE r.hostid='%s' "; |
| 1699 | 1699 | } |
| 1700 | 1700 | $sqlall .= " ORDER BY user_friendly_name"; |
@@ -1705,7 +1705,7 @@ discard block |
||
| 1705 | 1705 | if ($dbres_all) { |
| 1706 | 1706 | while ($result = db_fetch_object($dbres_all)) { |
| 1707 | 1707 | $mystate = state_num($result); |
| 1708 | - if ( ($result->appid==$app_id) OR ($app_id==0) OR ($app_id==-1) ) { |
|
| 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: |
@@ -1728,7 +1728,7 @@ discard block |
||
| 1728 | 1728 | |
| 1729 | 1729 | //map holds a map between app ids and user friendly names for all applications. |
| 1730 | 1730 | $application_map[$result->appid] = $result->user_friendly_name; |
| 1731 | - if ( ($mystate == $tselect) OR ($tselect==STATE_ALL) ) { |
|
| 1731 | + if (($mystate == $tselect) OR ($tselect == STATE_ALL)) { |
|
| 1732 | 1732 | //count of appids in the results. |
| 1733 | 1733 | $application_select_count[$result->appid]++; |
| 1734 | 1734 | }// if mystate |
@@ -1741,14 +1741,14 @@ discard block |
||
| 1741 | 1741 | // Entry for all applications. |
| 1742 | 1742 | $allcount = $application_select_count ? array_sum($application_select_count) : 0; |
| 1743 | 1743 | $applications[-1] = bts('Application', array(), NULL, 'boinc:task-table'); |
| 1744 | - $applications[0] = bts('All applications', array(), NULL, 'boinc:task-table') . ' (' . $allcount . ')'; |
|
| 1744 | + $applications[0] = bts('All applications', array(), NULL, 'boinc:task-table').' ('.$allcount.')'; |
|
| 1745 | 1745 | // Create application filter from application_map and application_select_count. |
| 1746 | - foreach($application_map as $akey => $aname) { |
|
| 1746 | + foreach ($application_map as $akey => $aname) { |
|
| 1747 | 1747 | $acount = 0; |
| 1748 | - if ( $application_select_count and array_key_exists($akey, $application_select_count) ) { |
|
| 1748 | + if ($application_select_count and array_key_exists($akey, $application_select_count)) { |
|
| 1749 | 1749 | $acount = $application_select_count[$akey]; |
| 1750 | 1750 | } |
| 1751 | - $applications[$akey] = $aname . ' ('. $acount . ')'; |
|
| 1751 | + $applications[$akey] = $aname.' ('.$acount.')'; |
|
| 1752 | 1752 | } |
| 1753 | 1753 | // Header array for (sub) results table. |
| 1754 | 1754 | $resultheader = array( |
@@ -1827,13 +1827,13 @@ discard block |
||
| 1827 | 1827 | $sqlwhere = array(); |
| 1828 | 1828 | |
| 1829 | 1829 | // Use userid, hostid, or workunitid |
| 1830 | - if ($category==0) { |
|
| 1830 | + if ($category == 0) { |
|
| 1831 | 1831 | $sqlwhere[] = "r.userid = '%s'"; |
| 1832 | 1832 | } |
| 1833 | - elseif ($category==1) { |
|
| 1833 | + elseif ($category == 1) { |
|
| 1834 | 1834 | $sqlwhere[] = "r.workunitid = '%s'"; |
| 1835 | 1835 | } |
| 1836 | - elseif ($category==2) { |
|
| 1836 | + elseif ($category == 2) { |
|
| 1837 | 1837 | $sqlwhere[] = "r.hostid = '%s'"; |
| 1838 | 1838 | } |
| 1839 | 1839 | |
@@ -1857,14 +1857,14 @@ discard block |
||
| 1857 | 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 | - if ($sqlwhere) $sqlsub .= " WHERE " . implode(' AND ', $sqlwhere); |
|
| 1863 | - $dbres_sub = pager_query( $sqlsub . tablesort_sql($resultheader), $tablerows, 0, NULL, $queryid, $app_id); |
|
| 1862 | + if ($sqlwhere) $sqlsub .= " WHERE ".implode(' AND ', $sqlwhere); |
|
| 1863 | + $dbres_sub = pager_query($sqlsub.tablesort_sql($resultheader), $tablerows, 0, NULL, $queryid, $app_id); |
|
| 1864 | 1864 | } |
| 1865 | 1865 | else { |
| 1866 | - if ($sqlwhere) $sqlsub .= " WHERE " . implode(' AND ', $sqlwhere); |
|
| 1867 | - $dbres_sub = pager_query( $sqlsub . tablesort_sql($resultheader), $tablerows, 0, NULL, $queryid); |
|
| 1866 | + if ($sqlwhere) $sqlsub .= " WHERE ".implode(' AND ', $sqlwhere); |
|
| 1867 | + $dbres_sub = pager_query($sqlsub.tablesort_sql($resultheader), $tablerows, 0, NULL, $queryid); |
|
| 1868 | 1868 | } |
| 1869 | 1869 | db_set_active('default'); |
| 1870 | 1870 | |
@@ -1874,7 +1874,7 @@ discard block |
||
| 1874 | 1874 | // state_num() function changes $result object, clone $result |
| 1875 | 1875 | // object for use in state_num() |
| 1876 | 1876 | // check if state matches selection |
| 1877 | - if ( (state_num(clone $result) == $tselect) OR ($tselect==STATE_ALL) ) { |
|
| 1877 | + if ((state_num(clone $result) == $tselect) OR ($tselect == STATE_ALL)) { |
|
| 1878 | 1878 | // create pretty result row |
| 1879 | 1879 | $prettyresult = array( |
| 1880 | 1880 | array( |
@@ -1890,7 +1890,7 @@ discard block |
||
| 1890 | 1890 | $nf->format($result->cpu_time), |
| 1891 | 1891 | $nf->format($result->granted_credit), |
| 1892 | 1892 | array( |
| 1893 | - 'data' => $result->user_friendly_name . " " . pretty_application_version($result->app_version_id,$result->version_number, $result->plan_class, $result->platform), |
|
| 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 | ); |
@@ -1903,54 +1903,54 @@ discard block |
||
| 1903 | 1903 | // Begin result navigation |
| 1904 | 1904 | |
| 1905 | 1905 | // Set pathprefix based on type |
| 1906 | - if ($category==0) { |
|
| 1906 | + if ($category == 0) { |
|
| 1907 | 1907 | $pathprefix = 'account/tasks'; |
| 1908 | 1908 | } |
| 1909 | - elseif ($category==1) { |
|
| 1910 | - $pathprefix = 'workunit/' . $queryid . '/tasks'; |
|
| 1909 | + elseif ($category == 1) { |
|
| 1910 | + $pathprefix = 'workunit/'.$queryid.'/tasks'; |
|
| 1911 | 1911 | } |
| 1912 | - elseif ($category==2) { |
|
| 1913 | - $pathprefix = 'host/' . $queryid . '/tasks'; |
|
| 1912 | + elseif ($category == 2) { |
|
| 1913 | + $pathprefix = 'host/'.$queryid.'/tasks'; |
|
| 1914 | 1914 | } |
| 1915 | 1915 | // Need an "All" tab as well, maps to app_id of zero. |
| 1916 | 1916 | $application_map[0] = bts('All', array(), NULL, 'boinc:task-table'); |
| 1917 | 1917 | $stitems = array(); |
| 1918 | 1918 | foreach ($taskstates as $state => $numstates) { |
| 1919 | - $mypath = $pathprefix . '/' . $state . '/' . $app_id; |
|
| 1920 | - if ($state==STATE_ALL) { |
|
| 1921 | - $ltext = '<span class="tab task-app-name">' . bts('All', array(), NULL, 'boinc:task-table') . ' (' . $numstates . ')</span>'; |
|
| 1919 | + $mypath = $pathprefix.'/'.$state.'/'.$app_id; |
|
| 1920 | + if ($state == STATE_ALL) { |
|
| 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 | - if ($state==$tselect) { |
|
| 1929 | + if ($state == $tselect) { |
|
| 1930 | 1930 | $myitem['class'] = 'active'; |
| 1931 | 1931 | } |
| 1932 | 1932 | $stitems[] = $myitem; |
| 1933 | 1933 | } |
| 1934 | 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) ) ); |
|
| 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 | 1941 | // Application select-drop down form |
| 1942 | 1942 | // Hack to place Application form into header |
| 1943 | 1943 | // App ID of zero maps to "-1" for drop-down box. |
| 1944 | - if ($app_id==0) { |
|
| 1945 | - $app_id=-1; |
|
| 1944 | + if ($app_id == 0) { |
|
| 1945 | + $app_id = -1; |
|
| 1946 | 1946 | } |
| 1947 | 1947 | $resultheader[] = drupal_get_form('boincwork_selectapp_form', $applications, $app_id); |
| 1948 | 1948 | |
| 1949 | 1949 | // Begin table of results |
| 1950 | - if ( is_array($resultheader) AND is_array($resultdata) ) { |
|
| 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 | - if ( ($category==1) OR ($category==2) ) { |
|
| 1953 | + if (($category == 1) OR ($category == 2)) { |
|
| 1954 | 1954 | unset($resultheader[$category]); |
| 1955 | 1955 | delete_col($resultdata, $category); |
| 1956 | 1956 | } |
@@ -1967,7 +1967,7 @@ discard block |
||
| 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) { |
|
| 1970 | + return array_walk($array, function(&$v) use ($offset) { |
|
| 1971 | 1971 | array_splice($v, $offset, 1); |
| 1972 | 1972 | }); |
| 1973 | 1973 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | }// switch |
| 72 | 72 | } else { |
| 73 | 73 | $form_state['storage']['wip'] = TRUE; |
| 74 | - if ( !in_array($prefs_preset, array('standard','maximum','green','minimum','custom')) ) { |
|
| 74 | + if (!in_array($prefs_preset, array('standard', 'maximum', 'green', 'minimum', 'custom'))) { |
|
| 75 | 75 | if ($established) { |
| 76 | 76 | $prefs_preset = 'custom'; |
| 77 | 77 | } else { |
@@ -141,10 +141,10 @@ discard block |
||
| 141 | 141 | ); |
| 142 | 142 | $form['hour_options'] = array( |
| 143 | 143 | '#type' => 'value', |
| 144 | - '#value' => array('0:00','1:00','2:00','3:00','4:00', |
|
| 145 | - '5:00','6:00','7:00','8:00','9:00','10:00','11:00', |
|
| 146 | - '12:00','13:00','14:00','15:00','16:00','17:00', |
|
| 147 | - '18:00','19:00','20:00','21:00','22:00','23:00') |
|
| 144 | + '#value' => array('0:00', '1:00', '2:00', '3:00', '4:00', |
|
| 145 | + '5:00', '6:00', '7:00', '8:00', '9:00', '10:00', '11:00', |
|
| 146 | + '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', |
|
| 147 | + '18:00', '19:00', '20:00', '21:00', '22:00', '23:00') |
|
| 148 | 148 | ); |
| 149 | 149 | |
| 150 | 150 | // Identify preference sets that are established to distinguish what has been |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | '#description' => bts('Suspend computing when your computer is busy running other programs.', array(), NULL, 'boinc:account-preferences-computing'), |
| 282 | 282 | ); |
| 283 | 283 | $form['prefs']['advanced']['processor']['hour_label'] = array( |
| 284 | - '#value' => '<div class="form-item"><label>' . bts('Compute only between:', array(), NULL, 'boinc:account-preferences-computing') . '</label></div>' |
|
| 284 | + '#value' => '<div class="form-item"><label>'.bts('Compute only between:', array(), NULL, 'boinc:account-preferences-computing').'</label></div>' |
|
| 285 | 285 | ); |
| 286 | 286 | $form['prefs']['advanced']['processor']['start_hour'] = array( |
| 287 | 287 | '#type' => 'select', |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | '#default_value' => $default['start_hour'] |
| 290 | 290 | ); |
| 291 | 291 | $form['prefs']['advanced']['processor']['hour_delimiter'] = array( |
| 292 | - '#value' => '<span>' . bts('and', array(), NULL, 'boinc:account-preference') . '</span>' |
|
| 292 | + '#value' => '<span>'.bts('and', array(), NULL, 'boinc:account-preference').'</span>' |
|
| 293 | 293 | ); |
| 294 | 294 | $form['prefs']['advanced']['processor']['end_hour'] = array( |
| 295 | 295 | '#type' => 'select', |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | '#default_value' => $default['end_hour'] |
| 298 | 298 | ); |
| 299 | 299 | $form['prefs']['advanced']['processor']['hour_description'] = array( |
| 300 | - '#value' => '<div class="form-item slim"><div class="description">' . bts('Compute only during a particular period each day.', array(), NULL, 'boinc:account-preferences-computing') . '</div></div>' |
|
| 300 | + '#value' => '<div class="form-item slim"><div class="description">'.bts('Compute only during a particular period each day.', array(), NULL, 'boinc:account-preferences-computing').'</div></div>' |
|
| 301 | 301 | ); |
| 302 | 302 | $form['prefs']['advanced']['processor']['leave_apps_in_memory'] = array( |
| 303 | 303 | '#title' => bts('Leave non-GPU tasks in memory while suspended?', array(), NULL, 'boinc:account-preferences-computing'), |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | '#description' => bts('Limit the upload rate of file transfers.', array(), NULL, 'boinc:account-preferences-computing') |
| 455 | 455 | ); |
| 456 | 456 | $form['prefs']['advanced']['network']['hour_label'] = array( |
| 457 | - '#value' => '<div class="form-item"><label>' . bts('Transfer files only between', array(), NULL, 'boinc:account-preferences-computing') . '</label></div>' |
|
| 457 | + '#value' => '<div class="form-item"><label>'.bts('Transfer files only between', array(), NULL, 'boinc:account-preferences-computing').'</label></div>' |
|
| 458 | 458 | ); |
| 459 | 459 | $form['prefs']['advanced']['network']['net_start_hour'] = array( |
| 460 | 460 | '#type' => 'select', |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | '#default_value' => $default['net_start_hour'] |
| 463 | 463 | ); |
| 464 | 464 | $form['prefs']['advanced']['network']['hour_delimiter'] = array( |
| 465 | - '#value' => '<span>' . bts('and', array(), NULL, 'boinc:account-preference') . '</span>' |
|
| 465 | + '#value' => '<span>'.bts('and', array(), NULL, 'boinc:account-preference').'</span>' |
|
| 466 | 466 | ); |
| 467 | 467 | $form['prefs']['advanced']['network']['net_end_hour'] = array( |
| 468 | 468 | '#type' => 'select', |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | '#default_value' => $default['net_end_hour'] |
| 471 | 471 | ); |
| 472 | 472 | $form['prefs']['advanced']['network']['hour_description'] = array( |
| 473 | - '#value' => '<div class="form-item slim"><div class="description">' . bts('Transfer files only during a particular period each day.', array(), NULL, 'boinc:account-preferences-computing') . '</div></div>' |
|
| 473 | + '#value' => '<div class="form-item slim"><div class="description">'.bts('Transfer files only during a particular period each day.', array(), NULL, 'boinc:account-preferences-computing').'</div></div>' |
|
| 474 | 474 | ); |
| 475 | 475 | $form['prefs']['advanced']['network']['daily_xfer_limit_mb'] = array( |
| 476 | 476 | '#title' => bts('Limit usage to', array(), NULL, 'boinc:account-preferences-computing'), |
@@ -530,23 +530,23 @@ discard block |
||
| 530 | 530 | '#suffix' => '</li>' |
| 531 | 531 | ); |
| 532 | 532 | $form['prefs']['form control tabs'] = array( |
| 533 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), drupal_get_path_alias("account/prefs/computing/edit")) . '</li>' |
|
| 533 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), drupal_get_path_alias("account/prefs/computing/edit")).'</li>' |
|
| 534 | 534 | ); |
| 535 | 535 | if ($venue AND $venue != 'generic') { |
| 536 | 536 | global $base_path; |
| 537 | - $form['prefs']['form control tabs']['#value'] .= '<li class="tab">' . |
|
| 537 | + $form['prefs']['form control tabs']['#value'] .= '<li class="tab">'. |
|
| 538 | 538 | l(bts('Clear', array(), NULL, 'boinc:form-clear'), "account/prefs/computing/clear/{$venue}", |
| 539 | 539 | array( |
| 540 | - 'query' => 'destination=' . urlencode(drupal_get_path_alias('account/prefs/computing/combined')), |
|
| 540 | + 'query' => 'destination='.urlencode(drupal_get_path_alias('account/prefs/computing/combined')), |
|
| 541 | 541 | 'attributes' => array( |
| 542 | - 'onclick' => 'return confirm(\'' . bts('This will remove all of your settings from the @name preference set. Are you sure?', |
|
| 543 | - array('@name' => $venue), NULL, 'boinc:account-preferences') . '\')' |
|
| 542 | + 'onclick' => 'return confirm(\''.bts('This will remove all of your settings from the @name preference set. Are you sure?', |
|
| 543 | + array('@name' => $venue), NULL, 'boinc:account-preferences').'\')' |
|
| 544 | 544 | ) |
| 545 | 545 | ) |
| 546 | - ) . '</li>'; |
|
| 546 | + ).'</li>'; |
|
| 547 | 547 | } |
| 548 | 548 | $form['prefs']['view control'] = array( |
| 549 | - '#value' => '<li class="first alt tab">' . l('(' . bts('Show comparison view', array(), NULL, 'boinc:account-preferences') . ')', 'account/prefs/computing/combined') . '</li>' |
|
| 549 | + '#value' => '<li class="first alt tab">'.l('('.bts('Show comparison view', array(), NULL, 'boinc:account-preferences').')', 'account/prefs/computing/combined').'</li>' |
|
| 550 | 550 | ); |
| 551 | 551 | $form['prefs']['form control tabs suffix'] = array( |
| 552 | 552 | '#value' => '</ul>' |
@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | return FALSE; |
| 785 | 785 | } |
| 786 | 786 | |
| 787 | - if ($new_host->userid==0) { |
|
| 787 | + if ($new_host->userid == 0) { |
|
| 788 | 788 | rules_invoke_event('boincwork_zombie_merge_error', $old_host->id, $new_host->id, variable_get('boinc_admin_mailing_list_subject_tag', '')); |
| 789 | 789 | watchdog('boincwork', |
| 790 | 790 | 'Zombie merge attempted, target host has userid=0: old host id=%old_host, target host id=%new_host', |
@@ -880,9 +880,9 @@ discard block |
||
| 880 | 880 | } |
| 881 | 881 | |
| 882 | 882 | $form['overview'] = array( |
| 883 | - '#value' => '<p>' . bts('Sometimes BOINC assigns separate identities to' |
|
| 883 | + '#value' => '<p>'.bts('Sometimes BOINC assigns separate identities to' |
|
| 884 | 884 | . ' the same computer by mistake. You can correct this by merging old' |
| 885 | - . ' identities with the newest one.', array(), NULL, 'boinc:account-host-merge') . '</p>' |
|
| 885 | + . ' identities with the newest one.', array(), NULL, 'boinc:account-host-merge').'</p>' |
|
| 886 | 886 | . '<p>' |
| 887 | 887 | . bts('Check the computers that are the same as @name' |
| 888 | 888 | . ' (created on @date at @time with computer ID @id)', |
@@ -892,7 +892,7 @@ discard block |
||
| 892 | 892 | '@time' => date('G:i:s T', $current_host->create_time), |
| 893 | 893 | '@id' => $current_host->id, |
| 894 | 894 | ), |
| 895 | - NULL, 'boinc:account-host-merge') . '</p>', |
|
| 895 | + NULL, 'boinc:account-host-merge').'</p>', |
|
| 896 | 896 | ); |
| 897 | 897 | |
| 898 | 898 | $options = array(); |
@@ -926,7 +926,7 @@ discard block |
||
| 926 | 926 | '#suffix' => '</li>' |
| 927 | 927 | ); |
| 928 | 928 | $form['prefs']['form control tabs'] = array( |
| 929 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "host/{$host_id}") . '</li>' |
|
| 929 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "host/{$host_id}").'</li>' |
|
| 930 | 930 | ); |
| 931 | 931 | |
| 932 | 932 | return $form; |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | if (count($merged) == 2) { |
| 972 | 972 | $oxford_comma = ''; |
| 973 | 973 | } |
| 974 | - $list = implode(', ', $list) . $oxford_comma . ' ' . $conjunction . ' ' . $last; |
|
| 974 | + $list = implode(', ', $list).$oxford_comma.' '.$conjunction.' '.$last; |
|
| 975 | 975 | } |
| 976 | 976 | else { |
| 977 | 977 | $list = $last; |
@@ -1220,23 +1220,23 @@ discard block |
||
| 1220 | 1220 | '#suffix' => '</li>' |
| 1221 | 1221 | ); |
| 1222 | 1222 | $form['prefs']['form control tabs'] = array( |
| 1223 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>' |
|
| 1223 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>' |
|
| 1224 | 1224 | ); |
| 1225 | 1225 | if ($venue AND $venue != 'generic') { |
| 1226 | 1226 | global $base_path; |
| 1227 | - $form['prefs']['form control tabs']['#value'] .= '<li class="tab">' . |
|
| 1227 | + $form['prefs']['form control tabs']['#value'] .= '<li class="tab">'. |
|
| 1228 | 1228 | l(bts('Clear', array(), NULL, 'boinc:form-clear'), "account/prefs/project/clear/{$venue}", |
| 1229 | 1229 | array( |
| 1230 | - 'query' => 'destination=' . urlencode(drupal_get_path_alias('account/prefs/project/combined')), |
|
| 1230 | + 'query' => 'destination='.urlencode(drupal_get_path_alias('account/prefs/project/combined')), |
|
| 1231 | 1231 | 'attributes' => array( |
| 1232 | - 'onclick' => 'return confirm(\'' . bts('This will remove all of your settings from the @name preference set. Are you sure?', |
|
| 1233 | - array('@name' => $venue), NULL, 'boinc:account-preferences') . '\')' |
|
| 1232 | + 'onclick' => 'return confirm(\''.bts('This will remove all of your settings from the @name preference set. Are you sure?', |
|
| 1233 | + array('@name' => $venue), NULL, 'boinc:account-preferences').'\')' |
|
| 1234 | 1234 | ) |
| 1235 | 1235 | ) |
| 1236 | - ) . '</li>'; |
|
| 1236 | + ).'</li>'; |
|
| 1237 | 1237 | } |
| 1238 | 1238 | $form['prefs']['view control'] = array( |
| 1239 | - '#value' => '<li class="first alt tab">' . l('(' . bts('Show comparison view', array(), NULL, 'boinc:account-preferences') . ')', 'account/prefs/project/combined') . '</li>' |
|
| 1239 | + '#value' => '<li class="first alt tab">'.l('('.bts('Show comparison view', array(), NULL, 'boinc:account-preferences').')', 'account/prefs/project/combined').'</li>' |
|
| 1240 | 1240 | ); |
| 1241 | 1241 | $form['prefs']['form control tabs suffix'] = array( |
| 1242 | 1242 | '#value' => '</ul>' |
@@ -1279,7 +1279,7 @@ discard block |
||
| 1279 | 1279 | |
| 1280 | 1280 | foreach ($xml['project_specific_preferences'] as $wrapped_element) { |
| 1281 | 1281 | $type = key($wrapped_element); |
| 1282 | - $element= reset($wrapped_element); |
|
| 1282 | + $element = reset($wrapped_element); |
|
| 1283 | 1283 | boincwork_generate_prefs_element($form, $type, $element, $prefs['project_specific']); |
| 1284 | 1284 | } |
| 1285 | 1285 | } |
@@ -1505,7 +1505,7 @@ discard block |
||
| 1505 | 1505 | $names = array(); |
| 1506 | 1506 | foreach ($languages as $langcode => $item) { |
| 1507 | 1507 | $name = t($item->name); |
| 1508 | - $names[check_plain($langcode)] = check_plain($name . ($item->native != $name ? ' ('. $item->native .')' : '')); |
|
| 1508 | + $names[check_plain($langcode)] = check_plain($name.($item->native != $name ? ' ('.$item->native.')' : '')); |
|
| 1509 | 1509 | } |
| 1510 | 1510 | $form['locale'] = array( |
| 1511 | 1511 | '#type' => 'fieldset', |
@@ -1530,20 +1530,20 @@ discard block |
||
| 1530 | 1530 | // Avatar options |
| 1531 | 1531 | $form['gravatar'] = array( |
| 1532 | 1532 | '#type' => 'item', |
| 1533 | - '#value' => bts('If you have a <a href="@gravatar-check">valid Gravatar</a> associated with your e-mail address, it will be used for your user picture.', array('@gravatar-check' => 'http://en.gravatar.com/site/check/' . $account->mail), NULL, 'boinc:account-preferences-community'), |
|
| 1533 | + '#value' => bts('If you have a <a href="@gravatar-check">valid Gravatar</a> associated with your e-mail address, it will be used for your user picture.', array('@gravatar-check' => 'http://en.gravatar.com/site/check/'.$account->mail), NULL, 'boinc:account-preferences-community'), |
|
| 1534 | 1534 | '#description' => bts('Your Gravatar will not be shown if you upload a user picture.', array(), NULL, 'boinc:account-preferences-community'), |
| 1535 | 1535 | ); |
| 1536 | 1536 | if (user_access('disable own gravatar', $account)) { |
| 1537 | 1537 | $form['gravatar'] = array( |
| 1538 | 1538 | '#type' => 'checkbox', |
| 1539 | - '#title' => bts('If you have a <a href="@gravatar-check">valid Gravatar</a> associated with your e-mail address, use it for your user picture.', array('@gravatar-check' => 'http://en.gravatar.com/site/check/' . $account->mail), NULL, 'boinc:account-preferences-community'), |
|
| 1539 | + '#title' => bts('If you have a <a href="@gravatar-check">valid Gravatar</a> associated with your e-mail address, use it for your user picture.', array('@gravatar-check' => 'http://en.gravatar.com/site/check/'.$account->mail), NULL, 'boinc:account-preferences-community'), |
|
| 1540 | 1540 | '#description' => bts('Gravatar will not be shown if an avatar is uploaded.', array(), NULL, 'boinc:account-preferences-community'), |
| 1541 | 1541 | '#default_value' => isset($account->gravatar) ? $account->gravatar : 0, |
| 1542 | 1542 | '#disabled' => !empty($account->picture), |
| 1543 | 1543 | ); |
| 1544 | 1544 | } |
| 1545 | 1545 | $form['gravatar']['#weight'] = 15; |
| 1546 | - $form['gravatar']['#prefix'] = '<fieldset class="collapsible"><legend><a href="#">' . bts('Avatar settings', array(), NULL, 'boinc:account-preferences-community') . '</a></legend>'; |
|
| 1546 | + $form['gravatar']['#prefix'] = '<fieldset class="collapsible"><legend><a href="#">'.bts('Avatar settings', array(), NULL, 'boinc:account-preferences-community').'</a></legend>'; |
|
| 1547 | 1547 | // Upload an avatar (pulled from profile_node_form): |
| 1548 | 1548 | if (!empty($profile_form['field_image'])) { |
| 1549 | 1549 | $form['field_image'] = $profile_form['field_image']; |
@@ -1578,7 +1578,7 @@ discard block |
||
| 1578 | 1578 | ); |
| 1579 | 1579 | // Can't have a typical Drupal form suffix on a select box? |
| 1580 | 1580 | $form['forums']['comments_per_page_suffix'] = array( |
| 1581 | - '#value' => '<span>' . bts('comments per page', array(), NULL, 'boinc:account-preferences-community') . '</span>' |
|
| 1581 | + '#value' => '<span>'.bts('comments per page', array(), NULL, 'boinc:account-preferences-community').'</span>' |
|
| 1582 | 1582 | ); |
| 1583 | 1583 | $form['forums']['comments_order'] = array( |
| 1584 | 1584 | '#type' => 'select', |
@@ -1631,7 +1631,7 @@ discard block |
||
| 1631 | 1631 | '#weight' => 1002, |
| 1632 | 1632 | ); |
| 1633 | 1633 | $form['form control tabs'] = array( |
| 1634 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>', |
|
| 1634 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>', |
|
| 1635 | 1635 | '#weight' => 1003, |
| 1636 | 1636 | ); |
| 1637 | 1637 | $form['form control tabs suffix'] = array( |
@@ -1717,10 +1717,10 @@ discard block |
||
| 1717 | 1717 | if ($user->language != $edit['language']) { |
| 1718 | 1718 | global $base_url; |
| 1719 | 1719 | if ($edit['language'] != language_default('language')) { |
| 1720 | - $form_state['redirect'] = $base_url . '/' . $edit['language'] . '/' . $_GET['q']; |
|
| 1720 | + $form_state['redirect'] = $base_url.'/'.$edit['language'].'/'.$_GET['q']; |
|
| 1721 | 1721 | } |
| 1722 | 1722 | else { |
| 1723 | - $form_state['redirect'] = $base_url . '/' . $_GET['q']; |
|
| 1723 | + $form_state['redirect'] = $base_url.'/'.$_GET['q']; |
|
| 1724 | 1724 | } |
| 1725 | 1725 | } |
| 1726 | 1726 | } |
@@ -1790,7 +1790,7 @@ discard block |
||
| 1790 | 1790 | // option that deals with privacy. |
| 1791 | 1791 | foreach ($privacy_consent_types as $ct) { |
| 1792 | 1792 | |
| 1793 | - $currstate = (check_user_consent($boincuser, $ct['shortname'])) ? 1 : 0 ; |
|
| 1793 | + $currstate = (check_user_consent($boincuser, $ct['shortname'])) ? 1 : 0; |
|
| 1794 | 1794 | // Set name to 'privacyconsent_SHORTNAME', which can be parsed |
| 1795 | 1795 | // later in the submit function. |
| 1796 | 1796 | $form['privacy']['privacyconsent_'.$ct['shortname']] = array( |
@@ -1804,7 +1804,7 @@ discard block |
||
| 1804 | 1804 | // Add a description with link to the question 'Do you consent to |
| 1805 | 1805 | // exporting your data...'. |
| 1806 | 1806 | $mypatt = '/Do you consent to exporting your data/'; |
| 1807 | - if (preg_match($mypatt, $ct['description']) ) { |
|
| 1807 | + if (preg_match($mypatt, $ct['description'])) { |
|
| 1808 | 1808 | $form['privacy']['privacyconsent_'.$ct['shortname']]['#description'] = bts('See our !privacy_policy_link for the current list of statistics exports.', |
| 1809 | 1809 | array( |
| 1810 | 1810 | '!privacy_policy_link' => l( |
@@ -1843,7 +1843,7 @@ discard block |
||
| 1843 | 1843 | $form['ignoreblock']['delete'][$ignored_user['iuid']] = array( |
| 1844 | 1844 | '#value' => l( |
| 1845 | 1845 | bts('delete', array(), NULL, 'boinc:ignore-user-delete-button'), |
| 1846 | - 'account/prefs/privacy/ignore_user/remove/'. $ignored_user['iuid'], |
|
| 1846 | + 'account/prefs/privacy/ignore_user/remove/'.$ignored_user['iuid'], |
|
| 1847 | 1847 | array() |
| 1848 | 1848 | ), |
| 1849 | 1849 | ); |
@@ -1894,7 +1894,7 @@ discard block |
||
| 1894 | 1894 | '#suffix' => '</li>' |
| 1895 | 1895 | ); |
| 1896 | 1896 | $form['prefs']['form control tabs'] = array( |
| 1897 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']) . '</li>' |
|
| 1897 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $_GET['q']).'</li>' |
|
| 1898 | 1898 | ); |
| 1899 | 1899 | $form['prefs']['form control tabs suffix'] = array( |
| 1900 | 1900 | '#value' => '</ul>' |
@@ -1981,7 +1981,7 @@ discard block |
||
| 1981 | 1981 | $privacyconsent_prefs = array_intersect_key($form_state['values'], array_flip($result)); |
| 1982 | 1982 | foreach ($privacyconsent_prefs as $name => $newstate) { |
| 1983 | 1983 | $subname = explode('_', $name)[1]; |
| 1984 | - $currstate = (check_user_consent($boincuser, $subname)) ? 1 : 0 ; |
|
| 1984 | + $currstate = (check_user_consent($boincuser, $subname)) ? 1 : 0; |
|
| 1985 | 1985 | list($checkct, $ctid) = check_consent_type($subname); |
| 1986 | 1986 | if ($checkct && ($currstate != $newstate)) { |
| 1987 | 1987 | consent_to_a_policy($boincuser, $ctid, $newstate, 0, 'Webform', time()); |
@@ -2047,7 +2047,7 @@ discard block |
||
| 2047 | 2047 | function boincwork_selectapp_form_submit($form, &$form_state) { |
| 2048 | 2048 | $myargs = arg(); |
| 2049 | 2049 | array_pop($myargs); |
| 2050 | - $newpath = implode('/', $myargs ) . '/' . $form['selectapp']['#value']; |
|
| 2050 | + $newpath = implode('/', $myargs).'/'.$form['selectapp']['#value']; |
|
| 2051 | 2051 | $form_state['redirect'] = $newpath; |
| 2052 | 2052 | } |
| 2053 | 2053 | |
@@ -62,21 +62,21 @@ discard block |
||
| 62 | 62 | ); |
| 63 | 63 | $items['community/teams/%/edit/admins/remove/%'] = array( |
| 64 | 64 | 'page callback' => 'boincteam_remove_admin', |
| 65 | - 'page arguments' => array(2,6), |
|
| 65 | + 'page arguments' => array(2, 6), |
|
| 66 | 66 | 'access callback' => 'boincteam_is_founder', |
| 67 | 67 | 'access arguments' => array(2), |
| 68 | 68 | 'type' => MENU_CALLBACK |
| 69 | 69 | ); |
| 70 | 70 | $items['community/teams/%/edit/founder/set/%'] = array( |
| 71 | 71 | 'page callback' => 'boincteam_set_founder', |
| 72 | - 'page arguments' => array(2,6), |
|
| 72 | + 'page arguments' => array(2, 6), |
|
| 73 | 73 | 'access callback' => 'boincteam_is_founder', |
| 74 | 74 | 'access arguments' => array(2), |
| 75 | 75 | 'type' => MENU_CALLBACK |
| 76 | 76 | ); |
| 77 | 77 | $items['community/teams/%/edit/members/remove/%'] = array( |
| 78 | 78 | 'page callback' => 'boincteam_remove_member', |
| 79 | - 'page arguments' => array(2,6), |
|
| 79 | + 'page arguments' => array(2, 6), |
|
| 80 | 80 | 'access callback' => 'boincteam_is_founder', |
| 81 | 81 | 'access arguments' => array(2), |
| 82 | 82 | 'type' => MENU_CALLBACK |
@@ -725,12 +725,12 @@ discard block |
||
| 725 | 725 | $boincteam = boincteam_load($boincteam_id); |
| 726 | 726 | $now = time(); |
| 727 | 727 | if ($boincteam->ping_user <= 0) { |
| 728 | - if ($boincteam->ping_time < $now - 60 * (24*60*60)) { |
|
| 728 | + if ($boincteam->ping_time < $now - 60*(24*60*60)) { |
|
| 729 | 729 | return TRUE; |
| 730 | 730 | } |
| 731 | 731 | return FALSE; |
| 732 | 732 | } |
| 733 | - if ($boincteam->ping_time < $now - 90 * (24*60*60)) { |
|
| 733 | + if ($boincteam->ping_time < $now - 90*(24*60*60)) { |
|
| 734 | 734 | return TRUE; |
| 735 | 735 | } |
| 736 | 736 | return FALSE; |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | * responded to the request |
| 742 | 742 | */ |
| 743 | 743 | function boincteam_foundership_transfer_ok_time($boincteam) { |
| 744 | - return $boincteam->ping_time + 60 * (24*60*60); |
|
| 744 | + return $boincteam->ping_time + 60*(24*60*60); |
|
| 745 | 745 | } |
| 746 | 746 | |
| 747 | 747 | /** |
@@ -779,26 +779,26 @@ discard block |
||
| 779 | 779 | */ |
| 780 | 780 | function boincteam_about_admins_panel() { |
| 781 | 781 | $output = ''; |
| 782 | - $output .= '<h2 class="pane-title">' . bts('About team admins', array(), NULL, 'boinc:team-admins-panel') . '</h2>'; |
|
| 782 | + $output .= '<h2 class="pane-title">'.bts('About team admins', array(), NULL, 'boinc:team-admins-panel').'</h2>'; |
|
| 783 | 783 | $output .= '<div>'; |
| 784 | - $output .= '<p>' . bts('Team admins can:', array(), NULL, 'boinc:team-admins-panel') . '</p>'; |
|
| 784 | + $output .= '<p>'.bts('Team admins can:', array(), NULL, 'boinc:team-admins-panel').'</p>'; |
|
| 785 | 785 | $output .= '<ul>'; |
| 786 | - $output .= ' <li>' . bts('Edit team information', array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
| 787 | - $output .= ' <li>' . bts("View the team's join / quit history", array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
| 788 | - $output .= ' <li>' . bts('Moderate the team forum', array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
| 789 | - $output .= ' <li>' . bts('Remove members from the team', array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
| 790 | - $output .= ' <li>' . bts('Disband a team if it has no members', array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
| 786 | + $output .= ' <li>'.bts('Edit team information', array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
| 787 | + $output .= ' <li>'.bts("View the team's join / quit history", array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
| 788 | + $output .= ' <li>'.bts('Moderate the team forum', array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
| 789 | + $output .= ' <li>'.bts('Remove members from the team', array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
| 790 | + $output .= ' <li>'.bts('Disband a team if it has no members', array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
| 791 | 791 | $output .= '</ul>'; |
| 792 | 792 | $output .= '</div>'; |
| 793 | 793 | $output .= '<div>'; |
| 794 | - $output .= '<p>' . bts('Team admins cannot:', array(), NULL, 'boinc:team-admins-panel') . '</p>'; |
|
| 794 | + $output .= '<p>'.bts('Team admins cannot:', array(), NULL, 'boinc:team-admins-panel').'</p>'; |
|
| 795 | 795 | $output .= '<ul>'; |
| 796 | - $output .= ' <li>' . bts('Change the team founder', array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
| 797 | - $output .= ' <li>' . bts('Remove members', array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
| 798 | - $output .= ' <li>' . bts('Add / Remove team admins', array(), NULL, 'boinc:team-admins-panel') . '</li>'; |
|
| 796 | + $output .= ' <li>'.bts('Change the team founder', array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
| 797 | + $output .= ' <li>'.bts('Remove members', array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
| 798 | + $output .= ' <li>'.bts('Add / Remove team admins', array(), NULL, 'boinc:team-admins-panel').'</li>'; |
|
| 799 | 799 | $output .= '</ul>'; |
| 800 | 800 | $output .= '</div>'; |
| 801 | - $output .= '<p>' . bts('If a team admin quits the team, they cease to be a' |
|
| 801 | + $output .= '<p>'.bts('If a team admin quits the team, they cease to be a' |
|
| 802 | 802 | . ' team admin. We recommend only selecting people you know and trust', array(), NULL, 'boinc:team-admins-panel') |
| 803 | 803 | . '</p>'; |
| 804 | 804 | return $output; |
@@ -809,26 +809,26 @@ discard block |
||
| 809 | 809 | */ |
| 810 | 810 | function boincteam_about_founder_panel() { |
| 811 | 811 | $output = ''; |
| 812 | - $output .= '<h2 class="pane-title">' . bts('Changing the team founder', array(), NULL, 'boinc:team-founder-panel') |
|
| 812 | + $output .= '<h2 class="pane-title">'.bts('Changing the team founder', array(), NULL, 'boinc:team-founder-panel') |
|
| 813 | 813 | . '</h2>'; |
| 814 | 814 | $output .= '<div>'; |
| 815 | - $output .= '<p>' . bts('Notes about changes in foundership:', array(), NULL, 'boinc:team-founder-panel') . '</p>'; |
|
| 815 | + $output .= '<p>'.bts('Notes about changes in foundership:', array(), NULL, 'boinc:team-founder-panel').'</p>'; |
|
| 816 | 816 | $output .= '<ul>'; |
| 817 | - $output .= ' <li>' . bts('Any member of the team is eligible', array(), NULL, 'boinc:team-founder-panel') . '</li>'; |
|
| 818 | - $output .= ' <li>' . bts('Current founder becomes a normal user', array(), NULL, 'boinc:team-founder-panel') . '</li>'; |
|
| 817 | + $output .= ' <li>'.bts('Any member of the team is eligible', array(), NULL, 'boinc:team-founder-panel').'</li>'; |
|
| 818 | + $output .= ' <li>'.bts('Current founder becomes a normal user', array(), NULL, 'boinc:team-founder-panel').'</li>'; |
|
| 819 | 819 | $output .= '</ul>'; |
| 820 | 820 | $output .= '</div>'; |
| 821 | 821 | $output .= '<div>'; |
| 822 | - $output .= '<p>' . bts('Foundership can be requested by team members:', array(), NULL, 'boinc:team-founder-panel') |
|
| 822 | + $output .= '<p>'.bts('Foundership can be requested by team members:', array(), NULL, 'boinc:team-founder-panel') |
|
| 823 | 823 | . '</p>'; |
| 824 | 824 | $output .= '<ul>'; |
| 825 | - $output .= ' <li>' . bts('One request is allowed at a time', array(), NULL, 'boinc:team-founder-panel') . '</li>'; |
|
| 826 | - $output .= ' <li>' . bts('It must be 60 days since any previous request', array(), NULL, 'boinc:team-founder-panel') |
|
| 825 | + $output .= ' <li>'.bts('One request is allowed at a time', array(), NULL, 'boinc:team-founder-panel').'</li>'; |
|
| 826 | + $output .= ' <li>'.bts('It must be 60 days since any previous request', array(), NULL, 'boinc:team-founder-panel') |
|
| 827 | 827 | . '</li>'; |
| 828 | - $output .= ' <li>' . bts('Any active request must be older than 90 days', array(), NULL, 'boinc:team-founder-panel') |
|
| 828 | + $output .= ' <li>'.bts('Any active request must be older than 90 days', array(), NULL, 'boinc:team-founder-panel') |
|
| 829 | 829 | . '</li>'; |
| 830 | - $output .= ' <li>' . bts('Current founder has 60 days to respond to a' |
|
| 831 | - . ' request', array(), NULL, 'boinc:team-founder-panel') . '</li>'; |
|
| 830 | + $output .= ' <li>'.bts('Current founder has 60 days to respond to a' |
|
| 831 | + . ' request', array(), NULL, 'boinc:team-founder-panel').'</li>'; |
|
| 832 | 832 | $output .= '</ul>'; |
| 833 | 833 | $output .= '</div>'; |
| 834 | 834 | return $output; |
@@ -842,9 +842,9 @@ discard block |
||
| 842 | 842 | $account = user_load($user->uid); |
| 843 | 843 | $unrestricted_role = array_search('verified contributor', user_roles(true)); |
| 844 | 844 | $output = ''; |
| 845 | - $output .= '<h2 class="pane-title">' . bts('Create a new team', array(), NULL, 'boinc:create-team-panel') . '</h2>'; |
|
| 846 | - $output .= '<p>' . bts('If you cannot find a team that is right for you, you' |
|
| 847 | - . ' can create a team.', array(), NULL, 'boinc:create-team-panel') . '</p>'; |
|
| 845 | + $output .= '<h2 class="pane-title">'.bts('Create a new team', array(), NULL, 'boinc:create-team-panel').'</h2>'; |
|
| 846 | + $output .= '<p>'.bts('If you cannot find a team that is right for you, you' |
|
| 847 | + . ' can create a team.', array(), NULL, 'boinc:create-team-panel').'</p>'; |
|
| 848 | 848 | $output .= '<ul class="tab-list">'; |
| 849 | 849 | $output .= ' <li class="first last tab">'; |
| 850 | 850 | if (isset($account->roles[$unrestricted_role])) { |
@@ -880,7 +880,7 @@ discard block |
||
| 880 | 880 | */ |
| 881 | 881 | function boincteam_create_team_panel() { |
| 882 | 882 | $output = ''; |
| 883 | - $output .= '<h2 class="pane-title">' . bts('Create a team', array(), NULL, 'boinc:create-team-panel') . '</h2>'; |
|
| 883 | + $output .= '<h2 class="pane-title">'.bts('Create a team', array(), NULL, 'boinc:create-team-panel').'</h2>'; |
|
| 884 | 884 | $output .= drupal_get_form('boincteam_create_form'); |
| 885 | 885 | |
| 886 | 886 | return $output; |
@@ -898,26 +898,26 @@ discard block |
||
| 898 | 898 | $account = user_load($uid); |
| 899 | 899 | if ($account->team) { |
| 900 | 900 | $team = boincteam_load(boincteam_lookup_id($account->team)); |
| 901 | - $output .= '<h2 class="pane-title">' . bts('Team', array(), NULL, 'boinc:team-dashboard') . '</h2>'; |
|
| 901 | + $output .= '<h2 class="pane-title">'.bts('Team', array(), NULL, 'boinc:team-dashboard').'</h2>'; |
|
| 902 | 902 | $output .= '<div class="stats">'; |
| 903 | - $output .= ' <label>' . bts('Name', array(), NULL, 'boinc:user-or-team-name') . ': </label>'; |
|
| 904 | - $output .= ' <span>' . l($team->name, "community/teams/{$account->team}") . '</span>'; |
|
| 905 | - $output .= '</div>' . "\n"; |
|
| 903 | + $output .= ' <label>'.bts('Name', array(), NULL, 'boinc:user-or-team-name').': </label>'; |
|
| 904 | + $output .= ' <span>'.l($team->name, "community/teams/{$account->team}").'</span>'; |
|
| 905 | + $output .= '</div>'."\n"; |
|
| 906 | 906 | $output .= '<div class="stats">'; |
| 907 | - $output .= ' <label>' . bts('Member since', array(), NULL, 'boinc:user-info') . ': </label>'; |
|
| 908 | - $output .= ' <span>' . date('j F Y', boincteam_get_member_join_date($team->id, $account->boincuser_id)) . '</span>'; |
|
| 909 | - $output .= '</div>' . "\n"; |
|
| 907 | + $output .= ' <label>'.bts('Member since', array(), NULL, 'boinc:user-info').': </label>'; |
|
| 908 | + $output .= ' <span>'.date('j F Y', boincteam_get_member_join_date($team->id, $account->boincuser_id)).'</span>'; |
|
| 909 | + $output .= '</div>'."\n"; |
|
| 910 | 910 | $output .= '<div class="stats">'; |
| 911 | - $output .= ' <label>' . bts('Country', array(), NULL, 'boinc:country-of-origin') . ': </label>'; |
|
| 912 | - $output .= ' <span>' . $team->country . '</span>'; |
|
| 913 | - $output .= '</div>' . "\n"; |
|
| 911 | + $output .= ' <label>'.bts('Country', array(), NULL, 'boinc:country-of-origin').': </label>'; |
|
| 912 | + $output .= ' <span>'.$team->country.'</span>'; |
|
| 913 | + $output .= '</div>'."\n"; |
|
| 914 | 914 | $output .= '<div class="stats">'; |
| 915 | - $output .= ' <label>' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . ': </label>'; |
|
| 916 | - $output .= ' <span>' . number_format($team->total_credit, 0) . '</span>'; |
|
| 917 | - $output .= '</div>' . "\n"; |
|
| 915 | + $output .= ' <label>'.bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits').': </label>'; |
|
| 916 | + $output .= ' <span>'.number_format($team->total_credit, 0).'</span>'; |
|
| 917 | + $output .= '</div>'."\n"; |
|
| 918 | 918 | } |
| 919 | 919 | else if ($user->uid == $account->uid) { |
| 920 | - $output .= '<h2 class="pane-title">' . bts('Team (None)', array(), NULL, 'boinc:team-dashboard') . '</h2>'; |
|
| 920 | + $output .= '<h2 class="pane-title">'.bts('Team (None)', array(), NULL, 'boinc:team-dashboard').'</h2>'; |
|
| 921 | 921 | $output .= '<ul class="tab-list action-list">'; |
| 922 | 922 | $output .= '<li class="tab primary">'; |
| 923 | 923 | $output .= l(bts('Join a Team', array(), NULL, 'boinc:team-dashboard'), 'community/teams'); |
@@ -933,7 +933,7 @@ discard block |
||
| 933 | 933 | function boincteam_edit_team_panel($team_id) { |
| 934 | 934 | $team = node_load($team_id); |
| 935 | 935 | $output = ''; |
| 936 | - $output .= '<h2 class="pane-title">' . $team->title . '</h2>'; |
|
| 936 | + $output .= '<h2 class="pane-title">'.$team->title.'</h2>'; |
|
| 937 | 937 | $output .= drupal_get_form('boincteam_edit_form', $team_id); |
| 938 | 938 | |
| 939 | 939 | return $output; |
@@ -945,12 +945,12 @@ discard block |
||
| 945 | 945 | function boincteam_join_team_panel($team_id) { |
| 946 | 946 | $team = node_load($team_id); |
| 947 | 947 | $output = ''; |
| 948 | - $output .= '<h2 class="pane-title">' . bts('Join team', array(), NULL, 'boinc:join-team-panel') . '</h2>'; |
|
| 949 | - $output .= '<p>' . bts('Click here to become a member of @this_team', |
|
| 950 | - array('@this_team' =>$team->title), NULL, 'boinc:join-team-panel') . '</p>'; |
|
| 948 | + $output .= '<h2 class="pane-title">'.bts('Join team', array(), NULL, 'boinc:join-team-panel').'</h2>'; |
|
| 949 | + $output .= '<p>'.bts('Click here to become a member of @this_team', |
|
| 950 | + array('@this_team' =>$team->title), NULL, 'boinc:join-team-panel').'</p>'; |
|
| 951 | 951 | $output .= '<ul class="tab-list">'; |
| 952 | - $output .= ' <li class="first last tab">' . |
|
| 953 | - l(bts('Join this team', array(), NULL, 'boinc:join-team-panel'), "community/teams/{$team_id}/join") . '</li>'; |
|
| 952 | + $output .= ' <li class="first last tab">'. |
|
| 953 | + l(bts('Join this team', array(), NULL, 'boinc:join-team-panel'), "community/teams/{$team_id}/join").'</li>'; |
|
| 954 | 954 | $output .= '</ul>'; |
| 955 | 955 | return $output; |
| 956 | 956 | } |
@@ -961,12 +961,12 @@ discard block |
||
| 961 | 961 | function boincteam_leave_team_panel($team_id) { |
| 962 | 962 | $team = node_load($team_id); |
| 963 | 963 | $output = ''; |
| 964 | - $output .= '<h2 class="pane-title">' . bts('Leave team', array(), NULL, 'boinc:leave-team-panel') . '</h2>'; |
|
| 965 | - $output .= '<p>' . bts('Click here to revoke your membership with' |
|
| 966 | - . ' @this_team', array('@this_team' =>$team->title), NULL, 'boinc:leave-team-panel') . '</p>'; |
|
| 964 | + $output .= '<h2 class="pane-title">'.bts('Leave team', array(), NULL, 'boinc:leave-team-panel').'</h2>'; |
|
| 965 | + $output .= '<p>'.bts('Click here to revoke your membership with' |
|
| 966 | + . ' @this_team', array('@this_team' =>$team->title), NULL, 'boinc:leave-team-panel').'</p>'; |
|
| 967 | 967 | $output .= '<ul class="tab-list">'; |
| 968 | - $output .= ' <li class="first last tab">' . |
|
| 969 | - l(bts('Leave this team', array(), NULL, 'boinc:leave-team-panel'), "community/teams/{$team_id}/leave") . '</li>'; |
|
| 968 | + $output .= ' <li class="first last tab">'. |
|
| 969 | + l(bts('Leave this team', array(), NULL, 'boinc:leave-team-panel'), "community/teams/{$team_id}/leave").'</li>'; |
|
| 970 | 970 | $output .= '</ul>'; |
| 971 | 971 | return $output; |
| 972 | 972 | } |
@@ -976,10 +976,10 @@ discard block |
||
| 976 | 976 | */ |
| 977 | 977 | function boincteam_manage_admins_panel_header($team_id) { |
| 978 | 978 | $output = ''; |
| 979 | - $output .= '<h4>' . bts('Add team admin', array(), NULL, 'boinc:team-manage-admins') . '</h4>'; |
|
| 979 | + $output .= '<h4>'.bts('Add team admin', array(), NULL, 'boinc:team-manage-admins').'</h4>'; |
|
| 980 | 980 | $output .= drupal_get_form('boincteam_add_admin_form', $team_id); |
| 981 | 981 | $output .= '<div class="clearfix"></div>'; |
| 982 | - $output .= '<h4>' . bts('Current team admins', array(), NULL, 'boinc:team-manage-admins') . '</h4>'; |
|
| 982 | + $output .= '<h4>'.bts('Current team admins', array(), NULL, 'boinc:team-manage-admins').'</h4>'; |
|
| 983 | 983 | |
| 984 | 984 | return $output; |
| 985 | 985 | } |
@@ -992,17 +992,17 @@ discard block |
||
| 992 | 992 | $team = node_load($team_id); |
| 993 | 993 | |
| 994 | 994 | $output = ''; |
| 995 | - $output .= '<h2 class="pane-title">' . bts('Manage team', array(), NULL, 'boinc:team-manage') . '</h2>'; |
|
| 995 | + $output .= '<h2 class="pane-title">'.bts('Manage team', array(), NULL, 'boinc:team-manage').'</h2>'; |
|
| 996 | 996 | |
| 997 | 997 | // PM all members |
| 998 | 998 | if (module_exists('privatemsg')) { |
| 999 | 999 | $output .= '<div class="form-item">'; |
| 1000 | 1000 | $output .= ' <ul class="tab-list action-list">'; |
| 1001 | - $output .= ' <li class="first tab primary">' . |
|
| 1002 | - l('Send message to team', "community/teams/{$team_id}/message-all-members") . '</li>'; |
|
| 1001 | + $output .= ' <li class="first tab primary">'. |
|
| 1002 | + l('Send message to team', "community/teams/{$team_id}/message-all-members").'</li>'; |
|
| 1003 | 1003 | $output .= ' </ul>'; |
| 1004 | 1004 | $output .= ' <div class="description">'; |
| 1005 | - $output .= bts('Contact all team members using e-mail.', array(), NULL, 'boinc:team-manage'); |
|
| 1005 | + $output .= bts('Contact all team members using e-mail.', array(), NULL, 'boinc:team-manage'); |
|
| 1006 | 1006 | $output .= ' </div>'; |
| 1007 | 1007 | $output .= '</div>'; |
| 1008 | 1008 | } |
@@ -1020,13 +1020,13 @@ discard block |
||
| 1020 | 1020 | } |
| 1021 | 1021 | $output .= '<div class="form-item">'; |
| 1022 | 1022 | $output .= ' <ul class="tab-list action-list">'; |
| 1023 | - $output .= ' <li class="first tab primary">' . |
|
| 1023 | + $output .= ' <li class="first tab primary">'. |
|
| 1024 | 1024 | l(bts('Manage team message board', array(), NULL, 'boinc:team-manage'), |
| 1025 | 1025 | "community/teams/{$team_id}/forum/{$team_forum_link_path}" |
| 1026 | 1026 | ); |
| 1027 | 1027 | $output .= ' </li>'; |
| 1028 | 1028 | $output .= ' <div class="description">'; |
| 1029 | - $output .= bts('Create or manage message board', array(), NULL, 'boinc:team-manage'); |
|
| 1029 | + $output .= bts('Create or manage message board', array(), NULL, 'boinc:team-manage'); |
|
| 1030 | 1030 | $output .= ' </div>'; |
| 1031 | 1031 | $output .= '</div>'; |
| 1032 | 1032 | } |
@@ -1034,15 +1034,15 @@ discard block |
||
| 1034 | 1034 | |
| 1035 | 1035 | // Team history |
| 1036 | 1036 | $output .= '<div class="form-item">'; |
| 1037 | - $output .= ' <label>' . bts('View change history', array(), NULL, 'boinc:team-manage') . '</label>'; |
|
| 1037 | + $output .= ' <label>'.bts('View change history', array(), NULL, 'boinc:team-manage').'</label>'; |
|
| 1038 | 1038 | $output .= ' <ul class="tab-list">'; |
| 1039 | - $output .= ' <li class="first tab primary">' . |
|
| 1040 | - l('HTML', "community/teams/{$team_id}/history") . '</li>'; |
|
| 1041 | - $output .= ' <li class="last tab primary">' . |
|
| 1042 | - l('XML', "community/teams/{$team_id}/history/xml") . '</li>'; |
|
| 1039 | + $output .= ' <li class="first tab primary">'. |
|
| 1040 | + l('HTML', "community/teams/{$team_id}/history").'</li>'; |
|
| 1041 | + $output .= ' <li class="last tab primary">'. |
|
| 1042 | + l('XML', "community/teams/{$team_id}/history/xml").'</li>'; |
|
| 1043 | 1043 | $output .= ' </ul>'; |
| 1044 | 1044 | $output .= ' <div class="description">'; |
| 1045 | - $output .= bts('See member activity', array(), NULL, 'boinc:team-manage'); |
|
| 1045 | + $output .= bts('See member activity', array(), NULL, 'boinc:team-manage'); |
|
| 1046 | 1046 | $output .= ' </div>'; |
| 1047 | 1047 | $output .= '</div>'; |
| 1048 | 1048 | |
@@ -1050,30 +1050,30 @@ discard block |
||
| 1050 | 1050 | $output .= ' <ul class="tab-list action-list">'; |
| 1051 | 1051 | |
| 1052 | 1052 | // Edit team information |
| 1053 | - $output .= ' <li class="first tab primary">' . |
|
| 1054 | - l(bts('Edit team info', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/info") . '</li>'; |
|
| 1053 | + $output .= ' <li class="first tab primary">'. |
|
| 1054 | + l(bts('Edit team info', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/info").'</li>'; |
|
| 1055 | 1055 | |
| 1056 | 1056 | // Member list |
| 1057 | - $output .= ' <li class="tab primary">' . |
|
| 1058 | - l(bts('View member list', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/members") . '</li>'; |
|
| 1057 | + $output .= ' <li class="tab primary">'. |
|
| 1058 | + l(bts('View member list', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/members").'</li>'; |
|
| 1059 | 1059 | |
| 1060 | 1060 | // Remove members |
| 1061 | - $output .= ' <li class="tab primary">' . |
|
| 1062 | - l(bts('Remove members', array(), NULL, 'boinc:team-admins-panel'), "community/teams/{$team_id}/edit/members") . '</li>'; |
|
| 1061 | + $output .= ' <li class="tab primary">'. |
|
| 1062 | + l(bts('Remove members', array(), NULL, 'boinc:team-admins-panel'), "community/teams/{$team_id}/edit/members").'</li>'; |
|
| 1063 | 1063 | |
| 1064 | 1064 | if ($is_founder) { |
| 1065 | 1065 | |
| 1066 | 1066 | // Change founder |
| 1067 | - $output .= ' <li class="tab primary">' . |
|
| 1068 | - l(bts('Change founder', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/founder") . '</li>'; |
|
| 1067 | + $output .= ' <li class="tab primary">'. |
|
| 1068 | + l(bts('Change founder', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/founder").'</li>'; |
|
| 1069 | 1069 | |
| 1070 | 1070 | // Manage admins |
| 1071 | - $output .= ' <li class="tab primary">' . |
|
| 1072 | - l(bts('Manage team admins', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/admins") . '</li>'; |
|
| 1071 | + $output .= ' <li class="tab primary">'. |
|
| 1072 | + l(bts('Manage team admins', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/edit/admins").'</li>'; |
|
| 1073 | 1073 | |
| 1074 | 1074 | // Delete the team |
| 1075 | - $output .= ' <li class="last tab primary">' . |
|
| 1076 | - l(bts('Remove team', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/delete") . '</li>'; |
|
| 1075 | + $output .= ' <li class="last tab primary">'. |
|
| 1076 | + l(bts('Remove team', array(), NULL, 'boinc:team-manage'), "community/teams/{$team_id}/delete").'</li>'; |
|
| 1077 | 1077 | } |
| 1078 | 1078 | |
| 1079 | 1079 | $output .= ' </ul>'; |
@@ -1090,12 +1090,12 @@ discard block |
||
| 1090 | 1090 | $account = user_load($user->uid); |
| 1091 | 1091 | $team = node_load($account->team); |
| 1092 | 1092 | $output = ''; |
| 1093 | - $output .= '<h2 class="pane-title">' . bts('My team', array(), NULL, 'boinc:account-team-panel') . '</h2>'; |
|
| 1094 | - $output .= '<p>' . bts('You are a member of @team.', |
|
| 1095 | - array('@team' => $team->title), NULL, 'boinc:account-team-panel') . '</p>'; |
|
| 1093 | + $output .= '<h2 class="pane-title">'.bts('My team', array(), NULL, 'boinc:account-team-panel').'</h2>'; |
|
| 1094 | + $output .= '<p>'.bts('You are a member of @team.', |
|
| 1095 | + array('@team' => $team->title), NULL, 'boinc:account-team-panel').'</p>'; |
|
| 1096 | 1096 | $output .= '<ul class="tab-list">'; |
| 1097 | - $output .= ' <li class="first last tab">' . |
|
| 1098 | - l(bts('View my team', array(), NULL, 'boinc:account-team-panel'), "community/teams/{$account->team}") . '</li>'; |
|
| 1097 | + $output .= ' <li class="first last tab">'. |
|
| 1098 | + l(bts('View my team', array(), NULL, 'boinc:account-team-panel'), "community/teams/{$account->team}").'</li>'; |
|
| 1099 | 1099 | $output .= '</ul>'; |
| 1100 | 1100 | return $output; |
| 1101 | 1101 | } |
@@ -1111,11 +1111,11 @@ discard block |
||
| 1111 | 1111 | $boincteam = boincteam_load($boincteam_id); |
| 1112 | 1112 | $boincuser_id = $account->boincuser_id; |
| 1113 | 1113 | $output = ''; |
| 1114 | - $output .= '<h2 class="pane-title">' . bts('Request foundership', array(), NULL, 'boinc:team-request-foundership') . '</h2>'; |
|
| 1114 | + $output .= '<h2 class="pane-title">'.bts('Request foundership', array(), NULL, 'boinc:team-request-foundership').'</h2>'; |
|
| 1115 | 1115 | |
| 1116 | 1116 | if (boincteam_user_requested_foundership($team_id)) { |
| 1117 | 1117 | $deadline = boincteam_foundership_transfer_ok_time($boincteam); |
| 1118 | - $days_to_deadline = ceil(($deadline - time()) / (24*60*60)); |
|
| 1118 | + $days_to_deadline = ceil(($deadline - time())/(24*60*60)); |
|
| 1119 | 1119 | $request_age = 60 - $days_to_deadline; |
| 1120 | 1120 | $days_to_respond = 30 + $days_to_deadline; |
| 1121 | 1121 | if (time() > $deadline) { |
@@ -1143,8 +1143,8 @@ discard block |
||
| 1143 | 1143 | } |
| 1144 | 1144 | $output .= '</p>'; |
| 1145 | 1145 | $output .= '<ul class="tab-list">'; |
| 1146 | - $output .= ' <li class="first last tab">' . |
|
| 1147 | - l(bts('Assume foundership', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/assume-foundership") . '</li>'; |
|
| 1146 | + $output .= ' <li class="first last tab">'. |
|
| 1147 | + l(bts('Assume foundership', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/assume-foundership").'</li>'; |
|
| 1148 | 1148 | $output .= '</ul>'; |
| 1149 | 1149 | } |
| 1150 | 1150 | else { |
@@ -1168,29 +1168,29 @@ discard block |
||
| 1168 | 1168 | // who made the request has 30 additional days to assume foundership if |
| 1169 | 1169 | // there is no response to the request) |
| 1170 | 1170 | $deadline = boincteam_foundership_transfer_ok_time($boincteam); |
| 1171 | - $days_to_deadline = ceil(($deadline - time()) / (24*60*60)) + 30; |
|
| 1171 | + $days_to_deadline = ceil(($deadline - time())/(24*60*60)) + 30; |
|
| 1172 | 1172 | $output .= '<p>'; |
| 1173 | 1173 | $output .= bts('A team foundership change was already requested recently.' |
| 1174 | 1174 | . ' Only one request is allowed within a period of 90 days.', |
| 1175 | 1175 | NULL, 'boinc:team-request-foundership'); |
| 1176 | 1176 | if ($days_to_deadline == 1) { |
| 1177 | - $output .= ' (' . bts('1 day remaining', array(), NULL, 'boinc:team-request-foundership') . ')'; |
|
| 1177 | + $output .= ' ('.bts('1 day remaining', array(), NULL, 'boinc:team-request-foundership').')'; |
|
| 1178 | 1178 | } |
| 1179 | 1179 | else { |
| 1180 | - $output .= ' (' . bts('@count days remaining', |
|
| 1180 | + $output .= ' ('.bts('@count days remaining', |
|
| 1181 | 1181 | array('@count' => $days_to_deadline), |
| 1182 | - NULL, 'boinc:team-request-foundership') . ')'; |
|
| 1182 | + NULL, 'boinc:team-request-foundership').')'; |
|
| 1183 | 1183 | } |
| 1184 | 1184 | $output .= '</p>'; |
| 1185 | 1185 | } |
| 1186 | 1186 | else { |
| 1187 | - $output .= '<p>' . bts('If the team founder is not active and you want to' |
|
| 1187 | + $output .= '<p>'.bts('If the team founder is not active and you want to' |
|
| 1188 | 1188 | . ' assume the role of founder, click below to request foundership of' |
| 1189 | 1189 | . ' @this_team.', |
| 1190 | - array('@this_team' =>$team->title), NULL, 'boinc:team-request-foundership') . '</p>'; |
|
| 1190 | + array('@this_team' =>$team->title), NULL, 'boinc:team-request-foundership').'</p>'; |
|
| 1191 | 1191 | $output .= '<ul class="tab-list">'; |
| 1192 | - $output .= ' <li class="first last tab">' . |
|
| 1193 | - l(bts('Initiate request', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/request-foundership") . '</li>'; |
|
| 1192 | + $output .= ' <li class="first last tab">'. |
|
| 1193 | + l(bts('Initiate request', array(), NULL, 'boinc:team-request-foundership'), "community/teams/{$team_id}/request-foundership").'</li>'; |
|
| 1194 | 1194 | $output .= '</ul>'; |
| 1195 | 1195 | } |
| 1196 | 1196 | return $output; |
@@ -1211,15 +1211,15 @@ discard block |
||
| 1211 | 1211 | if ($boincteam->ping_user) { |
| 1212 | 1212 | if ($boincteam->ping_user < 0) { |
| 1213 | 1213 | $member = user_load(boincuser_lookup_uid(-$boincteam->ping_user)); |
| 1214 | - $output .= '<h2 class="pane-title">' . bts('Obsolete transfer request', array(), NULL, 'boinc:team-request-foundership-response') |
|
| 1214 | + $output .= '<h2 class="pane-title">'.bts('Obsolete transfer request', array(), NULL, 'boinc:team-request-foundership-response') |
|
| 1215 | 1215 | . '</h2>'; |
| 1216 | - $output .= '<p>' . bts('Team member @name requested team foundership on' |
|
| 1216 | + $output .= '<p>'.bts('Team member @name requested team foundership on' |
|
| 1217 | 1217 | . ' @date, but then left the team. This request is now canceled.', |
| 1218 | 1218 | array( |
| 1219 | 1219 | '@name' => $member->boincuser_name, |
| 1220 | 1220 | '@date' => date('j M Y', $boincteam->ping_time), |
| 1221 | 1221 | ), |
| 1222 | - NULL, 'boinc:team-request-foundership-response') . '</p>'; |
|
| 1222 | + NULL, 'boinc:team-request-foundership-response').'</p>'; |
|
| 1223 | 1223 | // Automatically cancel the request |
| 1224 | 1224 | db_set_active('boinc_rw'); |
| 1225 | 1225 | db_query(" |
@@ -1232,15 +1232,15 @@ discard block |
||
| 1232 | 1232 | } |
| 1233 | 1233 | else { |
| 1234 | 1234 | $member = user_load(boincuser_lookup_uid($boincteam->ping_user)); |
| 1235 | - $output .= '<h2 class="pane-title">' . bts('Respond to transfer request', array(), NULL, 'boinc:team-request-foundership-response') |
|
| 1235 | + $output .= '<h2 class="pane-title">'.bts('Respond to transfer request', array(), NULL, 'boinc:team-request-foundership-response') |
|
| 1236 | 1236 | . '</h2>'; |
| 1237 | - $output .= '<p>' . bts('Team member @name has requested team foundership.' |
|
| 1237 | + $output .= '<p>'.bts('Team member @name has requested team foundership.' |
|
| 1238 | 1238 | . ' This may be because you left the team or have not had contact with' |
| 1239 | 1239 | . ' the team for a long time.', array( |
| 1240 | 1240 | '@name' => $member->boincuser_name, |
| 1241 | 1241 | ) |
| 1242 | - , array(), NULL, 'boinc:team-request-foundership-response') . '</p>'; |
|
| 1243 | - $output .= '<p>' . bts("If you don't decline the request by @date, @name" |
|
| 1242 | + , array(), NULL, 'boinc:team-request-foundership-response').'</p>'; |
|
| 1243 | + $output .= '<p>'.bts("If you don't decline the request by @date, @name" |
|
| 1244 | 1244 | . ' will have the option of assuming team foundership. (note: To' |
| 1245 | 1245 | . ' accept the request, assign foundership to @name using the form' |
| 1246 | 1246 | . ' below)', |
@@ -1248,10 +1248,10 @@ discard block |
||
| 1248 | 1248 | '@name' => $member->boincuser_name, |
| 1249 | 1249 | '@date' => date('j M Y', boincteam_foundership_transfer_ok_time($boincteam)), |
| 1250 | 1250 | ), |
| 1251 | - NULL, 'boinc:team-request-foundership-response') . '</p>'; |
|
| 1251 | + NULL, 'boinc:team-request-foundership-response').'</p>'; |
|
| 1252 | 1252 | $output .= '<ul class="tab-list">'; |
| 1253 | - $output .= ' <li class="first last tab">' . |
|
| 1254 | - l(bts('Deny request', array(), NULL, 'boinc:team-request-foundership-response'), "community/teams/{$team_id}/deny-foundership-request") . '</li>'; |
|
| 1253 | + $output .= ' <li class="first last tab">'. |
|
| 1254 | + l(bts('Deny request', array(), NULL, 'boinc:team-request-foundership-response'), "community/teams/{$team_id}/deny-foundership-request").'</li>'; |
|
| 1255 | 1255 | $output .= '</ul>'; |
| 1256 | 1256 | } |
| 1257 | 1257 | } |
@@ -1261,9 +1261,9 @@ discard block |
||
| 1261 | 1261 | function boincteam_search_panel() { |
| 1262 | 1262 | $output = ''; |
| 1263 | 1263 | if (module_exists('global_search_teams_solr')) { |
| 1264 | - $output .= '<h2 class="pane-title">' . bts('Search teams', array(), NULL, 'boinc:search-team') . '</h2>'; |
|
| 1264 | + $output .= '<h2 class="pane-title">'.bts('Search teams', array(), NULL, 'boinc:search-team').'</h2>'; |
|
| 1265 | 1265 | //$output .= '<p>' . bts('Render a search form here.', array(), NULL, 'boinc:search-team') . '</p>'; |
| 1266 | - $output .= '<p>' . boincteam_search_view() . '</p>'; |
|
| 1266 | + $output .= '<p>'.boincteam_search_view().'</p>'; |
|
| 1267 | 1267 | } |
| 1268 | 1268 | return $output; |
| 1269 | 1269 | } |
@@ -1279,20 +1279,20 @@ discard block |
||
| 1279 | 1279 | * General info about the concept of teams |
| 1280 | 1280 | */ |
| 1281 | 1281 | function boincteam_topic_overview_panel() { |
| 1282 | - $site_name = variable_get('site_name', 'Drupal-BOINC'); |
|
| 1282 | + $site_name = variable_get('site_name', 'Drupal-BOINC'); |
|
| 1283 | 1283 | $output = ''; |
| 1284 | - $output .= '<h2 class="pane-title">' . bts('Teams', array(), NULL, 'boinc:team-general-info') . '</h2>'; |
|
| 1284 | + $output .= '<h2 class="pane-title">'.bts('Teams', array(), NULL, 'boinc:team-general-info').'</h2>'; |
|
| 1285 | 1285 | $output .= '<div class="">'; |
| 1286 | - $output .= '<p>' . bts('@project participants may form teams. You may belong' |
|
| 1286 | + $output .= '<p>'.bts('@project participants may form teams. You may belong' |
|
| 1287 | 1287 | . ' to only one team. You can join or quit a team at any time. To join a' |
| 1288 | 1288 | . ' team, visit its team page and click "Join this team". Each team has a' |
| 1289 | - . ' founder who may:', array('@project' => $site_name), NULL, 'boinc:team-general-info') . '</p>'; |
|
| 1289 | + . ' founder who may:', array('@project' => $site_name), NULL, 'boinc:team-general-info').'</p>'; |
|
| 1290 | 1290 | $output .= '<ul>'; |
| 1291 | - $output .= ' <li>' . bts('Private Message all team members', array(), NULL, 'boinc:team-general-info') . '</li>'; |
|
| 1292 | - $output .= ' <li>' . bts("edit the team's name and description", array(), NULL, 'boinc:team-general-info') . '</li>'; |
|
| 1293 | - $output .= ' <li>' . bts('add or remove team admins', array(), NULL, 'boinc:team-general-info') . '</li>'; |
|
| 1294 | - $output .= ' <li>' . bts('remove members from the team', array(), NULL, 'boinc:team-general-info') . '</li>'; |
|
| 1295 | - $output .= ' <li>' . bts('disband a team if it has no members', array(), NULL, 'boinc:team-general-info') . '</li>'; |
|
| 1291 | + $output .= ' <li>'.bts('Private Message all team members', array(), NULL, 'boinc:team-general-info').'</li>'; |
|
| 1292 | + $output .= ' <li>'.bts("edit the team's name and description", array(), NULL, 'boinc:team-general-info').'</li>'; |
|
| 1293 | + $output .= ' <li>'.bts('add or remove team admins', array(), NULL, 'boinc:team-general-info').'</li>'; |
|
| 1294 | + $output .= ' <li>'.bts('remove members from the team', array(), NULL, 'boinc:team-general-info').'</li>'; |
|
| 1295 | + $output .= ' <li>'.bts('disband a team if it has no members', array(), NULL, 'boinc:team-general-info').'</li>'; |
|
| 1296 | 1296 | $output .= '</ul>'; |
| 1297 | 1297 | $output .= '</div>'; |
| 1298 | 1298 | return $output; |
@@ -1337,34 +1337,34 @@ discard block |
||
| 1337 | 1337 | } |
| 1338 | 1338 | } |
| 1339 | 1339 | $output = ''; |
| 1340 | - $output .= '<h2 class="pane-title">' . $boincteam->name . '</h2>'; |
|
| 1340 | + $output .= '<h2 class="pane-title">'.$boincteam->name.'</h2>'; |
|
| 1341 | 1341 | $output .= '<div>'; |
| 1342 | 1342 | $output .= '<div class="left-column">'; |
| 1343 | 1343 | $output .= '<ul class="stats">'; |
| 1344 | - $output .= ' <li>' . bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits') . ': ' . number_format($boincteam->total_credit, 0) . '</li>'; |
|
| 1345 | - $output .= ' <li>' . bts('Recent average credit', array(), NULL, 'boinc:user-or-team-RAC') . ': ' . number_format($boincteam->expavg_credit, 2) . '</li>'; |
|
| 1346 | - $output .= ' <li>' . bts('Country', array(), NULL, 'boinc:country-of-origin') . ': ' . $boincteam->country . '</li>'; |
|
| 1347 | - $output .= ' <li>' . bts('Type', array(), NULL, 'boinc:view-team-info') . ': ' . boincteam_get_type($team_id) . '</li>'; |
|
| 1344 | + $output .= ' <li>'.bts('Total credit', array(), NULL, 'boinc:user-or-team-total-credits').': '.number_format($boincteam->total_credit, 0).'</li>'; |
|
| 1345 | + $output .= ' <li>'.bts('Recent average credit', array(), NULL, 'boinc:user-or-team-RAC').': '.number_format($boincteam->expavg_credit, 2).'</li>'; |
|
| 1346 | + $output .= ' <li>'.bts('Country', array(), NULL, 'boinc:country-of-origin').': '.$boincteam->country.'</li>'; |
|
| 1347 | + $output .= ' <li>'.bts('Type', array(), NULL, 'boinc:view-team-info').': '.boincteam_get_type($team_id).'</li>'; |
|
| 1348 | 1348 | $output .= '</ul>'; |
| 1349 | 1349 | $output .= '</div>'; |
| 1350 | 1350 | $output .= '<div class="right-column">'; |
| 1351 | 1351 | $output .= '<ul class="stats">'; |
| 1352 | - $output .= ' <li>' . bts('Founder', array(), NULL, 'boinc:view-team-info') . ': ' . l($founder->boincuser_name, "account/{$founder->uid}") . '</li>'; |
|
| 1353 | - $output .= ' <li>' . bts('New members in last day', array(), NULL, 'boinc:view-team-info') . ': ' . implode('·', $new_members) . '</li>'; |
|
| 1354 | - $output .= ' <li>' . bts('Total members', array(), NULL, 'boinc:view-team-info') . ': ' . l($boincteam->nusers, "community/teams/{$team_id}/members") . '</li>'; |
|
| 1355 | - $output .= ' <li>' . bts('Active members', array(), NULL, 'boinc:view-team-info') . ': ' . $boincteam->nusers_active . '</li>'; |
|
| 1356 | - $output .= ' <li>' . bts('Members with credit', array(), NULL, 'boinc:view-team-info') . ': ' . $boincteam->nusers_worked . '</li>'; |
|
| 1352 | + $output .= ' <li>'.bts('Founder', array(), NULL, 'boinc:view-team-info').': '.l($founder->boincuser_name, "account/{$founder->uid}").'</li>'; |
|
| 1353 | + $output .= ' <li>'.bts('New members in last day', array(), NULL, 'boinc:view-team-info').': '.implode('·', $new_members).'</li>'; |
|
| 1354 | + $output .= ' <li>'.bts('Total members', array(), NULL, 'boinc:view-team-info').': '.l($boincteam->nusers, "community/teams/{$team_id}/members").'</li>'; |
|
| 1355 | + $output .= ' <li>'.bts('Active members', array(), NULL, 'boinc:view-team-info').': '.$boincteam->nusers_active.'</li>'; |
|
| 1356 | + $output .= ' <li>'.bts('Members with credit', array(), NULL, 'boinc:view-team-info').': '.$boincteam->nusers_worked.'</li>'; |
|
| 1357 | 1357 | $output .= '</ul>'; |
| 1358 | 1358 | $output .= '</div>'; |
| 1359 | 1359 | $output .= '</div>'; |
| 1360 | 1360 | $output .= '<div class="clearfix"></div>'; |
| 1361 | 1361 | if ($boincteam->url) { |
| 1362 | 1362 | $output .= '<div class="stats">'; |
| 1363 | - $output .= bts('Website', array(), NULL, 'boinc:website-of-user-or-team') . ': ' . l("http://{$boincteam->url}", "http://{$boincteam->url}"); |
|
| 1363 | + $output .= bts('Website', array(), NULL, 'boinc:website-of-user-or-team').': '.l("http://{$boincteam->url}", "http://{$boincteam->url}"); |
|
| 1364 | 1364 | $output .= '</div>'; |
| 1365 | 1365 | } |
| 1366 | 1366 | if ($team->body) { |
| 1367 | - $output .= '<h3>' . bts('Description', array(), NULL, 'boinc:team-description') . '</h3>'; |
|
| 1367 | + $output .= '<h3>'.bts('Description', array(), NULL, 'boinc:team-description').'</h3>'; |
|
| 1368 | 1368 | $output .= check_markup($team->body, $team->format); |
| 1369 | 1369 | $output .= '</div>'; |
| 1370 | 1370 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | // In Drupal 7, these operation cases will all exist as their own hooks, |
| 60 | 60 | // so let's approximate that here so that this function can simply be removed |
| 61 | 61 | // upon migration to 7 |
| 62 | - switch($op) { |
|
| 62 | + switch ($op) { |
|
| 63 | 63 | case 'insert': |
| 64 | 64 | boincteam_forum_node_insert($node); |
| 65 | 65 | break; |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * is inserted (forward compatible to Drupal 7) |
| 85 | 85 | */ |
| 86 | 86 | function boincteam_forum_node_insert($node) { |
| 87 | - switch($node->type) { |
|
| 87 | + switch ($node->type) { |
|
| 88 | 88 | case 'team_forum': |
| 89 | 89 | $account = user_load($node->uid); |
| 90 | 90 | $team_id = boincteam_forum_lookup_nid($node->tfid); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | * is loaded (forward compatible to Drupal 7) |
| 108 | 108 | */ |
| 109 | 109 | function boincteam_forum_node_load($node) { |
| 110 | - switch($node->type) { |
|
| 110 | + switch ($node->type) { |
|
| 111 | 111 | case 'team_forum': |
| 112 | 112 | $node->tfid = db_result(db_query(" |
| 113 | 113 | SELECT tfid FROM {boincteam_forum_node} |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | * is updated (forward compatible to Drupal 7) |
| 126 | 126 | */ |
| 127 | 127 | function boincteam_forum_node_update($node) { |
| 128 | - switch($node->type) { |
|
| 128 | + switch ($node->type) { |
|
| 129 | 129 | case 'team_forum': |
| 130 | 130 | |
| 131 | 131 | break; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | * is validated (forward compatible to Drupal 7) |
| 141 | 141 | */ |
| 142 | 142 | function boincteam_forum_node_validate($node) { |
| 143 | - switch($node->type) { |
|
| 143 | + switch ($node->type) { |
|
| 144 | 144 | case 'team_forum': |
| 145 | 145 | $account = user_load($node->uid); |
| 146 | 146 | // Get tfid from node, but if empty/null, get it from the database |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | * is viewed (forward compatible to Drupal 7) |
| 168 | 168 | */ |
| 169 | 169 | function boincteam_forum_node_view($node) { |
| 170 | - switch($node->type) { |
|
| 170 | + switch ($node->type) { |
|
| 171 | 171 | case 'team_forum': |
| 172 | 172 | $team_id = boincteam_forum_lookup_nid($node->tfid); |
| 173 | 173 | $public_forum = boincteam_forum_is_public($node->tfid); |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | while ($team_forum = db_fetch_object($result)) { |
| 257 | 257 | |
| 258 | 258 | $team_forum->link = url("community/teams/{$team_id}/forum/{$team_forum->tfid}"); |
| 259 | - $team_forum->zebra = $row % 2 ? 'even' : 'odd'; |
|
| 259 | + $team_forum->zebra = $row%2 ? 'even' : 'odd'; |
|
| 260 | 260 | $team_forum->new_topics = 0; // TODO: Track user views of team topics |
| 261 | 261 | $team_forum->new_text = ''; |
| 262 | 262 | $team_forum->new_url = ''; |
@@ -324,7 +324,7 @@ discard block |
||
| 324 | 324 | */ |
| 325 | 325 | function boincteam_forum_create_form_panel() { |
| 326 | 326 | $output = ''; |
| 327 | - $output .= '<h2 class="pane-title">' . bts('Create team message board', array(), NULL, 'boinc:team-forum') |
|
| 327 | + $output .= '<h2 class="pane-title">'.bts('Create team message board', array(), NULL, 'boinc:team-forum') |
|
| 328 | 328 | . '</h2>'; |
| 329 | 329 | $output .= drupal_get_form('boincteam_forum_create_form'); |
| 330 | 330 | |
@@ -337,8 +337,8 @@ discard block |
||
| 337 | 337 | function boincteam_forum_edit_form_panel($tfid) { |
| 338 | 338 | $team_forum = boincteam_forum_load($tfid); |
| 339 | 339 | $output = ''; |
| 340 | - $output .= '<h2 class="pane-title">' . bts('Edit message board', array(), NULL, 'boinc:team-forum') . ': ' . |
|
| 341 | - $team_forum->title . '</h2>'; |
|
| 340 | + $output .= '<h2 class="pane-title">'.bts('Edit message board', array(), NULL, 'boinc:team-forum').': '. |
|
| 341 | + $team_forum->title.'</h2>'; |
|
| 342 | 342 | $output .= drupal_get_form('boincteam_forum_edit_form', $tfid); |
| 343 | 343 | |
| 344 | 344 | return $output; |
@@ -354,19 +354,19 @@ discard block |
||
| 354 | 354 | ); |
| 355 | 355 | $forums = boincteam_forum_list($team_id); |
| 356 | 356 | $output = ''; |
| 357 | - $output .= '<h2 class="pane-title">' . bts('Team forum', array(), NULL, 'boinc:team-forum') . '</h2>'; |
|
| 357 | + $output .= '<h2 class="pane-title">'.bts('Team forum', array(), NULL, 'boinc:team-forum').'</h2>'; |
|
| 358 | 358 | $output .= '<p>' |
| 359 | 359 | . bts('A discussion forum has been set up for team members.', array(), NULL, 'boinc:team-forum') |
| 360 | 360 | . '</p>'; |
| 361 | 361 | $output .= '<ul class="tab-list action-list">'; |
| 362 | 362 | foreach ($forums as $forum) { |
| 363 | 363 | if (!$show_public_only OR $forum->public) { |
| 364 | - $output .= ' <li class="tab primary">' . |
|
| 364 | + $output .= ' <li class="tab primary">'. |
|
| 365 | 365 | l( |
| 366 | 366 | //$forum->title, |
| 367 | 367 | bts('Enter forum', array(), NULL, 'boinc:team-forum'), |
| 368 | 368 | "community/teams/{$team_id}/forum/{$forum->tfid}" |
| 369 | - ) . '</li>'; |
|
| 369 | + ).'</li>'; |
|
| 370 | 370 | // Since we're only supporting one team forum for now, we've labeled the |
| 371 | 371 | // link in a generic way above and will now just break out of the loop |
| 372 | 372 | break; |
@@ -381,20 +381,20 @@ discard block |
||
| 381 | 381 | */ |
| 382 | 382 | function boincteam_forum_topic_overview_panel($nid = NULL) { |
| 383 | 383 | $output = ''; |
| 384 | - $output .= '<h2 class="pane-title">' . bts('About message boards', array(), NULL, 'boinc:team-forum') . '</h2>'; |
|
| 384 | + $output .= '<h2 class="pane-title">'.bts('About message boards', array(), NULL, 'boinc:team-forum').'</h2>'; |
|
| 385 | 385 | $output .= '<div>'; |
| 386 | 386 | if ($nid) { |
| 387 | 387 | $team = node_load($nid); |
| 388 | - $output .= '<p>' . bts('You may create a message board for use by @team', |
|
| 389 | - array('@team' => $team->title), NULL, 'boinc:team-forum') . ':</p>'; |
|
| 388 | + $output .= '<p>'.bts('You may create a message board for use by @team', |
|
| 389 | + array('@team' => $team->title), NULL, 'boinc:team-forum').':</p>'; |
|
| 390 | 390 | } |
| 391 | 391 | else { |
| 392 | - $output .= '<p>' . bts('This is a team-only message board', array(), NULL, 'boinc:team-forum') . ':</p>'; |
|
| 392 | + $output .= '<p>'.bts('This is a team-only message board', array(), NULL, 'boinc:team-forum').':</p>'; |
|
| 393 | 393 | } |
| 394 | 394 | $output .= '<ul>'; |
| 395 | - $output .= ' <li>' . bts('Only members may post', array(), NULL, 'boinc:team-forum') . '</li>'; |
|
| 396 | - $output .= ' <li>' . bts('Only members may read (optional)', array(), NULL, 'boinc:team-forum') . '</li>'; |
|
| 397 | - $output .= ' <li>' . bts('Founder & Team Admins have moderator privileges', array(), NULL, 'boinc:team-forum') . |
|
| 395 | + $output .= ' <li>'.bts('Only members may post', array(), NULL, 'boinc:team-forum').'</li>'; |
|
| 396 | + $output .= ' <li>'.bts('Only members may read (optional)', array(), NULL, 'boinc:team-forum').'</li>'; |
|
| 397 | + $output .= ' <li>'.bts('Founder & Team Admins have moderator privileges', array(), NULL, 'boinc:team-forum'). |
|
| 398 | 398 | '</li>'; |
| 399 | 399 | $output .= '</ul>'; |
| 400 | 400 | $output .= '</div>'; |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | $node = node_load($nid); |
| 20 | 20 | if ($node->comment !== 0 AND user_access('post comments', $user)) { |
| 21 | 21 | $block['subject'] = NULL; // This should be NULL otherwise there will be duplicate h2 elements. |
| 22 | - $block['content'] = '<h2>' . bts('Post new comment', array(), NULL, 'boinc:forum-post-new-comment') . '</h2>'; |
|
| 22 | + $block['content'] = '<h2>'.bts('Post new comment', array(), NULL, 'boinc:forum-post-new-comment').'</h2>'; |
|
| 23 | 23 | $block['content'] .= drupal_get_form('comment_form', array('nid' => $nid)); |
| 24 | 24 | } |
| 25 | 25 | } |
@@ -311,8 +311,8 @@ discard block |
||
| 311 | 311 | // RFC2616 mandates that the decimal part is no more than three digits, |
| 312 | 312 | // so we multiply the qvalue by 1000 to avoid floating point comparisons. |
| 313 | 313 | $langcode = strtolower($match[1]); |
| 314 | - $qvalue = isset($match[2]) ? (float) $match[2] : 1; |
|
| 315 | - $browser_langcodes[$langcode] = (int) ($qvalue * 1000); |
|
| 314 | + $qvalue = isset($match[2]) ? (float)$match[2] : 1; |
|
| 315 | + $browser_langcodes[$langcode] = (int)($qvalue*1000); |
|
| 316 | 316 | } |
| 317 | 317 | } |
| 318 | 318 | |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | global $base_url; |
| 378 | 378 | global $base_path; |
| 379 | 379 | $site_name = variable_get('site_name', 'Drupal-BOINC'); |
| 380 | - $site_url = $base_url . $base_path; |
|
| 380 | + $site_url = $base_url.$base_path; |
|
| 381 | 381 | $settings = array( |
| 382 | 382 | 'from' => '', |
| 383 | 383 | 'subject' => "Content at {$site_name} is awaiting moderation", |
@@ -437,11 +437,11 @@ discard block |
||
| 437 | 437 | $user_info .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
| 438 | 438 | } |
| 439 | 439 | elseif (is_string($user_image)) { |
| 440 | - $user_info .= '<img src="' . $user_image . '"/>'; |
|
| 440 | + $user_info .= '<img src="'.$user_image.'"/>'; |
|
| 441 | 441 | } |
| 442 | 442 | $user_info .= ' </div>'; |
| 443 | 443 | } |
| 444 | - $user_info .= ' <div class="name">' . theme('username', $account) . '</div>'; |
|
| 444 | + $user_info .= ' <div class="name">'.theme('username', $account).'</div>'; |
|
| 445 | 445 | if ($account->uid) { |
| 446 | 446 | //$user_info .= ' <div class="join-date">Joined: ' . date('j M y', $account->created) . '</div>'; |
| 447 | 447 | //$user_info .= ' <div class="post-count">Posts: ' . $account->post_count . '</div>'; |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | $form['buttons']['preview']['#suffix'] = '</li>'; |
| 506 | 506 | $form['buttons']['preview']['#weight'] = 1003; |
| 507 | 507 | $form['buttons']['cancel'] = array( |
| 508 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_url) . '</li>', |
|
| 508 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), $cancel_url).'</li>', |
|
| 509 | 509 | '#weight' => 1004, |
| 510 | 510 | ); |
| 511 | 511 | $form['buttons']['form control tabs suffix'] = array( |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | $node = node_load($form['nid']['#value']); |
| 526 | 526 | $community_role = array_search('community member', user_roles(true)); |
| 527 | 527 | $unrestricted_role = array_search('verified contributor', user_roles(true)); |
| 528 | - if ( (isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role])) ) { |
|
| 528 | + if ((isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role]))) { |
|
| 529 | 529 | if ($node->type == 'forum') { |
| 530 | 530 | if (module_exists('captcha')) { |
| 531 | 531 | $form['comment_captcha'] = array( |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | $form['buttons']['preview_changes']['#suffix'] = '</li>'; |
| 571 | 571 | $form['buttons']['preview_changes']['#weight'] = 1004; |
| 572 | 572 | $form['buttons']['cancel'] = array( |
| 573 | - '#value' => '<li class="tab">' . l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "community/forum/{$forum_id}") . '</li>', |
|
| 573 | + '#value' => '<li class="tab">'.l(bts('Cancel', array(), NULL, 'boinc:form-cancel'), "community/forum/{$forum_id}").'</li>', |
|
| 574 | 574 | '#weight' => 1005, |
| 575 | 575 | ); |
| 576 | 576 | $form['buttons']['form control tabs suffix'] = array( |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | // Add captcha for role='community member' |
| 582 | 582 | $community_role = array_search('community member', user_roles(true)); |
| 583 | 583 | $unrestricted_role = array_search('verified contributor', user_roles(true)); |
| 584 | - if ( (isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role])) ) { |
|
| 584 | + if ((isset($account->roles[$community_role])) and (!isset($account->roles[$unrestricted_role]))) { |
|
| 585 | 585 | if (module_exists('captcha')) { |
| 586 | 586 | $form['comment_captcha'] = array( |
| 587 | 587 | '#type' => 'captcha', |
@@ -673,8 +673,8 @@ discard block |
||
| 673 | 673 | function boinccore_link($type, $object, $teaser = FALSE) { |
| 674 | 674 | // Add custom links with this hook |
| 675 | 675 | |
| 676 | - if ($type=='node') { |
|
| 677 | - if ( ($object->type=='forum') OR ($object->type=='team_forum') ) { |
|
| 676 | + if ($type == 'node') { |
|
| 677 | + if (($object->type == 'forum') OR ($object->type == 'team_forum')) { |
|
| 678 | 678 | // Add topic moderator controls |
| 679 | 679 | if (user_access('edit any forum topic')) { |
| 680 | 680 | $node_control = "node_control/{$object->nid}"; |
@@ -735,7 +735,7 @@ discard block |
||
| 735 | 735 | }// if user_access('edit any forum topic') |
| 736 | 736 | } |
| 737 | 737 | } |
| 738 | - else if ($type=='comment') { |
|
| 738 | + else if ($type == 'comment') { |
|
| 739 | 739 | $node = node_load($object->nid); |
| 740 | 740 | $nid = $object->nid; |
| 741 | 741 | $cid = $object->cid; |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | if (user_access('administer comments')) { |
| 758 | 758 | $comment_control = "comment_control/{$cid}"; |
| 759 | 759 | // Add link to convert comment into a new topic |
| 760 | - $reply_count = db_result(db_query(' SELECT COUNT(*) FROM comments WHERE pid = %d', $cid )); |
|
| 760 | + $reply_count = db_result(db_query(' SELECT COUNT(*) FROM comments WHERE pid = %d', $cid)); |
|
| 761 | 761 | if ($reply_count == 0) { |
| 762 | 762 | $links['convert'] = array( |
| 763 | 763 | 'title' => bts('Convert', array(), NULL, 'boinc:forum-convert-comment-to-topic'), |
@@ -802,7 +802,7 @@ discard block |
||
| 802 | 802 | */ |
| 803 | 803 | $message['headers']['Content-Transfer-Encoding'] = 'Quoted-Printable'; |
| 804 | 804 | if (is_array($message['body'])) { |
| 805 | - $message['body'] = array_map( "quoted_printable_encode", $message['body'] ); |
|
| 805 | + $message['body'] = array_map("quoted_printable_encode", $message['body']); |
|
| 806 | 806 | } else { |
| 807 | 807 | $message['body'] = quoted_printable_encode($message['body']); |
| 808 | 808 | } |
@@ -853,7 +853,7 @@ discard block |
||
| 853 | 853 | // If hiding a forum topic (node) and not an administrator, go to |
| 854 | 854 | // the forum page. Otherwise the user will reach an access-denied |
| 855 | 855 | // page. |
| 856 | - if (($action=="hide") and (!user_access('administer forums'))) { |
|
| 856 | + if (($action == "hide") and (!user_access('administer forums'))) { |
|
| 857 | 857 | drupal_goto("community/forum/{$node->tid}"); |
| 858 | 858 | } |
| 859 | 859 | drupal_goto("node/{$nid}"); |
@@ -895,8 +895,8 @@ discard block |
||
| 895 | 895 | $node->created = $comment->timestamp; |
| 896 | 896 | $node->changed = $node->created; |
| 897 | 897 | $node->promote = 0; // Display on front page? |
| 898 | - $node->sticky = 0; // Display top of page? |
|
| 899 | - $node->status = 1; // Published? |
|
| 898 | + $node->sticky = 0; // Display top of page? |
|
| 899 | + $node->status = 1; // Published? |
|
| 900 | 900 | $node->comment = 2; |
| 901 | 901 | //$node->language = 'en'; |
| 902 | 902 | $node->uid = $comment->uid; |
@@ -981,16 +981,16 @@ discard block |
||
| 981 | 981 | $xml->loadXML($global_prefs, LIBXML_NOBLANKS); |
| 982 | 982 | if ($errors = libxml_get_errors($xml)) { |
| 983 | 983 | $lines = explode("\r", $global_prefs); |
| 984 | - watchdog('am_set_info', "XML validation error in global_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
|
| 985 | - ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
|
| 984 | + watchdog('am_set_info', "XML validation error in global_prefs: {$errors[0]->message} at line {$errors[0]->line}". |
|
| 985 | + ': <br/>'.htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
|
| 986 | 986 | } |
| 987 | 987 | } |
| 988 | 988 | elseif ($project_prefs) { |
| 989 | 989 | $xml->loadXML($project_prefs, LIBXML_NOBLANKS); |
| 990 | 990 | if ($errors = libxml_get_errors($xml)) { |
| 991 | 991 | $lines = explode("\r", $project_prefs); |
| 992 | - watchdog('am_set_info', "XML validation error in project_prefs: {$errors[0]->message} at line {$errors[0]->line}" . |
|
| 993 | - ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
|
| 992 | + watchdog('am_set_info', "XML validation error in project_prefs: {$errors[0]->message} at line {$errors[0]->line}". |
|
| 993 | + ': <br/>'.htmlentities($lines[$errors[0]->line - 1]), array(), WATCHDOG_ERROR); |
|
| 994 | 994 | } |
| 995 | 995 | } |
| 996 | 996 | if (!$errors) { |
@@ -1033,8 +1033,8 @@ discard block |
||
| 1033 | 1033 | $xml = array( |
| 1034 | 1034 | 'error' => array( |
| 1035 | 1035 | 'error_num' => -112, |
| 1036 | - 'error_msg' => "{$errors[0]->message} at line {$errors[0]->line}" . |
|
| 1037 | - ': <br/>' . htmlentities($lines[$errors[0]->line - 1]) |
|
| 1036 | + 'error_msg' => "{$errors[0]->message} at line {$errors[0]->line}". |
|
| 1037 | + ': <br/>'.htmlentities($lines[$errors[0]->line - 1]) |
|
| 1038 | 1038 | ), |
| 1039 | 1039 | ); |
| 1040 | 1040 | } |
@@ -1142,10 +1142,10 @@ discard block |
||
| 1142 | 1142 | 'teaser' => $teaser, |
| 1143 | 1143 | 'uid' => $team_owner_uid, |
| 1144 | 1144 | 'path' => null, |
| 1145 | - 'status' => 1, // published or not - always publish |
|
| 1145 | + 'status' => 1, // published or not - always publish |
|
| 1146 | 1146 | 'promote' => 0, |
| 1147 | 1147 | 'created' => $created_time, |
| 1148 | - 'comment' => 0, // comments disabled |
|
| 1148 | + 'comment' => 0, // comments disabled |
|
| 1149 | 1149 | 'moderate' => 0, |
| 1150 | 1150 | 'sticky' => 0, |
| 1151 | 1151 | 'format' => $input_format |
@@ -1156,7 +1156,7 @@ discard block |
||
| 1156 | 1156 | module_load_include('inc', 'pathauto', 'pathauto'); |
| 1157 | 1157 | $node['path'] = pathauto_cleanstring($values['name']); |
| 1158 | 1158 | |
| 1159 | - $node = (object) $node; // node_save requires an object form |
|
| 1159 | + $node = (object)$node; // node_save requires an object form |
|
| 1160 | 1160 | $team_categories = taxonomy_get_term_by_name($values['type']); |
| 1161 | 1161 | $node->taxonomy[] = $team_categories[0]; |
| 1162 | 1162 | |
@@ -1315,7 +1315,7 @@ discard block |
||
| 1315 | 1315 | while ($member = db_fetch_object($result)) { |
| 1316 | 1316 | $team_members[$member->boinc_id]['country'] = $member->field_country_value; |
| 1317 | 1317 | $team_members[$member->boinc_id]['url'] = $member->field_url_value; |
| 1318 | - $team_members[$member->boinc_id]['has_profile'] = isset($member->nid) ? 1: 0; |
|
| 1318 | + $team_members[$member->boinc_id]['has_profile'] = isset($member->nid) ? 1 : 0; |
|
| 1319 | 1319 | $xml['users']['user'][] = $team_members[$member->boinc_id]; |
| 1320 | 1320 | } |
| 1321 | 1321 | } // end if credit_only |
@@ -1365,7 +1365,7 @@ discard block |
||
| 1365 | 1365 | if ($profile_nid = content_profile_profile_exists($profile, $account->uid)) { |
| 1366 | 1366 | $profile_node = node_load($profile_nid); |
| 1367 | 1367 | if ($profile_node) { |
| 1368 | - $avatar_image = get_cck_image_object(file_directory_path() . '/' . $image_path, 'field_image', 'profile', TRUE); |
|
| 1368 | + $avatar_image = get_cck_image_object(file_directory_path().'/'.$image_path, 'field_image', 'profile', TRUE); |
|
| 1369 | 1369 | if ($avatar_image) { |
| 1370 | 1370 | $profile_node->field_image[0] = $avatar_image; |
| 1371 | 1371 | node_save($profile_node); |
@@ -1479,7 +1479,7 @@ discard block |
||
| 1479 | 1479 | WHERE (n.status = 1) AND (c.uid = '%d') |
| 1480 | 1480 | ORDER BY timestamp DESC |
| 1481 | 1481 | LIMIT %d", |
| 1482 | - $uid, (int) $count |
|
| 1482 | + $uid, (int)$count |
|
| 1483 | 1483 | ); |
| 1484 | 1484 | $xml = array( |
| 1485 | 1485 | 'rpc_response' => array( |
@@ -1522,7 +1522,7 @@ discard block |
||
| 1522 | 1522 | WHERE (n.status = 1) AND (n.uid = '%d') |
| 1523 | 1523 | ORDER BY changed DESC |
| 1524 | 1524 | LIMIT %d", |
| 1525 | - $uid, (int) $count |
|
| 1525 | + $uid, (int)$count |
|
| 1526 | 1526 | ); |
| 1527 | 1527 | $xml = array( |
| 1528 | 1528 | 'rpc_response' => array( |
@@ -1691,7 +1691,7 @@ discard block |
||
| 1691 | 1691 | ); |
| 1692 | 1692 | } |
| 1693 | 1693 | // Determine which page to display in order to show the given comment |
| 1694 | - $page = floor($comment_offset / $comments_per_page); |
|
| 1694 | + $page = floor($comment_offset/$comments_per_page); |
|
| 1695 | 1695 | if ($page) { |
| 1696 | 1696 | $params = array('page' => $page); |
| 1697 | 1697 | } |
@@ -2083,7 +2083,7 @@ discard block |
||
| 2083 | 2083 | * Overview of moderation queues |
| 2084 | 2084 | */ |
| 2085 | 2085 | function boinccore_moderation_overview_panel() { |
| 2086 | - $output = '<h2 class="pane-title">' . bts('Moderation', array(), NULL, 'boinc:moderate-profiles') . '</h2>'; |
|
| 2086 | + $output = '<h2 class="pane-title">'.bts('Moderation', array(), NULL, 'boinc:moderate-profiles').'</h2>'; |
|
| 2087 | 2087 | $output .= '<ul class="tab-list action-list">'; |
| 2088 | 2088 | if (module_exists('user_profiles')) { |
| 2089 | 2089 | $profile_count = db_result(db_query(" |
@@ -2094,7 +2094,7 @@ discard block |
||
| 2094 | 2094 | $output .= '<li class="tab primary">'; |
| 2095 | 2095 | $output .= l(bts('Unvetted profiles', array(), NULL, 'boinc:moderate-profiles'), 'moderate/profiles'); |
| 2096 | 2096 | $output .= '<div class="item-count-wrapper">'; |
| 2097 | - $output .= '<span class="item-count">' . $profile_count . '</span>'; |
|
| 2097 | + $output .= '<span class="item-count">'.$profile_count.'</span>'; |
|
| 2098 | 2098 | $output .= '</div>'; |
| 2099 | 2099 | $output .= '</li>'; |
| 2100 | 2100 | } |
@@ -2112,7 +2112,7 @@ discard block |
||
| 2112 | 2112 | require_boinc('boinc_db'); |
| 2113 | 2113 | |
| 2114 | 2114 | $num_deleted = BoincToken::delete_expired(); |
| 2115 | - if ($num_deleted>0) { |
|
| 2115 | + if ($num_deleted > 0) { |
|
| 2116 | 2116 | watchdog('boinccore', "Deleted ${num_deleted} tokens from table token", WATCHDOG_NOTICE); |
| 2117 | 2117 | } |
| 2118 | 2118 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | function boinc_links__system_main_menu($links, $menu, $element) { |
| 84 | 84 | $html = ''; |
| 85 | - $html .= '<ul id="' . $menu['id'] . '" class="' . $menu['class'] . '">' . "\n"; |
|
| 85 | + $html .= '<ul id="'.$menu['id'].'" class="'.$menu['class'].'">'."\n"; |
|
| 86 | 86 | $item_count = count($links); |
| 87 | 87 | $i = 1; |
| 88 | 88 | foreach ($links as $key => $link) { |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | if (strpos($key, 'active-trail')) $classes[] = 'active'; |
| 91 | 91 | if ($i == 1) $classes[] = 'first'; |
| 92 | 92 | if ($i == $item_count) $classes[] = 'last'; |
| 93 | - $html .= '<li class="' . implode(' ', $classes) .'">'; |
|
| 93 | + $html .= '<li class="'.implode(' ', $classes).'">'; |
|
| 94 | 94 | if ($link['title'] == 'Home') { |
| 95 | 95 | $link['title'] = bts('Home', array(), NULL, 'boinc:menu-link'); |
| 96 | 96 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | if ($link['href'] == 'dashboard') { |
| 100 | 100 | $item_count = privatemsg_unread_count(); |
| 101 | 101 | if ($item_count) { |
| 102 | - $link['title'] .= '</a> <a href="' . url('messages') . '" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
| 102 | + $link['title'] .= '</a> <a href="'.url('messages').'" class="compound secondary"><div class="item-count-wrapper"><span class="item-count">'.$item_count.'</span></div>'; |
|
| 103 | 103 | $link['html'] = TRUE; |
| 104 | 104 | $link['attributes']['class'] = 'compound'; |
| 105 | 105 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | if ($link['href'] == 'moderate') { |
| 110 | 110 | $item_count = boincuser_moderation_queue_count(); |
| 111 | 111 | if ($item_count) { |
| 112 | - $link['title'] .= ' <div class="item-count-wrapper"><span class="item-count">' . $item_count . '</span></div>'; |
|
| 112 | + $link['title'] .= ' <div class="item-count-wrapper"><span class="item-count">'.$item_count.'</span></div>'; |
|
| 113 | 113 | $link['html'] = TRUE; |
| 114 | 114 | } |
| 115 | 115 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $html .= '</li>'; |
| 118 | 118 | $i++; |
| 119 | 119 | } |
| 120 | - $html .= '</ul>' . "\n"; |
|
| 120 | + $html .= '</ul>'."\n"; |
|
| 121 | 121 | return $html; |
| 122 | 122 | } |
| 123 | 123 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | return ''; |
| 133 | 133 | } |
| 134 | 134 | else { |
| 135 | - return '<li '. ($active ? 'class="active" ' : '') .'>'. $link ."</li>\n"; |
|
| 135 | + return '<li '.($active ? 'class="active" ' : '').'>'.$link."</li>\n"; |
|
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | if (empty($locality)) { |
| 198 | 198 | $locality = "en"; |
| 199 | 199 | } |
| 200 | - $vars['flag_path'] = base_path() . path_to_theme() . "/images/flags/{$locality}.png"; |
|
| 200 | + $vars['flag_path'] = base_path().path_to_theme()."/images/flags/{$locality}.png"; |
|
| 201 | 201 | |
| 202 | 202 | $server_status_url = variable_get('boinc_server_status_url', ''); |
| 203 | 203 | if (!$server_status_url) { |
@@ -219,16 +219,16 @@ discard block |
||
| 219 | 219 | if (arg(0) == 'search') { |
| 220 | 220 | unset($vars['title']); |
| 221 | 221 | } |
| 222 | - else if ( (arg(0)=='account') AND (is_numeric(arg(1))) AND (empty(arg(2))) ) { |
|
| 222 | + else if ((arg(0) == 'account') AND (is_numeric(arg(1))) AND (empty(arg(2)))) { |
|
| 223 | 223 | unset($vars['title']); |
| 224 | 224 | } |
| 225 | - else if ( (arg(0)=='account') AND (arg(1)=='profile') ) { |
|
| 225 | + else if ((arg(0) == 'account') AND (arg(1) == 'profile')) { |
|
| 226 | 226 | unset($vars['title']); |
| 227 | 227 | } |
| 228 | - else if ( (arg(0)=='dashboard') ) { |
|
| 228 | + else if ((arg(0) == 'dashboard')) { |
|
| 229 | 229 | unset($vars['title']); |
| 230 | 230 | } |
| 231 | - else if ( (arg(0)=='community') AND ( (arg(1)=='teams') OR (arg(1)=='stats') ) ) { |
|
| 231 | + else if ((arg(0) == 'community') AND ((arg(1) == 'teams') OR (arg(1) == 'stats'))) { |
|
| 232 | 232 | unset($vars['title']); |
| 233 | 233 | } |
| 234 | 234 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | $tab = str_replace('li class="', 'li class="first ', $tab); |
| 245 | 245 | } |
| 246 | 246 | if ($key == $last_key) { |
| 247 | - $tab = str_replace('li class="', 'li class="last ', $tab) . '</ul>'; |
|
| 247 | + $tab = str_replace('li class="', 'li class="last ', $tab).'</ul>'; |
|
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | elseif (strpos($tab, 'li ')) { |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $tab = str_replace('li ', 'li class="first" ', $tab); |
| 253 | 253 | } |
| 254 | 254 | if ($key == $last_key) { |
| 255 | - $tab = str_replace('li ', 'li class="last" ', $tab) . '</ul>'; |
|
| 255 | + $tab = str_replace('li ', 'li class="last" ', $tab).'</ul>'; |
|
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | 258 | } |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | // Optionally, run node-type-specific preprocess functions, like |
| 291 | 291 | // boinc_preprocess_node_page() or boinc_preprocess_node_story(). |
| 292 | - $function = __FUNCTION__ . '_' . $vars['node']->type; |
|
| 292 | + $function = __FUNCTION__.'_'.$vars['node']->type; |
|
| 293 | 293 | if (function_exists($function)) { |
| 294 | 294 | $function($vars, $hook); |
| 295 | 295 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | $vars['node']->comment = 0; |
| 341 | 341 | |
| 342 | 342 | $vars['first_page'] = (!isset($_GET['page']) OR ($_GET['page'] < 1)); |
| 343 | - $page_count = max(ceil($vars['comment_count'] / $comments_per_page), 1); |
|
| 343 | + $page_count = max(ceil($vars['comment_count']/$comments_per_page), 1); |
|
| 344 | 344 | $vars['last_page'] = ($page_count == 1 OR ($page_count > 1 AND $_GET['page'] == $page_count - 1)); |
| 345 | 345 | |
| 346 | 346 | $links = $vars['links']; |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | case 'boinc_host': |
| 453 | 453 | $view = views_get_current_view(); |
| 454 | 454 | if (!($view->result)) { |
| 455 | - $vars['footer'] = '<h3>' . bts ('Host not found in database.', array(), NULL, 'boinc:host-details') . '</h3>'; |
|
| 455 | + $vars['footer'] = '<h3>'.bts('Host not found in database.', array(), NULL, 'boinc:host-details').'</h3>'; |
|
| 456 | 456 | } |
| 457 | 457 | break; |
| 458 | 458 | case 'boinc_host_list': |
@@ -471,10 +471,10 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | if ($result) { |
| 473 | 473 | // Display the stderr output in the footer |
| 474 | - $vars['footer'] = '<h3>' . bts('Stderr output', array(), NULL, 'boinc:task-details-errorlog') .'</h3>'; |
|
| 475 | - $vars['footer'] .= '<pre>' . htmlspecialchars($result->result_stderr_out) . '</pre>'; |
|
| 474 | + $vars['footer'] = '<h3>'.bts('Stderr output', array(), NULL, 'boinc:task-details-errorlog').'</h3>'; |
|
| 475 | + $vars['footer'] .= '<pre>'.htmlspecialchars($result->result_stderr_out).'</pre>'; |
|
| 476 | 476 | } else { |
| 477 | - $vars['footer'] = '<h3>' . bts ('Task not found in database.', array(), NULL, 'boinc:task-details') . '</h3>'; |
|
| 477 | + $vars['footer'] = '<h3>'.bts('Task not found in database.', array(), NULL, 'boinc:task-details').'</h3>'; |
|
| 478 | 478 | } |
| 479 | 479 | break; |
| 480 | 480 | case 'boinc_teams': |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | ob_start(); |
| 488 | 488 | // Get the workunit ID from the URL |
| 489 | 489 | $result_id = arg(1); |
| 490 | - require_boinc(array('util','boinc_db')); |
|
| 490 | + require_boinc(array('util', 'boinc_db')); |
|
| 491 | 491 | $wu = BoincWorkunit::lookup_id($result_id); |
| 492 | 492 | if ($wu) { |
| 493 | 493 | // Output from admin defined BOINC project-specific function |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | // Output of project_workunit() gets caught in the buffer |
| 496 | 496 | $vars['footer'] = ob_get_clean(); |
| 497 | 497 | } else { |
| 498 | - $vars['footer'] = '<h3>' . bts ('Workunit not found in database.', array(), NULL, 'boinc:workunit-details') . '</h3>'; |
|
| 498 | + $vars['footer'] = '<h3>'.bts('Workunit not found in database.', array(), NULL, 'boinc:workunit-details').'</h3>'; |
|
| 499 | 499 | } |
| 500 | 500 | default: |
| 501 | 501 | } |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | $author_picture .= theme('imagefield_image', $user_image['image'], $user_image['alt'], $user_image['alt'], array(), false); |
| 518 | 518 | } |
| 519 | 519 | elseif (is_string($user_image)) { |
| 520 | - $author_picture .= '<img src="' . $user_image . '"/>'; |
|
| 520 | + $author_picture .= '<img src="'.$user_image.'"/>'; |
|
| 521 | 521 | } |
| 522 | 522 | } |
| 523 | 523 | $author_picture .= '</div>'; |
@@ -556,14 +556,14 @@ discard block |
||
| 556 | 556 | case 'profile': |
| 557 | 557 | case 'user': |
| 558 | 558 | $node = $variables['result']['node']; |
| 559 | - $variables['url'] = url('account/' . $node->is_uid); |
|
| 559 | + $variables['url'] = url('account/'.$node->is_uid); |
|
| 560 | 560 | $variables['title'] = $node->tos_name; |
| 561 | 561 | $variables['user_image'] = boincuser_get_user_profile_image($node->is_uid); |
| 562 | 562 | $variables['account'] = user_load($node->is_uid); |
| 563 | 563 | break; |
| 564 | 564 | case 'team': |
| 565 | 565 | $node = $variables['result']['node']; |
| 566 | - $variables['url'] = url('/community/teams/' . $node->entity_id);; |
|
| 566 | + $variables['url'] = url('/community/teams/'.$node->entity_id); ; |
|
| 567 | 567 | break; |
| 568 | 568 | case 'forum': |
| 569 | 569 | $node = $variables['result']['node']; |
@@ -581,7 +581,7 @@ discard block |
||
| 581 | 581 | // Parent forum topic title |
| 582 | 582 | $variables['parent_title'] = $drupalnode->title; |
| 583 | 583 | // Link to the parent forum topic |
| 584 | - $variables['parent_topic'] = l($drupalnode->title, drupal_get_path_alias('node/' . $nid) ); |
|
| 584 | + $variables['parent_topic'] = l($drupalnode->title, drupal_get_path_alias('node/'.$nid)); |
|
| 585 | 585 | // Get the taxonomy for the node, creates a link to the parent forum |
| 586 | 586 | $taxonomy = reset($drupalnode->taxonomy); |
| 587 | 587 | if ($vocab = taxonomy_vocabulary_load($taxonomy->vid)) { |
@@ -599,7 +599,7 @@ discard block |
||
| 599 | 599 | if (!arg(2)) { |
| 600 | 600 | $message = ''; |
| 601 | 601 | } |
| 602 | - return '<p>' . $message . '</p>'; |
|
| 602 | + return '<p>'.$message.'</p>'; |
|
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | /** |
@@ -615,11 +615,11 @@ discard block |
||
| 615 | 615 | |
| 616 | 616 | // Shorten the name when it is too long or it will break many tables. |
| 617 | 617 | if (drupal_strlen($name) > 20) { |
| 618 | - $name = drupal_substr($name, 0, 15) . '...'; |
|
| 618 | + $name = drupal_substr($name, 0, 15).'...'; |
|
| 619 | 619 | } |
| 620 | 620 | |
| 621 | 621 | if (user_access('access user profiles')) { |
| 622 | - $output = l($name, 'account/' . $object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
|
| 622 | + $output = l($name, 'account/'.$object->uid, array('attributes' => array('title' => bts('View user profile.', array(), NULL, 'boinc:users-table')))); |
|
| 623 | 623 | } |
| 624 | 624 | else { |
| 625 | 625 | $output = check_plain($name); |
@@ -637,7 +637,7 @@ discard block |
||
| 637 | 637 | $output = check_plain($object->name); |
| 638 | 638 | } |
| 639 | 639 | |
| 640 | - $output .= ' (' . bts('not verified', array(), NULL, 'boinc:user-not-found') . ')'; |
|
| 640 | + $output .= ' ('.bts('not verified', array(), NULL, 'boinc:user-not-found').')'; |
|
| 641 | 641 | } |
| 642 | 642 | else { |
| 643 | 643 | $output = check_plain(variable_get('anonymous', bts('Anonymous', array(), NULL, 'boinc:anonymous-user'))); |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | * Remove the link under text areas that reads: |
| 651 | 651 | * "More information about formatting options" |
| 652 | 652 | */ |
| 653 | -function boinc_filter_tips_more_info () { |
|
| 653 | +function boinc_filter_tips_more_info() { |
|
| 654 | 654 | return ''; |
| 655 | 655 | } |
| 656 | 656 | |
@@ -692,8 +692,8 @@ discard block |
||
| 692 | 692 | The !site team', array( |
| 693 | 693 | '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
| 694 | 694 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
| 695 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
| 696 | - '!link' => url('account/'. $sender->uid, array('absolute' => TRUE)), |
|
| 695 | + '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message').': '.$flag->friend_message : '', |
|
| 696 | + '!link' => url('account/'.$sender->uid, array('absolute' => TRUE)), |
|
| 697 | 697 | ), array(), NULL, 'boinc:friend-request-email'); |
| 698 | 698 | break; |
| 699 | 699 | |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | The !site team', array( |
| 712 | 712 | '!name' => isset($sender->boincuser_name) ? $sender->boincuser_name : $sender->name, |
| 713 | 713 | '!site' => variable_get('site_name', 'Drupal-BOINC'), |
| 714 | - '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message') . ': ' . $flag->friend_message : '', |
|
| 714 | + '!message' => $flag->friend_message ? bts('Message', array(), NULL, 'boinc:friend-request-email:-1:a-private-message').': '.$flag->friend_message : '', |
|
| 715 | 715 | '!link' => url('goto/friend-requests', array('absolute' => TRUE)), |
| 716 | 716 | ), |
| 717 | 717 | array(), NULL, 'boinc:friend-request-email'); |
@@ -724,13 +724,13 @@ discard block |
||
| 724 | 724 | * Edit action links |
| 725 | 725 | */ |
| 726 | 726 | function phptemplate_links($links, $attributes = array('class' => 'links')) { |
| 727 | - if ($links){ |
|
| 727 | + if ($links) { |
|
| 728 | 728 | // Remove flag-subscriptions link. It will be placed elsewhere. |
| 729 | 729 | if (isset($links['flag-subscriptions'])) { |
| 730 | 730 | unset($links['flag-subscriptions']); |
| 731 | 731 | } |
| 732 | 732 | // Reorder the links however you need them. |
| 733 | - $links = reorder_links($links, array('comment_edit','quote','comment_add','comment_reply','flag-abuse_comment','flag-abuse_node'), array('comment_delete')); |
|
| 733 | + $links = reorder_links($links, array('comment_edit', 'quote', 'comment_add', 'comment_reply', 'flag-abuse_comment', 'flag-abuse_node'), array('comment_delete')); |
|
| 734 | 734 | // Use the built-in theme_links() function to format the $links array. |
| 735 | 735 | return theme_links($links, $attributes); |
| 736 | 736 | } |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | // are the class attribute for the <li> tags. |
| 814 | 814 | $dom = new DOMDocument; |
| 815 | 815 | $dom->loadHTML(mb_convert_encoding($links, 'HTML-ENTITIES', 'UTF-8')); |
| 816 | - foreach($dom->getElementsByTagName('li') as $node) { |
|
| 816 | + foreach ($dom->getElementsByTagName('li') as $node) { |
|
| 817 | 817 | $key = $node->getAttribute("class"); |
| 818 | 818 | $alllinks[$key] = $dom->saveHTML($node); |
| 819 | 819 | } |
@@ -826,7 +826,7 @@ discard block |
||
| 826 | 826 | "hide", "unhide", |
| 827 | 827 | "comment_delete", |
| 828 | 828 | ); |
| 829 | - foreach(array_keys($alllinks) as $key1) { |
|
| 829 | + foreach (array_keys($alllinks) as $key1) { |
|
| 830 | 830 | // Select string up to first space, if present. |
| 831 | 831 | $class1 = strtok($key1, ' '); |
| 832 | 832 | if (in_array($class1, $selected_classes)) { |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | $dom->loadHTML(mb_convert_encoding($alink, 'HTML-ENTITIES', 'UTF-8')); |
| 856 | 856 | |
| 857 | 857 | $myli = $dom->getElementsByTagName('li'); |
| 858 | - if ($myli->length>0) { |
|
| 858 | + if ($myli->length > 0) { |
|
| 859 | 859 | $newclasses = trim(($myli[0]->getAttribute("class"))." first"); |
| 860 | 860 | $myli[0]->setAttribute("class", $newclasses); |
| 861 | 861 | $alink = $dom->saveHTML($myli[0]); |
@@ -872,13 +872,13 @@ discard block |
||
| 872 | 872 | |
| 873 | 873 | $output = '<ul class="menu"><li class="first">'; |
| 874 | 874 | if ($user->uid) { |
| 875 | - $output .= '<a href="' . url('logout') . '">' . bts('Logout', array(), NULL, 'boinc:menu-link') . '</a>'; |
|
| 875 | + $output .= '<a href="'.url('logout').'">'.bts('Logout', array(), NULL, 'boinc:menu-link').'</a>'; |
|
| 876 | 876 | } else { |
| 877 | - $output .= '<a href="' . url('user/login', array('query' => drupal_get_destination()) ) . '">' . bts('Login', array(), NULL, 'boinc:menu-link') . '</a>'; |
|
| 877 | + $output .= '<a href="'.url('user/login', array('query' => drupal_get_destination())).'">'.bts('Login', array(), NULL, 'boinc:menu-link').'</a>'; |
|
| 878 | 878 | } |
| 879 | 879 | $output .= '</li>'; |
| 880 | 880 | if (module_exists('global_search') OR module_exists('global_search_solr')) { |
| 881 | - $output .= '<li class="last"> <a class="search" href="' . url('search/site') . '">' . bts('search', array(), NULL, 'boinc:menu-link') .'</a> </l1>'; |
|
| 881 | + $output .= '<li class="last"> <a class="search" href="'.url('search/site').'">'.bts('search', array(), NULL, 'boinc:menu-link').'</a> </l1>'; |
|
| 882 | 882 | } |
| 883 | 883 | $output .= '</ul>'; |
| 884 | 884 | return $output; |
@@ -905,8 +905,8 @@ discard block |
||
| 905 | 905 | if ($ignored[$object->uid] == 0) { |
| 906 | 906 | $links['ignore_user'] = array( |
| 907 | 907 | 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
| 908 | - 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
|
| 909 | - 'query' => 'destination='. $_GET['q'], |
|
| 908 | + 'href' => 'account/prefs/privacy/ignore_user/add/'.$object->uid, |
|
| 909 | + 'query' => 'destination='.$_GET['q'], |
|
| 910 | 910 | 'attributes' => array( |
| 911 | 911 | 'class' => 'ignore-user', |
| 912 | 912 | 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
@@ -921,8 +921,8 @@ discard block |
||
| 921 | 921 | if ($ignored[$object->uid] == 0) { |
| 922 | 922 | $links['ignore_user'] = array( |
| 923 | 923 | 'title' => bts('Ignore user', array(), NULL, 'boinc:ignore-user-add'), |
| 924 | - 'href' => 'account/prefs/privacy/ignore_user/add/'. $object->uid, |
|
| 925 | - 'query' => 'destination='. $_GET['q'], |
|
| 924 | + 'href' => 'account/prefs/privacy/ignore_user/add/'.$object->uid, |
|
| 925 | + 'query' => 'destination='.$_GET['q'], |
|
| 926 | 926 | 'attributes' => array( |
| 927 | 927 | 'class' => 'ignore-user', |
| 928 | 928 | 'title' => bts('Add user to your ignore list', array(), NULL, 'boinc:ignore-user-add'), |
@@ -42,15 +42,15 @@ |
||
| 42 | 42 | $start_id = 0; //Set this to something else if you like |
| 43 | 43 | $profiles = _mysql_query("select * from profile where userid>$start_id order by userid"); |
| 44 | 44 | echo _mysql_error(); |
| 45 | - $i=0; |
|
| 46 | - while ($profile = _mysql_fetch_object($profiles)){ |
|
| 45 | + $i = 0; |
|
| 46 | + while ($profile = _mysql_fetch_object($profiles)) { |
|
| 47 | 47 | $i++; |
| 48 | 48 | if ($i%100 == 0) { //For every 100 profiles |
| 49 | - echo $profile->userid.". "; flush(); // print out where we are |
|
| 49 | + echo $profile->userid.". "; flush(); // print out where we are |
|
| 50 | 50 | //usleep(200000); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if ($profile->userid > $start_id){ |
|
| 53 | + if ($profile->userid > $start_id) { |
|
| 54 | 54 | fix_profile($profile); |
| 55 | 55 | } |
| 56 | 56 | } |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | } else { |
| 68 | 68 | sort($files); |
| 69 | 69 | start_table(); |
| 70 | - table_header("Name<br><p class=\"text-muted\">(click to view)</p>", "Modified", "Size (bytes)", "MD5", "Delete","Download"); |
|
| 70 | + table_header("Name<br><p class=\"text-muted\">(click to view)</p>", "Modified", "Size (bytes)", "MD5", "Delete", "Download"); |
|
| 71 | 71 | foreach ($files as $f) { |
| 72 | 72 | $path = "$dir/$f"; |
| 73 | 73 | list($error, $size, $md5) = sandbox_parse_link_file($path); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | $s = stat($tmp_name); |
| 118 | 118 | $size = $s['size']; |
| 119 | 119 | [$exists, $elf] = sandbox_lf_exists($user, $md5); |
| 120 | - if (!$exists){ |
|
| 120 | + if (!$exists) { |
|
| 121 | 121 | // move file to download dir |
| 122 | 122 | // |
| 123 | 123 | $phys_path = sandbox_physical_path($user, $md5); |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | error_page("physical file is missing"); |
| 151 | 151 | } |
| 152 | 152 | $bused = sandbox_file_in_use($user, $name); |
| 153 | - if ($bused){ |
|
| 153 | + if ($bused) { |
|
| 154 | 154 | $notice = "<strong>$name</strong> is being used by batch(es), you can not delete it now!<br/>"; |
| 155 | - } else{ |
|
| 155 | + } else { |
|
| 156 | 156 | unlink("$dir/$name"); |
| 157 | 157 | $notice = "<strong>$name</strong> was deleted from your sandbox<br/>"; |
| 158 | 158 | [$exists, $elf] = sandbox_lf_exists($user, $md5); |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | if (!$action) $action = post_str('action', true); |
| 197 | 197 | |
| 198 | 198 | switch ($action) { |
| 199 | -case '': list_files($user,""); break; |
|
| 199 | +case '': list_files($user, ""); break; |
|
| 200 | 200 | case 'upload_file': upload_file($user); break; |
| 201 | 201 | case 'delete_file': delete_file($user); break; |
| 202 | 202 | case 'download_file': download_file($user); break; |