@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * @inheritdoc |
35 | 35 | */ |
36 | - public function processAsFilter(IQuery $query, $searchData=null) |
|
36 | + public function processAsFilter(IQuery $query, $searchData = null) |
|
37 | 37 | { |
38 | 38 | $searchData = ($searchData === null) ? $this->getValue() : $searchData; |
39 | 39 | if (!empty($searchData)) { |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | public function getComponentDetails() |
60 | 60 | { |
61 | 61 | return [ |
62 | - 'name' => 'Colour', 'icon' => 'fa fa-paint-brush', 'group' => 'Text', 'order' => 25, |
|
62 | + 'name' => 'Colour', 'icon' => 'fa fa-paint-brush', 'group' => 'Text', 'order' => 25, |
|
63 | 63 | ]; |
64 | 64 | } |
65 | 65 | } |
66 | 66 | \ No newline at end of file |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function getFieldHtml() |
42 | 42 | { |
43 | - return "<div id=\"{$this->getId()}\">" . |
|
44 | - "<firefly-form-file-browser value=\"{$this->value}\" name=\"{$this->getInputName()}\"></firefly-form-file-browser>" . |
|
43 | + return "<div id=\"{$this->getId()}\">". |
|
44 | + "<firefly-form-file-browser value=\"{$this->value}\" name=\"{$this->getInputName()}\"></firefly-form-file-browser>". |
|
45 | 45 | "</div>"; |
46 | 46 | } |
47 | 47 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public function getData() |
61 | 61 | { |
62 | 62 | $name = $this->getInputName(); |
63 | - if ( neon()->request->hasFile($name) ) { |
|
63 | + if (neon()->request->hasFile($name)) { |
|
64 | 64 | $this->value = neon()->request->file($name)->save(); |
65 | 65 | } |
66 | 66 | return $this->value; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | /** |
70 | 70 | * @inheritdoc |
71 | 71 | */ |
72 | - public function getValueDisplay($context='') |
|
72 | + public function getValueDisplay($context = '') |
|
73 | 73 | { |
74 | 74 | return Html::a(neon()->firefly->getFileName($this->value), neon()->firefly->getUrl($this->value), ['target' => '_blank', 'rel' => 'noopener noreferrer']); |
75 | 75 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * @inheritDoc |
31 | 31 | */ |
32 | - public function getValueDisplay($context='') |
|
32 | + public function getValueDisplay($context = '') |
|
33 | 33 | { |
34 | 34 | $items = $this->getSelectedItems(); |
35 | 35 | return implode(',', $items); |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | /** |
76 | 76 | * @inheritdoc |
77 | 77 | */ |
78 | - public function processAsFilter(IQuery $query, $searchData=null) |
|
78 | + public function processAsFilter(IQuery $query, $searchData = null) |
|
79 | 79 | { |
80 | 80 | if (isset($searchData[0])) { |
81 | 81 | $keys = explode(',', $searchData[0]); |
82 | - foreach($keys as $key) { |
|
82 | + foreach ($keys as $key) { |
|
83 | 83 | if (!empty($key) && $key !== 'null') { |
84 | 84 | $query->where($this->getDataKey(), 'like', $key); |
85 | 85 | } |
@@ -41,8 +41,9 @@ discard block |
||
41 | 41 | public function setValueFromDb($value) |
42 | 42 | { |
43 | 43 | $items = []; |
44 | - foreach ($value as $item) |
|
45 | - $items[] = $item['key']; |
|
44 | + foreach ($value as $item) { |
|
45 | + $items[] = $item['key']; |
|
46 | + } |
|
46 | 47 | return parent::setValueFromDb($items); |
47 | 48 | } |
48 | 49 | |
@@ -55,10 +56,12 @@ discard block |
||
55 | 56 | public function getSelectedItems() |
56 | 57 | { |
57 | 58 | $values = $this->getValue(); |
58 | - if (!is_array($values)) |
|
59 | - $values = [$values]; |
|
60 | - if ($this->create === false) |
|
61 | - return Arr::only($this->getItems(), $values); |
|
59 | + if (!is_array($values)) { |
|
60 | + $values = [$values]; |
|
61 | + } |
|
62 | + if ($this->create === false) { |
|
63 | + return Arr::only($this->getItems(), $values); |
|
64 | + } |
|
62 | 65 | return $values; |
63 | 66 | } |
64 | 67 |
@@ -32,7 +32,7 @@ |
||
32 | 32 | /** |
33 | 33 | * @inheritdoc |
34 | 34 | */ |
35 | - public function getValueDisplay($context='') |
|
35 | + public function getValueDisplay($context = '') |
|
36 | 36 | { |
37 | 37 | return neon()->formatter->asJson($this->getValue()); |
38 | 38 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | /** |
21 | 21 | * @inheritDoc |
22 | 22 | */ |
23 | - public function getValueDisplay($context='') |
|
23 | + public function getValueDisplay($context = '') |
|
24 | 24 | { |
25 | 25 | $items = $this->getSelectedItems(); |
26 | 26 | return Html::displayAsTags($items); |
@@ -63,7 +63,7 @@ |
||
63 | 63 | public function getComponentDetails() |
64 | 64 | { |
65 | 65 | return [ |
66 | - 'label' => 'Link Many', 'icon' => 'fa fa-link', 'group' => 'Table Links', |
|
66 | + 'label' => 'Link Many', 'icon' => 'fa fa-link', 'group' => 'Table Links', |
|
67 | 67 | ]; |
68 | 68 | } |
69 | 69 | } |
70 | 70 | \ No newline at end of file |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | /** |
103 | 103 | * @inheritdoc |
104 | 104 | */ |
105 | - public function processAsFilter(IQuery $query, $searchData=null) |
|
105 | + public function processAsFilter(IQuery $query, $searchData = null) |
|
106 | 106 | { |
107 | 107 | $searchData = ($searchData === null) ? $this->getValue() : $searchData; |
108 | 108 | if ($searchData !== '') { |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | /** |
127 | 127 | * @inheritdoc |
128 | 128 | */ |
129 | - public function getValueDisplay($context='') |
|
129 | + public function getValueDisplay($context = '') |
|
130 | 130 | { |
131 | 131 | // the asDate function sets all empty values to 0 meaning it returns a formatted version of 1970-01-01 |
132 | 132 | if (empty($this->getData())) |
@@ -129,8 +129,9 @@ |
||
129 | 129 | public function getValueDisplay($context='') |
130 | 130 | { |
131 | 131 | // the asDate function sets all empty values to 0 meaning it returns a formatted version of 1970-01-01 |
132 | - if (empty($this->getData())) |
|
133 | - return neon()->formatter->nullDisplay; |
|
132 | + if (empty($this->getData())) { |
|
133 | + return neon()->formatter->nullDisplay; |
|
134 | + } |
|
134 | 135 | return neon()->formatter->asDate($this->getData()); |
135 | 136 | } |
136 | 137 |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | class Textarea extends Text |
20 | 20 | { |
21 | - const TEXT_TRUNCATE_LENGTH=250; |
|
21 | + const TEXT_TRUNCATE_LENGTH = 250; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * Set some allowable tags for single text fields |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | /** |
37 | 37 | * @inheritdoc |
38 | 38 | */ |
39 | - public function getValueDisplay($context='') |
|
39 | + public function getValueDisplay($context = '') |
|
40 | 40 | { |
41 | 41 | $text = parent::getValueDisplay(); |
42 | 42 | if (strlen($text) > self::TEXT_TRUNCATE_LENGTH) |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | /** |
58 | 58 | * @inheritdoc |
59 | 59 | */ |
60 | - public function processAsFilter(IQuery $query, $searchData=null) |
|
60 | + public function processAsFilter(IQuery $query, $searchData = null) |
|
61 | 61 | { |
62 | 62 | $searchData = ($searchData === null) ? $this->getValue() : $searchData; |
63 | 63 | if ($searchData !== '') { |
@@ -39,8 +39,9 @@ |
||
39 | 39 | public function getValueDisplay($context='') |
40 | 40 | { |
41 | 41 | $text = parent::getValueDisplay(); |
42 | - if (strlen($text) > self::TEXT_TRUNCATE_LENGTH) |
|
43 | - return substr($text, 0, self::TEXT_TRUNCATE_LENGTH).'...'; |
|
42 | + if (strlen($text) > self::TEXT_TRUNCATE_LENGTH) { |
|
43 | + return substr($text, 0, self::TEXT_TRUNCATE_LENGTH).'...'; |
|
44 | + } |
|
44 | 45 | return $text; |
45 | 46 | } |
46 | 47 |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | public function getData() |
56 | 56 | { |
57 | 57 | $name = $this->getInputName(); |
58 | - if ( neon()->request->hasFile($name) ) { |
|
58 | + if (neon()->request->hasFile($name)) { |
|
59 | 59 | $this->value = neon()->request->file($name)->save(); |
60 | 60 | } |
61 | 61 | return $this->value; |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | /** |
73 | 73 | * @inheritdoc |
74 | 74 | */ |
75 | - public function getValueDisplay($context='') |
|
75 | + public function getValueDisplay($context = '') |
|
76 | 76 | { |
77 | 77 | $url = neon()->firefly->getUrl($this->value); |
78 | 78 | return '<img class="img-responsive" src="'.$url.'" />'; |