summaryrefslogtreecommitdiff
path: root/views/admin/form/checkbox.phtml
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/checkbox.phtml
parentae89a04884f3870b78f6fa1ea93d14ea8d27aedf (diff)
- Arbeiten V4
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5896 0d5edaf7-2b12-4e95-93f4-047927463d4b
Diffstat (limited to 'views/admin/form/checkbox.phtml')
-rw-r--r--views/admin/form/checkbox.phtml29
1 files changed, 29 insertions, 0 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