@@ -1,12 +1,12 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * YAWIK |
|
| 4 | - * |
|
| 5 | - * @filesource |
|
| 6 | - * @copyright (c) 2013-2016 Cross Solution (http://cross-solution.de) |
|
| 7 | - * @author cbleek |
|
| 8 | - * @license MIT |
|
| 9 | - */ |
|
| 3 | + * YAWIK |
|
| 4 | + * |
|
| 5 | + * @filesource |
|
| 6 | + * @copyright (c) 2013-2016 Cross Solution (http://cross-solution.de) |
|
| 7 | + * @author cbleek |
|
| 8 | + * @license MIT |
|
| 9 | + */ |
|
| 10 | 10 | |
| 11 | 11 | namespace Core\Form\View\Helper; |
| 12 | 12 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | use Zend\Form\ElementInterface; |
| 16 | 16 | use Zend\Form\Exception; |
| 17 | 17 | |
| 18 | -class RequiredMarkInFormLabel extends FormLabel{ |
|
| 18 | +class RequiredMarkInFormLabel extends FormLabel { |
|
| 19 | 19 | public function __invoke(ElementInterface $element = null, $labelContent = null, $position = null) |
| 20 | 20 | { |
| 21 | 21 | // Set $required to a default of true | existing elements required-value |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | if (!$element->hasAttribute('id')) { |
| 86 | 86 | $elementId = preg_replace( |
| 87 | 87 | array('~[^A-Za-z0-9_-]~', '~--+~', '~^-|-$~'), |
| 88 | - array('-' , '-', ''), |
|
| 88 | + array('-', '-', ''), |
|
| 89 | 89 | $element->getName() |
| 90 | 90 | ); |
| 91 | 91 | $element->setAttribute('id', $elementId); |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | && $element->getAttribute('type') != 'checkbox' |
| 101 | 101 | && !$element instanceof Button |
| 102 | 102 | ) { |
| 103 | - $element->setAttribute('class', $element->getAttribute('class').' form-control '); |
|
| 103 | + $element->setAttribute('class', $element->getAttribute('class') . ' form-control '); |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | $elementString = $elementHelper->render($element); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | // moved label here so we can change it in the ElementViewHelper |
| 134 | - $label = $element->getLabel(); |
|
| 134 | + $label = $element->getLabel(); |
|
| 135 | 135 | if (isset($label) && '' !== $label && !$element instanceof \Zend\Form\Element\Button) { |
| 136 | 136 | // Translate the label |
| 137 | 137 | if (null !== ($translator = $this->getTranslator())) { |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | $element->setLabelAttributes($labelAttributes); |
| 175 | 175 | |
| 176 | - $label = $labelHelper($element,$label); |
|
| 176 | + $label = $labelHelper($element, $label); |
|
| 177 | 177 | if ($this->shouldWrap) { |
| 178 | 178 | $spanWidth = 12 - $labelWidth; |
| 179 | 179 | $elementString = sprintf( |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | 'id', |
| 99 | 99 | preg_replace( |
| 100 | 100 | array('~[^A-Za-z0-9_-]~', '~--+~', '~^-|-$~'), |
| 101 | - array('-' , '-' , '' ), |
|
| 101 | + array('-', '-', ''), |
|
| 102 | 102 | $formId |
| 103 | 103 | ) |
| 104 | 104 | ); |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | if (!$element->hasAttribute('id')) { |
| 120 | 120 | $elementId = preg_replace( |
| 121 | 121 | array('~[^A-Za-z0-9_-]~', '~--+~', '~^-|-$~'), |
| 122 | - array('-' , '-', ''), |
|
| 122 | + array('-', '-', ''), |
|
| 123 | 123 | $form->getName() . '-' . $element->getName() |
| 124 | 124 | ); |
| 125 | 125 | $element->setAttribute('id', $elementId); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function indexAction() |
| 57 | 57 | { |
| 58 | - if (!$this->options->getEnableRegistration()){ |
|
| 58 | + if (!$this->options->getEnableRegistration()) { |
|
| 59 | 59 | $this->notification()->info( /*@translate*/ 'Registration is disabled'); |
| 60 | 60 | return $this->redirect()->toRoute('lang'); |
| 61 | 61 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | /*@translate*/ 'Please fill form correctly' |
| 89 | 89 | ); |
| 90 | 90 | } |
| 91 | - }else{ |
|
| 91 | + } else { |
|
| 92 | 92 | /* @var $register \Zend\Form\Fieldset */ |
| 93 | 93 | $register = $this->form->get('register'); |
| 94 | 94 | $register->get('role')->setValue($this->params('role')); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | $this->form->setAttribute('action', $this->url()->fromRoute('lang/register')); |
| 108 | 108 | |
| 109 | - $viewModel->setVariable('form' , $this->form ); |
|
| 109 | + $viewModel->setVariable('form', $this->form); |
|
| 110 | 110 | |
| 111 | 111 | return $viewModel; |
| 112 | 112 | } |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | */ |
| 78 | 78 | if (isset($this->value['params']['by']) && 'me' == $this->value['params']['by']) { |
| 79 | 79 | $queryBuilder->field('user')->equals($this->user->id); |
| 80 | - }else{ |
|
| 80 | + } else{ |
|
| 81 | 81 | $queryBuilder->field('permissions.view')->equals($this->user->id); |
| 82 | 82 | } |
| 83 | 83 | if ( |