@@ -56,8 +56,8 @@ |
||
56 | 56 | public static function getMatchOptions() |
57 | 57 | { |
58 | 58 | return [ |
59 | - ['value' => self::MATCH_TYPE_MUST, 'title' => _t(__CLASS__ . '.MUST_MATCH', 'Must match')], |
|
60 | - ['value' => self::MATCH_TYPE_MUST_NOT, 'title' => _t(__CLASS__ . '.MUST_NOT_MATCH', 'Must not match')], |
|
59 | + ['value' => self::MATCH_TYPE_MUST, 'title' => _t(__CLASS__.'.MUST_MATCH', 'Must match')], |
|
60 | + ['value' => self::MATCH_TYPE_MUST_NOT, 'title' => _t(__CLASS__.'.MUST_NOT_MATCH', 'Must not match')], |
|
61 | 61 | ]; |
62 | 62 | } |
63 | 63 | } |
@@ -24,10 +24,10 @@ |
||
24 | 24 | |
25 | 25 | public function getCMSFields() |
26 | 26 | { |
27 | - $this->beforeUpdateCMSFields(function (FieldList $fields) { |
|
27 | + $this->beforeUpdateCMSFields(function(FieldList $fields) { |
|
28 | 28 | $fields->push(TextField::create( |
29 | 29 | 'Options', |
30 | - _t(__CLASS__ . '.OPTIONS', 'Dropdown options') |
|
30 | + _t(__CLASS__.'.OPTIONS', 'Dropdown options') |
|
31 | 31 | )); |
32 | 32 | }); |
33 | 33 |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | |
55 | 55 | public function getCMSFields() |
56 | 56 | { |
57 | - $this->beforeUpdateCMSFields(function (FieldList $fields) { |
|
57 | + $this->beforeUpdateCMSFields(function(FieldList $fields) { |
|
58 | 58 | $originalLabel = ReadonlyField::create('OriginalLabel') |
59 | 59 | ->setDescription(_t( |
60 | - __CLASS__ . '.ORIGINAL_LABEL_DESCRIPTION', |
|
60 | + __CLASS__.'.ORIGINAL_LABEL_DESCRIPTION', |
|
61 | 61 | 'Title of this field as provided by the CKAN resource' |
62 | 62 | )); |
63 | 63 | $fields->replaceField('OriginalLabel', $originalLabel); |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | $fields->removeByName('Type'); |
69 | 69 | |
70 | 70 | $positionField = NumericField::create('Position') |
71 | - ->setTitle(_t(__CLASS__ . '.ORDER_LABEL', 'Presented order')) |
|
71 | + ->setTitle(_t(__CLASS__.'.ORDER_LABEL', 'Presented order')) |
|
72 | 72 | ->setDescription(_t( |
73 | - __CLASS__ . '.ORDER_DENOMINATOR', |
|
73 | + __CLASS__.'.ORDER_DENOMINATOR', |
|
74 | 74 | 'of {count} columns', |
75 | 75 | ['count' => static::get()->filter('ResourceID', $this->ResourceID)->count()] |
76 | 76 | )) |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | ->addExtraClass('visibility-options__option'); |
84 | 84 | $duplicates = $fields->dataFieldByName('RemoveDuplicates') |
85 | 85 | ->setTitle( |
86 | - _t(__CLASS__ . '.REMOVE_DUPLICATES_LABEL', 'Only show one value if duplicates exist') |
|
86 | + _t(__CLASS__.'.REMOVE_DUPLICATES_LABEL', 'Only show one value if duplicates exist') |
|
87 | 87 | ) |
88 | 88 | ->addExtraClass('visibility-options__option'); |
89 | 89 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | 'DisplayConditions', |
100 | 100 | ResultConditionsField::create( |
101 | 101 | 'DisplayConditions', |
102 | - _t(__CLASS__ . '.RESULT_CONDITIONS', 'Result conditions') |
|
102 | + _t(__CLASS__.'.RESULT_CONDITIONS', 'Result conditions') |
|
103 | 103 | ) |
104 | 104 | ); |
105 | 105 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | public function getCMSFields() |
62 | 62 | { |
63 | - $this->beforeUpdateCMSFields(function (FieldList $fields) { |
|
63 | + $this->beforeUpdateCMSFields(function(FieldList $fields) { |
|
64 | 64 | $allColumnsField = $fields->dataFieldByName('AllColumns'); |
65 | 65 | $allColumnsField->addExtraClass('ckan-columns__all-columns'); |
66 | 66 | |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | $columnSources = CompositeField::create($allColumnsField, $filterFields); |
79 | 79 | $columnSources |
80 | - ->setTitle(_t(__CLASS__ . '.COLUMNS_SOURCES', 'Columns source(s)')) |
|
80 | + ->setTitle(_t(__CLASS__.'.COLUMNS_SOURCES', 'Columns source(s)')) |
|
81 | 81 | ->addExtraClass('ckan-columns__sources'); |
82 | 82 | $fields->push($columnSources); |
83 | 83 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | return DBField::create_Field( |
133 | 133 | 'HTMLFragment', |
134 | 134 | '<span class="ckan-columns--all-columns">' |
135 | - . _t(__CLASS__ . '.ALL_COLUMNS', 'All columns') |
|
135 | + . _t(__CLASS__.'.ALL_COLUMNS', 'All columns') |
|
136 | 136 | . '</span>' |
137 | 137 | ); |
138 | 138 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | return DBField::create_Field( |
149 | 149 | 'HTMLFragment', |
150 | 150 | '<span class="ckan-columns--multiple">' |
151 | - . _t(__CLASS__ . '.MULTIPLE_COLUMNS', 'Multiple columns') |
|
151 | + . _t(__CLASS__.'.MULTIPLE_COLUMNS', 'Multiple columns') |
|
152 | 152 | . '</span>' |
153 | 153 | ); |
154 | 154 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | public function getCMSFields() |
48 | 48 | { |
49 | - $this->beforeUpdateCMSFields(function (FieldList $fields) { |
|
49 | + $this->beforeUpdateCMSFields(function(FieldList $fields) { |
|
50 | 50 | $resource = $this->DataResource(); |
51 | 51 | |
52 | 52 | $fields->addFieldToTab( |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | $columns = $component->getDisplayFields($resourceFields); |
82 | 82 | |
83 | 83 | // We only want to change the labels for the GridField view, not the model's edit form |
84 | - $columns['ShowInResultsView'] = _t(__CLASS__ . '.IN_RESULTS', 'In Results'); |
|
85 | - $columns['ShowInDetailView'] = _t(__CLASS__ . '.IN_DETAIL', 'In Detail'); |
|
84 | + $columns['ShowInResultsView'] = _t(__CLASS__.'.IN_RESULTS', 'In Results'); |
|
85 | + $columns['ShowInDetailView'] = _t(__CLASS__.'.IN_DETAIL', 'In Detail'); |
|
86 | 86 | |
87 | 87 | // Abbreviate the position title |
88 | - $columns['Position'] = _t(__CLASS__ . '.POS', 'Pos.', 'Abbreviated version of position'); |
|
88 | + $columns['Position'] = _t(__CLASS__.'.POS', 'Pos.', 'Abbreviated version of position'); |
|
89 | 89 | |
90 | 90 | $editable = array_flip(['ShowInResultsView', 'ShowInDetailView']); |
91 | 91 | $component->setDisplayFields(array_diff_key($columns, $editable)); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $fields = parent::getSettingsFields(); |
122 | 122 | |
123 | 123 | $fields->addFieldsToTab('Root.Settings', [ |
124 | - TextField::create('ItemsPerPage', _t(__CLASS__ . '.ITEMS_PER_PAGE', 'Items per page')), |
|
124 | + TextField::create('ItemsPerPage', _t(__CLASS__.'.ITEMS_PER_PAGE', 'Items per page')), |
|
125 | 125 | ]); |
126 | 126 | |
127 | 127 | return $fields; |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | use Injectable; |
19 | 19 | |
20 | 20 | private static $dependencies = [ |
21 | - 'GuzzleClient' => '%$' . Client::class, |
|
21 | + 'GuzzleClient' => '%$'.Client::class, |
|
22 | 22 | ]; |
23 | 23 | |
24 | 24 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | $statusCode = $response->getStatusCode(); |
86 | 86 | if ($statusCode < 200 || $statusCode >= 300) { |
87 | - throw new RuntimeException('CKAN API is not available. Error code ' . $statusCode); |
|
87 | + throw new RuntimeException('CKAN API is not available. Error code '.$statusCode); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | if (!count(preg_grep('#application/json#', $response->getHeader('Content-Type')))) { |
@@ -16,7 +16,7 @@ |
||
16 | 16 | use Injectable; |
17 | 17 | |
18 | 18 | private static $dependencies = [ |
19 | - 'APIClient' => '%$' . APIClientInterface::class, |
|
19 | + 'APIClient' => '%$'.APIClientInterface::class, |
|
20 | 20 | ]; |
21 | 21 | |
22 | 22 | /** |
@@ -41,7 +41,7 @@ |
||
41 | 41 | { |
42 | 42 | $data = ArrayData::create([ |
43 | 43 | 'Resource' => $this->resource, |
44 | - 'EditLinkTitle' => _t(__CLASS__ . '.EDIT_LINK_TITLE', 'Edit resource'), |
|
44 | + 'EditLinkTitle' => _t(__CLASS__.'.EDIT_LINK_TITLE', 'Edit resource'), |
|
45 | 45 | ]); |
46 | 46 | $result = $data->renderWith(__CLASS__); |
47 | 47 |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | |
66 | 66 | // Set a default description |
67 | 67 | $this->setDescription(_t( |
68 | - __CLASS__ . '.DESCRIPTION', |
|
68 | + __CLASS__.'.DESCRIPTION', |
|
69 | 69 | 'Connect to a data source from {site}. Once added and saved you can configure the appearance and add search' |
70 | 70 | . ' filters.', |
71 | - [ 'site' => $this->getSiteName() ] |
|
71 | + ['site' => $this->getSiteName()] |
|
72 | 72 | )); |
73 | 73 | } |
74 | 74 | |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $resource = $dataObject->{$this->name}; |
142 | 142 | |
143 | 143 | if (!$resource || !$resource instanceof DataObjectInterface) { |
144 | - throw new InvalidArgumentException('Could not determine where to save the value of ' . __CLASS__); |
|
144 | + throw new InvalidArgumentException('Could not determine where to save the value of '.__CLASS__); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | // Pull the value that'll be null or an associative array of our specification |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | { |
189 | 189 | // Allow empty site names |
190 | 190 | if ($this->siteName === null) { |
191 | - return _t(__CLASS__ . '.GENERIC_SITE_NAME', 'a CKAN website'); |
|
191 | + return _t(__CLASS__.'.GENERIC_SITE_NAME', 'a CKAN website'); |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | return $this->siteName; |