Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 44 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
PFEnumInput | |
0.00% |
0 / 44 |
|
0.00% |
0 / 4 |
42 | |
0.00% |
0 / 1 |
getOtherPropTypesHandled | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getOtherCargoTypesHandled | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getValuesParameters | |
0.00% |
0 / 34 |
|
0.00% |
0 / 1 |
12 | |||
getParameters | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * @file |
4 | * @ingroup PF |
5 | */ |
6 | |
7 | /** |
8 | * The base class for every form input that holds a pre-set enumeration |
9 | * of values. |
10 | * |
11 | * @ingroup PFFormInput |
12 | */ |
13 | abstract class PFEnumInput extends PFFormInput { |
14 | |
15 | public static function getOtherPropTypesHandled() { |
16 | return [ 'enumeration', '_boo' ]; |
17 | } |
18 | |
19 | public static function getOtherCargoTypesHandled() { |
20 | return [ 'Enumeration', 'Boolean' ]; |
21 | } |
22 | |
23 | public static function getValuesParameters() { |
24 | $params = []; |
25 | $params[] = [ |
26 | 'name' => 'values', |
27 | 'type' => 'string', |
28 | 'description' => wfMessage( 'pf_forminputs_values' )->text() |
29 | ]; |
30 | if ( defined( 'SMW_VERSION' ) ) { |
31 | $params[] = [ |
32 | 'name' => 'values from property', |
33 | 'type' => 'string', |
34 | 'description' => wfMessage( 'pf_forminputs_valuesfromproperty' )->text() |
35 | ]; |
36 | } |
37 | $params[] = [ |
38 | 'name' => 'values from category', |
39 | 'type' => 'string', |
40 | 'description' => wfMessage( 'pf_forminputs_valuesfromcategory' )->text() |
41 | ]; |
42 | $params[] = [ |
43 | 'name' => 'values from namespace', |
44 | 'type' => 'string', |
45 | 'description' => wfMessage( 'pf_forminputs_valuesfromnamespace' )->text() |
46 | ]; |
47 | $params[] = [ |
48 | 'name' => 'values from wikidata', |
49 | 'type' => 'string', |
50 | 'description' => wfMessage( 'pf_forminputs_valuesfromwikidata' )->text() |
51 | ]; |
52 | if ( defined( 'SMW_VERSION' ) ) { |
53 | $params[] = [ |
54 | 'name' => 'values from concept', |
55 | 'type' => 'string', |
56 | 'description' => wfMessage( 'pf_forminputs_valuesfromconcept' )->text() |
57 | ]; |
58 | } |
59 | return $params; |
60 | } |
61 | |
62 | public static function getParameters() { |
63 | $params = parent::getParameters(); |
64 | $params = array_merge( $params, self::getValuesParameters() ); |
65 | $params[] = [ |
66 | 'name' => 'show on select', |
67 | 'type' => 'string', |
68 | 'description' => wfMessage( 'pf_forminputs_showonselect' )->text() |
69 | ]; |
70 | return $params; |
71 | } |
72 | } |