@@ -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 |          $this->addExtraClass('ckan-resource-locator__container'); | 
                                                        
@@ -144,7 +144,7 @@ discard block  | 
                                                    ||
| 144 | 144 |          $resource = $dataObject->{$this->name}; | 
                                                        
| 145 | 145 | |
| 146 | 146 |          if (!$resource || !$resource instanceof DataObjectInterface) { | 
                                                        
| 147 | -            throw new InvalidArgumentException('Could not determine where to save the value of ' . __CLASS__); | 
                                                        |
| 147 | +            throw new InvalidArgumentException('Could not determine where to save the value of '.__CLASS__); | 
                                                        |
| 148 | 148 | }  | 
                                                        
| 149 | 149 | |
| 150 | 150 | // Pull the value that'll be null or an associative array of our specification  | 
                                                        
@@ -191,7 +191,7 @@ discard block  | 
                                                    ||
| 191 | 191 |      { | 
                                                        
| 192 | 192 | // Allow empty site names  | 
                                                        
| 193 | 193 |          if ($this->siteName === null) { | 
                                                        
| 194 | - return _t(__CLASS__ . '.GENERIC_SITE_NAME', 'a CKAN website');  | 
                                                        |
| 194 | + return _t(__CLASS__.'.GENERIC_SITE_NAME', 'a CKAN website');  | 
                                                        |
| 195 | 195 | }  | 
                                                        
| 196 | 196 | |
| 197 | 197 | return $this->siteName;  | 
                                                        
@@ -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 | }  | 
                                                        
@@ -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 | /**  | 
                                                        
@@ -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(  | 
                                                        
@@ -72,7 +72,7 @@ discard block  | 
                                                    ||
| 72 | 72 |                  if ($resource->Name) { | 
                                                        
| 73 | 73 | $title = $resource->Name;  | 
                                                        
| 74 | 74 |                      if ($resource->ResourceName) { | 
                                                        
| 75 | - $title .= ' / ' . $resource->ResourceName;  | 
                                                        |
| 75 | + $title .= ' / '.$resource->ResourceName;  | 
                                                        |
| 76 | 76 | }  | 
                                                        
| 77 | 77 | $resourceFields->setTitle($title);  | 
                                                        
| 78 | 78 | }  | 
                                                        
@@ -90,11 +90,11 @@ discard block  | 
                                                    ||
| 90 | 90 | $columns = $component->getDisplayFields($resourceFields);  | 
                                                        
| 91 | 91 | |
| 92 | 92 | // We only want to change the labels for the GridField view, not the model's edit form  | 
                                                        
| 93 | - $columns['ShowInResultsView'] = _t(__CLASS__ . '.IN_RESULTS', 'In Results');  | 
                                                        |
| 94 | - $columns['ShowInDetailView'] = _t(__CLASS__ . '.IN_DETAIL', 'In Detail');  | 
                                                        |
| 93 | + $columns['ShowInResultsView'] = _t(__CLASS__.'.IN_RESULTS', 'In Results');  | 
                                                        |
| 94 | + $columns['ShowInDetailView'] = _t(__CLASS__.'.IN_DETAIL', 'In Detail');  | 
                                                        |
| 95 | 95 | |
| 96 | 96 | // Abbreviate the position title  | 
                                                        
| 97 | - $columns['Position'] = _t(__CLASS__ . '.POS', 'Pos.', 'Abbreviated version of position');  | 
                                                        |
| 97 | + $columns['Position'] = _t(__CLASS__.'.POS', 'Pos.', 'Abbreviated version of position');  | 
                                                        |
| 98 | 98 | |
| 99 | 99 | $editable = array_flip(['ShowInResultsView', 'ShowInDetailView']);  | 
                                                        
| 100 | 100 | $component->setDisplayFields(array_diff_key($columns, $editable));  | 
                                                        
@@ -130,7 +130,7 @@ discard block  | 
                                                    ||
| 130 | 130 | $fields = parent::getSettingsFields();  | 
                                                        
| 131 | 131 | |
| 132 | 132 |          $fields->addFieldsToTab('Root.Settings', [ | 
                                                        
| 133 | -            TextField::create('ItemsPerPage', _t(__CLASS__ . '.ITEMS_PER_PAGE', 'Items per page')), | 
                                                        |
| 133 | +            TextField::create('ItemsPerPage', _t(__CLASS__.'.ITEMS_PER_PAGE', 'Items per page')), | 
                                                        |
| 134 | 134 | ]);  | 
                                                        
| 135 | 135 | |
| 136 | 136 | return $fields;  |