Commit | Line | Data |
---|---|---|
6a488035 | 1 | <?php |
5f1ebaec | 2 | /* |
6a488035 | 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 | */ |
17 | class CRM_SMS_Controller_Send extends CRM_Core_Controller { | |
18 | ||
19 | /** | |
fe482240 | 20 | * Class constructor. |
b05b5a19 | 21 | * |
5f1ebaec | 22 | * @param string $title |
b05b5a19 EM |
23 | * @param bool|int $action |
24 | * @param bool $modal | |
f7ad2038 | 25 | * |
26 | * @throws \CRM_Core_Exception | |
6a488035 | 27 | */ |
00be9182 | 28 | public function __construct($title = NULL, $action = CRM_Core_Action::NONE, $modal = TRUE) { |
6a488035 TO |
29 | parent::__construct($title, $modal, NULL, FALSE, TRUE); |
30 | ||
f7ad2038 | 31 | $mailingID = CRM_Utils_Request::retrieve('mid', 'String', $this); |
6a488035 TO |
32 | |
33 | // also get the text and html file | |
f7ad2038 | 34 | $txtFile = CRM_Utils_Request::retrieveValue('txtFile', 'String'); |
6a488035 TO |
35 | |
36 | $config = CRM_Core_Config::singleton(); | |
37 | if ($txtFile && | |
38 | file_exists($config->uploadDir . $txtFile) | |
39 | ) { | |
40 | $this->set('textFilePath', $config->uploadDir . $txtFile); | |
41 | } | |
42 | ||
43 | $this->_stateMachine = new CRM_SMS_StateMachine_Send($this, $action, $mailingID); | |
44 | ||
45 | // create and instantiate the pages | |
46 | $this->addPages($this->_stateMachine, $action); | |
47 | ||
48 | // add all the actions | |
be2fb01f | 49 | $uploadNames = array_merge(['textFile'], |
6a488035 TO |
50 | CRM_Core_BAO_File::uploadNames() |
51 | ); | |
52 | ||
5f1ebaec | 53 | $this->addActions(CRM_Core_Config::singleton()->uploadDir, |
6a488035 TO |
54 | $uploadNames |
55 | ); | |
56 | } | |
96025800 | 57 | |
6a488035 | 58 | } |