@@ -23,15 +23,15 @@ |
||
23 | 23 | class ApplicationsController extends BaseActionController |
24 | 24 | { |
25 | 25 | |
26 | - /** |
|
27 | - * @var array|\Admin\Model\ClientsTable |
|
28 | - */ |
|
29 | - protected $clientsTable; |
|
26 | + /** |
|
27 | + * @var array|\Admin\Model\ClientsTable |
|
28 | + */ |
|
29 | + protected $clientsTable; |
|
30 | 30 | |
31 | - /** |
|
32 | - * @var array|\Admin\Model\ApplicationsTable |
|
33 | - */ |
|
34 | - protected $applicationsTable; |
|
31 | + /** |
|
32 | + * @var array|\Admin\Model\ApplicationsTable |
|
33 | + */ |
|
34 | + protected $applicationsTable; |
|
35 | 35 | |
36 | 36 | /** |
37 | 37 | * initialize titles and toolbar items |
@@ -83,12 +83,12 @@ discard block |
||
83 | 83 | $dataObj = array(); |
84 | 84 | foreach ($aApplicationslist as $row) { |
85 | 85 | $data[] = $row; |
86 | - $dataObj[] = (object)$row; |
|
86 | + $dataObj[] = (object) $row; |
|
87 | 87 | } |
88 | - if ( $this->isXHR() ) { |
|
88 | + if ($this->isXHR()) { |
|
89 | 89 | $datatablesData = array('data' => $data); |
90 | 90 | $datatablesData['data'] = array_map( |
91 | - function ($row) use ($oController) { |
|
91 | + function($row) use ($oController) { |
|
92 | 92 | $actions = '<div class="button-group tiny btn-group btn-group-xs">'. |
93 | 93 | '<a class="button btn btn-default tiny btn-xs btn-clean btn-cta-xhr cta-xhr-modal" href="'.$oController->url()->fromRoute( |
94 | 94 | 'admin/applicationsedit', |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $applications->exchangeArray($form->getData()); |
144 | 144 | $this->getApplicationsTable()->saveApplication($applications); |
145 | 145 | $this->flashMessenger()->addSuccessMessage($this->translate('application has been saved')); |
146 | - if ( $this->isXHR() ) { |
|
146 | + if ($this->isXHR()) { |
|
147 | 147 | $tmplVars["showForm"] = false; |
148 | 148 | } else { |
149 | 149 | return $this->redirect()->toRoute('admin/applicationsedit', array('action' => 'index')); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | return $this->redirect()->toRoute('admin/applicationsedit'); |
184 | 184 | } |
185 | 185 | |
186 | - $form = new ApplicationsForm(); |
|
186 | + $form = new ApplicationsForm(); |
|
187 | 187 | $form->bind($applications); |
188 | 188 | |
189 | 189 | $clients = $this->getClientsTable()->fetchAll()->toArray(); |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | if ($form->isValid()) { |
202 | 202 | $this->getApplicationsTable()->saveApplication($applications); |
203 | 203 | $this->flashMessenger()->addSuccessMessage($this->translate("application has been saved")); |
204 | - if ( $this->isXHR() ) { |
|
204 | + if ($this->isXHR()) { |
|
205 | 205 | $tmplVars["showForm"] = false; |
206 | 206 | } else { |
207 | 207 | return $this->redirect()->toRoute('admin/applicationsedit', array('action' => 'index')); |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $id = (int) $request->getPost('id'); |
250 | 250 | $this->getApplicationsTable()->deleteApplication($id); |
251 | 251 | $this->flashMessenger()->addSuccessMessage($this->translate("application has been deleted")); |
252 | - if ( $this->isXHR() ) { |
|
252 | + if ($this->isXHR()) { |
|
253 | 253 | $tmplVars["showForm"] = false; |
254 | 254 | } else { |
255 | 255 | return $this->redirect()->toRoute('admin/applicationsedit', array('action' => 'index')); |
@@ -23,10 +23,10 @@ |
||
23 | 23 | class ClientsController extends BaseActionController |
24 | 24 | { |
25 | 25 | |
26 | - /** |
|
27 | - * @var array|\Admin\Model\ClientsTable |
|
28 | - */ |
|
29 | - protected $clientsTable; |
|
26 | + /** |
|
27 | + * @var array|\Admin\Model\ClientsTable |
|
28 | + */ |
|
29 | + protected $clientsTable; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * initialize titles and toolbar items |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | { |
70 | 70 | $tmplVars = $this->getTemplateVars(); |
71 | 71 | $aClientslist = $this->getClientsTable()->fetchAll(); |
72 | - if ( $this->isXHR() ) { |
|
72 | + if ($this->isXHR()) { |
|
73 | 73 | $datatablesData = array('data' => $aClientslist->toArray()); |
74 | 74 | $oController = $this; |
75 | 75 | $datatablesData['data'] = array_map( |
76 | - function ($row) use ($oController) { |
|
76 | + function($row) use ($oController) { |
|
77 | 77 | $actions = '<div class="button-group tiny btn-group btn-group-xs">'. |
78 | 78 | '<a class="button btn btn-default tiny btn-xs btn-clean btn-cta-xhr cta-xhr-modal" href="'.$oController->url()->fromRoute( |
79 | 79 | 'admin/clientsedit', |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $clients->exchangeArray($form->getData()); |
122 | 122 | $this->getClientsTable()->saveClients($clients); |
123 | 123 | $this->flashMessenger()->addSuccessMessage($this->translate('client has been saved')); |
124 | - if ( $this->isXHR() ) { |
|
124 | + if ($this->isXHR()) { |
|
125 | 125 | $tmplVars["showForm"] = false; |
126 | 126 | } else { |
127 | 127 | return $this->redirect()->toRoute('admin/clientsedit', array('action' => 'index')); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | return $this->redirect()->toRoute('admin/clientsedit'); |
162 | 162 | } |
163 | 163 | |
164 | - $form = new ClientsForm(); |
|
164 | + $form = new ClientsForm(); |
|
165 | 165 | $form->bind($clients); |
166 | 166 | |
167 | 167 | $request = $this->getRequest(); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | if ($form->isValid()) { |
173 | 173 | $this->getClientsTable()->saveClients($clients); |
174 | 174 | $this->flashMessenger()->addSuccessMessage($this->translate("client has been saved")); |
175 | - if ( $this->isXHR() ) { |
|
175 | + if ($this->isXHR()) { |
|
176 | 176 | $tmplVars["showForm"] = false; |
177 | 177 | } else { |
178 | 178 | return $this->redirect()->toRoute('admin/clientsedit', array('action' => 'index')); |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $id = (int) $request->getPost('id'); |
222 | 222 | $this->getClientsTable()->deleteClients($id); |
223 | 223 | $this->flashMessenger()->addSuccessMessage($this->translate("client has been deleted")); |
224 | - if ( $this->isXHR() ) { |
|
224 | + if ($this->isXHR()) { |
|
225 | 225 | $tmplVars["showForm"] = false; |
226 | 226 | } else { |
227 | 227 | return $this->redirect()->toRoute('admin/clientsedit', array('action' => 'index')); |
@@ -23,9 +23,9 @@ |
||
23 | 23 | class SettingsController extends BaseActionController |
24 | 24 | { |
25 | 25 | |
26 | - /** |
|
27 | - * @var array|\Admin\Model\SettingsTable |
|
28 | - */ |
|
26 | + /** |
|
27 | + * @var array|\Admin\Model\SettingsTable |
|
28 | + */ |
|
29 | 29 | protected $settingsTable; |
30 | 30 | |
31 | 31 | /** |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | { |
70 | 70 | $tmplVars = $this->getTemplateVars(); |
71 | 71 | $aSettingslist = $this->getSettingsTable()->fetchAll(); |
72 | - if ( $this->isXHR() ) { |
|
72 | + if ($this->isXHR()) { |
|
73 | 73 | $datatablesData = array('data' => $aSettingslist->toArray()); |
74 | 74 | $oController = $this; |
75 | 75 | $datatablesData['data'] = array_map( |
76 | - function ($row) use ($oController) { |
|
76 | + function($row) use ($oController) { |
|
77 | 77 | $actions = '<div class="button-group tiny btn-group btn-group-xs">'. |
78 | 78 | '<a class="button btn btn-default tiny btn-xs btn-clean btn-cta-xhr cta-xhr-modal" href="'.$oController->url()->fromRoute( |
79 | 79 | 'admin/settingsedit', |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $settings->exchangeArray($form->getData()); |
122 | 122 | $this->getSettingsTable()->saveSettings($settings); |
123 | 123 | $this->flashMessenger()->addSuccessMessage($this->translate('setting has been saved')); |
124 | - if ( $this->isXHR() ) { |
|
124 | + if ($this->isXHR()) { |
|
125 | 125 | $tmplVars["showForm"] = false; |
126 | 126 | } else { |
127 | 127 | return $this->redirect()->toRoute('admin/settingsedit', array('action' => 'index')); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | return $this->redirect()->toRoute('admin/settingsedit'); |
162 | 162 | } |
163 | 163 | |
164 | - $form = new SettingsForm(); |
|
164 | + $form = new SettingsForm(); |
|
165 | 165 | $form->bind($settings); |
166 | 166 | |
167 | 167 | $request = $this->getRequest(); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | if ($form->isValid()) { |
173 | 173 | $this->getSettingsTable()->saveSettings($settings); |
174 | 174 | $this->flashMessenger()->addSuccessMessage($this->translate("setting has been saved")); |
175 | - if ( $this->isXHR() ) { |
|
175 | + if ($this->isXHR()) { |
|
176 | 176 | $tmplVars["showForm"] = false; |
177 | 177 | } else { |
178 | 178 | return $this->redirect()->toRoute('admin/settingsedit', array('action' => 'index')); |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $id = (int) $request->getPost('id'); |
222 | 222 | $this->getSettingsTable()->deleteSettings($id); |
223 | 223 | $this->flashMessenger()->addSuccessMessage($this->translate("setting has been deleted")); |
224 | - if ( $this->isXHR() ) { |
|
224 | + if ($this->isXHR()) { |
|
225 | 225 | $tmplVars["showForm"] = false; |
226 | 226 | } else { |
227 | 227 | return $this->redirect()->toRoute('admin/settingsedit', array('action' => 'index')); |
@@ -82,11 +82,11 @@ |
||
82 | 82 | array( |
83 | 83 | 'name' => 'facebook', |
84 | 84 | 'attributes' => array( |
85 | - 'type' => 'url', |
|
86 | - ), |
|
87 | - 'options' => array( |
|
88 | - 'label' => 'Facebook', |
|
89 | - ), |
|
85 | + 'type' => 'url', |
|
86 | + ), |
|
87 | + 'options' => array( |
|
88 | + 'label' => 'Facebook', |
|
89 | + ), |
|
90 | 90 | ) |
91 | 91 | ); |
92 | 92 | $this->add( |
@@ -76,10 +76,10 @@ |
||
76 | 76 | array( |
77 | 77 | 'name' => 'reset', |
78 | 78 | 'attributes' => array( |
79 | - 'type' => 'reset', |
|
80 | - 'value' => 'reset', |
|
81 | - 'id' => 'resetbutton', |
|
82 | - ), |
|
79 | + 'type' => 'reset', |
|
80 | + 'value' => 'reset', |
|
81 | + 'id' => 'resetbutton', |
|
82 | + ), |
|
83 | 83 | 'options' => array( |
84 | 84 | 'label' => 'reset', |
85 | 85 | ), |
@@ -29,7 +29,7 @@ |
||
29 | 29 | array( |
30 | 30 | 'name' => 'aclroles_id', |
31 | 31 | 'attributes' => array( |
32 | - 'type' => 'hidden' , |
|
32 | + 'type' => 'hidden', |
|
33 | 33 | ), |
34 | 34 | ) |
35 | 35 | ); |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | return $resultSet; |
35 | 35 | } |
36 | 36 | |
37 | - public function getUserByEmailOrUsername( $id ) |
|
37 | + public function getUserByEmailOrUsername($id) |
|
38 | 38 | { |
39 | - if (empty($id) ) { |
|
39 | + if (empty($id)) { |
|
40 | 40 | return false; |
41 | 41 | } |
42 | 42 | $resultSet = $this->tableGateway->select( |
43 | - function (Select $select) use ($id) { |
|
43 | + function(Select $select) use ($id) { |
|
44 | 44 | $select->where( |
45 | 45 | array( |
46 | 46 | "username = '".$id."'", |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | 'aclrole' => $user->aclrole, |
80 | 80 | ); |
81 | 81 | |
82 | - $id = (int)$user->user_id; |
|
82 | + $id = (int) $user->user_id; |
|
83 | 83 | if ($id == 0) { |
84 | 84 | $this->tableGateway->insert($data); |
85 | 85 | } else { |
@@ -63,7 +63,7 @@ |
||
63 | 63 | 'icq' => $user->icq, |
64 | 64 | ); |
65 | 65 | |
66 | - $id = (int)$user->user_id; |
|
66 | + $id = (int) $user->user_id; |
|
67 | 67 | if ($id == 0) { |
68 | 68 | throw new \Exception('invalid user'); |
69 | 69 | } else { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | public function fetchAll($scope = '') |
47 | 47 | { |
48 | 48 | $resultSet = $this->tableGateway->select( |
49 | - function (Select $select) use ($scope) { |
|
49 | + function(Select $select) use ($scope) { |
|
50 | 50 | if (!empty($scope)) { |
51 | 51 | $select->where('scope = \''.$scope.'\'')->order('type, name ASC'); |
52 | 52 | } else { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | 'client_id' => $applications->client_id, |
102 | 102 | ); |
103 | 103 | |
104 | - $id = (int)$applications->application_id; |
|
104 | + $id = (int) $applications->application_id; |
|
105 | 105 | if ($id == 0) { |
106 | 106 | $this->tableGateway->insert($data); |
107 | 107 | } else { |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public function fetchAll($scope = '') |
32 | 32 | { |
33 | 33 | $resultSet = $this->tableGateway->select( |
34 | - function (Select $select) use ($scope) { |
|
34 | + function(Select $select) use ($scope) { |
|
35 | 35 | if (!empty($scope)) { |
36 | 36 | $select->where('scope = \''.$scope.'\'')->order('type, name ASC'); |
37 | 37 | } else { |
@@ -47,14 +47,14 @@ discard block |
||
47 | 47 | return $this->fetchAll('application'); |
48 | 48 | } |
49 | 49 | |
50 | - public function fetchUser( $id ) |
|
50 | + public function fetchUser($id) |
|
51 | 51 | { |
52 | 52 | if (!$id) { return array(); |
53 | 53 | } |
54 | 54 | $resultSet = $this->tableGateway->select( |
55 | - function (Select $select) use ($id) { |
|
55 | + function(Select $select) use ($id) { |
|
56 | 56 | if (!empty($id)) { |
57 | - $select->where(array( '(scope = \'user\') AND (ref_id = \''.((int)$id).'\')' ))->order('type, name ASC'); |
|
57 | + $select->where(array('(scope = \'user\') AND (ref_id = \''.((int) $id).'\')'))->order('type, name ASC'); |
|
58 | 58 | } else { |
59 | 59 | $select->order('type, name ASC'); |
60 | 60 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | 'statistics' => $clients->statistics, |
87 | 87 | ); |
88 | 88 | |
89 | - $id = (int)$clients->clients_id; |
|
89 | + $id = (int) $clients->clients_id; |
|
90 | 90 | if ($id == 0) { |
91 | 91 | $this->tableGateway->insert($data); |
92 | 92 | } else { |