@@ -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 |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | public function generateElement() { |
5 | 5 | $return = '<select '; |
6 | 6 | $return .= $this->renderAttributes(); |
7 | - $return .= ' >'. $this->renderOptions() .'</select>'; |
|
7 | + $return .= ' >' . $this->renderOptions() . '</select>'; |
|
8 | 8 | return $return; |
9 | 9 | } |
10 | 10 | |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | $atribs['value'] = $value; |
26 | 26 | $selectedValue = $this->getElement()->getValue(); |
27 | - if ($selectedValue === 0 OR $value=== 0) { |
|
27 | + if ($selectedValue === 0 OR $value === 0) { |
|
28 | 28 | if ($value === $selectedValue) { |
29 | 29 | $atribs['selected'] = 'selected'; |
30 | 30 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | foreach ($atribs as $name=>$value) { |
36 | 36 | $return .= ' ' . $name . '="' . $value . '"'; |
37 | 37 | } |
38 | - $return .= '>'.$label.'</option>'; |
|
38 | + $return .= '>' . $label . '</option>'; |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | return $return; |
@@ -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; |
@@ -10,14 +10,14 @@ |
||
10 | 10 | $return .= '<script type="text/javascript">'; |
11 | 11 | $return .= '$(function() {'; |
12 | 12 | |
13 | - $options = array(); |
|
14 | - $options[] = 'changeMonth: true'; |
|
15 | - $options[] = 'changeYear: true'; |
|
13 | + $options = array(); |
|
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>'; |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | /** |
13 | 13 | * @return Nip_Form_Renderer_Abstract |
14 | - */ |
|
14 | + */ |
|
15 | 15 | public function getRenderer() { |
16 | 16 | return $this->_renderer; |
17 | 17 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | /** |
25 | 25 | * @return Nip_Form_Element_Abstract |
26 | - */ |
|
26 | + */ |
|
27 | 27 | public function getElement() { |
28 | 28 | return $this->_element; |
29 | 29 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | } |
43 | 43 | |
44 | 44 | public function renderElement() { |
45 | - $return = $this->renderDecorators($this->generateElement(), 'element'); |
|
45 | + $return = $this->renderDecorators($this->generateElement(), 'element'); |
|
46 | 46 | $this->getElement()->setRendered(true); |
47 | 47 | return $return; |
48 | 48 | } |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | if ($this->getElement()->isError() && $this->getElement()->getForm()->getOption('renderElementErrors') !== false) { |
69 | 69 | $errors = $this->getElement()->getErrors(); |
70 | 70 | $errors_string = implode('<br />', $errors); |
71 | - $return .= '<span class="help-inline">' . $errors_string .'</span>'; |
|
71 | + $return .= '<span class="help-inline">' . $errors_string . '</span>'; |
|
72 | 72 | } |
73 | 73 | return $return; |
74 | 74 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $value = $overrides[$name]; |
87 | 87 | } |
88 | 88 | if ($name == "name" && $this->getElement()->isGroup()) { |
89 | - $value = $value."[]"; |
|
89 | + $value = $value . "[]"; |
|
90 | 90 | } |
91 | 91 | $return .= ' ' . $name . '="' . $value . '"'; |
92 | 92 | } |
@@ -25,14 +25,14 @@ |
||
25 | 25 | $return .= '<script type="text/javascript">'; |
26 | 26 | $return .= 'jQuery(document).ready(function() {'; |
27 | 27 | |
28 | - $options = array(); |
|
29 | - $options[] = 'changeMonth: true'; |
|
30 | - $options[] = 'changeYear: true'; |
|
28 | + $options = array(); |
|
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>'; |
@@ -8,8 +8,8 @@ |
||
8 | 8 | foreach ($elements as $key=>$element) { |
9 | 9 | $element->addClass('form-control'); |
10 | 10 | $returnElements[] = |
11 | - '<div class="col-xs-4" style="max-width: 100px;">'. |
|
12 | - $element->render(). |
|
11 | + '<div class="col-xs-4" style="max-width: 100px;">' . |
|
12 | + $element->render() . |
|
13 | 13 | '</div>'; |
14 | 14 | } |
15 | 15 |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | |
32 | 32 | $return .= '<div class="form-group row-'.$element->getUniqueId().($element->isError() ? ' has-error' : '').'">'; |
33 | 33 | |
34 | - $renderLabel = $element->getOption('render_label'); |
|
35 | - if ($renderLabel !== false) { |
|
36 | - $return .= $this->renderLabel($element); |
|
37 | - } |
|
34 | + $renderLabel = $element->getOption('render_label'); |
|
35 | + if ($renderLabel !== false) { |
|
36 | + $return .= $this->renderLabel($element); |
|
37 | + } |
|
38 | 38 | |
39 | 39 | if ($this->getForm()->hasClass('form-horizontal')) { |
40 | 40 | $class = $element->getType() == 'checkbox' ? 'col-sm-offset-3 col-sm-9' : 'col-sm-9'; |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | return $return; |
57 | 57 | } |
58 | 58 | |
59 | - public function renderLabel($label, $required = false, $error = false) |
|
60 | - { |
|
59 | + public function renderLabel($label, $required = false, $error = false) |
|
60 | + { |
|
61 | 61 | if (is_object($label)) { |
62 | 62 | $element = $label; |
63 | 63 | $label = $element->getLabel(); |
@@ -65,19 +65,19 @@ discard block |
||
65 | 65 | $error = $element->isError(); |
66 | 66 | } |
67 | 67 | |
68 | - $return = '<label class="control-label'.($this->getForm()->hasClass('form-horizontal') ? ' col-sm-3' : '') . ($error ? ' error' : '') . '">'; |
|
69 | - $return .= $label. ':'; |
|
68 | + $return = '<label class="control-label'.($this->getForm()->hasClass('form-horizontal') ? ' col-sm-3' : '') . ($error ? ' error' : '') . '">'; |
|
69 | + $return .= $label. ':'; |
|
70 | 70 | |
71 | - if ($required) { |
|
72 | - $return .= '<span class="required">*</span>'; |
|
73 | - } |
|
71 | + if ($required) { |
|
72 | + $return .= '<span class="required">*</span>'; |
|
73 | + } |
|
74 | 74 | |
75 | - $return .= "</label>"; |
|
76 | - return $return; |
|
77 | - } |
|
75 | + $return .= "</label>"; |
|
76 | + return $return; |
|
77 | + } |
|
78 | 78 | |
79 | - public function renderElement(Nip_Form_Element_Abstract $element) |
|
80 | - { |
|
79 | + public function renderElement(Nip_Form_Element_Abstract $element) |
|
80 | + { |
|
81 | 81 | $element->addClass('form-control'); |
82 | 82 | return $element->renderElement(); |
83 | 83 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | return $element->render(); |
30 | 30 | } |
31 | 31 | |
32 | - $return .= '<div class="form-group row-'.$element->getUniqueId().($element->isError() ? ' has-error' : '').'">'; |
|
32 | + $return .= '<div class="form-group row-' . $element->getUniqueId() . ($element->isError() ? ' has-error' : '') . '">'; |
|
33 | 33 | |
34 | 34 | $renderLabel = $element->getOption('render_label'); |
35 | 35 | if ($renderLabel !== false) { |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | $class = $element->getType() == 'checkbox' ? 'col-sm-offset-3 col-sm-9' : 'col-sm-9'; |
41 | 41 | } |
42 | 42 | |
43 | - $return .= '<div class="'.$class.'">'; |
|
43 | + $return .= '<div class="' . $class . '">'; |
|
44 | 44 | $return .= $this->renderElement($element); |
45 | 45 | |
46 | 46 | $helpBlock = $element->getOption('form-help'); |
47 | 47 | if ($helpBlock) { |
48 | - $return .= '<span class="help-block">'.$helpBlock.'</span>'; |
|
48 | + $return .= '<span class="help-block">' . $helpBlock . '</span>'; |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | $return .= $element->renderErrors(); |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | $error = $element->isError(); |
66 | 66 | } |
67 | 67 | |
68 | - $return = '<label class="control-label'.($this->getForm()->hasClass('form-horizontal') ? ' col-sm-3' : '') . ($error ? ' error' : '') . '">'; |
|
69 | - $return .= $label. ':'; |
|
68 | + $return = '<label class="control-label' . ($this->getForm()->hasClass('form-horizontal') ? ' col-sm-3' : '') . ($error ? ' error' : '') . '">'; |
|
69 | + $return .= $label . ':'; |
|
70 | 70 | |
71 | 71 | if ($required) { |
72 | 72 | $return .= '<span class="required">*</span>'; |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | |
90 | 90 | if ($buttons) { |
91 | 91 | $return .= '<div class="form-group"> |
92 | - <div class="'.($this->getForm()->hasClass('form-horizontal') ? 'col-sm-offset-3 col-sm-9' : '').'">'; |
|
92 | + <div class="'.($this->getForm()->hasClass('form-horizontal') ? 'col-sm-offset-3 col-sm-9' : '') . '">'; |
|
93 | 93 | foreach ($buttons as $button) { |
94 | - $return .= $button->render()."\n"; |
|
94 | + $return .= $button->render() . "\n"; |
|
95 | 95 | } |
96 | 96 | $return .= '</div>'; |
97 | 97 | $return .= '</div>'; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $this->_data[$idRow][$idCol]['element'] = $element; |
39 | 39 | $this->_data[$idRow][$idCol]['type'] = $type; |
40 | 40 | if (!in_array($idCol, $this->_cols)) { |
41 | - $this->_cols[]= $idCol; |
|
41 | + $this->_cols[] = $idCol; |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
@@ -50,13 +50,13 @@ discard block |
||
50 | 50 | public function renderElements() { |
51 | 51 | $return = '<table'; |
52 | 52 | foreach ($this->_table as $attrib => $value) { |
53 | - $return .= ' '. $attrib .'="'. $value .'"'; |
|
53 | + $return .= ' ' . $attrib . '="' . $value . '"'; |
|
54 | 54 | } |
55 | 55 | $return .= '>'; |
56 | 56 | $renderRows = $this->renderRows(); |
57 | 57 | $return .= '<tbody'; |
58 | 58 | foreach ($this->_tbody as $attrib => $value) { |
59 | - $return .= ' '. $attrib .'="'. $value .'"'; |
|
59 | + $return .= ' ' . $attrib . '="' . $value . '"'; |
|
60 | 60 | } |
61 | 61 | $return .= '>'; |
62 | 62 | if ($renderRows) { |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $return .= '<tr'; |
78 | 78 | if ($this->_rows[$idRow]) { |
79 | 79 | foreach ($this->_rows[$idRow] as $attrib => $value) { |
80 | - $return .= ' '. $attrib .'="'. $value .'"'; |
|
80 | + $return .= ' ' . $attrib . '="' . $value . '"'; |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 |