@@ -57,8 +57,8 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | protected function init() |
| 59 | 59 | { |
| 60 | - if($this->request->param('Action')) { |
|
| 61 | - if(empty($this->request->postVars())) { |
|
| 60 | + if ($this->request->param('Action')) { |
|
| 61 | + if (empty($this->request->postVars())) { |
|
| 62 | 62 | $this->redirect('/admin/find'); |
| 63 | 63 | } |
| 64 | 64 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | if (!$this->getRequest()->requestVar('Keywords')) { |
| 113 | 113 | $lastResults = $this->lastSearchResults(); |
| 114 | - if($lastResults) { |
|
| 114 | + if ($lastResults) { |
|
| 115 | 115 | $resultsTitle = 'Last Results'; |
| 116 | 116 | } else { |
| 117 | 117 | $resultsTitle = 'Last Edited'; |
@@ -181,9 +181,9 @@ discard block |
||
| 181 | 181 | Environment::increaseTimeLimitTo(300); |
| 182 | 182 | Environment::setMemoryLimitMax(-1); |
| 183 | 183 | Environment::increaseMemoryLimitTo(-1); |
| 184 | - if(empty($this->rawData)) { |
|
| 184 | + if (empty($this->rawData)) { |
|
| 185 | 185 | $lastResults = $this->lastSearchResults(); |
| 186 | - if($lastResults) { |
|
| 186 | + if ($lastResults) { |
|
| 187 | 187 | return $lastResults; |
| 188 | 188 | } |
| 189 | 189 | } |
@@ -208,18 +208,18 @@ discard block |
||
| 208 | 208 | ->setWordsAsString($this->keywords) |
| 209 | 209 | ->getLinks() |
| 210 | 210 | ; |
| 211 | - if($results->count() === 1) { |
|
| 211 | + if ($results->count() === 1) { |
|
| 212 | 212 | $result = $results->first(); |
| 213 | - if($result->HasCMSEditLink) { |
|
| 213 | + if ($result->HasCMSEditLink) { |
|
| 214 | 214 | // files do not re-redirect nicely... |
| 215 | - if(!in_array(File::class, ClassInfo::ancestry($result->ClassName), true)) { |
|
| 215 | + if (!in_array(File::class, ClassInfo::ancestry($result->ClassName), true)) { |
|
| 216 | 216 | $this->redirect($result->CMSEditLink()); |
| 217 | 217 | } |
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | // Accessing the session |
| 221 | 221 | $session = $this->getRequest()->getSession(); |
| 222 | - if($session) { |
|
| 222 | + if ($session) { |
|
| 223 | 223 | $session->set('QuickSearchLastResults', serialize($results->toArray())); |
| 224 | 224 | } |
| 225 | 225 | return $results; |
@@ -250,16 +250,16 @@ discard block |
||
| 250 | 250 | { |
| 251 | 251 | // Accessing the session |
| 252 | 252 | $session = $this->getRequest()->getSession(); |
| 253 | - if($this->quickSearchType) { |
|
| 253 | + if ($this->quickSearchType) { |
|
| 254 | 254 | $session->set('QuickSearchType', $this->quickSearchType); |
| 255 | - } elseif($session) { |
|
| 255 | + } elseif ($session) { |
|
| 256 | 256 | $this->quickSearchType = $session->get('QuickSearchType'); |
| 257 | - if(isset($_GET['flush'])) { |
|
| 257 | + if (isset($_GET['flush'])) { |
|
| 258 | 258 | $this->quickSearchType = ''; |
| 259 | 259 | $session->set('QuickSearchType', ''); |
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | - if(!$this->quickSearchType) { |
|
| 262 | + if (!$this->quickSearchType) { |
|
| 263 | 263 | $this->quickSearchType = $this->Config()->get('default_quick_search_type'); |
| 264 | 264 | } |
| 265 | 265 | return (string) $this->quickSearchType; |
@@ -269,15 +269,15 @@ discard block |
||
| 269 | 269 | { |
| 270 | 270 | // Accessing the session |
| 271 | 271 | $session = $this->getRequest()->getSession(); |
| 272 | - if($session) { |
|
| 273 | - if(isset($_GET['flush'])) { |
|
| 272 | + if ($session) { |
|
| 273 | + if (isset($_GET['flush'])) { |
|
| 274 | 274 | $session->clear('QuickSearchLastResults'); |
| 275 | 275 | } else { |
| 276 | 276 | $data = $session->get('QuickSearchLastResults'); |
| 277 | - if($data) { |
|
| 277 | + if ($data) { |
|
| 278 | 278 | $array = unserialize($data); |
| 279 | 279 | $al = ArrayList::create(); |
| 280 | - foreach($array as $item) { |
|
| 280 | + foreach ($array as $item) { |
|
| 281 | 281 | $al->push($item); |
| 282 | 282 | } |
| 283 | 283 | return $al; |