| @@ -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,11 +208,11 @@ 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 && $result->CMSEditLink) { | |
| 213 | +            if ($result->HasCMSEditLink && $result->CMSEditLink) { | |
| 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 is a variable, not a method! | 
| 217 | 217 | $this->redirect($result->CMSEditLink); | 
| 218 | 218 | } | 
| @@ -220,7 +220,7 @@ discard block | ||
| 220 | 220 | } | 
| 221 | 221 | // Accessing the session | 
| 222 | 222 | $session = $this->getRequest()->getSession(); | 
| 223 | -        if($session) { | |
| 223 | +        if ($session) { | |
| 224 | 224 |              $session->set('QuickSearchLastResults', serialize($results->toArray())); | 
| 225 | 225 | } | 
| 226 | 226 | return $results; | 
| @@ -251,16 +251,16 @@ discard block | ||
| 251 | 251 |      { | 
| 252 | 252 | // Accessing the session | 
| 253 | 253 | $session = $this->getRequest()->getSession(); | 
| 254 | -        if($this->quickSearchType) { | |
| 254 | +        if ($this->quickSearchType) { | |
| 255 | 255 |              $session->set('QuickSearchType', $this->quickSearchType); | 
| 256 | -        } elseif($session) { | |
| 256 | +        } elseif ($session) { | |
| 257 | 257 |              $this->quickSearchType = $session->get('QuickSearchType'); | 
| 258 | -            if(isset($_GET['flush'])) { | |
| 258 | +            if (isset($_GET['flush'])) { | |
| 259 | 259 | $this->quickSearchType = ''; | 
| 260 | 260 |                  $session->set('QuickSearchType', ''); | 
| 261 | 261 | } | 
| 262 | 262 | } | 
| 263 | -        if(!$this->quickSearchType) { | |
| 263 | +        if (!$this->quickSearchType) { | |
| 264 | 264 |              $this->quickSearchType = $this->Config()->get('default_quick_search_type'); | 
| 265 | 265 | } | 
| 266 | 266 | return (string) $this->quickSearchType; | 
| @@ -270,15 +270,15 @@ discard block | ||
| 270 | 270 |      { | 
| 271 | 271 | // Accessing the session | 
| 272 | 272 | $session = $this->getRequest()->getSession(); | 
| 273 | -        if($session) { | |
| 274 | -            if(isset($_GET['flush'])) { | |
| 273 | +        if ($session) { | |
| 274 | +            if (isset($_GET['flush'])) { | |
| 275 | 275 |                  $session->clear('QuickSearchLastResults'); | 
| 276 | 276 |              } else { | 
| 277 | 277 |                  $data = $session->get('QuickSearchLastResults'); | 
| 278 | -                if($data) { | |
| 278 | +                if ($data) { | |
| 279 | 279 | $array = unserialize($data); | 
| 280 | 280 | $al = ArrayList::create(); | 
| 281 | -                    foreach($array as $item) { | |
| 281 | +                    foreach ($array as $item) { | |
| 282 | 282 | $al->push($item); | 
| 283 | 283 | } | 
| 284 | 284 | return $al; |