summaryrefslogtreecommitdiff
path: root/views/admin/form
diff options
context:
space:
mode:
authorDaniel Schmitzer <noreply@maennchen1.de>2016-11-04 14:34:21 +0000
committerDaniel Schmitzer <noreply@maennchen1.de>2016-11-04 14:34:21 +0000
commite4326891a13a1bf445635ffbe30fae4e7462b458 (patch)
tree7a9fef1e99eb7785467967894b55e9da2a86e3c5 /views/admin/form
parentae89a04884f3870b78f6fa1ea93d14ea8d27aedf (diff)
- Arbeiten V4
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5896 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/admin/form')
-rw-r--r--views/admin/form/checkbox.phtml29
-rw-r--r--views/admin/form/text.phtml5
-rw-r--r--views/admin/form/upload.phtml31
3 files changed, 64 insertions, 1 deletions
diff --git a/views/admin/form/checkbox.phtml b/views/admin/form/checkbox.phtml
index fcf63e6..b1f7bda 100644
--- a/views/admin/form/checkbox.phtml
+++ b/views/admin/form/checkbox.phtml
@@ -17,7 +17,11 @@
<label>
<div class="wpsg_field_wrap">
+
+ <?php if (!isset($this->view['field_config']['noHidden'])) { ?>
<input type="hidden" name="<?php echo $this->view['field_name']; ?>" value="0" />
+ <?php } ?>
+
<input type="checkbox" id="<?php echo $this->view['field_id']; ?>" name="<?php echo $this->view['field_name']; ?>" value="<?php echo wpsg_getStr($this->view['field_config']['value'], '1'); ?>" <?php echo (($this->view['field_checked'] > 0)?'checked="checked"':''); ?> />
<?php echo $this->view['field_label']; ?>
@@ -33,6 +37,31 @@
</div>
+ <?php if (wpsg_isTrue($this->view['field_config']['inlineEdit'])) { ?>
+ <script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ jQuery('#<?php echo $this->view['field_id']; ?>').on('change', function() {
+
+ var value = '0';
+ if (jQuery(this).prop('checked')) value = '1';
+
+ jQuery.ajax( {
+ url: '<?php echo $this->view['field_config']['inlineEdit_url']; ?>',
+ data: {
+ 'name': '<?php echo $this->view['field_name']; ?>',
+ 'value': value
+ }
+ } );
+
+ } );
+
+ } );
+
+ /* ]]> */</script>
+ <?php } ?>
+
<div class="clearfix wpsg_clear"></div>
</div> \ No newline at end of file
diff --git a/views/admin/form/text.phtml b/views/admin/form/text.phtml
index 450c2ea..90a2b4c 100644
--- a/views/admin/form/text.phtml
+++ b/views/admin/form/text.phtml
@@ -17,7 +17,7 @@
</div>
</div>
- <?php if (isset($this->view['field_config']['inlineEdit']) && $this->view['field_config']['inlineEdit']) { ?>
+ <?php if (wpsg_isTrue($this->view['field_config']['inlineEdit'])) { ?>
<script type="text/javascript">/* <![CDATA[ */
jQuery(document).ready(function() {
@@ -27,6 +27,9 @@
'type': '<?php echo $this->view['field_config']['inlineEdit_type']; ?>',
'placement': 'bottom'
<?php } ?>
+ <?php if (wpsg_isSizedArray($this->view['field_config']['inlineEdit_source'])) { ?>
+ ,'data': <?php echo json_encode($this->view['field_config']['inlineEdit_source']); ?>
+ <?php } ?>
} );
} );
diff --git a/views/admin/form/upload.phtml b/views/admin/form/upload.phtml
index dd0591b..8e3c47e 100644
--- a/views/admin/form/upload.phtml
+++ b/views/admin/form/upload.phtml
@@ -28,6 +28,37 @@
</div>
+ <?php if (wpsg_isTrue($this->view['field_config']['ajax_upload'])) { ?>
+ <script type="text/javascript">/* <![CDATA[ */
+
+ jQuery(document).ready(function() {
+
+ jQuery('#<?php echo $this->view['field_id']; ?>').on('change', function() {
+
+ var data = new FormData();
+ data.append('file', this.files[0]);
+
+ jQuery.ajax( {
+ url: '<?php echo $this->view['field_config']['ajax_upload_url']; ?>',
+ data: data,
+ type: 'POST',
+ processData: false,
+ contentType: false,
+ success: function(data) {
+
+ <?php if (wpsg_isSizedString($this->view['field_config']['ajax_success'])) { ?>
+ <?php echo $this->view['field_config']['ajax_success']; ?>(data);
+ <?php } ?>
+
+ }
+ } );
+ } );
+
+ } );
+
+ /* ]]> */</script>
+ <?php } ?>
+
<div class="clearfix wpsg_clear"></div>
</div>