Merge pull request #18916 from colemanw/crudLink
[civicrm-core.git] / CRM / Group / Controller.php
CommitLineData
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
TO
11
12/**
13 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
6a488035
TO
16 */
17class CRM_Group_Controller extends CRM_Core_Controller {
18
caee90f4
SL
19 protected $entity = 'Contact';
20
6a488035 21 /**
fe482240 22 * Class constructor.
ca87146b
EM
23 *
24 * @param null $title
25 * @param bool|int $action
26 * @param bool $modal
6a488035 27 */
00be9182 28 public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) {
6a488035
TO
29 parent::__construct($title, $modal);
30
31 $this->_stateMachine = new CRM_Group_StateMachine($this, $action);
32
33 // create and instantiate the pages
34 $this->addPages($this->_stateMachine, $action);
35
36 // hack for now, set Search to Basic mode
37 $this->_pages['Basic']->setAction(CRM_Core_Action::BASIC);
38
39 // add all the actions
40 $config = CRM_Core_Config::singleton();
41
42 // to handle file type custom data
43 $uploadDir = $config->uploadDir;
44
45 $uploadNames = $this->get('uploadNames');
46 if (!empty($uploadNames)) {
47 $uploadNames = array_merge($uploadNames,
48 CRM_Core_BAO_File::uploadNames()
49 );
50 }
51 else {
52 $uploadNames = CRM_Core_BAO_File::uploadNames();
53 }
54
55 // add all the actions
56 $this->addActions($uploadDir, $uploadNames);
caee90f4 57 $this->set('entity', $this->entity);
6a488035
TO
58 }
59
e0ef6999
EM
60 /**
61 * @return mixed
62 */
00be9182 63 public function run() {
6a488035
TO
64 return parent::run();
65 }
66
e0ef6999
EM
67 /**
68 * @return mixed
69 */
6a488035
TO
70 public function selectorName() {
71 return $this->get('selectorName');
72 }
96025800 73
6a488035 74}