/
advanced_search.php
73 lines (59 loc) · 2.03 KB
/
advanced_search.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php /** @noinspection PhpUnused */
namespace Concrete\Controller\Dialog\Groups;
use Concrete\Controller\Dialog\Search\AdvancedSearch as AdvancedSearchController;
use Concrete\Core\Entity\Search\SavedGroupSearch;
use Concrete\Core\Entity\Search\SavedSearch;
use Concrete\Core\Search\Field\ManagerFactory;
use Concrete\Core\Support\Facade\Url;
use Doctrine\ORM\EntityManager;
class AdvancedSearch extends AdvancedSearchController
{
protected function canAccess()
{
$dh = $this->app->make('helper/concrete/user');
return $dh->canAccessUserSearchInterface();
}
public function getSearchProvider()
{
return $this->app->make('Concrete\Core\User\Group\Search\SearchProvider');
}
public function getSearchPresets()
{
$em = $this->app->make(EntityManager::class);
if (is_object($em)) {
return $em->getRepository(SavedGroupSearch::class)->findAll();
}
}
public function getSubmitMethod()
{
return 'get';
}
public function getSubmitAction()
{
return $this->app->make('url')->to('/dashboard/users/groups', 'advanced_search');
}
public function getFieldManager()
{
return ManagerFactory::get('group');
}
public function getSavedSearchBaseURL(SavedSearch $search)
{
return $this->app->make('url')->to('/dashboard/users/groups', 'preset', $search->getID());
}
public function getSavedSearchDeleteURL(SavedSearch $search)
{
return (string)Url::to('/ccm/system/dialogs/groups/advanced_search/preset/delete?presetID=' . $search->getID());
}
public function getSavedSearchEditURL(SavedSearch $search)
{
return (string)Url::to('/ccm/system/dialogs/groups/advanced_search/preset/edit?presetID=' . $search->getID());
}
public function getCurrentSearchBaseURL()
{
return (string)Url::to('/ccm/system/search/groups/current');
}
public function getBasicSearchBaseURL()
{
return (string)Url::to('/ccm/system/search/groups/basic');
}
}