GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — 7.x-1.x ( 1ce78a...4bc9f1 )
by Devin
02:35
created

template.php ➔ med_form_alter()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 12
c 1
b 0
f 1
nc 2
nop 3
dl 0
loc 17
rs 9.4285
1
<?php
2
3
/**
4
 * Implements template_preprocess_html().
5
 *
6
 */
7
//function bbc_preprocess_html(&$variables) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
47% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
8
//  // Add conditional CSS for IE. To use uncomment below and add IE css file
9
//  drupal_add_css(path_to_theme() . '/css/ie.css', array('weight' => CSS_THEME, 'browsers' => array('!IE' => FALSE), 'preprocess' => FALSE));
10
//
11
//  // Need legacy support for IE downgrade to Foundation 2 or use JS file below
12
//  // drupal_add_js('http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE7.js', 'external');
13
//}
14
15
/**
16
 * Implements template_preprocess_page
17
 *
18
 */
19
//function bbc_preprocess_page(&$variables) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
64% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
20
//}
21
22
/**
23
 * Implements template_preprocess_node
24
 *
25
 */
26
//function bbc_preprocess_node(&$variables) {
0 ignored issues
show
Unused Code Comprehensibility introduced by
64% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
27
//}
28
29
function med_form_alter(&$form, &$form_state, $form_id) {
0 ignored issues
show
Unused Code introduced by
The parameter $form_state is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
30
  if ($form_id == 'search_block_form') {
31
    $form['search_block_form']['#title'] = t('Search'); // Change the text on the label element
32
    $form['search_block_form']['#title_display'] = 'invisible'; // Toggle label visibilty
33
    $form['search_block_form']['#size'] = 40;  // define size of the textfield
34
    $form['search_block_form']['#default_value'] = t('Search'); // Set a default value for the textfield
35
    $form['actions']['submit']['#value'] = t('GO!'); // Change the text on the submit button
36
    $form['actions']['submit'] = array('#type' => 'image_button', '#src' => base_path() . path_to_theme() . '/images/search-button.png');
37
    // Add extra attributes to the text box
38
    $form['search_block_form']['#attributes']['onblur'] = "if (this.value == '') {this.value = 'Search';}";
39
    $form['search_block_form']['#attributes']['onfocus'] = "if (this.value == 'Search') {this.value = '';}";
40
    // Prevent user from searching the default text
41
    $form['#attributes']['onsubmit'] = "if(this.search_block_form.value=='Search'){ alert('Please enter a search'); return false; }";
42
    // Alternative (HTML5) placeholder attribute instead of using the javascript
43
    $form['search_block_form']['#attributes']['placeholder'] = t('Search');
44
  }
45
}
46
47
/**
48
 * Implements hook_preprocess_page().
49
 *
50
 * Adds jQuery.mmenu to every page load.
51
 */
52
function med_preprocess_page(&$variables) {
0 ignored issues
show
Unused Code introduced by
The parameter $variables is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
53
  if (module_exists('libraries')) {
54
    // Get the jQuery.mmenu library path.
55
    $library_exists = libraries_detect('jQuery.mmenu');
56
57
    // Check that all of our requirements are met before proceeding.
58
    if ($library_exists) {
59
      // Load the jQuery.mmenu library.
60
      libraries_load('jQuery.mmenu');
61
    }
62
  }
63
}
64