@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * @author Zilvinas Vaira |
8 | 8 | * |
9 | 9 | */ |
10 | -class PopupMessageContainer implements PageElementInterface{ |
|
10 | +class PopupMessageContainer implements PageElementInterface { |
|
11 | 11 | |
12 | 12 | protected $id = ''; |
13 | 13 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $this->pageElement = $pageElement; |
37 | 37 | $this->id = $id; |
38 | 38 | $this->title = $title; |
39 | - if(!$isVisible){ |
|
39 | + if (!$isVisible) { |
|
40 | 40 | $this->disabledStyle = 'style="display:none;"'; |
41 | 41 | } |
42 | 42 | $this->setCloseButtonClass('close'); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * |
48 | 48 | * @param string $token |
49 | 49 | */ |
50 | - public function setCloseButtonClass($token){ |
|
50 | + public function setCloseButtonClass($token) { |
|
51 | 51 | $this->closeButtonClass = $this->id . '-' . $token; |
52 | 52 | } |
53 | 53 |
@@ -13,13 +13,13 @@ |
||
13 | 13 | |
14 | 14 | protected $action = ''; |
15 | 15 | |
16 | - protected $params = array (); |
|
16 | + protected $params = array(); |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * |
20 | 20 | * @param string $action |
21 | 21 | */ |
22 | - public function __construct($action){ |
|
22 | + public function __construct($action) { |
|
23 | 23 | $this->action = $action; |
24 | 24 | } |
25 | 25 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @author Zilvinas Vaira |
7 | 7 | * |
8 | 8 | */ |
9 | -class YesNoDialogBox extends AbstractTextDialogBox{ |
|
9 | +class YesNoDialogBox extends AbstractTextDialogBox { |
|
10 | 10 | |
11 | 11 | const NO = 0; |
12 | 12 | const YES = 1; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @param string $action |
26 | 26 | * @param string $text |
27 | 27 | */ |
28 | - public function __construct($id, $action, $text){ |
|
28 | + public function __construct($id, $action, $text) { |
|
29 | 29 | parent::__construct($action, $text); |
30 | 30 | $this->id = $id; |
31 | 31 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | * @param string $name |
36 | 36 | * @param string $value |
37 | 37 | */ |
38 | - public function setYesControl($name, $value){ |
|
38 | + public function setYesControl($name, $value) { |
|
39 | 39 | $this->controls[self::YES]['name'] = $name; |
40 | 40 | $this->controls[self::YES]['value'] = $value; |
41 | 41 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param string $name |
46 | 46 | * @param string $value |
47 | 47 | */ |
48 | - public function setNoControl($name, $value){ |
|
48 | + public function setNoControl($name, $value) { |
|
49 | 49 | $this->controls[self::NO]['name'] = $name; |
50 | 50 | $this->controls[self::NO]['value'] = $value; |
51 | 51 | } |
@@ -55,12 +55,12 @@ discard block |
||
55 | 55 | * {@inheritDoc} |
56 | 56 | * @see \web\lib\admin\view\AbstractDialogBox::renderControls() |
57 | 57 | */ |
58 | - protected function renderControls(){ |
|
58 | + protected function renderControls() { |
|
59 | 59 | ?> |
60 | 60 | <button type="submit" name="<?php echo $this->controls[self::YES]['name']; ?>" value="<?php echo $this->controls[self::YES]['value']; ?>"><?php echo _('Yes'); ?></button> |
61 | - <?php if($this->controls[self::NO]['name'] == ''){ ?> |
|
61 | + <?php if ($this->controls[self::NO]['name'] == '') { ?> |
|
62 | 62 | <button class="<?php echo $this->id . '-close'; ?>" type="reset"><?php echo _('No'); ?></button> |
63 | - <?php }else{ ?> |
|
63 | + <?php } else { ?> |
|
64 | 64 | <button type="submit" name="<?php echo $this->controls[self::NO]['name']; ?>" value="<?php echo $this->controls[self::NO]['value']; ?>"><?php echo _('No'); ?></button> |
65 | 65 | <?php } |
66 | 66 | } |
@@ -172,9 +172,9 @@ |
||
172 | 172 | $totalFailures = 0; |
173 | 173 | foreach ($decoded_response['messages'] as $message) { |
174 | 174 | if ($message['status'] == 0) { |
175 | - $loggerInstance->debug(2, $message['message-id']. ": Success"); |
|
175 | + $loggerInstance->debug(2, $message['message-id'] . ": Success"); |
|
176 | 176 | } else { |
177 | - $loggerInstance->debug(2, $message['message-id']. ": Failed (failure code = ".$message['status'].")"); |
|
177 | + $loggerInstance->debug(2, $message['message-id'] . ": Failed (failure code = " . $message['status'] . ")"); |
|
178 | 178 | $totalFailures++; |
179 | 179 | } |
180 | 180 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * {@inheritDoc} |
17 | 17 | * @see \web\lib\admin\view\AbstractDialogBox::renderControls() |
18 | 18 | */ |
19 | - protected function renderControls(){ |
|
19 | + protected function renderControls() { |
|
20 | 20 | ?> |
21 | 21 | <div style="position: relative; padding-bottom: 10px; width: 450px;"> |
22 | 22 | <label>Send email using client aplication:</label> |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * @author Zilvinas Vaira |
11 | 11 | * |
12 | 12 | */ |
13 | -class SendTokenBySms extends AbstractInvokerCommand{ |
|
13 | +class SendTokenBySms extends AbstractInvokerCommand { |
|
14 | 14 | |
15 | 15 | const COMMAND = "sendtokenbysms"; |
16 | 16 | const PARAM_PHONE = "phone"; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @param string $commandToken |
39 | 39 | * @param SilverbulletContext $context |
40 | 40 | */ |
41 | - public function __construct($commandToken, $context){ |
|
41 | + public function __construct($commandToken, $context) { |
|
42 | 42 | parent::__construct($commandToken, $context); |
43 | 43 | $this->detailsCommand = new GetTokenEmailDetails(GetTokenEmailDetails::COMMAND, $context); |
44 | 44 | $this->context = $context; |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @param string $phone |
50 | 50 | * @param string $content |
51 | 51 | */ |
52 | - private function sendSMS($phone, $content){ |
|
52 | + private function sendSMS($phone, $content) { |
|
53 | 53 | $error = ""; |
54 | 54 | $result = -1; |
55 | 55 | try { |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @see \web\lib\admin\http\AbstractCommand::execute() |
80 | 80 | */ |
81 | 81 | public function execute() { |
82 | - if(isset($_POST[GetTokenEmailDetails::PARAM_TOKENLINK]) && isset($_POST[SendTokenBySms::PARAM_PHONE])){ |
|
82 | + if (isset($_POST[GetTokenEmailDetails::PARAM_TOKENLINK]) && isset($_POST[SendTokenBySms::PARAM_PHONE])) { |
|
83 | 83 | |
84 | 84 | $invitationToken = $this->parseString($_POST[GetTokenEmailDetails::PARAM_TOKENLINK]); |
85 | 85 | $phone = $this->parseString($_POST[SendTokenBySms::PARAM_PHONE]); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | * {@inheritDoc} |
16 | 16 | * @see \web\lib\admin\view\AbstractDialogBox::renderControls() |
17 | 17 | */ |
18 | - protected function renderControls(){ |
|
18 | + protected function renderControls() { |
|
19 | 19 | ?> |
20 | 20 | <div style="position: relative; padding-bottom: 10px; width: 450px;"> |
21 | 21 | <label>Enter user phone: +</label> |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @author Zilvinas Vaira |
9 | 9 | * |
10 | 10 | */ |
11 | -class RevokeInvitationCommand extends AbstractInvokerCommand{ |
|
11 | +class RevokeInvitationCommand extends AbstractInvokerCommand { |
|
12 | 12 | |
13 | 13 | const COMMAND = 'revokeinvitation'; |
14 | 14 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @param string $commandToken |
24 | 24 | * @param SilverbulletContext $context |
25 | 25 | */ |
26 | - public function __construct($commandToken, $context){ |
|
26 | + public function __construct($commandToken, $context) { |
|
27 | 27 | parent::__construct($commandToken, $context); |
28 | 28 | $this->context = $context; |
29 | 29 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * {@inheritDoc} |
34 | 34 | * @see \web\lib\admin\http\AbstractCommand::execute() |
35 | 35 | */ |
36 | - public function execute(){ |
|
36 | + public function execute() { |
|
37 | 37 | $invitationId = $this->parseInt($_POST[self::COMMAND]); |
38 | 38 | |
39 | 39 | $invitation = SilverbulletInvitation::prepare($invitationId); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | * @author Zilvinas Vaira |
9 | 9 | * |
10 | 10 | */ |
11 | -class AddUsersCommand extends AbstractInvokerCommand{ |
|
11 | +class AddUsersCommand extends AbstractInvokerCommand { |
|
12 | 12 | |
13 | 13 | const COMMAND = 'newusers'; |
14 | 14 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * @param string $commandToken |
24 | 24 | * @param SilverbulletContext $context |
25 | 25 | */ |
26 | - public function __construct($commandToken, $context){ |
|
26 | + public function __construct($commandToken, $context) { |
|
27 | 27 | parent::__construct($commandToken, $context); |
28 | 28 | $this->context = $context; |
29 | 29 | } |
@@ -33,27 +33,27 @@ discard block |
||
33 | 33 | * {@inheritDoc} |
34 | 34 | * @see \web\lib\admin\http\AbstractCommand::execute() |
35 | 35 | */ |
36 | - public function execute(){ |
|
36 | + public function execute() { |
|
37 | 37 | $parser = new CSVParser($_FILES[self::COMMAND], "\n", ','); |
38 | - if(!$parser->isValid()){ |
|
38 | + if (!$parser->isValid()) { |
|
39 | 39 | $this->storeErrorMessage(_('File either is empty or is not CSV file!')); |
40 | 40 | } |
41 | 41 | $userCount = 0; |
42 | 42 | $invitationsCount = 0; |
43 | - while($parser->hasMoreRows()){ |
|
43 | + while ($parser->hasMoreRows()) { |
|
44 | 44 | $row = $parser->nextRow(); |
45 | - if(isset($row[0]) && isset($row[1])){ |
|
45 | + if (isset($row[0]) && isset($row[1])) { |
|
46 | 46 | $user = $this->context->createUser($row[0], $row[1], $this); |
47 | 47 | $max = empty($row[2]) ? 1 : intval($row[2]); |
48 | - if(!empty($user->getIdentifier())){ |
|
48 | + if (!empty($user->getIdentifier())) { |
|
49 | 49 | $this->context->createInvitation($user, $this, $max); |
50 | 50 | $userCount++; |
51 | 51 | } |
52 | - }else{ |
|
52 | + } else { |
|
53 | 53 | $this->storeErrorMessage(sprintf(_('Username or expiry date missing for %s record!'), $userCount + 1)); |
54 | 54 | } |
55 | 55 | } |
56 | - if($userCount>0){ |
|
56 | + if ($userCount > 0) { |
|
57 | 57 | $this->storeInfoMessage(sprintf(_('%s total users were imported and %s invitations created!'), $userCount, $invitationsCount)); |
58 | 58 | } |
59 | 59 | } |