| @@ 26-35 (lines=10) @@ | ||
| 23 | public function search() |
|
| 24 | { |
|
| 25 | //Keyword to search. (For pagination) |
|
| 26 | if (!empty($this->request->data['search'])) { |
|
| 27 | $keyword = $this->request->data['search']; |
|
| 28 | $this->request->session()->write('Search.Admin.Users.Keyword', $keyword); |
|
| 29 | } else { |
|
| 30 | if ($this->request->session()->read('Search.Admin.Users.Keyword')) { |
|
| 31 | $keyword = $this->request->session()->read('Search.Admin.Users.Keyword'); |
|
| 32 | } else { |
|
| 33 | $keyword = ''; |
|
| 34 | } |
|
| 35 | } |
|
| 36 | ||
| 37 | //Search type. (For pagination) |
|
| 38 | if (!empty($this->request->data['type'])) { |
|
| @@ 38-47 (lines=10) @@ | ||
| 35 | } |
|
| 36 | ||
| 37 | //Search type. (For pagination) |
|
| 38 | if (!empty($this->request->data['type'])) { |
|
| 39 | $type = $this->request->data['type']; |
|
| 40 | $this->request->session()->write('Search.Admin.Users.Type', $type); |
|
| 41 | } else { |
|
| 42 | if ($this->request->session()->read('Search.Admin.Users.Type')) { |
|
| 43 | $type = $this->request->session()->read('Search.Admin.Users.Type'); |
|
| 44 | } else { |
|
| 45 | $type = ''; |
|
| 46 | } |
|
| 47 | } |
|
| 48 | ||
| 49 | switch ($type) { |
|
| 50 | case "username": |
|
| @@ 1134-1143 (lines=10) @@ | ||
| 1131 | $this->loadModel('ConversationsUsers'); |
|
| 1132 | ||
| 1133 | //Check the keyword to search. (For pagination) |
|
| 1134 | if (!empty($this->request->data['search'])) { |
|
| 1135 | $keyword = $this->request->data['search']; |
|
| 1136 | $this->request->session()->write('Search.Conversations.Keyword', $keyword); |
|
| 1137 | } else { |
|
| 1138 | if ($this->request->session()->read('Search.Conversations.Keyword')) { |
|
| 1139 | $keyword = $this->request->session()->read('Search.Conversations.Keyword'); |
|
| 1140 | } else { |
|
| 1141 | $keyword = ''; |
|
| 1142 | } |
|
| 1143 | } |
|
| 1144 | ||
| 1145 | //Pagination |
|
| 1146 | $this->paginate = [ |
|
| @@ 454-463 (lines=10) @@ | ||
| 451 | $this->loadModel('BlogArticles'); |
|
| 452 | ||
| 453 | //Check the keyword to search. (For pagination) |
|
| 454 | if (!empty($this->request->data['search'])) { |
|
| 455 | $keyword = $this->request->data['search']; |
|
| 456 | $this->request->session()->write('Search.Blog.Keyword', $keyword); |
|
| 457 | } else { |
|
| 458 | if ($this->request->session()->read('Search.Blog.Keyword')) { |
|
| 459 | $keyword = $this->request->session()->read('Search.Blog.Keyword'); |
|
| 460 | } else { |
|
| 461 | $keyword = ''; |
|
| 462 | } |
|
| 463 | } |
|
| 464 | ||
| 465 | //Pagination |
|
| 466 | $this->paginate = [ |
|