@@ -17,7 +17,7 @@ |
||
17 | 17 | $name = str_replace(']', '', $name); |
18 | 18 | $parts = explode('[', $name); |
19 | 19 | |
20 | - if (count($parts) > 1 ) { |
|
20 | + if (count($parts) > 1) { |
|
21 | 21 | if ($_FILES[$parts[0]]) { |
22 | 22 | $fileData = []; |
23 | 23 | foreach ($_FILES[$parts[0]] as $key=>$data) { |
@@ -13,7 +13,7 @@ |
||
13 | 13 | public function addOptionsArray($options, $valueKey, $labelKey) |
14 | 14 | { |
15 | 15 | foreach ($options as $key => $option) { |
16 | - $option = (object)$option; |
|
16 | + $option = (object) $option; |
|
17 | 17 | |
18 | 18 | $oValue = $option->$valueKey; |
19 | 19 | $oLabel = $option->$labelKey; |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | |
19 | 19 | public function updateNameSelects() { |
20 | 20 | $inputName = $this->getName(); |
21 | - $this->_elements['hours']->setName($inputName.'[hours]'); |
|
22 | - $this->_elements['minutes']->setName($inputName.'[minutes]'); |
|
23 | - $this->_elements['seconds']->setName($inputName.'[seconds]'); |
|
21 | + $this->_elements['hours']->setName($inputName . '[hours]'); |
|
22 | + $this->_elements['minutes']->setName($inputName . '[minutes]'); |
|
23 | + $this->_elements['seconds']->setName($inputName . '[seconds]'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | public function initSelects() { |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | $hoursElement = $this->getForm()->getNewElement('select'); |
31 | 31 | |
32 | 32 | $hoursElement->addOption('-', 'HH'); |
33 | - for ($i=0; $i<=24 ; $i++) { |
|
34 | - $hoursElement->addOption($i, $i.'h'); |
|
33 | + for ($i = 0; $i <= 24; $i++) { |
|
34 | + $hoursElement->addOption($i, $i . 'h'); |
|
35 | 35 | } |
36 | 36 | $hoursElement->setValue('-'); |
37 | 37 | |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | $minutesElement = $this->getForm()->getNewElement('select'); |
44 | 44 | |
45 | 45 | $minutesElement->addOption('-', 'MM'); |
46 | - for ($i=0; $i<=59 ; $i++) { |
|
47 | - $minutesElement->addOption($i, $i.'m'); |
|
46 | + for ($i = 0; $i <= 59; $i++) { |
|
47 | + $minutesElement->addOption($i, $i . 'm'); |
|
48 | 48 | } |
49 | 49 | $minutesElement->setValue('-'); |
50 | 50 | |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | $secondsElement = $this->getForm()->getNewElement('select'); |
56 | 56 | |
57 | 57 | $secondsElement->addOption('-', 'SS'); |
58 | - for ($i=0; $i<=59 ; $i++) { |
|
59 | - $secondsElement->addOption($i, $i.'s'); |
|
58 | + for ($i = 0; $i <= 59; $i++) { |
|
59 | + $secondsElement->addOption($i, $i . 's'); |
|
60 | 60 | } |
61 | 61 | $secondsElement->setValue('-'); |
62 | 62 | |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | $value = $this->getValue(); |
107 | 107 | if ($value) { |
108 | 108 | $expectedValue = str_pad(intval($this->_elements['hours']->getValue()), 2, "0", STR_PAD_LEFT); |
109 | - $expectedValue .= ':'. str_pad(intval($this->_elements['minutes']->getValue()), 2, "0", STR_PAD_LEFT); |
|
110 | - $expectedValue .= ':'. str_pad(intval($this->_elements['seconds']->getValue()), 2, "0", STR_PAD_LEFT); |
|
109 | + $expectedValue .= ':' . str_pad(intval($this->_elements['minutes']->getValue()), 2, "0", STR_PAD_LEFT); |
|
110 | + $expectedValue .= ':' . str_pad(intval($this->_elements['seconds']->getValue()), 2, "0", STR_PAD_LEFT); |
|
111 | 111 | if ($expectedValue != $value) { |
112 | 112 | $message = $this->getForm()->getMessageTemplate('bad-' . $this->getName()); |
113 | 113 | $message = $message ? $message : 'I couldn\'t parse the ' . strtolower($this->getLabel()) . ' you entered'; |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | $hour = intval($this->_elements['hours']->getValue()); |
123 | 123 | $minutes = intval($this->_elements['minutes']->getValue()); |
124 | 124 | $seconds = intval($this->_elements['seconds']->getValue()); |
125 | - if ($hour+$minutes+$seconds > 0) { |
|
126 | - return mktime($hour,$minutes,$seconds); |
|
125 | + if ($hour + $minutes + $seconds > 0) { |
|
126 | + return mktime($hour, $minutes, $seconds); |
|
127 | 127 | } |
128 | 128 | return false; |
129 | 129 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | |
25 | 25 | public function getModelMessage($name, $variables = array()) |
26 | 26 | { |
27 | - return $this->getModel()->getManager()->getMessage('form.'.$name, $variables); |
|
27 | + return $this->getModel()->getManager()->getMessage('form.' . $name, $variables); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $decorator = $this->generate(); |
51 | 51 | switch ($this->_placement) { |
52 | 52 | case self::PREPEND: |
53 | - return $decorator . $this->getSeparator() . $content; |
|
53 | + return $decorator . $this->getSeparator() . $content; |
|
54 | 54 | case self::APPEND: |
55 | 55 | default: |
56 | 56 | return $content . $this->getSeparator() . $decorator; |
@@ -11,13 +11,13 @@ |
||
11 | 11 | $return .= '$(function() {'; |
12 | 12 | |
13 | 13 | $options = []; |
14 | - $options[] = 'changeMonth: true'; |
|
15 | - $options[] = 'changeYear: true'; |
|
14 | + $options[] = 'changeMonth: true'; |
|
15 | + $options[] = 'changeYear: true'; |
|
16 | 16 | |
17 | - $yearRange = $this->getElement()->getOption('yearRange'); |
|
18 | - if ($yearRange) { |
|
19 | - $options[] = 'yearRange: "'.$yearRange.'"'; |
|
20 | - } |
|
17 | + $yearRange = $this->getElement()->getOption('yearRange'); |
|
18 | + if ($yearRange) { |
|
19 | + $options[] = 'yearRange: "'.$yearRange.'"'; |
|
20 | + } |
|
21 | 21 | $format = $this->getElement()->getFormat(); |
22 | 22 | $format = strtr($format, array( |
23 | 23 | 'Y' => 'yy', |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | |
17 | 17 | $yearRange = $this->getElement()->getOption('yearRange'); |
18 | 18 | if ($yearRange) { |
19 | - $options[] = 'yearRange: "'.$yearRange.'"'; |
|
19 | + $options[] = 'yearRange: "' . $yearRange . '"'; |
|
20 | 20 | } |
21 | 21 | $format = $this->getElement()->getFormat(); |
22 | 22 | $format = strtr($format, array( |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | 'd' => 'dd', |
25 | 25 | 'm' => 'mm', |
26 | 26 | )); |
27 | - $options[] = 'dateFormat: "'.$format.'"'; |
|
27 | + $options[] = 'dateFormat: "' . $format . '"'; |
|
28 | 28 | |
29 | 29 | $return .= " jQuery('#{$this->getElement()->getAttrib('id')}').datepicker({ |
30 | - ".implode(',',$options)." |
|
30 | + " . implode(',', $options) . " |
|
31 | 31 | });"; |
32 | 32 | $return .= '});'; |
33 | 33 | $return .= '</script>'; |
@@ -2,9 +2,9 @@ |
||
2 | 2 | class Nip_Form_Renderer_Elements_Checkbox extends Nip_Form_Renderer_Elements_Input_Abstract { |
3 | 3 | |
4 | 4 | public function generateElement() { |
5 | - if (!$this->getElement()->getValue()) { |
|
6 | - $this->getElement()->setValue('on'); |
|
7 | - } |
|
5 | + if (!$this->getElement()->getValue()) { |
|
6 | + $this->getElement()->setValue('on'); |
|
7 | + } |
|
8 | 8 | $this->getElement()->removeClass('form-control'); |
9 | 9 | |
10 | 10 | $return = '<div class="checkbox">'; |
@@ -10,7 +10,7 @@ |
||
10 | 10 | $return = '<div class="checkbox">'; |
11 | 11 | $return .= '<label>'; |
12 | 12 | $return .= parent::generateElement(); |
13 | - $return .= ' '. $this->getElement()->getLabel(); |
|
13 | + $return .= ' ' . $this->getElement()->getLabel(); |
|
14 | 14 | $return .= '</label>'; |
15 | 15 | $return .= '</div>'; |
16 | 16 | return $return; |
@@ -26,13 +26,13 @@ |
||
26 | 26 | $return .= 'jQuery(document).ready(function() {'; |
27 | 27 | |
28 | 28 | $options = []; |
29 | - $options[] = 'changeMonth: true'; |
|
30 | - $options[] = 'changeYear: true'; |
|
29 | + $options[] = 'changeMonth: true'; |
|
30 | + $options[] = 'changeYear: true'; |
|
31 | 31 | |
32 | - $yearRange = $this->getElement()->getOption('yearRange'); |
|
33 | - if ($yearRange) { |
|
34 | - $options[] = 'yearRange: "'.$yearRange.'"'; |
|
35 | - } |
|
32 | + $yearRange = $this->getElement()->getOption('yearRange'); |
|
33 | + if ($yearRange) { |
|
34 | + $options[] = 'yearRange: "'.$yearRange.'"'; |
|
35 | + } |
|
36 | 36 | $format = $this->getElement()->getFormat(); |
37 | 37 | $format = strtr($format, array( |
38 | 38 | 'Y' => 'yy', |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | $elements = $this->getElement()->getElements(); |
8 | 8 | foreach ($elements as $key=>$element) { |
9 | 9 | $element->addClass('form-control'); |
10 | - $returnElements[] = '<div class="col-xs-4" style="max-width:'.($key == 'day' ? 95 : 110).'px;">'. |
|
11 | - $element->render().'</div>'; |
|
10 | + $returnElements[] = '<div class="col-xs-4" style="max-width:' . ($key == 'day' ? 95 : 110) . 'px;">' . |
|
11 | + $element->render() . '</div>'; |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | $return .= implode(' ', $returnElements); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | $yearRange = $this->getElement()->getOption('yearRange'); |
33 | 33 | if ($yearRange) { |
34 | - $options[] = 'yearRange: "'.$yearRange.'"'; |
|
34 | + $options[] = 'yearRange: "' . $yearRange . '"'; |
|
35 | 35 | } |
36 | 36 | $format = $this->getElement()->getFormat(); |
37 | 37 | $format = strtr($format, array( |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | 'd' => 'dd', |
40 | 40 | 'm' => 'mm', |
41 | 41 | )); |
42 | - $options[] = 'dateFormat: "'.$format.'"'; |
|
42 | + $options[] = 'dateFormat: "' . $format . '"'; |
|
43 | 43 | |
44 | 44 | $return .= " jQuery('#{$this->getElement()->getAttrib('id')}').datepicker({ |
45 | - ".implode(',',$options)." |
|
45 | + " . implode(',', $options) . " |
|
46 | 46 | });"; |
47 | 47 | $return .= '});'; |
48 | 48 | $return .= '</script>'; |
@@ -4,7 +4,7 @@ |
||
4 | 4 | public function generateElement() { |
5 | 5 | $return = '<textarea '; |
6 | 6 | $return .= $this->renderAttributes(); |
7 | - $return .= ' >'. $this->getElement()->getValue() .'</textarea>'; |
|
7 | + $return .= ' >' . $this->getElement()->getValue() . '</textarea>'; |
|
8 | 8 | return $return; |
9 | 9 | } |
10 | 10 |