5532 |
daniel |
1 |
<div class="form-group form-group-sm <?php echo ((wpsg_isSizedString($this->view['field_config']['help']))?'has-feedback':''); ?>">
|
|
|
2 |
|
|
|
3 |
<label class="col-sm-6 control-label" for="<?php echo $this->view['field_id']; ?>"><?php echo $this->view['field_label']; ?></label>
|
|
|
4 |
|
|
|
5 |
<div class="col-sm-6">
|
|
|
6 |
|
|
|
7 |
<div class="wpsg_field_wrap">
|
|
|
8 |
<input
|
|
|
9 |
type="file"
|
|
|
10 |
size="<?php echo $this->view['field_size']; ?>"
|
|
|
11 |
maxLength="<?php echo $this->view['field_maxLength']; ?>"
|
|
|
12 |
<?php if (wpsg_isSizedString($this->view['field_config']['accept'])) { ?>
|
|
|
13 |
accept="<?php echo $this->view['field_config']['accept']; ?>"
|
|
|
14 |
<?php } ?>
|
|
|
15 |
class="form-control input-sm"
|
|
|
16 |
name="<?php echo $this->view['field_name']; ?>"
|
|
|
17 |
value="<?php echo wpsg_hspc($this->view['field_value']); ?>"
|
|
|
18 |
id="<?php echo $this->view['field_id']; ?>"
|
|
|
19 |
placeholder="<?php echo wpsg_getStr($this->view['field_config']['placeholder']); ?>"
|
|
|
20 |
<?php if (wpsg_isTrue($this->view['field_config']['readonly'])) { ?>
|
|
|
21 |
readonly="readonly"
|
|
|
22 |
<?php } ?>
|
|
|
23 |
/>
|
|
|
24 |
<?php if (wpsg_isSizedString($this->view['field_config']['help'])) { ?>
|
6005 |
hartmut |
25 |
<a href="#" data-wpsg-tip="<?php echo $this->view['field_config']['help']; ?>" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=<?php echo $this->view['field_config']['help']; ?>" class="glyphicon glyphicon glyphicon-question-sign form-control-feedback" aria-hidden="true"></a>
|
5532 |
daniel |
26 |
<?php } ?>
|
|
|
27 |
</div>
|
|
|
28 |
|
|
|
29 |
</div>
|
|
|
30 |
|
5896 |
daniel |
31 |
<?php if (wpsg_isTrue($this->view['field_config']['ajax_upload'])) { ?>
|
|
|
32 |
<script type="text/javascript">/* <![CDATA[ */
|
|
|
33 |
|
|
|
34 |
jQuery(document).ready(function() {
|
|
|
35 |
|
|
|
36 |
jQuery('#<?php echo $this->view['field_id']; ?>').on('change', function() {
|
|
|
37 |
|
|
|
38 |
var data = new FormData();
|
|
|
39 |
data.append('file', this.files[0]);
|
|
|
40 |
|
|
|
41 |
jQuery.ajax( {
|
|
|
42 |
url: '<?php echo $this->view['field_config']['ajax_upload_url']; ?>',
|
|
|
43 |
data: data,
|
|
|
44 |
type: 'POST',
|
|
|
45 |
processData: false,
|
|
|
46 |
contentType: false,
|
|
|
47 |
success: function(data) {
|
|
|
48 |
|
|
|
49 |
<?php if (wpsg_isSizedString($this->view['field_config']['ajax_success'])) { ?>
|
|
|
50 |
<?php echo $this->view['field_config']['ajax_success']; ?>(data);
|
|
|
51 |
<?php } ?>
|
|
|
52 |
|
|
|
53 |
}
|
|
|
54 |
} );
|
|
|
55 |
} );
|
|
|
56 |
|
|
|
57 |
} );
|
|
|
58 |
|
|
|
59 |
/* ]]> */</script>
|
|
|
60 |
<?php } ?>
|
|
|
61 |
|
5532 |
daniel |
62 |
<div class="clearfix wpsg_clear"></div>
|
|
|
63 |
|
|
|
64 |
</div>
|