Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
bc77d7c0 | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 5 | | | |
bc77d7c0 TO |
6 | | This work is published under the GNU AGPLv3 license with some | |
7 | | permitted exceptions and without any warranty. For full license | | |
8 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 | 9 | +--------------------------------------------------------------------+ |
d25dd0ee | 10 | */ |
6a488035 | 11 | |
6a488035 TO |
12 | /** |
13 | * This class is used by the Search functionality. | |
14 | * | |
15 | * - the search controller is used for building/processing multiform | |
16 | * searches. | |
17 | * | |
301705fb | 18 | * Typically the first form will display the search criteria and its results |
6a488035 | 19 | * |
ac3ab0e4 | 20 | * The second form is used to process search results with the associated actions |
6a488035 TO |
21 | * |
22 | */ | |
23 | class CRM_Event_Controller_Search extends CRM_Core_Controller { | |
24 | ||
233e08f1 | 25 | protected $entity = 'Participant'; |
26 | ||
6a488035 | 27 | /** |
fe482240 | 28 | * Class constructor. |
3bdf1f3a | 29 | * |
30 | * @param string $title | |
31 | * @param bool|int $action | |
32 | * @param bool $modal | |
016d95d3 | 33 | * |
34 | * @throws \CRM_Core_Exception | |
6a488035 | 35 | */ |
00be9182 | 36 | public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { |
6a488035 TO |
37 | |
38 | parent::__construct($title, $modal); | |
39 | ||
40 | $this->_stateMachine = new CRM_Event_StateMachine_Search($this, $action); | |
41 | ||
42 | // create and instantiate the pages | |
43 | $this->addPages($this->_stateMachine, $action); | |
44 | ||
6a488035 TO |
45 | $session = CRM_Core_Session::singleton(); |
46 | $uploadNames = $session->get('uploadNames'); | |
47 | if (!empty($uploadNames)) { | |
48 | $uploadNames = array_merge($uploadNames, | |
49 | CRM_Core_BAO_File::uploadNames() | |
50 | ); | |
51 | } | |
52 | else { | |
53 | $uploadNames = CRM_Core_BAO_File::uploadNames(); | |
54 | } | |
55 | ||
56 | $config = CRM_Core_Config::singleton(); | |
57 | $uploadDir = $config->uploadDir; | |
58 | ||
59 | // add all the actions | |
60 | $this->addActions($uploadDir, $uploadNames); | |
233e08f1 | 61 | $this->set('entity', $this->entity); |
6a488035 | 62 | } |
96025800 | 63 | |
6a488035 | 64 | } |