| @@ -280,12 +280,12 @@ discard block | ||
| 280 | 280 | } | 
| 281 | 281 | |
| 282 | 282 |    switch ($op) { | 
| 283 | - case 'delete': | |
| 284 | - // Only call delete function on certain node types | |
| 285 | -      if (in_array( $node->type, $node_types)) { | |
| 286 | - boinc_solr_comments_delete($node); | |
| 287 | - } | |
| 288 | - break; | |
| 283 | + case 'delete': | |
| 284 | + // Only call delete function on certain node types | |
| 285 | +    if (in_array( $node->type, $node_types)) { | |
| 286 | + boinc_solr_comments_delete($node); | |
| 287 | + } | |
| 288 | + break; | |
| 289 | 289 | } //switch | 
| 290 | 290 | } | 
| 291 | 291 | |
| @@ -335,13 +335,13 @@ discard block | ||
| 335 | 335 | */ | 
| 336 | 336 |  function boinc_solr_comments_comment(&$a1, $op) { | 
| 337 | 337 |    switch ($op) { | 
| 338 | - case 'view': | |
| 339 | - case 'update': | |
| 340 | - break; | |
| 341 | - case 'delete': | |
| 342 | - // $a1 should be a comment object | |
| 343 | - boinc_solr_comments_deletecomment($a1); | |
| 344 | - break; | |
| 338 | + case 'view': | |
| 339 | + case 'update': | |
| 340 | + break; | |
| 341 | + case 'delete': | |
| 342 | + // $a1 should be a comment object | |
| 343 | + boinc_solr_comments_deletecomment($a1); | |
| 344 | + break; | |
| 345 | 345 | }// switch | 
| 346 | 346 | } | 
| 347 | 347 | |
| @@ -78,8 +78,8 @@ discard block | ||
| 78 | 78 |    foreach ($documents as $document) { | 
| 79 | 79 | //dd($document, "index documents alter - document"); | 
| 80 | 80 | |
| 81 | - $to_process = ( array_key_exists($document->bundle, $node_types) AND $node_types[$document->bundle] ); | |
| 82 | -    if ( $document->entity_type=='node' AND $to_process) { | |
| 81 | + $to_process = (array_key_exists($document->bundle, $node_types) AND $node_types[$document->bundle]); | |
| 82 | +    if ($document->entity_type == 'node' AND $to_process) { | |
| 83 | 83 | |
| 84 | 84 | // Remove ts_comments if present. | 
| 85 | 85 |        if (isset($document->ts_comments)) { | 
| @@ -110,7 +110,7 @@ discard block | ||
| 110 | 110 | $comment_document->bundle = 'Comment'; | 
| 111 | 111 | $comment_document->bundle_name = 'Comment'; | 
| 112 | 112 | |
| 113 | - $comment_document->path = 'goto/comment/' . $comment->cid; | |
| 113 | + $comment_document->path = 'goto/comment/'.$comment->cid; | |
| 114 | 114 | $comment_document->url = url($comment_document->path, $url_options); | 
| 115 | 115 | |
| 116 | 116 | // Comment object has no language | 
| @@ -140,7 +140,7 @@ discard block | ||
| 140 | 140 | |
| 141 | 141 | // Index formatted username so it can be searched and sorted | 
| 142 | 142 | // on. | 
| 143 | -        $account = (object) array('uid' => $comment->uid, 'name' => $comment->name); | |
| 143 | +        $account = (object)array('uid' => $comment->uid, 'name' => $comment->name); | |
| 144 | 144 | $username = check_plain($account->name); | 
| 145 | 145 | $comment_document->ss_name_formatted = $username; | 
| 146 | 146 | $comment_document->tos_name_formatted = $username; | 
| @@ -184,7 +184,7 @@ discard block | ||
| 184 | 184 | |
| 185 | 185 | // Copy over fields [im_taxonomy_vid_1], [tid], [im_vid_1], | 
| 186 | 186 | // [im_vid_Forums], [tm_vid_1_names] | 
| 187 | -          if ( ( preg_match('/tid/', $fieldName) OR preg_match('/vid/', $fieldName) ) AND is_array($fieldValue) ) { | |
| 187 | +          if ((preg_match('/tid/', $fieldName) OR preg_match('/vid/', $fieldName)) AND is_array($fieldValue)) { | |
| 188 | 188 |              foreach ($fieldValue as $subkey => $subvalue) { | 
| 189 | 189 | $comment_document->addField($fieldName, $subvalue); | 
| 190 | 190 | } | 
| @@ -226,8 +226,8 @@ discard block | ||
| 226 | 226 | */ | 
| 227 | 227 |  function boinc_solr_comments_apachesolr_process_results(&$results, DrupalSolrQueryInterface $query) { | 
| 228 | 228 | //dpm($query->getSolrParams(), "process_results query getSolrParams"); | 
| 229 | -  foreach($results as $id => $result) { | |
| 230 | -    if ($result['entity_type']=='comment') { | |
| 229 | +  foreach ($results as $id => $result) { | |
| 230 | +    if ($result['entity_type'] == 'comment') { | |
| 231 | 231 | $results[$id]['type'] = 'Comment'; | 
| 232 | 232 | $results[$id]['date'] = $result['fields']['changed']; | 
| 233 | 233 |          if (isset($result['fields']['is_uid'])) { | 
| @@ -252,7 +252,7 @@ discard block | ||
| 252 | 252 | */ | 
| 253 | 253 |  function boinc_solr_comments_apachesolr_query_alter($query) { | 
| 254 | 254 | // Add custom field to query results | 
| 255 | -  $query->addParam('fl','tos_content_extra'); | |
| 255 | +  $query->addParam('fl', 'tos_content_extra'); | |
| 256 | 256 | } | 
| 257 | 257 | |
| 258 | 258 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * | 
| @@ -282,7 +282,7 @@ discard block | ||
| 282 | 282 |    switch ($op) { | 
| 283 | 283 | case 'delete': | 
| 284 | 284 | // Only call delete function on certain node types | 
| 285 | -      if (in_array( $node->type, $node_types)) { | |
| 285 | +      if (in_array($node->type, $node_types)) { | |
| 286 | 286 | boinc_solr_comments_delete($node); | 
| 287 | 287 | } | 
| 288 | 288 | break; | 
| @@ -314,7 +314,7 @@ discard block | ||
| 314 | 314 |    try { | 
| 315 | 315 | $solr = apachesolr_get_solr($env_id); | 
| 316 | 316 | // Custom query to find all comments with parent nid of the node bing deleted. | 
| 317 | - $query = "entity_type:comment AND tos_content_extra:" . $node->nid; | |
| 317 | + $query = "entity_type:comment AND tos_content_extra:".$node->nid; | |
| 318 | 318 | $solr->deleteByQuery($query); | 
| 319 | 319 | // Log the query used for deletion. | 
| 320 | 320 |      watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO); | 
| @@ -399,7 +399,7 @@ discard block | ||
| 399 | 399 | */ | 
| 400 | 400 | |
| 401 | 401 |  function boinc_solr_comments_enable() { | 
| 402 | -  drupal_set_message( bts('Warning: Your content <a href="@url">must be re-indexed</a> before Apache Solr will search comments.', array('@url' => url('admin/settings/apachesolr/index')), NULL, 'boinc:admin-solr-index-comments-message'), 'warning'); | |
| 402 | +  drupal_set_message(bts('Warning: Your content <a href="@url">must be re-indexed</a> before Apache Solr will search comments.', array('@url' => url('admin/settings/apachesolr/index')), NULL, 'boinc:admin-solr-index-comments-message'), 'warning'); | |
| 403 | 403 | } | 
| 404 | 404 | |
| 405 | 405 | /** | 
| @@ -410,7 +410,7 @@ discard block | ||
| 410 | 410 | * The comment to be published (unhidden). | 
| 411 | 411 | */ | 
| 412 | 412 |  function boinc_solr_comments_publish($comment) { | 
| 413 | -  if ( ($comment->cid) AND ($comment->nid) ) { | |
| 413 | +  if (($comment->cid) AND ($comment->nid)) { | |
| 414 | 414 | $node = node_load($comment->nid); | 
| 415 | 415 | // Tell Solr that the node has been updated, so the comment can be | 
| 416 | 416 | // indexed. | 
| @@ -426,7 +426,7 @@ discard block | ||
| 426 | 426 | * The comment to be unpublished (hidden). | 
| 427 | 427 | */ | 
| 428 | 428 |  function boinc_solr_comments_unpublish($comment) { | 
| 429 | -  if ( ($comment->cid) ) { | |
| 429 | +  if (($comment->cid)) { | |
| 430 | 430 | // Call the deletecomment function for hook comment. | 
| 431 | 431 | boinc_solr_comments_deletecomment($comment); | 
| 432 | 432 | } | 
| @@ -19,10 +19,10 @@ | ||
| 19 | 19 |    foreach (content_types() as $key => $info) { | 
| 20 | 20 | // Exclude node types profile, team, and panel | 
| 21 | 21 |      switch ($key) { | 
| 22 | - case 'profile': | |
| 23 | - case 'team': | |
| 24 | - case 'panel': | |
| 25 | - continue 2; | |
| 22 | + case 'profile': | |
| 23 | + case 'team': | |
| 24 | + case 'panel': | |
| 25 | + continue 2; | |
| 26 | 26 | }// switch key | 
| 27 | 27 | $options[$key] = $info['name']; | 
| 28 | 28 | } | 
| @@ -33,7 +33,7 @@ | ||
| 33 | 33 |      'boinc_solr_comments_nodetypes' => variable_get('boinc_solr_comments_nodetypes', ''), | 
| 34 | 34 | ); | 
| 35 | 35 |    if (empty($default['boinc_solr_comments_nodetypes'])) { | 
| 36 | -    $default['boinc_solr_comments_nodetypes'] = array('forum','team_forum','news','page','story'); | |
| 36 | +    $default['boinc_solr_comments_nodetypes'] = array('forum', 'team_forum', 'news', 'page', 'story'); | |
| 37 | 37 | } | 
| 38 | 38 | |
| 39 | 39 | // Define the form | 
| @@ -444,7 +444,7 @@ | ||
| 444 | 444 |  function boincteam_views_handlers() { | 
| 445 | 445 | return array( | 
| 446 | 446 | 'info' => array( | 
| 447 | -      'path' => drupal_get_path('module', 'boincteam') . '/views', | |
| 447 | +      'path' => drupal_get_path('module', 'boincteam').'/views', | |
| 448 | 448 | ), | 
| 449 | 449 | 'handlers' => array( | 
| 450 | 450 | 'views_handler_argument_boincteam_id' => array( | 
| @@ -65,15 +65,15 @@ discard block | ||
| 65 | 65 | */ | 
| 66 | 66 |  function boincwork_admin_prefs_upload_form_validate($form, &$form_state) { | 
| 67 | 67 | |
| 68 | -  $xsd = './' . drupal_get_path('module', 'boincwork') . '/includes/projectprefs.xsd'; | |
| 68 | +  $xsd = './'.drupal_get_path('module', 'boincwork').'/includes/projectprefs.xsd'; | |
| 69 | 69 | libxml_use_internal_errors(true); | 
| 70 | 70 | $xml = new DomDocument(); | 
| 71 | 71 | $xml->loadXML($form_state['values']['prefs_xml'], LIBXML_NOBLANKS); | 
| 72 | 72 |    if (!$xml->schemaValidate($xsd)) { | 
| 73 | 73 | $errors = libxml_get_errors(); | 
| 74 | 74 |      $lines = explode("\r", $form_state['values']['prefs_xml']); | 
| 75 | -    drupal_set_message("{$errors[0]->message} at line {$errors[0]->line}" . | |
| 76 | - ': <br/>' . htmlentities($lines[$errors[0]->line - 1]), 'error'); | |
| 75 | +    drupal_set_message("{$errors[0]->message} at line {$errors[0]->line}". | |
| 76 | + ': <br/>'.htmlentities($lines[$errors[0]->line - 1]), 'error'); | |
| 77 | 77 |      form_set_error('upload', t('XML file failed validation')); | 
| 78 | 78 | } | 
| 79 | 79 | } | 
| @@ -101,7 +101,7 @@ discard block | ||
| 101 | 101 |        "{$path}/minimum" => t('Minimum') | 
| 102 | 102 | ); | 
| 103 | 103 |      variable_set('jump_use_js_presets-Array', 1); | 
| 104 | -    drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js'); | |
| 104 | +    drupal_add_js(drupal_get_path('module', 'jump').'/jump.js'); | |
| 105 | 105 | $output .= '<div class="simple-form-controls"><div class="form-item venue">'; | 
| 106 | 106 | $output .= '<label>Preset:</label>'; | 
| 107 | 107 | $output .= jump_quickly($preset_options, 'presets'); | 
| @@ -150,7 +150,7 @@ discard block | ||
| 150 | 150 | '#type' => 'submit', | 
| 151 | 151 |      '#value' => t('Save configuration') | 
| 152 | 152 | ); | 
| 153 | - $form['saveuseconfigxml'] = array ( | |
| 153 | + $form['saveuseconfigxml'] = array( | |
| 154 | 154 | '#type' => 'submit', | 
| 155 | 155 |        '#value' => t('Save configuration with disk usage settings from config.xml'), | 
| 156 | 156 |        '#validate' => array('boincwork_admin_prefs_preset_saveuseconfigxml'), | 
| @@ -175,33 +175,33 @@ discard block | ||
| 175 | 175 | // Verify all non-boolean user input values and notify form API of failures | 
| 176 | 176 | |
| 177 | 177 | // Processing preferences | 
| 178 | -  if (!verify_numeric($values['processor']['idle_time_to_run'], 1, 9999)) form_set_error('idle_time_to_run', t('Invalid setting for') . " \"{$form['processor']['idle_time_to_run']['#title']} [x] {$form['processor']['idle_time_to_run']['#field_suffix']}\""); | |
| 179 | -  if (!verify_numeric($values['processor']['suspend_if_no_recent_input'], 0, 9999)) form_set_error('suspend_if_no_recent_input', t('Invalid setting for') . " \"{$form['processor']['suspend_if_no_recent_input']['#title']} [x] {$form['processor']['suspend_if_no_recent_input']['#field_suffix']}\""); | |
| 180 | -  if (!verify_numeric($values['processor']['suspend_cpu_usage'], 0, 100)) form_set_error('suspend_cpu_usage', t('Invalid setting for') . " \"{$form['processor']['suspend_cpu_usage']['#title']} [x] {$form['processor']['suspend_cpu_usage']['#field_suffix']}\""); | |
| 181 | -  if (!verify_numeric($values['processor']['start_hour'], 0, 23)) form_set_error('start_hour', t('Invalid setting for') . " \"{$form['processor']['start_hour']['#title']} [x] {$form['processor']['start_hour']['#field_suffix']}\""); | |
| 182 | -  if (!verify_numeric($values['processor']['end_hour'], 0, 23)) form_set_error('end_hour', t('Invalid setting for') . " \"{$form['processor']['end_hour']['#title']} [x] {$form['processor']['end_hour']['#field_suffix']}\""); | |
| 183 | -  if (!verify_numeric($values['processor']['cpu_scheduling_period_minutes'], 1, 9999)) form_set_error('cpu_scheduling_period_minutes', t('Invalid setting for') . " \"{$form['processor']['cpu_scheduling_period_minutes']['#title']} [x] {$form['processor']['cpu_scheduling_period_minutes']['#field_suffix']}\""); | |
| 184 | -  if (!verify_numeric($values['processor']['max_ncpus_pct'], 0, 100)) form_set_error('max_ncpus_pct', t('Invalid setting for') . " \"{$form['processor']['max_ncpus_pct']['#title']} [x] {$form['processor']['max_ncpus_pct']['#field_suffix']}\""); | |
| 185 | -  if (!verify_numeric($values['processor']['cpu_usage_limit'], 0, 100)) form_set_error('cpu_usage_limit', t('Invalid setting for') . " \"{$form['processor']['cpu_usage_limit']['#title']} [x] {$form['processor']['cpu_usage_limit']['#field_suffix']}\""); | |
| 178 | +  if (!verify_numeric($values['processor']['idle_time_to_run'], 1, 9999)) form_set_error('idle_time_to_run', t('Invalid setting for')." \"{$form['processor']['idle_time_to_run']['#title']} [x] {$form['processor']['idle_time_to_run']['#field_suffix']}\""); | |
| 179 | +  if (!verify_numeric($values['processor']['suspend_if_no_recent_input'], 0, 9999)) form_set_error('suspend_if_no_recent_input', t('Invalid setting for')." \"{$form['processor']['suspend_if_no_recent_input']['#title']} [x] {$form['processor']['suspend_if_no_recent_input']['#field_suffix']}\""); | |
| 180 | +  if (!verify_numeric($values['processor']['suspend_cpu_usage'], 0, 100)) form_set_error('suspend_cpu_usage', t('Invalid setting for')." \"{$form['processor']['suspend_cpu_usage']['#title']} [x] {$form['processor']['suspend_cpu_usage']['#field_suffix']}\""); | |
| 181 | +  if (!verify_numeric($values['processor']['start_hour'], 0, 23)) form_set_error('start_hour', t('Invalid setting for')." \"{$form['processor']['start_hour']['#title']} [x] {$form['processor']['start_hour']['#field_suffix']}\""); | |
| 182 | +  if (!verify_numeric($values['processor']['end_hour'], 0, 23)) form_set_error('end_hour', t('Invalid setting for')." \"{$form['processor']['end_hour']['#title']} [x] {$form['processor']['end_hour']['#field_suffix']}\""); | |
| 183 | +  if (!verify_numeric($values['processor']['cpu_scheduling_period_minutes'], 1, 9999)) form_set_error('cpu_scheduling_period_minutes', t('Invalid setting for')." \"{$form['processor']['cpu_scheduling_period_minutes']['#title']} [x] {$form['processor']['cpu_scheduling_period_minutes']['#field_suffix']}\""); | |
| 184 | +  if (!verify_numeric($values['processor']['max_ncpus_pct'], 0, 100)) form_set_error('max_ncpus_pct', t('Invalid setting for')." \"{$form['processor']['max_ncpus_pct']['#title']} [x] {$form['processor']['max_ncpus_pct']['#field_suffix']}\""); | |
| 185 | +  if (!verify_numeric($values['processor']['cpu_usage_limit'], 0, 100)) form_set_error('cpu_usage_limit', t('Invalid setting for')." \"{$form['processor']['cpu_usage_limit']['#title']} [x] {$form['processor']['cpu_usage_limit']['#field_suffix']}\""); | |
| 186 | 186 | |
| 187 | 187 | // Storage preferences | 
| 188 | -  if (!verify_numeric($values['storage']['disk_max_used_gb'], 0, 9999999)) form_set_error('disk_max_used_gb', t('Invalid setting for') . " \"{$form['storage']['disk_max_used_gb']['#title']} [x] {$form['storage']['disk_max_used_gb']['#field_suffix']}\""); | |
| 189 | -  if (!verify_numeric($values['storage']['disk_min_free_gb'], 0.001, 9999999)) form_set_error('disk_min_free_gb', t('Invalid setting for') . " \"{$form['storage']['disk_min_free_gb']['#title']} [x] {$form['storage']['disk_min_free_gb']['#field_suffix']}\""); | |
| 190 | -  if (!verify_numeric($values['storage']['disk_max_used_pct'], 0, 100)) form_set_error('disk_max_used_pct', t('Invalid setting for') . " \"{$form['storage']['disk_max_used_pct']['#title']} [x] {$form['storage']['disk_max_used_pct']['#field_suffix']}\""); | |
| 191 | -  if (!verify_numeric($values['storage']['disk_interval'], 0, 9999999)) form_set_error('disk_interval', t('Invalid setting for') . " \"{$form['storage']['disk_interval']['#title']} [x] {$form['storage']['disk_interval']['#field_suffix']}\""); | |
| 192 | -  if (!verify_numeric($values['storage']['vm_max_used_pct'], 0, 100)) form_set_error('vm_max_used_pct', t('Invalid setting for') . " \"{$form['storage']['vm_max_used_pct']['#title']} [x] {$form['storage']['vm_max_used_pct']['#field_suffix']}\""); | |
| 193 | -  if (!verify_numeric($values['storage']['ram_max_used_busy_pct'], 0, 100)) form_set_error('ram_max_used_busy_pct', t('Invalid setting for') . " \"{$form['storage']['ram_max_used_busy_pct']['#title']} [x] {$form['storage']['ram_max_used_busy_pct']['#field_suffix']}\""); | |
| 194 | -  if (!verify_numeric($values['storage']['ram_max_used_idle_pct'], 0, 100)) form_set_error('ram_max_used_idle_pct', t('Invalid setting for') . " \"{$form['storage']['ram_max_used_idle_pct']['#title']} [x] {$form['storage']['ram_max_used_idle_pct']['#field_suffix']}\""); | |
| 188 | +  if (!verify_numeric($values['storage']['disk_max_used_gb'], 0, 9999999)) form_set_error('disk_max_used_gb', t('Invalid setting for')." \"{$form['storage']['disk_max_used_gb']['#title']} [x] {$form['storage']['disk_max_used_gb']['#field_suffix']}\""); | |
| 189 | +  if (!verify_numeric($values['storage']['disk_min_free_gb'], 0.001, 9999999)) form_set_error('disk_min_free_gb', t('Invalid setting for')." \"{$form['storage']['disk_min_free_gb']['#title']} [x] {$form['storage']['disk_min_free_gb']['#field_suffix']}\""); | |
| 190 | +  if (!verify_numeric($values['storage']['disk_max_used_pct'], 0, 100)) form_set_error('disk_max_used_pct', t('Invalid setting for')." \"{$form['storage']['disk_max_used_pct']['#title']} [x] {$form['storage']['disk_max_used_pct']['#field_suffix']}\""); | |
| 191 | +  if (!verify_numeric($values['storage']['disk_interval'], 0, 9999999)) form_set_error('disk_interval', t('Invalid setting for')." \"{$form['storage']['disk_interval']['#title']} [x] {$form['storage']['disk_interval']['#field_suffix']}\""); | |
| 192 | +  if (!verify_numeric($values['storage']['vm_max_used_pct'], 0, 100)) form_set_error('vm_max_used_pct', t('Invalid setting for')." \"{$form['storage']['vm_max_used_pct']['#title']} [x] {$form['storage']['vm_max_used_pct']['#field_suffix']}\""); | |
| 193 | +  if (!verify_numeric($values['storage']['ram_max_used_busy_pct'], 0, 100)) form_set_error('ram_max_used_busy_pct', t('Invalid setting for')." \"{$form['storage']['ram_max_used_busy_pct']['#title']} [x] {$form['storage']['ram_max_used_busy_pct']['#field_suffix']}\""); | |
| 194 | +  if (!verify_numeric($values['storage']['ram_max_used_idle_pct'], 0, 100)) form_set_error('ram_max_used_idle_pct', t('Invalid setting for')." \"{$form['storage']['ram_max_used_idle_pct']['#title']} [x] {$form['storage']['ram_max_used_idle_pct']['#field_suffix']}\""); | |
| 195 | 195 | |
| 196 | 196 | // Network preferences | 
| 197 | -  if (!verify_numeric($values['network']['work_buf_min_days'], 0, 10)) form_set_error('work_buf_min_days', t('Invalid setting for') . " \"{$form['network']['work_buf_min_days']['#title']} [x] {$form['network']['work_buf_min_days']['#field_suffix']}\""); | |
| 198 | -  if (!verify_numeric($values['network']['work_buf_additional_days'], 0, 10)) form_set_error('work_buf_additional_days', t('Invalid setting for') . " \"{$form['network']['work_buf_additional_days']['#title']} [x] {$form['network']['work_buf_additional_days']['#field_suffix']}\""); | |
| 199 | -  if (!verify_numeric($values['network']['max_bytes_sec_down'], 0, 9999.999)) form_set_error('max_bytes_sec_down', t('Invalid setting for') . " \"{$form['network']['max_bytes_sec_down']['#title']} [x] {$form['network']['max_bytes_sec_down']['#field_suffix']}\""); | |
| 200 | -  if (!verify_numeric($values['network']['max_bytes_sec_up'], 0, 9999.999)) form_set_error('max_bytes_sec_up', t('Invalid setting for') . " \"{$form['network']['max_bytes_sec_up']['#title']} [x] {$form['network']['max_bytes_sec_up']['#field_suffix']}\""); | |
| 201 | -  if (!verify_numeric($values['network']['net_start_hour'], 0, 23)) form_set_error('net_start_hour', t('Invalid setting for') . " \"{$form['network']['net_start_hour']['#title']} [x] {$form['network']['net_start_hour']['#field_suffix']}\""); | |
| 202 | -  if (!verify_numeric($values['network']['net_end_hour'], 0, 23)) form_set_error('net_end_hour', t('Invalid setting for') . " \"{$form['network']['net_end_hour']['#title']} [x] {$form['network']['net_end_hour']['#field_suffix']}\""); | |
| 203 | -  if (!verify_numeric($values['network']['daily_xfer_limit_mb'], 0, 9999999)) form_set_error('daily_xfer_limit_mb', t('Invalid setting for') . " \"{$form['network']['daily_xfer_limit_mb']['#title']} [x] {$form['network']['daily_xfer_limit_mb']['#field_suffix']}\""); | |
| 204 | -  if (!verify_numeric($values['network']['daily_xfer_period_days'], 0, 9999999)) form_set_error('daily_xfer_period_days', t('Invalid setting for') . " \"{$form['network']['daily_xfer_limit_mb']['#title']} [x] {$form['network']['daily_xfer_limit_mb']['#field_suffix']}\""); | |
| 197 | +  if (!verify_numeric($values['network']['work_buf_min_days'], 0, 10)) form_set_error('work_buf_min_days', t('Invalid setting for')." \"{$form['network']['work_buf_min_days']['#title']} [x] {$form['network']['work_buf_min_days']['#field_suffix']}\""); | |
| 198 | +  if (!verify_numeric($values['network']['work_buf_additional_days'], 0, 10)) form_set_error('work_buf_additional_days', t('Invalid setting for')." \"{$form['network']['work_buf_additional_days']['#title']} [x] {$form['network']['work_buf_additional_days']['#field_suffix']}\""); | |
| 199 | +  if (!verify_numeric($values['network']['max_bytes_sec_down'], 0, 9999.999)) form_set_error('max_bytes_sec_down', t('Invalid setting for')." \"{$form['network']['max_bytes_sec_down']['#title']} [x] {$form['network']['max_bytes_sec_down']['#field_suffix']}\""); | |
| 200 | +  if (!verify_numeric($values['network']['max_bytes_sec_up'], 0, 9999.999)) form_set_error('max_bytes_sec_up', t('Invalid setting for')." \"{$form['network']['max_bytes_sec_up']['#title']} [x] {$form['network']['max_bytes_sec_up']['#field_suffix']}\""); | |
| 201 | +  if (!verify_numeric($values['network']['net_start_hour'], 0, 23)) form_set_error('net_start_hour', t('Invalid setting for')." \"{$form['network']['net_start_hour']['#title']} [x] {$form['network']['net_start_hour']['#field_suffix']}\""); | |
| 202 | +  if (!verify_numeric($values['network']['net_end_hour'], 0, 23)) form_set_error('net_end_hour', t('Invalid setting for')." \"{$form['network']['net_end_hour']['#title']} [x] {$form['network']['net_end_hour']['#field_suffix']}\""); | |
| 203 | +  if (!verify_numeric($values['network']['daily_xfer_limit_mb'], 0, 9999999)) form_set_error('daily_xfer_limit_mb', t('Invalid setting for')." \"{$form['network']['daily_xfer_limit_mb']['#title']} [x] {$form['network']['daily_xfer_limit_mb']['#field_suffix']}\""); | |
| 204 | +  if (!verify_numeric($values['network']['daily_xfer_period_days'], 0, 9999999)) form_set_error('daily_xfer_period_days', t('Invalid setting for')." \"{$form['network']['daily_xfer_limit_mb']['#title']} [x] {$form['network']['daily_xfer_limit_mb']['#field_suffix']}\""); | |
| 205 | 205 | } | 
| 206 | 206 | |
| 207 | 207 | /** | 
| @@ -217,7 +217,7 @@ discard block | ||
| 217 | 217 | // Processing preferences | 
| 218 | 218 | $prefs['run_on_batteries'] = ($values['processor']['run_on_batteries']) ? 0 : 1; | 
| 219 | 219 | $prefs['run_if_user_active'] = ($values['processor']['run_if_user_active']) ? 0 : 1; | 
| 220 | - $prefs['run_gpu_if_user_active'] = ($values['processor']['run_gpu_if_user_active']) ? 0: 1; | |
| 220 | + $prefs['run_gpu_if_user_active'] = ($values['processor']['run_gpu_if_user_active']) ? 0 : 1; | |
| 221 | 221 | $prefs['idle_time_to_run'] = $values['processor']['idle_time_to_run']; | 
| 222 | 222 | $prefs['suspend_if_no_recent_input'] = $values['processor']['suspend_if_no_recent_input']; | 
| 223 | 223 | $prefs['suspend_cpu_usage'] = $values['processor']['suspend_cpu_usage']; | 
| @@ -267,7 +267,7 @@ discard block | ||
| 267 | 267 | |
| 268 | 268 | // Get the full configuration | 
| 269 | 269 | $all_presets = boincwork_get_preset_prefs(); | 
| 270 | - $all_presets = (array) $all_presets['general_preferences']; | |
| 270 | + $all_presets = (array)$all_presets['general_preferences']; | |
| 271 | 271 | |
| 272 | 272 | // Check for sane config | 
| 273 | 273 |    if (isset($all_presets['preset'])) { | 
| @@ -13,8 +13,8 @@ | ||
| 13 | 13 |    function render($values) { | 
| 14 | 14 | $gflops = 0; | 
| 15 | 15 |      if ($values->host_app_version_et_avg) { | 
| 16 | - $gflops = 1e-9 / $values->host_app_version_et_avg; | |
| 16 | + $gflops = 1e-9/$values->host_app_version_et_avg; | |
| 17 | 17 | } | 
| 18 | - return round($gflops, 2) . ' GFLOPS'; | |
| 18 | + return round($gflops, 2).' GFLOPS'; | |
| 19 | 19 | } | 
| 20 | 20 | } | 
| @@ -11,7 +11,7 @@ | ||
| 11 | 11 | } | 
| 12 | 12 | |
| 13 | 13 |    function render($values) { | 
| 14 | - $time_in_days = $values->host_app_version_turnaround_avg / (24*60*60); | |
| 15 | -    return round($time_in_days, 2) . ' ' . t('days'); | |
| 14 | + $time_in_days = $values->host_app_version_turnaround_avg/(24*60*60); | |
| 15 | +    return round($time_in_days, 2).' '.t('days'); | |
| 16 | 16 | } | 
| 17 | 17 | } | 
| @@ -11,6 +11,6 @@ | ||
| 11 | 11 | } | 
| 12 | 12 | |
| 13 | 13 |    function render($values) { | 
| 14 | -    return sprintf("%01.2f", $values->app_version_host_app_version_version_num / 100); | |
| 14 | +    return sprintf("%01.2f", $values->app_version_host_app_version_version_num/100); | |
| 15 | 15 | } | 
| 16 | 16 | } | 
| @@ -1637,7 +1637,7 @@ | ||
| 1637 | 1637 | |
| 1638 | 1638 | return array( | 
| 1639 | 1639 | 'info' => array( | 
| 1640 | -      'path' => drupal_get_path('module', 'boincwork') . '/views', | |
| 1640 | +      'path' => drupal_get_path('module', 'boincwork').'/views', | |
| 1641 | 1641 | ), | 
| 1642 | 1642 | 'handlers' => array( | 
| 1643 | 1643 | 'views_handler_argument_boincuser_id' => array( | 
| @@ -180,12 +180,12 @@ | ||
| 180 | 180 | */ | 
| 181 | 181 |  function boincwork_locale($op = 'groups', $group = NULL) { | 
| 182 | 182 |    switch ($op) { | 
| 183 | - case 'groups': | |
| 184 | -      return array('project' => bts('Project')); | |
| 185 | - case 'info': | |
| 186 | - $info['project']['refresh callback'] = 'boincwork_locale_refresh'; | |
| 187 | - $info['project']['format'] = FALSE; | |
| 188 | - return $info; | |
| 183 | + case 'groups': | |
| 184 | +    return array('project' => bts('Project')); | |
| 185 | + case 'info': | |
| 186 | + $info['project']['refresh callback'] = 'boincwork_locale_refresh'; | |
| 187 | + $info['project']['format'] = FALSE; | |
| 188 | + return $info; | |
| 189 | 189 | } | 
| 190 | 190 | } | 
| 191 | 191 | |
| @@ -133,7 +133,7 @@ discard block | ||
| 133 | 133 | $items['host/%/set-venue/%'] = array( | 
| 134 | 134 | 'title' => 'Set host venue', | 
| 135 | 135 | 'page callback' => 'boincwork_host_set_venue', | 
| 136 | - 'page arguments' => array(1,3), | |
| 136 | + 'page arguments' => array(1, 3), | |
| 137 | 137 | 'access callback' => 'user_is_logged_in', | 
| 138 | 138 | 'type' => MENU_CALLBACK, | 
| 139 | 139 | ); | 
| @@ -184,7 +184,7 @@ discard block | ||
| 184 | 184 | 'title' => 'Account Tasks Table', | 
| 185 | 185 | 'description' => '', | 
| 186 | 186 | 'page callback' => 'boincwork_account_task_table', | 
| 187 | - 'page arguments' => array(2,3), | |
| 187 | + 'page arguments' => array(2, 3), | |
| 188 | 188 |      'access arguments' => array('access content'), | 
| 189 | 189 | 'type' => MENU_CALLBACK, | 
| 190 | 190 | ); | 
| @@ -192,7 +192,7 @@ discard block | ||
| 192 | 192 | 'title' => 'Host Tasks Table', | 
| 193 | 193 | 'description' => '', | 
| 194 | 194 | 'page callback' => 'boincwork_host_task_table', | 
| 195 | - 'page arguments' => array(1,3,4), | |
| 195 | + 'page arguments' => array(1, 3, 4), | |
| 196 | 196 |      'access arguments' => array('access content'), | 
| 197 | 197 | 'type' => MENU_CALLBACK, | 
| 198 | 198 | ); | 
| @@ -276,15 +276,15 @@ discard block | ||
| 276 | 276 |      if ($vars['message']['is_blocked']) { | 
| 277 | 277 | $vars['message_actions']['unignore_user'] = array( | 
| 278 | 278 |          'title' => bts('Stop Ignoring User', array(), NULL, 'boinc:ignore-user-remove'), | 
| 279 | - 'href' => 'account/prefs/privacy/ignore_user/remove/'. $author->uid, | |
| 280 | - 'query' => 'destination=messages/view/' . $thread_id, | |
| 279 | + 'href' => 'account/prefs/privacy/ignore_user/remove/'.$author->uid, | |
| 280 | + 'query' => 'destination=messages/view/'.$thread_id, | |
| 281 | 281 | ); | 
| 282 | 282 | } | 
| 283 | 283 |      else { | 
| 284 | 284 | $vars['message_actions']['ignore_user'] = array( | 
| 285 | 285 |          'title' => bts('Ignore User', array(), NULL, 'boinc:ignore-user-add'), | 
| 286 | - 'href' => 'account/prefs/privacy/ignore_user/add/'. $author->uid, | |
| 287 | - 'query' => 'destination=messages/view/' . $thread_id, | |
| 286 | + 'href' => 'account/prefs/privacy/ignore_user/add/'.$author->uid, | |
| 287 | + 'query' => 'destination=messages/view/'.$thread_id, | |
| 288 | 288 | ); | 
| 289 | 289 | } | 
| 290 | 290 | } | 
| @@ -297,7 +297,7 @@ discard block | ||
| 297 | 297 | // Delete expired hosts in the BOINC database, host_delete table. | 
| 298 | 298 |    require_boinc('boinc_db'); | 
| 299 | 299 | $num_deleted = BoincHostDeleted::delete_expired(); | 
| 300 | -  if ($num_deleted>0) { | |
| 300 | +  if ($num_deleted > 0) { | |
| 301 | 301 |      watchdog('boincwork', "Deleted ${num_deleted} hosts from host_deleted table", WATCHDOG_NOTICE); | 
| 302 | 302 | } | 
| 303 | 303 | } | 
| @@ -344,10 +344,10 @@ discard block | ||
| 344 | 344 |        drupal_prepare_form('boincwork_generalprefs_form', $prefs[$pref_set], $form_state); | 
| 345 | 345 | } | 
| 346 | 346 | |
| 347 | -    $output .= '<p>' . bts('These apply to all BOINC projects in which you participate.', array(), NULL, 'boinc:account-preferences-computing') . '<br/>'; | |
| 348 | -    $output .= bts('On computers attached to multiple projects, the most recently modified preferences will be used.', array(), NULL, 'boinc:account-preferences-computing') . '</p>'; | |
| 349 | -    $output .= '<p>' . bts('Preferences last modified: @mod_time', array('@mod_time' => pretty_time_str($prefs['generic']['prefs']['modified']['#value'])), NULL, 'boinc:account-preferences') . '</p>'; | |
| 350 | -    $output .= '<h2>' . bts('Combined preferences', array(), NULL, 'boinc:account-preferences') . ' ' . l('(' . bts('Switch View', array(), NULL, 'boinc:account-preferences') . ')', 'account/prefs/computing') . '</h2>'; | |
| 347 | +    $output .= '<p>'.bts('These apply to all BOINC projects in which you participate.', array(), NULL, 'boinc:account-preferences-computing').'<br/>'; | |
| 348 | +    $output .= bts('On computers attached to multiple projects, the most recently modified preferences will be used.', array(), NULL, 'boinc:account-preferences-computing').'</p>'; | |
| 349 | +    $output .= '<p>'.bts('Preferences last modified: @mod_time', array('@mod_time' => pretty_time_str($prefs['generic']['prefs']['modified']['#value'])), NULL, 'boinc:account-preferences').'</p>'; | |
| 350 | +    $output .= '<h2>'.bts('Combined preferences', array(), NULL, 'boinc:account-preferences').' '.l('('.bts('Switch View', array(), NULL, 'boinc:account-preferences').')', 'account/prefs/computing').'</h2>'; | |
| 351 | 351 | |
| 352 | 352 | $output .= '<table class="preferences combined">'; | 
| 353 | 353 | |
| @@ -357,7 +357,7 @@ discard block | ||
| 357 | 357 | $output .= '<tr class="section-heading">'; | 
| 358 | 358 |        $output .= "<td>{$section['name']}</td>"; | 
| 359 | 359 |        foreach ($pref_sets as $pref_set) { | 
| 360 | - $output .= '<td>' . $pref_set . '</td>'; | |
| 360 | + $output .= '<td>'.$pref_set.'</td>'; | |
| 361 | 361 | } | 
| 362 | 362 | $output .= '</tr>'; | 
| 363 | 363 |        foreach ($section['elements'] as $name => $setting) { | 
| @@ -405,11 +405,11 @@ discard block | ||
| 405 | 405 | $second_pref = $special_map[$name]; | 
| 406 | 406 | $second_pref_setting = $prefs[$pref_set]['prefs']['advanced'][$category][$second_pref]; | 
| 407 | 407 | $second_value = isset($second_pref_setting['#options']) ? $second_pref_setting['#options'][$second_pref_setting['#default_value']] : $second_pref_setting['#default_value']; | 
| 408 | -              $output .= "<td>{$value} {$pref_setting['#field_suffix']} {$special_delimiter[$name]}" . | |
| 408 | +              $output .= "<td>{$value} {$pref_setting['#field_suffix']} {$special_delimiter[$name]}". | |
| 409 | 409 |                  " {$second_value} {$second_pref_setting['#field_suffix']} </td>"; | 
| 410 | 410 | } | 
| 411 | 411 | } | 
| 412 | -          else  { | |
| 412 | +          else { | |
| 413 | 413 | $output .= '<td>---</td>'; | 
| 414 | 414 | } | 
| 415 | 415 | } | 
| @@ -437,12 +437,12 @@ discard block | ||
| 437 | 437 | ); | 
| 438 | 438 | // Show Clear links for established preference sets | 
| 439 | 439 |        if ($pref_set != 'generic' AND $prefs[$pref_set]['#established']) { | 
| 440 | -        $output .= ' </li><li class="tab"> ' . l(bts('Clear', array(), NULL, 'boinc:form-clear'), "account/prefs/computing/clear/{$pref_set}", | |
| 440 | +        $output .= ' </li><li class="tab"> '.l(bts('Clear', array(), NULL, 'boinc:form-clear'), "account/prefs/computing/clear/{$pref_set}", | |
| 441 | 441 | array( | 
| 442 | 442 | 'query' => drupal_get_destination(), | 
| 443 | 443 | 'attributes' => array( | 
| 444 | -              'onclick' => 'return confirm(\'' . bts('This will remove all of your settings from the "@name" preference set. Are you sure?', | |
| 445 | -                array('@name' => ucfirst($pref_set)), NULL, 'boinc:account-computing-preferences') . '\')' | |
| 444 | +              'onclick' => 'return confirm(\''.bts('This will remove all of your settings from the "@name" preference set. Are you sure?', | |
| 445 | +                array('@name' => ucfirst($pref_set)), NULL, 'boinc:account-computing-preferences').'\')' | |
| 446 | 446 | ) | 
| 447 | 447 | ) | 
| 448 | 448 | ); | 
| @@ -468,8 +468,8 @@ discard block | ||
| 468 | 468 |          "{$path}/work" => bts('Work', array(), NULL, 'boinc:account-preferences-location') | 
| 469 | 469 | ); | 
| 470 | 470 |        variable_set('jump_use_js_venues-Array', 1); | 
| 471 | -      drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js'); | |
| 472 | -      drupal_add_js(drupal_get_path('theme', 'boinc') . '/js/prefs.js', 'theme'); | |
| 471 | +      drupal_add_js(drupal_get_path('module', 'jump').'/jump.js'); | |
| 472 | +      drupal_add_js(drupal_get_path('theme', 'boinc').'/js/prefs.js', 'theme'); | |
| 473 | 473 | |
| 474 | 474 | $output .= '<div id="venue-selector" class="simple-form-controls">'; | 
| 475 | 475 | $output .= ' <div class="form-item venue">'; | 
| @@ -489,7 +489,7 @@ discard block | ||
| 489 | 489 |      if (!$current_set['#established']) { | 
| 490 | 490 | drupal_set_message(bts( | 
| 491 | 491 | "No preferences found for set '@venue'. Click SAVE CHANGES below to save the following preferences to your account.", | 
| 492 | - array( '@venue' => $venue, ), | |
| 492 | +          array('@venue' => $venue,), | |
| 493 | 493 | NULL, 'boinc:account-preferences'), 'status'); | 
| 494 | 494 | } | 
| 495 | 495 | |
| @@ -548,8 +548,8 @@ discard block | ||
| 548 | 548 |        drupal_prepare_form('boincwork_projectprefs_form', $prefs[$pref_set], $form_state); | 
| 549 | 549 | } | 
| 550 | 550 | |
| 551 | -    $output .= '<p>' . bts('Preferences last modified: @mod_time', array('@mod_time' => pretty_time_str($prefs['generic']['modified']['#value'])), NULL, 'boinc:account-preferences') . '</p>'; | |
| 552 | -    $output .= '<h2>' . bts('Combined preferences', array(), NULL, 'boinc:account-preferences') . ' ' . l('(' . bts('Switch View', array(), NULL, 'boinc:account-preferences') . ')', 'account/prefs/project') . '</h2>'; | |
| 551 | +    $output .= '<p>'.bts('Preferences last modified: @mod_time', array('@mod_time' => pretty_time_str($prefs['generic']['modified']['#value'])), NULL, 'boinc:account-preferences').'</p>'; | |
| 552 | +    $output .= '<h2>'.bts('Combined preferences', array(), NULL, 'boinc:account-preferences').' '.l('('.bts('Switch View', array(), NULL, 'boinc:account-preferences').')', 'account/prefs/project').'</h2>'; | |
| 553 | 553 | |
| 554 | 554 | $output .= '<table class="preferences combined">'; | 
| 555 | 555 | |
| @@ -559,7 +559,7 @@ discard block | ||
| 559 | 559 | $output .= '<tr class="section-heading">'; | 
| 560 | 560 |        $output .= "<td>{$section['name']}</td>"; | 
| 561 | 561 |        foreach ($pref_sets as $pref_set) { | 
| 562 | - $output .= '<td>' . $pref_set . '</td>'; | |
| 562 | + $output .= '<td>'.$pref_set.'</td>'; | |
| 563 | 563 | } | 
| 564 | 564 | $output .= '</tr>'; | 
| 565 | 565 |        foreach ($section['elements'] as $name => $setting) { | 
| @@ -601,12 +601,12 @@ discard block | ||
| 601 | 601 |        $output .= l($action_text, "account/prefs/project/edit/{$pref_set}"); | 
| 602 | 602 | // Show Clear links for established preference sets | 
| 603 | 603 |        if ($pref_set != 'generic' AND $prefs[$pref_set]['#established']) { | 
| 604 | -        $output .= ' </li><li class="tab"> ' . l(bts('Clear', array(), NULL, 'boinc:form-clear'), "account/prefs/project/clear/{$pref_set}", | |
| 604 | +        $output .= ' </li><li class="tab"> '.l(bts('Clear', array(), NULL, 'boinc:form-clear'), "account/prefs/project/clear/{$pref_set}", | |
| 605 | 605 | array( | 
| 606 | 606 | 'query' => drupal_get_destination(), | 
| 607 | 607 | 'attributes' => array( | 
| 608 | -              'onclick' => 'return confirm(\'' . bts('This will remove all of your settings from the "@name" preference set. Are you sure?', | |
| 609 | -                array('@name' => ucfirst($pref_set)), NULL, 'boinc:account-preferences-project') . '\')' | |
| 608 | +              'onclick' => 'return confirm(\''.bts('This will remove all of your settings from the "@name" preference set. Are you sure?', | |
| 609 | +                array('@name' => ucfirst($pref_set)), NULL, 'boinc:account-preferences-project').'\')' | |
| 610 | 610 | ) | 
| 611 | 611 | ) | 
| 612 | 612 | ); | 
| @@ -622,7 +622,7 @@ discard block | ||
| 622 | 622 | // Set this preference set as the one to use for any new hosts attached | 
| 623 | 623 | // to the user account | 
| 624 | 624 | boincwork_set_default_venue($venue); | 
| 625 | -    drupal_set_message( bts('The primary preference set has been changed to "@set"', array('@set' => $venue), NULL, 'boinc:account-preferences-project') ); | |
| 625 | +    drupal_set_message(bts('The primary preference set has been changed to "@set"', array('@set' => $venue), NULL, 'boinc:account-preferences-project')); | |
| 626 | 626 |      drupal_goto('account/prefs/project/combined'); | 
| 627 | 627 | break; | 
| 628 | 628 | |
| @@ -641,8 +641,8 @@ discard block | ||
| 641 | 641 |          "{$path}/work" => bts('Work', array(), NULL, 'boinc:account-preferences-location') | 
| 642 | 642 | ); | 
| 643 | 643 |        variable_set('jump_use_js_venues-Array', 1); | 
| 644 | -      drupal_add_js(drupal_get_path('module', 'jump') . '/jump.js'); | |
| 645 | -      drupal_add_js(drupal_get_path('theme', 'boinc') . '/js/prefs.js', 'theme'); | |
| 644 | +      drupal_add_js(drupal_get_path('module', 'jump').'/jump.js'); | |
| 645 | +      drupal_add_js(drupal_get_path('theme', 'boinc').'/js/prefs.js', 'theme'); | |
| 646 | 646 | |
| 647 | 647 | $output .= '<div id="venue-selector" class="simple-form-controls">'; | 
| 648 | 648 | $output .= ' <div class="form-item venue">'; | 
| @@ -662,7 +662,7 @@ discard block | ||
| 662 | 662 |      if (!$current_set['#established']) { | 
| 663 | 663 | drupal_set_message(bts( | 
| 664 | 664 | "No preferences found for set '@venue'. Click SAVE CHANGES below to save the following preferences to your account.", | 
| 665 | - array( '@venue' => $venue, ), | |
| 665 | +          array('@venue' => $venue,), | |
| 666 | 666 | NULL, 'boinc:account-preferences'), 'status'); | 
| 667 | 667 | } | 
| 668 | 668 | |
| @@ -734,7 +734,7 @@ discard block | ||
| 734 | 734 | // Edit preferences link | 
| 735 | 735 | $output .= '<tr>'; | 
| 736 | 736 | $output .= '<td></td>'; | 
| 737 | -    $output .= '<td>' . l(bts('Edit privacy preferences', array('@project' => PROJECT), NULL, 'boinc:account-preferences-privacy'), "account/prefs/privacy/edit") . '</td>'; | |
| 737 | +    $output .= '<td>'.l(bts('Edit privacy preferences', array('@project' => PROJECT), NULL, 'boinc:account-preferences-privacy'), "account/prefs/privacy/edit").'</td>'; | |
| 738 | 738 | $output .= '</tr>'; | 
| 739 | 739 | |
| 740 | 740 | $output .= '</table>'; | 
| @@ -769,15 +769,15 @@ discard block | ||
| 769 | 769 |    switch ($type) { | 
| 770 | 770 | case 'all': | 
| 771 | 771 |      //include_boinc('user/cert_all.php'); | 
| 772 | -    require_boinc(array('util','cert','user')); | |
| 772 | +    require_boinc(array('util', 'cert', 'user')); | |
| 773 | 773 | |
| 774 | 774 |      $join = date('j F Y', $boincuser->create_time); | 
| 775 | 775 |      $today = date('j F Y', time(0)); | 
| 776 | 776 | |
| 777 | -    if ($border=="no") { | |
| 777 | +    if ($border == "no") { | |
| 778 | 778 | $border = 0; | 
| 779 | 779 |      } else { | 
| 780 | - $border=8; | |
| 780 | + $border = 8; | |
| 781 | 781 | } | 
| 782 | 782 | |
| 783 | 783 | $title_font = "\"Optima,ZapfChancery\""; | 
| @@ -821,7 +821,7 @@ discard block | ||
| 821 | 821 | <tr><th align=left>Project</th><th align=left>Cobblestones</th><th align=left>Joined</th></tr> | 
| 822 | 822 | "; | 
| 823 | 823 |      foreach ($boincuser->projects as $p) { | 
| 824 | - if ($p->total_credit<100) continue; | |
| 824 | + if ($p->total_credit < 100) continue; | |
| 825 | 825 | show_proj($p); | 
| 826 | 826 | } | 
| 827 | 827 | echo " | 
| @@ -840,15 +840,15 @@ discard block | ||
| 840 | 840 | case 'account': | 
| 841 | 841 | default: | 
| 842 | 842 |      //include_boinc('user/cert1.php'); | 
| 843 | -    require_boinc(array('util','cert')); | |
| 843 | +    require_boinc(array('util', 'cert')); | |
| 844 | 844 | |
| 845 | 845 |      $join = date('j F Y', $boincuser->create_time); | 
| 846 | 846 |      $today = date('j F Y', time(0)); | 
| 847 | 847 | |
| 848 | -    if ($border=="no") { | |
| 848 | +    if ($border == "no") { | |
| 849 | 849 | $border = 0; | 
| 850 | 850 |      } else { | 
| 851 | - $border=8; | |
| 851 | + $border = 8; | |
| 852 | 852 | } | 
| 853 | 853 | |
| 854 | 854 | $credit = credit_string($boincuser->total_credit, false); | 
| @@ -1064,7 +1064,7 @@ discard block | ||
| 1064 | 1064 | |
| 1065 | 1065 | // If terms of use string exists and override is true, set terms-of-use | 
| 1066 | 1066 | // to Drupal varaible. | 
| 1067 | -  if ( (!empty($termsofuse) && ($overrideboinctou)) ) { | |
| 1067 | +  if ((!empty($termsofuse) && ($overrideboinctou))) { | |
| 1068 | 1068 |      if (!empty($xml['project_config']['terms_of_use'])) { | 
| 1069 | 1069 | // Remove any existing terms of use | 
| 1070 | 1070 | unset($xml['project_config']['terms_of_use']); | 
| @@ -1111,7 +1111,7 @@ discard block | ||
| 1111 | 1111 | * Page callback for host task table | 
| 1112 | 1112 | */ | 
| 1113 | 1113 |  function boincwork_host_task_table($host_id = NULL, $tselect = NULL, $app_id = NULL) { | 
| 1114 | -  require_boinc( array('util', 'result') ); | |
| 1114 | +  require_boinc(array('util', 'result')); | |
| 1115 | 1115 | |
| 1116 | 1116 |    $title = bts('Tasks for computer @host_id', array('@host_id' => $host_id), NULL, 'boinc:host-task-table'); | 
| 1117 | 1117 | drupal_set_title($title); |