diff --git a/plugins/PicoContact/src/P01contact_Field.php b/plugins/PicoContact/src/P01contact_Field.php
index 2f08bbe..06b7690 100644
--- a/plugins/PicoContact/src/P01contact_Field.php
+++ b/plugins/PicoContact/src/P01contact_Field.php
@@ -1,4 +1,5 @@
isBlacklisted()) {
- $this->error = 'field_'.$reason;
+ $this->error = 'field_' . $reason;
return false;
}
// not empty but not valid
if (!empty($this->value) && !$this->isValid()) {
- $this->error = 'field_'.$this->type;
+ $this->error = 'field_' . $this->type;
return false;
}
@@ -145,7 +146,7 @@ class P01contactField
'secret' => $this->form->config('recaptcha_secret_key'),
'response' => $answer,
];
- $url = 'https://www.google.com/recaptcha/api/siteverify?'.http_build_query($params);
+ $url = 'https://www.google.com/recaptcha/api/siteverify?' . http_build_query($params);
if (function_exists('curl_version')) {
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HEADER, false);
@@ -204,30 +205,25 @@ class P01contactField
*/
public function html()
{
- $id = 'p01-contact'.$this->form->getId().'_field'.$this->id;
- $name = 'p01-contact_fields['.$this->id.']';
+ $id = 'p01-contact' . $this->form->getId() . '_field' . $this->id;
+ $name = 'p01-contact_fields[' . $this->id . ']';
$type = $this->getGeneralType();
$orig = $type != $this->type ? $this->type : '';
$value = $this->value;
$disabled = $this->locked ? ' disabled="disabled"' : '';
$required = $this->required ? ' required ' : '';
- $placeholder = $this->placeholder ? ' placeholder="'.$this->placeholder.'"' : '';
+ $placeholder = $this->placeholder ? ' placeholder="' . $this->placeholder . '"' : '';
$is_single_option = is_array($this->value) && 1 == count($this->value) ? 'inline' : '';
- $html = "
";
+ $html = "
";
- $html .= '
';
- if ('' === $is_single_option) {
- $html .= $this->htmlLabel($id);
- }
- $html .= '
';
- $html .= '
';
switch ($type) {
case 'textarea':
- $html .= '
';
@@ -263,20 +259,21 @@ class P01contactField
$value = !empty($v) ? $v : 'Default';
$selected = $this->isSelected($i) ? ' selected="selected"' : '';
$html .= "
';
+ $html .= $value . '';
}
$html .= '';
break;
default:
- $html .= '
';
+ $html .= '
';
break;
}
-
- $html .= '
';
+ if ('' === $is_single_option) {
+ $html .= $this->htmlLabel($id);
+ }
$html .= '
';
return $html;
@@ -294,7 +291,7 @@ class P01contactField
$emphasis = $this->value ? 'font-weight:bold' : 'font-style:italic';
$html .= "\n\n\n";
$html .= '';
- $html .= '| ';
+ $html .= ' | ';
$html .= $this->title ? $this->title : ucfirst($this->form->lang($this->type));
$html .= ' | ';
$html .= "\t\t";
@@ -302,7 +299,7 @@ class P01contactField
// properties
$html .= '';
if (!$this->value) {
- $html .= $this->form->lang('empty').' ';
+ $html .= $this->form->lang('empty') . ' ';
}
if ($this->title) {
$properties[] = $this->type;
@@ -316,15 +313,15 @@ class P01contactField
}
}
if (count($properties)) {
- $html .= '('.implode(', ', $properties).') ';
+ $html .= '(' . implode(', ', $properties) . ') ';
}
- $html .= '#'.$this->id;
+ $html .= '#' . $this->id;
$html .= ' |
';
$html .= "\n\n";
// value
if (!$this->value) {
- return $html.'';
+ return $html . '';
}
$html .= '';
$html .= '';
@@ -340,7 +337,7 @@ class P01contactField
$html .= ' ';
$checkmark = '☐';
}
- $html .= ''.$checkmark.'';
+ $html .= '' . $checkmark . '';
$html .= empty($v) ? 'Default' : $v;
$html .= " \n";
}
@@ -371,17 +368,17 @@ class P01contactField
*/
private function htmlLabel($for)
{
- $html .= ' |