@@ -40,12 +40,12 @@ |
||
| 40 | 40 | Environment::increaseMemoryLimitTo(-1); |
| 41 | 41 | $debug = $request->postVar('debug') ? 'checked="checked"' : ''; |
| 42 | 42 | $word = Convert::raw2sql($request->requestVar('word')); |
| 43 | - if (! is_string($word)) { |
|
| 43 | + if (!is_string($word)) { |
|
| 44 | 44 | $word = ''; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | $replace = Convert::raw2sql($request->requestVar('replace')); |
| 48 | - if (! is_string($replace)) { |
|
| 48 | + if (!is_string($replace)) { |
|
| 49 | 49 | $replace = ''; |
| 50 | 50 | } |
| 51 | 51 | |
@@ -285,8 +285,8 @@ |
||
| 285 | 285 | |
| 286 | 286 | protected function classCanBeIncluded(string $dataObjectClassName): bool |
| 287 | 287 | { |
| 288 | - if(count($this->excludedClasses) || count($this->includedClasses)) { |
|
| 289 | - if(!class_exists($dataObjectClassName)) { |
|
| 288 | + if (count($this->excludedClasses) || count($this->includedClasses)) { |
|
| 289 | + if (!class_exists($dataObjectClassName)) { |
|
| 290 | 290 | return false; |
| 291 | 291 | } |
| 292 | 292 | if (count($this->includedClasses)) { |
@@ -90,7 +90,7 @@ |
||
| 90 | 90 | _t(__CLASS__ . '.ReplaceToggle', 'Replace with ... (optional - make a backup first!)'), |
| 91 | 91 | [ |
| 92 | 92 | (new CheckboxField('ApplyReplace', 'Run replace (please make sure to make a backup first!)', $this->applyReplace)) |
| 93 | - ->setDescription('Check this to replace the searched value set above with its replacement value. Note that searches ignore uppercase / lowercase, but replace actions will only search and replace values with the same upper / lowercase.'), |
|
| 93 | + ->setDescription('Check this to replace the searched value set above with its replacement value. Note that searches ignore uppercase / lowercase, but replace actions will only search and replace values with the same upper / lowercase.'), |
|
| 94 | 94 | (new TextField('ReplaceWith', 'Replace (optional - careful!)', $this->replace ?? '')) |
| 95 | 95 | ->setAttribute('placeholder', 'e.g. contract - make sure to also tick checkbox below'), |
| 96 | 96 | ] |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | ->setWordsAsString($this->keywords) |
| 188 | 188 | ->getLinks() |
| 189 | 189 | ; |
| 190 | - if($results->count() === 1) { |
|
| 190 | + if ($results->count() === 1) { |
|
| 191 | 191 | $result = $results->first(); |
| 192 | 192 | $this->redirect($result->CMSEditLink); |
| 193 | 193 | return null; |
@@ -220,12 +220,12 @@ discard block |
||
| 220 | 220 | { |
| 221 | 221 | // Accessing the session |
| 222 | 222 | $session = $this->getRequest()->getSession(); |
| 223 | - if($this->quickSearchType) { |
|
| 223 | + if ($this->quickSearchType) { |
|
| 224 | 224 | $session->set('QuickSearchType', $this->quickSearchType); |
| 225 | 225 | } else { |
| 226 | 226 | $this->quickSearchType = $session->get('QuickSearchType'); |
| 227 | 227 | } |
| 228 | - if(!$this->quickSearchType) { |
|
| 228 | + if (!$this->quickSearchType) { |
|
| 229 | 229 | $this->quickSearchType = $this->Config()->get('default_quick_search_type'); |
| 230 | 230 | } |
| 231 | 231 | return (string) $this->quickSearchType; |
@@ -32,9 +32,9 @@ |
||
| 32 | 32 | 'limited' => 'Limited search', |
| 33 | 33 | ]; |
| 34 | 34 | $availableSearchClasses = self::available_quick_searches(); |
| 35 | - if(!empty($availableSearchClasses) > 0) { |
|
| 36 | - foreach($availableSearchClasses as $availableSearchClass) { |
|
| 37 | - $array[$availableSearchClass] = Injector::inst()->get($availableSearchClass)->getTitle(); |
|
| 35 | + if (!empty($availableSearchClasses) > 0) { |
|
| 36 | + foreach ($availableSearchClasses as $availableSearchClass) { |
|
| 37 | + $array[$availableSearchClass] = Injector::inst()->get($availableSearchClass)->getTitle(); |
|
| 38 | 38 | } |
| 39 | 39 | } |
| 40 | 40 | return $array; |
@@ -135,13 +135,13 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | public function setQuickSearchType(string $s): SearchApi |
| 137 | 137 | { |
| 138 | - if($s === 'all') { |
|
| 138 | + if ($s === 'all') { |
|
| 139 | 139 | $this->isQuickSearch = false; |
| 140 | 140 | $this->quickSearchType = ''; |
| 141 | - } elseif($s === 'limited') { |
|
| 141 | + } elseif ($s === 'limited') { |
|
| 142 | 142 | $this->isQuickSearch = true; |
| 143 | 143 | $this->quickSearchType = ''; |
| 144 | - } elseif(class_exists($s)) { |
|
| 144 | + } elseif (class_exists($s)) { |
|
| 145 | 145 | $this->quickSearchType = $s; |
| 146 | 146 | $object = Injector::inst()->get($s); |
| 147 | 147 | $this->setIncludedClasses($object->getClassesToSearch()); |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | if ($this->debug) { |
| 341 | 341 | DB::alteration_message(' ... Searching in ' . $className); |
| 342 | 342 | } |
| 343 | - if(count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) { |
|
| 343 | + if (count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) { |
|
| 344 | 344 | continue; |
| 345 | 345 | } |
| 346 | 346 | if (!in_array($className, $this->excludedClasses, true)) { |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | $fields = $this->getAllValidFields($className); |
| 349 | 349 | $filterAny = []; |
| 350 | 350 | foreach ($fields as $field) { |
| 351 | - if(count($this->includedFields) && !in_array($field, $this->includedFields, true)) { |
|
| 351 | + if (count($this->includedFields) && !in_array($field, $this->includedFields, true)) { |
|
| 352 | 352 | continue; |
| 353 | 353 | } |
| 354 | 354 | |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | $array = []; |
| 412 | 412 | $classNames = $this->getAllDataObjects(); |
| 413 | 413 | foreach ($classNames as $className) { |
| 414 | - if(count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) { |
|
| 414 | + if (count($this->includedClasses) && !in_array($className, $this->includedClasses, true)) { |
|
| 415 | 415 | continue; |
| 416 | 416 | } |
| 417 | 417 | if (!in_array($className, $this->excludedClasses, true)) { |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | $items = $this->turnArrayIntoObjects($matches); |
| 483 | 483 | foreach ($items as $item) { |
| 484 | 484 | $link = $finder->getLink($item, $this->excludedClasses); |
| 485 | - if($item->canView()) { |
|
| 485 | + if ($item->canView()) { |
|
| 486 | 486 | $cmsEditLink = $item->canEdit() ? $finder->getCMSEditLink($item) : ''; |
| 487 | 487 | $list->push( |
| 488 | 488 | ArrayData::create( |