Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/microweber/microweber into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Radanovn committed Sep 9, 2021
2 parents 55f6569 + 1eca893 commit 81fb45d
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 33 deletions.
2 changes: 2 additions & 0 deletions src/MicroweberPackages/Form/FormsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ public function post($params)
$validatorMessages = reset($inputFieldErros);
}
return array(
'form_errors'=>$validator->messages()->toArray(),
'error' => $validatorMessages
);
}
Expand Down Expand Up @@ -493,6 +494,7 @@ public function post($params)
$validatorMessages = reset($inputFieldErros);
}
return array(
'form_errors'=>$validator->messages()->toArray(),
'error' => $validatorMessages
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
<?php $i++; ?>
<div class="checkbox">
<label>
<input type="checkbox" name="<?php echo $data["name"]; ?>[]" id="field-<?php echo $data["id"]; ?>" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $value; ?>"/> <?php echo $value; ?>
<input type="checkbox" name="<?php echo $data["name_key"]; ?>[]" id="field-<?php echo $data["id"]; ?>" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $value; ?>"/> <?php echo $value; ?>
</label>
</div>

<?php endforeach; ?>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<input type="hidden" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $data["value"]; ?>" name="<?php echo $data["name"]; ?>" />
<input type="hidden" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $data["value"]; ?>" name="<?php echo $data["name_key"]; ?>" />
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<span class="mw-ui-btn" id="upload_button_<?php echo($rand); ?>">
<span class="mw-icon-upload"></span>&nbsp; <?php _e("Browse"); ?>
</span>
<input type="hidden" class="mw-ui-invisible-field" id="file_name<?php echo $data["name"]; ?>" autocomplete="off"/>
<input type="hidden" class="mw-ui-invisible-field" id="file_name<?php echo $data["name_key"]; ?>" autocomplete="off"/>

<input type="hidden" <?php if ($settings['required']) { ?> required <?php } ?> class="mw-ui-invisible-field" id="uploaded_file_src<?php echo($rand); ?>" name="<?php echo $data["name"]; ?>" autocomplete="off"/>
<input type="hidden" <?php if ($settings['required']) { ?> required <?php } ?> class="mw-ui-invisible-field" id="uploaded_file_src<?php echo($rand); ?>" name="<?php echo $data["name_key"]; ?>" autocomplete="off"/>

<span class="ellipsis" id="val_<?php echo $rand; ?>" style="font-size: small; opacity: 0.66; max-width: 200px; margin-left: 12px;"></span>

Expand All @@ -43,7 +43,7 @@
$(document).ready(function () {
var uploader = mw.files.uploader({
multiple: false,
name: '<?php echo $data["name"]; ?>',
name: '<?php echo $data["name_key"]; ?>',
autostart: true,
element: document.getElementById('upload_button_<?php echo($rand); ?>'),
filetypes: '<?php if ($settings['options']['file_types']): ?><?php echo implode(",", $settings['options']['file_types']); ?> <?php endif ?>'
Expand All @@ -54,7 +54,7 @@

$(uploader).on('FilesAdded', function (frame, file) {

document.getElementById('file_name<?php echo $data["name"]; ?>').value = file[0].name;
document.getElementById('file_name<?php echo $data["name_key"]; ?>').value = file[0].name;

});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
foreach ($data['values'] as $key => $value): ?>
<?php $i++; ?>
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" name="<?php echo $data["name"]; ?>[]" id="field-<?php echo $i; ?>-<?php echo $data["id"]; ?>" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $value; ?>"/>
<input class="custom-control-input" type="checkbox" name="<?php echo $data["name_key"]; ?>[]" id="field-<?php echo $i; ?>-<?php echo $data["id"]; ?>" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $value; ?>"/>
<label class="custom-control-label" for="field-<?php echo $i; ?>-<?php echo $data["id"]; ?>"><?php echo $value; ?></label>
</div>
<?php endforeach; ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<input type="hidden" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $data["value"]; ?>" name="<?php echo $data["name"]; ?>" />
<input type="hidden" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $data["value"]; ?>" name="<?php echo $data["name_key"]; ?>" />
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
<span class="mw-icon-upload"></span>&nbsp; <?php _e("Browse"); ?>
</span>

<input type="hidden" class="mw-ui-invisible-field" id="file_name<?php echo $data["name"]; ?>" autocomplete="off" />
<input type="hidden" class="mw-ui-invisible-field" id="file_name<?php echo $data["name_key"]; ?>" autocomplete="off" />

<input type="hidden" <?php if ($settings['required']){ ?> required <?php } ?> class="mw-ui-invisible-field" id="uploaded_file_src<?php echo($rand); ?>" name="<?php echo $data["name"]; ?>" autocomplete="off" />
<input type="hidden" <?php if ($settings['required']){ ?> required <?php } ?> class="mw-ui-invisible-field" id="uploaded_file_src<?php echo($rand); ?>" name="<?php echo $data["name_key"]; ?>" autocomplete="off" />

<span class="ellipsis" id="val_<?php echo $rand; ?>" style="font-size: small; opacity: 0.66; max-width: 200px; margin-left: 12px;"></span>

Expand All @@ -39,7 +39,7 @@

var uploader = mw.upload({
multiple:false,
name:'<?php echo $data["name"]; ?>',
name:'<?php echo $data["name_key"]; ?>',
autostart: true,
element: document.getElementById('upload_button_<?php echo($rand); ?>'),
filetypes:'<?php if ($settings['options']['file_types']): ?><?php echo implode(",",$settings['options']['file_types']); ?> <?php endif ?>'
Expand All @@ -49,7 +49,7 @@
var local_id = '<?php echo($rand); ?>';

$uploader.on('FilesAdded', function(frame, file){
document.getElementById('file_name<?php echo $data["name"]; ?>').value = file[0].name;
document.getElementById('file_name<?php echo $data["name_key"]; ?>').value = file[0].name;
});

$uploader.on('progress', function(frame, file){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
foreach ($data['values'] as $key => $value): ?>
<?php $i++; ?>
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" name="<?php echo $data["name"]; ?>[]" id="field-<?php echo $i; ?>-<?php echo $data["id"]; ?>" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $value; ?>"/>
<input class="custom-control-input" type="checkbox" name="<?php echo $data["name_key"]; ?>[]" id="field-<?php echo $i; ?>-<?php echo $data["id"]; ?>" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $value; ?>"/>
<label class="custom-control-label" for="field-<?php echo $i; ?>-<?php echo $data["id"]; ?>"><?php echo $value; ?></label>
</div>
<?php endforeach; ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<input type="hidden" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $data["value"]; ?>" name="<?php echo $data["name"]; ?>" />
<input type="hidden" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $data["value"]; ?>" name="<?php echo $data["name_key"]; ?>" />
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<span class="mw-icon-upload"></span>&nbsp; <?php _e("Browse"); ?>
</span>

<input type="hidden" class="mw-ui-invisible-field" id="file_name<?php echo $data["name"]; ?>" autocomplete="off" />
<input type="hidden" class="mw-ui-invisible-field" id="file_name<?php echo $data["name_key"]; ?>" autocomplete="off" />

<input type="hidden" <?php if ($settings['required']){ ?> required <?php } ?> class="mw-ui-invisible-field" id="uploaded_file_src<?php echo($rand); ?>" name="<?php echo $data["name"]; ?>" autocomplete="off" />
<input type="hidden" <?php if ($settings['required']){ ?> required <?php } ?> class="mw-ui-invisible-field" id="uploaded_file_src<?php echo($rand); ?>" name="<?php echo $data["name_key"]; ?>" autocomplete="off" />

<span class="ellipsis" id="val_<?php echo $rand; ?>" style="font-size: small; opacity: 0.66; max-width: 200px; margin-left: 12px;"></span>

Expand All @@ -42,7 +42,7 @@

var uploader = mw.upload({
multiple:false,
name:'<?php echo $data["name"]; ?>',
name:'<?php echo $data["name_key"]; ?>',
autostart: true,
element: document.getElementById('upload_button_<?php echo($rand); ?>'),
filetypes:'<?php if ($settings['options']['file_types']): ?><?php echo implode(",",$settings['options']['file_types']); ?> <?php endif ?>'
Expand All @@ -52,7 +52,7 @@
var local_id = '<?php echo($rand); ?>';

$uploader.on('FilesAdded', function(frame, file){
document.getElementById('file_name<?php echo $data["name"]; ?>').value = file[0].name;
document.getElementById('file_name<?php echo $data["name_key"]; ?>').value = file[0].name;
});

$uploader.on('progress', function(frame, file){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
foreach ($data['values'] as $key => $value): ?>
<?php $i++; ?>
<div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" name="<?php echo $data["name"]; ?>[]" id="field-<?php echo $i; ?>-<?php echo $data["id"]; ?>" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $value; ?>"/>
<input class="custom-control-input" type="checkbox" name="<?php echo $data["name_key"]; ?>[]" id="field-<?php echo $i; ?>-<?php echo $data["id"]; ?>" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $value; ?>"/>
<label class="custom-control-label" for="field-<?php echo $i; ?>-<?php echo $data["id"]; ?>"><?php echo $value; ?></label>
</div>
<?php endforeach; ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<input type="hidden" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $data["value"]; ?>" name="<?php echo $data["name"]; ?>" />
<input type="hidden" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $data["value"]; ?>" name="<?php echo $data["name_key"]; ?>" />
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<span class="mw-icon-upload"></span>&nbsp; <?php _e("Browse"); ?>
</span>

<input type="hidden" class="mw-ui-invisible-field" id="file_name<?php echo $data["name"]; ?>" autocomplete="off" />
<input type="hidden" class="mw-ui-invisible-field" id="file_name<?php echo $data["name_key"]; ?>" autocomplete="off" />

<input type="hidden" <?php if ($settings['required']){ ?> required <?php } ?> class="mw-ui-invisible-field" id="uploaded_file_src<?php echo($rand); ?>" name="<?php echo $data["name"]; ?>" autocomplete="off" />
<input type="hidden" <?php if ($settings['required']){ ?> required <?php } ?> class="mw-ui-invisible-field" id="uploaded_file_src<?php echo($rand); ?>" name="<?php echo $data["name_key"]; ?>" autocomplete="off" />

<span class="ellipsis" id="val_<?php echo $rand; ?>" style="font-size: small; opacity: 0.66; max-width: 200px; margin-left: 12px;"></span>

Expand All @@ -42,7 +42,7 @@

var uploader = mw.upload({
multiple:false,
name:'<?php echo $data["name"]; ?>',
name:'<?php echo $data["name_key"]; ?>',
autostart: true,
element: document.getElementById('upload_button_<?php echo($rand); ?>'),
filetypes:'<?php if ($settings['options']['file_types']): ?><?php echo implode(",",$settings['options']['file_types']); ?> <?php endif ?>'
Expand All @@ -52,7 +52,7 @@
var local_id = '<?php echo($rand); ?>';

$uploader.on('FilesAdded', function(frame, file){
document.getElementById('file_name<?php echo $data["name"]; ?>').value = file[0].name;
document.getElementById('file_name<?php echo $data["name_key"]; ?>').value = file[0].name;
});

$uploader.on('progress', function(frame, file){
Expand Down
6 changes: 3 additions & 3 deletions userfiles/modules/custom_fields/templates/mw-ui/checkbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<?php $i = 0; foreach($data['values'] as $value): ?>
<?php $i++; ?>
<label class="mw-ui-check">
<input type="checkbox" name="<?php echo $data["name"]; ?>[]" id="field-<?php echo $data["id"]; ?>" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $value; ?>" />
<input type="checkbox" name="<?php echo $data["name_key"]; ?>[]" id="field-<?php echo $data["id"]; ?>" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $value; ?>" />
<span></span>
<span><?php echo $value; ?></span>
</label>

<?php endforeach; ?>
</div>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion userfiles/modules/custom_fields/templates/mw-ui/hidden.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<input type="hidden" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $data["value"]; ?>" name="<?php echo $data["name"]; ?>" />
<input type="hidden" data-custom-field-id="<?php echo $data["id"]; ?>" value="<?php echo $data["value"]; ?>" name="<?php echo $data["name_key"]; ?>" />
8 changes: 4 additions & 4 deletions userfiles/modules/custom_fields/templates/mw-ui/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
<span class="mw-ui-btn" id="upload_button_<?php echo($rand); ?>">
<span class="mw-icon-upload"></span>&nbsp; <?php _e("Browse"); ?>
</span>
<input type="hidden" class="mw-ui-invisible-field" id="file_name<?php echo $data["name"]; ?>" autocomplete="off" />
<input type="hidden" class="mw-ui-invisible-field" id="file_name<?php echo $data["name_key"]; ?>" autocomplete="off" />

<input type="hidden" <?php if ($settings['required']){ ?> required <?php } ?> class="mw-ui-invisible-field" id="uploaded_file_src<?php echo($rand); ?>" name="<?php echo $data["name"]; ?>" autocomplete="off" />
<input type="hidden" <?php if ($settings['required']){ ?> required <?php } ?> class="mw-ui-invisible-field" id="uploaded_file_src<?php echo($rand); ?>" name="<?php echo $data["name_key"]; ?>" autocomplete="off" />

<span class="ellipsis" id="val_<?php echo $rand; ?>" style="font-size: small; opacity: 0.66; max-width: 200px; margin-left: 12px;"></span>

Expand All @@ -41,7 +41,7 @@

var uploader = mw.upload({
multiple:false,
name:'<?php echo $data["name"]; ?>',
name:'<?php echo $data["name_key"]; ?>',
autostart: true,
element: document.getElementById('upload_button_<?php echo($rand); ?>'),
filetypes:'<?php if ($settings['options']['file_types']): ?><?php echo implode(",",$settings['options']['file_types']); ?> <?php endif ?>'
Expand All @@ -53,7 +53,7 @@

$uploader.on('FilesAdded', function(frame, file){

document.getElementById('file_name<?php echo $data["name"]; ?>').value = file[0].name;
document.getElementById('file_name<?php echo $data["name_key"]; ?>').value = file[0].name;

});

Expand Down

0 comments on commit 81fb45d

Please sign in to comment.