@@ -28,7 +28,7 @@ |
||
28 | 28 | */ |
29 | 29 | $fm->define('OCA\Polls\Db\Comment')->setDefinitions([ |
30 | 30 | 'userId' => Faker::firstNameMale(), |
31 | - 'dt' => function () { |
|
31 | + 'dt' => function() { |
|
32 | 32 | $date = new DateTime('today'); |
33 | 33 | return $date->format('Y-m-d H:i:s'); |
34 | 34 | }, |
@@ -31,12 +31,12 @@ |
||
31 | 31 | 'title' => Faker::sentence(10), |
32 | 32 | 'description' => Faker::text(255), |
33 | 33 | 'owner' => Faker::firstNameMale(), |
34 | - 'created' => function () { |
|
34 | + 'created' => function() { |
|
35 | 35 | $date = new DateTime('today'); |
36 | 36 | return $date->format('Y-m-d H:i:s'); |
37 | 37 | }, |
38 | 38 | 'access' => 'registered', |
39 | - 'expire' => function () { |
|
39 | + 'expire' => function() { |
|
40 | 40 | $date = new DateTime('tomorrow'); |
41 | 41 | return $date->format('Y-m-d H:i:s'); |
42 | 42 | }, |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | <div class="table-row table-body"> |
152 | 152 | <div class="wrapper group-master"> |
153 | 153 | <div class="wrapper group-1"> |
154 | - <div class="thumbnail <?php p($expiry_style . ' ' . $commented_class. ' ' . $participated_class); ?>"></div><!-- Image to display the status or type of poll --> |
|
154 | + <div class="thumbnail <?php p($expiry_style . ' ' . $commented_class . ' ' . $participated_class); ?>"></div><!-- Image to display the status or type of poll --> |
|
155 | 155 | <a href="<?php p($pollUrl); ?>" class="wrapper group-1-1"> |
156 | 156 | <div class="flex-column name"> <?php p($poll->getTitle()); ?></div> |
157 | 157 | <div class="flex-column description"> <?php p($poll->getDescription()); ?></div> |
@@ -193,10 +193,10 @@ discard block |
||
193 | 193 | </div> |
194 | 194 | <div class="wrapper group-2-1"> |
195 | 195 | <div class="flex-column access"><?php p($l->t($poll->getAccess())); ?></div> |
196 | - <div class="flex-column created has-tooltip live-relative-timestamp" data-timestamp="<?php p(strtotime($poll->getCreated())*1000); ?>" data-value="<?php p($poll->getCreated()); ?>"><?php p(\OCP\Template::relative_modified_date(strtotime($poll->getCreated()))); ?></div> |
|
196 | + <div class="flex-column created has-tooltip live-relative-timestamp" data-timestamp="<?php p(strtotime($poll->getCreated()) * 1000); ?>" data-value="<?php p($poll->getCreated()); ?>"><?php p(\OCP\Template::relative_modified_date(strtotime($poll->getCreated()))); ?></div> |
|
197 | 197 | </div> |
198 | 198 | <div class="wrapper group-2-2"> |
199 | - <div class="flex-column has-tooltip expiry<?php p($expiry_style . $timestamp_style); ?>" data-timestamp="<?php p(strtotime($poll->getExpire())*1000); ?>" data-value="<?php p($poll->getExpire()); ?>"> <?php p($expiry_date); ?></div> |
|
199 | + <div class="flex-column has-tooltip expiry<?php p($expiry_style . $timestamp_style); ?>" data-timestamp="<?php p(strtotime($poll->getExpire()) * 1000); ?>" data-value="<?php p($poll->getExpire()); ?>"> <?php p($expiry_date); ?></div> |
|
200 | 200 | <div class="flex-column participants"> |
201 | 201 | <div class="symbol alt-tooltip partic_voted icon-<?php p($participated_class); ?>" title="<?php p($participated_title); ?>"></div> |
202 | 202 | <div class="symbol alt-tooltip partic_commented icon-<?php p($commented_class); ?>" title="<?php p($commented_title); ?>"></div> |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | } |
229 | 229 | // Nextcloud >= 12 |
230 | 230 | $groups = \OC::$server->getGroupManager()->getUserGroups(\OC::$server->getUserSession()->getUser()); |
231 | - return array_map(function ($group) { |
|
231 | + return array_map(function($group) { |
|
232 | 232 | return $group->getGID(); |
233 | 233 | }, $groups); |
234 | 234 | } |
@@ -171,7 +171,7 @@ |
||
171 | 171 | <table id="selected-dates-table" class="choices"> |
172 | 172 | </table> |
173 | 173 | </div> |
174 | - <div id="text-select-container" <?php if(!$isUpdate || $poll->getType() === 0) print_unescaped('style="display:none;"'); ?> > |
|
174 | + <div id="text-select-container" <?php if (!$isUpdate || $poll->getType() === 0) print_unescaped('style="display:none;"'); ?> > |
|
175 | 175 | <label for="text-title" class="input_title"><?php p($l->t('Text item')); ?></label> |
176 | 176 | <div class="input-group"> |
177 | 177 | <input type="text" id="text-title" placeholder="<?php print_unescaped('Insert text...'); ?>" /> |
@@ -703,7 +703,7 @@ |
||
703 | 703 | } |
704 | 704 | // Nextcloud >= 12 |
705 | 705 | $groups = $this->groupManager->getUserGroups(\OC::$server->getUserSession()->getUser()); |
706 | - return array_map(function ($group) { |
|
706 | + return array_map(function($group) { |
|
707 | 707 | return $group->getGID(); |
708 | 708 | }, $groups); |
709 | 709 | } |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | |
272 | 272 | if ($class === 'unvoted') { |
273 | 273 | $dataUnvoted = $l->t('New option!'); |
274 | - $updatedPoll=true; |
|
274 | + $updatedPoll = true; |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | print_unescaped('<li id="voteid_' . $optionElement->getId() . '" class="flex-column active poll-cell ' . $class . '" data-value="' . $optionElement->getPollOptionText() . '" data-unvoted="' . $dataUnvoted . '"></li>'); |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | </div> |
287 | 287 | <?php if ($updatedPoll) : ?> |
288 | 288 | <div class="updated-poll alert"> |
289 | - <p> <?php p($l->t('This poll was updated since your last visit. Please check your votes.'));?></p> |
|
289 | + <p> <?php p($l->t('This poll was updated since your last visit. Please check your votes.')); ?></p> |
|
290 | 290 | </div> |
291 | 291 | <?php endif; ?> |
292 | 292 |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | 'notnull' => false, |
122 | 122 | ]); |
123 | 123 | $table->addColumn('poll_option_text', Type::STRING, [ |
124 | - 'notnull' => false, // maybe true? |
|
124 | + 'notnull' => false, // maybe true? |
|
125 | 125 | 'length' => 256, |
126 | 126 | ]); |
127 | 127 | $table->setPrimaryKey(['id']); |
@@ -351,8 +351,8 @@ discard block |
||
351 | 351 | ->from('polls_options') |
352 | 352 | // ->where($queryFind->expr()->eq('poll_id', $pollId)) |
353 | 353 | // ->andWhere($queryFind->expr()->eq('poll_option', $text)); |
354 | - ->where('poll_id = "'. $pollId .'"') |
|
355 | - ->andWhere('poll_option_text ="' .$text .'"'); |
|
354 | + ->where('poll_id = "' . $pollId . '"') |
|
355 | + ->andWhere('poll_option_text ="' . $text . '"'); |
|
356 | 356 | |
357 | 357 | $resultFind = $queryFind->execute(); |
358 | 358 | $row = $resultFind->fetch(); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | /** |
48 | 48 | * Controllers |
49 | 49 | */ |
50 | - $container->registerService('PageController', function (IContainer $c) { |
|
50 | + $container->registerService('PageController', function(IContainer $c) { |
|
51 | 51 | return new PageController( |
52 | 52 | $c->query('AppName'), |
53 | 53 | $c->query('Request'), |
@@ -66,51 +66,51 @@ discard block |
||
66 | 66 | ); |
67 | 67 | }); |
68 | 68 | |
69 | - $container->registerService('UserManager', function (IContainer $c) { |
|
69 | + $container->registerService('UserManager', function(IContainer $c) { |
|
70 | 70 | return $c->query('ServerContainer')->getUserManager(); |
71 | 71 | }); |
72 | 72 | |
73 | - $container->registerService('GroupManager', function (IContainer $c) { |
|
73 | + $container->registerService('GroupManager', function(IContainer $c) { |
|
74 | 74 | return $c->query('ServerContainer')->getGroupManager(); |
75 | 75 | }); |
76 | 76 | |
77 | - $container->registerService('AvatarManager', function (IContainer $c) { |
|
77 | + $container->registerService('AvatarManager', function(IContainer $c) { |
|
78 | 78 | return $c->query('ServerContainer')->getAvatarManager(); |
79 | 79 | }); |
80 | 80 | |
81 | - $container->registerService('Logger', function (IContainer $c) { |
|
81 | + $container->registerService('Logger', function(IContainer $c) { |
|
82 | 82 | return $c->query('ServerContainer')->getLogger(); |
83 | 83 | }); |
84 | 84 | |
85 | - $container->registerService('L10N', function (IContainer $c) { |
|
85 | + $container->registerService('L10N', function(IContainer $c) { |
|
86 | 86 | return $c->query('ServerContainer')->getL10N($c->query('AppName')); |
87 | 87 | }); |
88 | 88 | |
89 | - $container->registerService('CommentMapper', function (IContainer $c) use ($server) { |
|
89 | + $container->registerService('CommentMapper', function(IContainer $c) use ($server) { |
|
90 | 90 | return new CommentMapper( |
91 | 91 | $server->getDatabaseConnection() |
92 | 92 | ); |
93 | 93 | }); |
94 | 94 | |
95 | - $container->registerService('OptionsMapper', function (IContainer $c) use ($server) { |
|
95 | + $container->registerService('OptionsMapper', function(IContainer $c) use ($server) { |
|
96 | 96 | return new OptionsMapper( |
97 | 97 | $server->getDatabaseConnection() |
98 | 98 | ); |
99 | 99 | }); |
100 | 100 | |
101 | - $container->registerService('EventMapper', function (IContainer $c) use ($server) { |
|
101 | + $container->registerService('EventMapper', function(IContainer $c) use ($server) { |
|
102 | 102 | return new EventMapper( |
103 | 103 | $server->getDatabaseConnection() |
104 | 104 | ); |
105 | 105 | }); |
106 | 106 | |
107 | - $container->registerService('NotificationMapper', function (IContainer $c) use ($server) { |
|
107 | + $container->registerService('NotificationMapper', function(IContainer $c) use ($server) { |
|
108 | 108 | return new NotificationMapper( |
109 | 109 | $server->getDatabaseConnection() |
110 | 110 | ); |
111 | 111 | }); |
112 | 112 | |
113 | - $container->registerService('VotesMapper', function (IContainer $c) use ($server) { |
|
113 | + $container->registerService('VotesMapper', function(IContainer $c) use ($server) { |
|
114 | 114 | return new VotesMapper( |
115 | 115 | $server->getDatabaseConnection() |
116 | 116 | ); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function registerNavigationEntry() { |
124 | 124 | $container = $this->getContainer(); |
125 | - $container->query('OCP\INavigationManager')->add(function () use ($container) { |
|
125 | + $container->query('OCP\INavigationManager')->add(function() use ($container) { |
|
126 | 126 | $urlGenerator = $container->query('OCP\IURLGenerator'); |
127 | 127 | $l10n = $container->query('OCP\IL10N'); |
128 | 128 | return [ |