@@ -7,12 +7,12 @@ |
||
7 | 7 | * for field-specific subclasses to use if they need to. |
8 | 8 | */ |
9 | 9 | class content_handler_argument_string extends views_handler_argument_string { |
10 | - var $content_field; |
|
10 | + var $content_field; |
|
11 | 11 | |
12 | - function construct() { |
|
12 | + function construct() { |
|
13 | 13 | parent::construct(); |
14 | 14 | |
15 | 15 | $this->content_field = content_fields($this->definition['content_field_name']); |
16 | 16 | $this->additional_fields = $this->definition['additional fields']; |
17 | - } |
|
17 | + } |
|
18 | 18 | } |
19 | 19 | \ No newline at end of file |
@@ -7,12 +7,12 @@ |
||
7 | 7 | * for field-specific subclasses to use if they need to. |
8 | 8 | */ |
9 | 9 | class content_handler_argument_numeric extends views_handler_argument_numeric { |
10 | - var $content_field; |
|
10 | + var $content_field; |
|
11 | 11 | |
12 | - function construct() { |
|
12 | + function construct() { |
|
13 | 13 | parent::construct(); |
14 | 14 | |
15 | 15 | $this->content_field = content_fields($this->definition['content_field_name']); |
16 | 16 | $this->additional_fields = $this->definition['additional fields']; |
17 | - } |
|
17 | + } |
|
18 | 18 | } |
19 | 19 | \ No newline at end of file |
@@ -7,11 +7,11 @@ |
||
7 | 7 | * for field-specific subclasses to use if they need to. |
8 | 8 | */ |
9 | 9 | class content_handler_filter_string extends views_handler_filter_string { |
10 | - var $content_field; |
|
10 | + var $content_field; |
|
11 | 11 | |
12 | - function construct() { |
|
12 | + function construct() { |
|
13 | 13 | parent::construct(); |
14 | 14 | $this->content_field = content_fields($this->definition['content_field_name']); |
15 | 15 | $this->additional_fields = $this->definition['additional fields']; |
16 | - } |
|
16 | + } |
|
17 | 17 | } |
18 | 18 | \ No newline at end of file |
@@ -7,68 +7,68 @@ |
||
7 | 7 | * values by allowing the views administrator to select deltas. |
8 | 8 | */ |
9 | 9 | class content_handler_sort extends views_handler_sort { |
10 | - var $content_field; |
|
10 | + var $content_field; |
|
11 | 11 | |
12 | - function construct() { |
|
12 | + function construct() { |
|
13 | 13 | parent::construct(); |
14 | 14 | |
15 | 15 | $this->content_field = content_fields($this->definition['content_field_name']); |
16 | 16 | $this->additional_fields = $this->definition['additional fields']; |
17 | - } |
|
17 | + } |
|
18 | 18 | |
19 | - function option_definition() { |
|
19 | + function option_definition() { |
|
20 | 20 | $options = parent::option_definition(); |
21 | 21 | $options['delta'] = array('default' => -1); |
22 | 22 | |
23 | 23 | return $options; |
24 | - } |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * Add a delta selector for multiple fields. |
|
28 | - */ |
|
29 | - function options_form(&$form, &$form_state) { |
|
26 | + /** |
|
27 | + * Add a delta selector for multiple fields. |
|
28 | + */ |
|
29 | + function options_form(&$form, &$form_state) { |
|
30 | 30 | $field = $this->content_field; |
31 | 31 | parent::options_form($form, $form_state); |
32 | 32 | |
33 | 33 | // Only add the form gadget if the field is multiple. |
34 | 34 | if ($field['multiple']) { |
35 | - $max_delta = $field['multiple']; |
|
36 | - // 1 means unlimited. |
|
37 | - if ($max_delta == 1) { |
|
35 | + $max_delta = $field['multiple']; |
|
36 | + // 1 means unlimited. |
|
37 | + if ($max_delta == 1) { |
|
38 | 38 | $max_delta = 10; |
39 | - } |
|
39 | + } |
|
40 | 40 | |
41 | - $options = array('-1' => t('All')); |
|
42 | - for ($i = 0; $i < $max_delta; $i++) { |
|
41 | + $options = array('-1' => t('All')); |
|
42 | + for ($i = 0; $i < $max_delta; $i++) { |
|
43 | 43 | $options[$i] = $i + 1; |
44 | - } |
|
45 | - $form['delta'] = array( |
|
44 | + } |
|
45 | + $form['delta'] = array( |
|
46 | 46 | '#type' => 'select', |
47 | 47 | '#options' => $options, |
48 | 48 | '#default_value' => $this->options['delta'], |
49 | 49 | '#title' => t('Delta'), |
50 | 50 | '#description' => t('The delta allows you to select which item in a multiple value field will be used for sorting. Select "1" to use the first item, "2" for the second item, and so on. If you select "All", each item in the field will create a new row, which may appear to cause duplicates.'), |
51 | - ); |
|
51 | + ); |
|
52 | + } |
|
52 | 53 | } |
53 | - } |
|
54 | 54 | |
55 | - function ensure_my_table() { |
|
55 | + function ensure_my_table() { |
|
56 | 56 | if (!isset($this->table_alias)) { |
57 | - $join = $this->get_join(); |
|
58 | - if (!isset($join->extra)) { |
|
57 | + $join = $this->get_join(); |
|
58 | + if (!isset($join->extra)) { |
|
59 | 59 | $join->extra = array(); |
60 | - } |
|
61 | - $delta = isset($this->options['delta']) ? $this->options['delta'] : -1; |
|
62 | - if ($delta != -1) { |
|
60 | + } |
|
61 | + $delta = isset($this->options['delta']) ? $this->options['delta'] : -1; |
|
62 | + if ($delta != -1) { |
|
63 | 63 | $join->extra[] = array( |
64 | - 'field' => 'delta', |
|
65 | - 'value' => $delta, |
|
66 | - 'numeric' => TRUE, |
|
64 | + 'field' => 'delta', |
|
65 | + 'value' => $delta, |
|
66 | + 'numeric' => TRUE, |
|
67 | 67 | ); |
68 | - } |
|
68 | + } |
|
69 | 69 | |
70 | - $this->table_alias = $this->query->ensure_table($this->table, $this->relationship, $join); |
|
70 | + $this->table_alias = $this->query->ensure_table($this->table, $this->relationship, $join); |
|
71 | 71 | } |
72 | 72 | return $this->table_alias; |
73 | - } |
|
73 | + } |
|
74 | 74 | } |
75 | 75 | \ No newline at end of file |
@@ -62,7 +62,7 @@ |
||
62 | 62 | $join->extra[] = array( |
63 | 63 | 'field' => 'delta', |
64 | 64 | 'value' => $delta, |
65 | - 'numeric' => TRUE, |
|
65 | + 'numeric' => true, |
|
66 | 66 | ); |
67 | 67 | } |
68 | 68 |
@@ -7,36 +7,36 @@ |
||
7 | 7 | * for field-specific subclasses to use if they need to. |
8 | 8 | */ |
9 | 9 | class content_handler_filter_many_to_one extends views_handler_filter_many_to_one { |
10 | - var $content_field; |
|
10 | + var $content_field; |
|
11 | 11 | |
12 | - function construct() { |
|
12 | + function construct() { |
|
13 | 13 | parent::construct(); |
14 | 14 | $this->content_field = content_fields($this->definition['content_field_name']); |
15 | 15 | $this->additional_fields = $this->definition['additional fields']; |
16 | 16 | $field = $this->content_field; |
17 | 17 | $this->value_title = $field['widget']['label']; |
18 | - } |
|
18 | + } |
|
19 | 19 | |
20 | - function get_value_options() { |
|
20 | + function get_value_options() { |
|
21 | 21 | $this->value_options = $this->allowed_values(); |
22 | - } |
|
22 | + } |
|
23 | 23 | |
24 | - // Get allowed values from hook_allowed_values(), if any, |
|
25 | - // or from content_allowed_values(); |
|
26 | - function allowed_values() { |
|
24 | + // Get allowed values from hook_allowed_values(), if any, |
|
25 | + // or from content_allowed_values(); |
|
26 | + function allowed_values() { |
|
27 | 27 | $field = $this->content_field; |
28 | 28 | $function = $field['module'] .'_allowed_values'; |
29 | 29 | if ($this->value_form_type == 'select') { |
30 | - // Select elements accept multidimensional arrays to support optgroups. |
|
31 | - $options = function_exists($function) ? $function($field) : content_allowed_values($field, FALSE); |
|
32 | - // For selects, HTML should be filtered out and entities left unencoded. |
|
33 | - // See content_allowed_values / content_filter_xss / filter_xss. |
|
34 | - content_allowed_values_filter_html($options); |
|
30 | + // Select elements accept multidimensional arrays to support optgroups. |
|
31 | + $options = function_exists($function) ? $function($field) : content_allowed_values($field, FALSE); |
|
32 | + // For selects, HTML should be filtered out and entities left unencoded. |
|
33 | + // See content_allowed_values / content_filter_xss / filter_xss. |
|
34 | + content_allowed_values_filter_html($options); |
|
35 | 35 | } |
36 | 36 | else { |
37 | - $options = function_exists($function) ? $function($field) : content_allowed_values($field); |
|
37 | + $options = function_exists($function) ? $function($field) : content_allowed_values($field); |
|
38 | 38 | } |
39 | 39 | return (array) $options; |
40 | - } |
|
40 | + } |
|
41 | 41 | |
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | // or from content_allowed_values(); |
26 | 26 | function allowed_values() { |
27 | 27 | $field = $this->content_field; |
28 | - $function = $field['module'] .'_allowed_values'; |
|
28 | + $function = $field['module'].'_allowed_values'; |
|
29 | 29 | if ($this->value_form_type == 'select') { |
30 | 30 | // Select elements accept multidimensional arrays to support optgroups. |
31 | 31 | $options = function_exists($function) ? $function($field) : content_allowed_values($field, FALSE); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | else { |
37 | 37 | $options = function_exists($function) ? $function($field) : content_allowed_values($field); |
38 | 38 | } |
39 | - return (array) $options; |
|
39 | + return (array)$options; |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -32,8 +32,7 @@ |
||
32 | 32 | // For selects, HTML should be filtered out and entities left unencoded. |
33 | 33 | // See content_allowed_values / content_filter_xss / filter_xss. |
34 | 34 | content_allowed_values_filter_html($options); |
35 | - } |
|
36 | - else { |
|
35 | + } else { |
|
37 | 36 | $options = function_exists($function) ? $function($field) : content_allowed_values($field); |
38 | 37 | } |
39 | 38 | return (array) $options; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $function = $field['module'] .'_allowed_values'; |
29 | 29 | if ($this->value_form_type == 'select') { |
30 | 30 | // Select elements accept multidimensional arrays to support optgroups. |
31 | - $options = function_exists($function) ? $function($field) : content_allowed_values($field, FALSE); |
|
31 | + $options = function_exists($function) ? $function($field) : content_allowed_values($field, false); |
|
32 | 32 | // For selects, HTML should be filtered out and entities left unencoded. |
33 | 33 | // See content_allowed_values / content_filter_xss / filter_xss. |
34 | 34 | content_allowed_values_filter_html($options); |
@@ -7,12 +7,12 @@ |
||
7 | 7 | * for field-specific subclasses to use if they need to. |
8 | 8 | */ |
9 | 9 | class content_handler_argument extends views_handler_argument { |
10 | - var $content_field; |
|
10 | + var $content_field; |
|
11 | 11 | |
12 | - function construct() { |
|
12 | + function construct() { |
|
13 | 13 | parent::construct(); |
14 | 14 | |
15 | 15 | $this->content_field = content_fields($this->definition['content_field_name']); |
16 | 16 | $this->additional_fields = $this->definition['additional fields']; |
17 | - } |
|
17 | + } |
|
18 | 18 | } |
19 | 19 | \ No newline at end of file |
@@ -6,43 +6,43 @@ |
||
6 | 6 | * Handler for 'content_handler_argument_many_to_one' style. |
7 | 7 | */ |
8 | 8 | class content_handler_argument_many_to_one extends views_handler_argument_many_to_one { |
9 | - var $content_field; |
|
9 | + var $content_field; |
|
10 | 10 | |
11 | - function construct() { |
|
11 | + function construct() { |
|
12 | 12 | parent::construct(); |
13 | 13 | |
14 | 14 | $this->content_field = content_fields($this->definition['content_field_name']); |
15 | 15 | $this->additional_fields = $this->definition['additional fields']; |
16 | - } |
|
16 | + } |
|
17 | 17 | |
18 | - function summary_name($data) { |
|
18 | + function summary_name($data) { |
|
19 | 19 | $options = $this->allowed_values(); |
20 | 20 | $value = $data->{$this->name_alias}; |
21 | 21 | if (isset($options[$value])) { |
22 | - $value = $options[$value]; |
|
22 | + $value = $options[$value]; |
|
23 | 23 | } |
24 | 24 | else { |
25 | - $value = parent::summary_name($data); |
|
25 | + $value = parent::summary_name($data); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | return $value; |
29 | - } |
|
29 | + } |
|
30 | 30 | |
31 | - function title_query() { |
|
31 | + function title_query() { |
|
32 | 32 | $options = $this->allowed_values(); |
33 | 33 | $values = $this->value; |
34 | 34 | foreach ($values as $key => $value) { |
35 | - if (isset($options[$value])) { |
|
35 | + if (isset($options[$value])) { |
|
36 | 36 | $values[$key] = $options[$value]; |
37 | - } |
|
37 | + } |
|
38 | 38 | } |
39 | 39 | return $values; |
40 | - } |
|
40 | + } |
|
41 | 41 | |
42 | - function allowed_values() { |
|
42 | + function allowed_values() { |
|
43 | 43 | $field = $this->content_field; |
44 | 44 | $function = $field['module'] .'_allowed_values'; |
45 | 45 | $options = function_exists($function) ? $function($field) : content_allowed_values($field); |
46 | 46 | return (array) $options; |
47 | - } |
|
47 | + } |
|
48 | 48 | } |
49 | 49 | \ No newline at end of file |
@@ -41,8 +41,8 @@ |
||
41 | 41 | |
42 | 42 | function allowed_values() { |
43 | 43 | $field = $this->content_field; |
44 | - $function = $field['module'] .'_allowed_values'; |
|
44 | + $function = $field['module'].'_allowed_values'; |
|
45 | 45 | $options = function_exists($function) ? $function($field) : content_allowed_values($field); |
46 | - return (array) $options; |
|
46 | + return (array)$options; |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | \ No newline at end of file |
@@ -20,8 +20,7 @@ |
||
20 | 20 | $value = $data->{$this->name_alias}; |
21 | 21 | if (isset($options[$value])) { |
22 | 22 | $value = $options[$value]; |
23 | - } |
|
24 | - else { |
|
23 | + } else { |
|
25 | 24 | $value = parent::summary_name($data); |
26 | 25 | } |
27 | 26 |
@@ -7,11 +7,11 @@ |
||
7 | 7 | * for field-specific subclasses to use if they need to. |
8 | 8 | */ |
9 | 9 | class content_handler_filter_numeric extends views_handler_filter_numeric { |
10 | - var $content_field; |
|
10 | + var $content_field; |
|
11 | 11 | |
12 | - function construct() { |
|
12 | + function construct() { |
|
13 | 13 | parent::construct(); |
14 | 14 | $this->content_field = content_fields($this->definition['content_field_name']); |
15 | 15 | $this->additional_fields = $this->definition['additional fields']; |
16 | - } |
|
16 | + } |
|
17 | 17 | } |
18 | 18 | \ No newline at end of file |
@@ -10,17 +10,17 @@ |
||
10 | 10 | // Ensure compatibility with Views pre 2.4, where the |
11 | 11 | // views_handler_filter_float class lived in views_handler_filter_numeric.inc. |
12 | 12 | if (!class_exists('views_handler_filter_float')) { |
13 | - // Manually include the parent class. |
|
14 | - $definition = views_fetch_handler_data('views_handler_filter_numeric'); |
|
15 | - views_include_handler($definition, 'handler'); |
|
13 | + // Manually include the parent class. |
|
14 | + $definition = views_fetch_handler_data('views_handler_filter_numeric'); |
|
15 | + views_include_handler($definition, 'handler'); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | class content_handler_filter_float extends views_handler_filter_float { |
19 | - var $content_field; |
|
19 | + var $content_field; |
|
20 | 20 | |
21 | - function construct() { |
|
21 | + function construct() { |
|
22 | 22 | parent::construct(); |
23 | 23 | $this->content_field = content_fields($this->definition['content_field_name']); |
24 | 24 | $this->additional_fields = $this->definition['additional fields']; |
25 | - } |
|
25 | + } |
|
26 | 26 | } |
27 | 27 | \ No newline at end of file |