| @@ -42,8 +42,7 @@ | ||
| 42 | 42 |    if (is_array($element)) { | 
| 43 | 43 | show($element); | 
| 44 | 44 | return drupal_render($element); | 
| 45 | - } | |
| 46 | -  else { | |
| 45 | +  } else { | |
| 47 | 46 | // Safe-guard for inappropriate use of render() on flat variables: return | 
| 48 | 47 | // the variable as-is. | 
| 49 | 48 | return $element; | 
| @@ -131,8 +131,7 @@ discard block | ||
| 131 | 131 |          if ($comment->uid == 0 || strlen($comment->name) == 0) { | 
| 132 | 132 | // @see user_validate_name(). !'0' === TRUE. | 
| 133 | 133 | $comment_document->ss_name = '0'; | 
| 134 | - } | |
| 135 | -        else { | |
| 134 | +        } else { | |
| 136 | 135 | $comment_document->ss_name = $comment->name; | 
| 137 | 136 | // We want the name to be searchable for keywords. | 
| 138 | 137 | $comment_document->tos_name = $comment->name; | 
| @@ -318,8 +317,7 @@ discard block | ||
| 318 | 317 | $solr->deleteByQuery($query); | 
| 319 | 318 | // Log the query used for deletion. | 
| 320 | 319 |      watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO); | 
| 321 | - } | |
| 322 | -  catch (Exception $e) { | |
| 320 | +  } catch (Exception $e) { | |
| 323 | 321 |        watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); | 
| 324 | 322 | return FALSE; | 
| 325 | 323 | }// try | 
| @@ -376,8 +374,7 @@ discard block | ||
| 376 | 374 | $solr->deleteByQuery($query); | 
| 377 | 375 | // Log the query used for deletion. | 
| 378 | 376 |      watchdog('Apache Solr', 'Deleted documents from index with query @query', array('@query' => $query), WATCHDOG_INFO); | 
| 379 | - } | |
| 380 | -  catch (Exception $e) { | |
| 377 | +    } catch (Exception $e) { | |
| 381 | 378 |      watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); | 
| 382 | 379 | return FALSE; | 
| 383 | 380 | }// try | 
| @@ -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 | } | 
| @@ -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( |