@@ -66,7 +66,7 @@ |
||
66 | 66 | /** |
67 | 67 | * Displays the avatar of a given user. |
68 | 68 | * |
69 | - * @param int|string $uid The user's id or name |
|
69 | + * @param integer $uid The user's id or name |
|
70 | 70 | * @param array $parameters Any additional arguments (e.g. width, height, size, rating) |
71 | 71 | * |
72 | 72 | * @return string |
@@ -13,17 +13,16 @@ |
||
13 | 13 | namespace Zikula\RoutesModule\Entity\Repository\Base; |
14 | 14 | |
15 | 15 | use Doctrine\Common\Collections\ArrayCollection; |
16 | -use Gedmo\Sortable\Entity\Repository\SortableRepository; |
|
17 | - |
|
18 | 16 | use Doctrine\ORM\Query; |
19 | 17 | use Doctrine\ORM\QueryBuilder; |
20 | 18 | use Doctrine\ORM\Tools\Pagination\Paginator; |
19 | +use Gedmo\Sortable\Entity\Repository\SortableRepository; |
|
21 | 20 | use InvalidArgumentException; |
22 | 21 | use Psr\Log\LoggerInterface; |
23 | 22 | use Zikula\Common\Translator\TranslatorInterface; |
24 | -use Zikula\UsersModule\Api\ApiInterface\CurrentUserApiInterface; |
|
25 | 23 | use Zikula\RoutesModule\Entity\RouteEntity; |
26 | 24 | use Zikula\RoutesModule\Helper\CollectionFilterHelper; |
25 | +use Zikula\UsersModule\Api\ApiInterface\CurrentUserApiInterface; |
|
27 | 26 | |
28 | 27 | /** |
29 | 28 | * Repository class used to implement own convenience methods for performing certain DQL queries. |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | |
151 | 151 | $qb = $this->getEntityManager()->createQueryBuilder(); |
152 | 152 | $qb->update($this->mainEntityClass, 'tbl') |
153 | - ->set('tbl.createdBy', $newUserId) |
|
154 | - ->where('tbl.createdBy = :creator') |
|
155 | - ->setParameter('creator', $userId); |
|
153 | + ->set('tbl.createdBy', $newUserId) |
|
154 | + ->where('tbl.createdBy = :creator') |
|
155 | + ->setParameter('creator', $userId); |
|
156 | 156 | $query = $qb->getQuery(); |
157 | 157 | $query->execute(); |
158 | 158 | |
@@ -183,9 +183,9 @@ discard block |
||
183 | 183 | |
184 | 184 | $qb = $this->getEntityManager()->createQueryBuilder(); |
185 | 185 | $qb->update($this->mainEntityClass, 'tbl') |
186 | - ->set('tbl.updatedBy', $newUserId) |
|
187 | - ->where('tbl.updatedBy = :editor') |
|
188 | - ->setParameter('editor', $userId); |
|
186 | + ->set('tbl.updatedBy', $newUserId) |
|
187 | + ->where('tbl.updatedBy = :editor') |
|
188 | + ->setParameter('editor', $userId); |
|
189 | 189 | $query = $qb->getQuery(); |
190 | 190 | $query->execute(); |
191 | 191 | |
@@ -214,8 +214,8 @@ discard block |
||
214 | 214 | |
215 | 215 | $qb = $this->getEntityManager()->createQueryBuilder(); |
216 | 216 | $qb->delete($this->mainEntityClass, 'tbl') |
217 | - ->where('tbl.createdBy = :creator') |
|
218 | - ->setParameter('creator', $userId); |
|
217 | + ->where('tbl.createdBy = :creator') |
|
218 | + ->setParameter('creator', $userId); |
|
219 | 219 | $query = $qb->getQuery(); |
220 | 220 | $query->execute(); |
221 | 221 | |
@@ -244,8 +244,8 @@ discard block |
||
244 | 244 | |
245 | 245 | $qb = $this->getEntityManager()->createQueryBuilder(); |
246 | 246 | $qb->delete($this->mainEntityClass, 'tbl') |
247 | - ->where('tbl.updatedBy = :editor') |
|
248 | - ->setParameter('editor', $userId); |
|
247 | + ->where('tbl.updatedBy = :editor') |
|
248 | + ->setParameter('editor', $userId); |
|
249 | 249 | $query = $qb->getQuery(); |
250 | 250 | $query->execute(); |
251 | 251 | |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | { |
331 | 331 | if (count($exclusions) > 0) { |
332 | 332 | $qb->andWhere('tbl.id NOT IN (:excludedIdentifiers)') |
333 | - ->setParameter('excludedIdentifiers', $exclusions); |
|
333 | + ->setParameter('excludedIdentifiers', $exclusions); |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | return $qb; |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | $offset = ($currentPage - 1) * $resultsPerPage; |
391 | 391 | |
392 | 392 | $query->setFirstResult($offset) |
393 | - ->setMaxResults($resultsPerPage); |
|
393 | + ->setMaxResults($resultsPerPage); |
|
394 | 394 | |
395 | 395 | return $query; |
396 | 396 | } |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | |
488 | 488 | $qb = $this->getEntityManager()->createQueryBuilder(); |
489 | 489 | $qb->select($selection) |
490 | - ->from($this->mainEntityClass, 'tbl'); |
|
490 | + ->from($this->mainEntityClass, 'tbl'); |
|
491 | 491 | |
492 | 492 | if (!empty($where)) { |
493 | 493 | $qb->andWhere($where); |
@@ -536,7 +536,7 @@ discard block |
||
536 | 536 | { |
537 | 537 | $qb = $this->getCountQuery('', false); |
538 | 538 | $qb->andWhere('tbl.' . $fieldName . ' = :' . $fieldName) |
539 | - ->setParameter($fieldName, $fieldValue); |
|
539 | + ->setParameter($fieldName, $fieldValue); |
|
540 | 540 | |
541 | 541 | if ($excludeId > 0) { |
542 | 542 | $qb = $this->addExclusion($qb, [$excludeId]); |
@@ -579,7 +579,7 @@ discard block |
||
579 | 579 | |
580 | 580 | $qb = $this->getEntityManager()->createQueryBuilder(); |
581 | 581 | $qb->select($selection) |
582 | - ->from($this->mainEntityClass, 'tbl'); |
|
582 | + ->from($this->mainEntityClass, 'tbl'); |
|
583 | 583 | |
584 | 584 | if (true === $useJoins) { |
585 | 585 | $this->addJoinsToFrom($qb); |
@@ -607,7 +607,7 @@ discard block |
||
607 | 607 | if ($orderBy == 'RAND()') { |
608 | 608 | // random selection |
609 | 609 | $qb->addSelect('MOD(tbl.id, ' . mt_rand(2, 15) . ') AS HIDDEN randomIdentifiers') |
610 | - ->add('orderBy', 'randomIdentifiers'); |
|
610 | + ->add('orderBy', 'randomIdentifiers'); |
|
611 | 611 | |
612 | 612 | return $qb; |
613 | 613 | } |
@@ -626,12 +626,12 @@ discard block |
||
626 | 626 | } |
627 | 627 | if (false !== strpos($orderBy, 'tbl.createdBy')) { |
628 | 628 | $qb->addSelect('tblCreator') |
629 | - ->leftJoin('tbl.createdBy', 'tblCreator'); |
|
629 | + ->leftJoin('tbl.createdBy', 'tblCreator'); |
|
630 | 630 | $orderBy = str_replace('tbl.createdBy', 'tblCreator.uname', $orderBy); |
631 | 631 | } |
632 | 632 | if (false !== strpos($orderBy, 'tbl.updatedBy')) { |
633 | 633 | $qb->addSelect('tblUpdater') |
634 | - ->leftJoin('tbl.updatedBy', 'tblUpdater'); |
|
634 | + ->leftJoin('tbl.updatedBy', 'tblUpdater'); |
|
635 | 635 | $orderBy = str_replace('tbl.updatedBy', 'tblUpdater.uname', $orderBy); |
636 | 636 | } |
637 | 637 | $qb->add('orderBy', $orderBy); |
@@ -281,7 +281,7 @@ |
||
281 | 281 | /** |
282 | 282 | * Selects an object from the database. |
283 | 283 | * |
284 | - * @param mixed $id The id (or array of ids) to use to retrieve the object (optional) (default=0) |
|
284 | + * @param integer $id The id (or array of ids) to use to retrieve the object (optional) (default=0) |
|
285 | 285 | * @param boolean $useJoins Whether to include joining related objects (optional) (default=true) |
286 | 286 | * @param boolean $slimMode If activated only some basic fields are selected without using any joins (optional) (default=false) |
287 | 287 | * |
@@ -12,13 +12,11 @@ |
||
12 | 12 | |
13 | 13 | namespace Zikula\RoutesModule\Form\Handler\Route\Base; |
14 | 14 | |
15 | +use RuntimeException; |
|
16 | +use Symfony\Component\HttpFoundation\RedirectResponse; |
|
15 | 17 | use Zikula\RoutesModule\Form\Handler\Common\EditHandler; |
16 | 18 | use Zikula\RoutesModule\Form\Type\RouteType; |
17 | 19 | |
18 | -use Symfony\Component\HttpFoundation\RedirectResponse; |
|
19 | -use Symfony\Component\Security\Core\Exception\AccessDeniedException; |
|
20 | -use RuntimeException; |
|
21 | - |
|
22 | 20 | /** |
23 | 21 | * This handler class handles the page events of editing forms. |
24 | 22 | * It aims on the route object type. |
@@ -124,7 +124,7 @@ |
||
124 | 124 | |
125 | 125 | if (null !== $this->returnTo) { |
126 | 126 | $refererParts = explode('/', $this->returnTo); |
127 | - $isDisplayOrEditPage = $refererParts[count($refererParts)-1] == $this->idValue; |
|
127 | + $isDisplayOrEditPage = $refererParts[count($refererParts) - 1] == $this->idValue; |
|
128 | 128 | if (!$isDisplayOrEditPage || $objectIsPersisted) { |
129 | 129 | // return to referer |
130 | 130 | return $this->returnTo; |
@@ -20,8 +20,8 @@ |
||
20 | 20 | use Zikula\Core\Response\PlainResponse; |
21 | 21 | use Zikula\ExtensionsModule\Api\ApiInterface\VariableApiInterface; |
22 | 22 | use Zikula\PermissionsModule\Api\ApiInterface\PermissionApiInterface; |
23 | -use Zikula\ThemeModule\Engine\ParameterBag; |
|
24 | 23 | use Zikula\RoutesModule\Helper\ControllerHelper; |
24 | +use Zikula\ThemeModule\Engine\ParameterBag; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Helper base class for view layer methods. |
@@ -17,9 +17,9 @@ |
||
17 | 17 | use Zikula\Common\Translator\TranslatorInterface; |
18 | 18 | use Zikula\Core\Doctrine\EntityAccess; |
19 | 19 | use Zikula\PermissionsModule\Api\ApiInterface\PermissionApiInterface; |
20 | -use Zikula\UsersModule\Api\ApiInterface\CurrentUserApiInterface; |
|
21 | 20 | use Zikula\RoutesModule\Entity\Factory\EntityFactory; |
22 | 21 | use Zikula\RoutesModule\Helper\ListEntriesHelper; |
22 | +use Zikula\UsersModule\Api\ApiInterface\CurrentUserApiInterface; |
|
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Helper base class for workflow methods. |
@@ -93,31 +93,31 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
96 | - * This method returns a list of possible object states. |
|
97 | - * |
|
98 | - * @return array List of collected state information |
|
99 | - */ |
|
100 | - public function getObjectStates() |
|
101 | - { |
|
102 | - $states = []; |
|
103 | - $states[] = [ |
|
104 | - 'value' => 'initial', |
|
105 | - 'text' => $this->translator->__('Initial'), |
|
106 | - 'ui' => 'danger' |
|
107 | - ]; |
|
108 | - $states[] = [ |
|
109 | - 'value' => 'approved', |
|
110 | - 'text' => $this->translator->__('Approved'), |
|
111 | - 'ui' => 'success' |
|
112 | - ]; |
|
113 | - $states[] = [ |
|
114 | - 'value' => 'deleted', |
|
115 | - 'text' => $this->translator->__('Deleted'), |
|
116 | - 'ui' => 'danger' |
|
117 | - ]; |
|
96 | + * This method returns a list of possible object states. |
|
97 | + * |
|
98 | + * @return array List of collected state information |
|
99 | + */ |
|
100 | + public function getObjectStates() |
|
101 | + { |
|
102 | + $states = []; |
|
103 | + $states[] = [ |
|
104 | + 'value' => 'initial', |
|
105 | + 'text' => $this->translator->__('Initial'), |
|
106 | + 'ui' => 'danger' |
|
107 | + ]; |
|
108 | + $states[] = [ |
|
109 | + 'value' => 'approved', |
|
110 | + 'text' => $this->translator->__('Approved'), |
|
111 | + 'ui' => 'success' |
|
112 | + ]; |
|
113 | + $states[] = [ |
|
114 | + 'value' => 'deleted', |
|
115 | + 'text' => $this->translator->__('Deleted'), |
|
116 | + 'ui' => 'danger' |
|
117 | + ]; |
|
118 | 118 | |
119 | - return $states; |
|
120 | - } |
|
119 | + return $states; |
|
120 | + } |
|
121 | 121 | |
122 | 122 | /** |
123 | 123 | * This method returns information about a certain state. |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | |
216 | 216 | if ($buttonClass == '' && substr($actionId, 0, 6) == 'update') { |
217 | 217 | $buttonClass = 'success'; |
218 | - } |
|
218 | + } |
|
219 | 219 | |
220 | 220 | if (empty($buttonClass)) { |
221 | 221 | $buttonClass = 'default'; |
@@ -16,10 +16,10 @@ |
||
16 | 16 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
17 | 17 | use Zikula\Common\Translator\TranslatorInterface; |
18 | 18 | use Zikula\Core\Event\GenericEvent; |
19 | +use Zikula\RoutesModule\Entity\Factory\EntityFactory; |
|
19 | 20 | use Zikula\UsersModule\Api\ApiInterface\CurrentUserApiInterface; |
20 | 21 | use Zikula\UsersModule\Constant as UsersConstant; |
21 | 22 | use Zikula\UsersModule\UserEvents; |
22 | -use Zikula\RoutesModule\Entity\Factory\EntityFactory; |
|
23 | 23 | |
24 | 24 | /** |
25 | 25 | * Event handler base class for user-related events. |
@@ -17,8 +17,8 @@ |
||
17 | 17 | use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
18 | 18 | use Symfony\Component\DependencyInjection\ContainerAwareTrait; |
19 | 19 | use Zikula\Common\Translator\TranslatorTrait; |
20 | -use Zikula\UsersModule\Constant as UsersConstant; |
|
21 | 20 | use Zikula\RoutesModule\Entity\RouteEntity; |
21 | +use Zikula\UsersModule\Constant as UsersConstant; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * This is the item actions menu implementation class. |
@@ -211,7 +211,7 @@ |
||
211 | 211 | return false; |
212 | 212 | } |
213 | 213 | |
214 | - $out = "GET $path_query? HTTP/1.1\r\n"; |
|
214 | + $out = "get $path_query? HTTP/1.1\r\n"; |
|
215 | 215 | $out .= "User-Agent: $userAgent\r\n"; |
216 | 216 | $out .= "Referer: $ref\r\n"; |
217 | 217 | $out .= "Host: $urlArray[host]\r\n"; |
@@ -70,7 +70,7 @@ |
||
70 | 70 | return false; |
71 | 71 | } |
72 | 72 | |
73 | - list($id, , $timestamp) = $this->tokenGenerator->decode($token); |
|
73 | + list($id,, $timestamp) = $this->tokenGenerator->decode($token); |
|
74 | 74 | $decoded = [ |
75 | 75 | 'id' => $id, |
76 | 76 | 'time' => $timestamp |