Subversion Repositories wpShopGermany4

Rev

Rev 7787 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5896 daniel 1
<?php
2
 
3
    /**
7787 daniel 4
     * User: Daschmi (https://daschmi.de)
5896 daniel 5
     * Date: 03.11.2016
6
     * Time: 14:12
7
     */
8
 
9
    $inlineEdit_url = WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=inlinedit&noheader=1&profil_id='.$this->view['profil']['id'];
10
 
11
?>
12
<table class="table table-body-striped" id="wpsg_mod_export_fieldtable">
13
    <thead>
14
        <tr>
15
            <th class="wpsg_mod_export_col_name"><?php echo __('Spaltenname', 'wpsg'); ?></th>
16
            <th class="wpsg_mod_export_col_value"><?php echo __('Wert', 'wpsg'); ?></th>
17
            <th class="wpsg_mod_export_col_format"><?php echo __('Format', 'wpsg'); ?></th>
5911 daniel 18
 
19
            <th style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_XML)?'table-cell':'none'); ?>;" title="<?php echo __('Feld im XML als Attribut exportieren', 'wpsg'); ?>" class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_XML; ?> wpsg_mod_export_col_att"><?php echo __('Att'); ?></th>
20
            <th style="display:<?php echo (($this->view['profil']['format'] != wpsg_mod_export::FORMAT_XML)?'table-cell; padding:0px':'none'); ?>;" class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>">&nbsp;</th>
21
 
5896 daniel 22
            <th class="wpsg_mod_export_col_remove">
23
 
24
                <a style="float:right;" onclick="return wpsg_mod_export_addField(<?php echo $this->view['profil']['id']; ?>);" title="<?php echo __('Neues Feld einfügen', 'wpsg'); ?>" href="#" class="glyphicon glyphicon-plus"></a>
25
 
26
            </th>
27
        </tr>
28
    </thead>
29
 
30
    <?php $i = 0; foreach ((array)$this->view['profil']['fields'] as $f_id => $f) { $i ++; ?>
31
    <tbody id="field_<?php echo $f_id; ?>">
32
        <tr class="wpsg_tablerow wpsg_mod_export_row1 wpsg_mod_export_fieldrow_<?php echo $f_id; ?> <?php echo (($i % 2 == 0)?'odd':'even'); ?>">
33
 
34
            <td class="wpsg_mod_export_col">
35
                <div class="name wpsg_editable" id="field_name_<?php echo $f_id; ?>"><?php echo $f['name']; ?></div>
36
            </td>
37
            <td class="wpsg_mod_export_col_field"><div class="wpsg_editable" id="field_typ_<?php echo $f_id; ?>"><?php
38
 
8131 daniel 39
                foreach ($this->view['fields'] as $fieldgroup) {
5896 daniel 40
 
8131 daniel 41
                    foreach ($fieldgroup['fields'] as $field_key => $field) {
5896 daniel 42
 
8131 daniel 43
                        if ($field_key == $f['value_key']) {
5896 daniel 44
 
45
                            echo $field;
46
 
47
                        }
48
 
49
                    }
50
 
51
                }
52
 
53
            ?></div></td>
54
            <td class="wpsg_mod_export_col_format">
55
 
56
                <div class="wpsg_editable" id="field_format_<?php echo $f_id; ?>"><?php echo $this->view['arFieldFormats'][$f['format']]; ?></div>
57
 
5911 daniel 58
            </td>
59
 
60
            <td style="display:<?php echo (($this->view['profil']['format'] == wpsg_mod_export::FORMAT_XML)?'table-cell':'none'); ?>;" class="wpsg_mod_export_col_att wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_XML; ?>">
61
 
62
                <input type="checkbox" onchange="wpsg_mod_export_setAtt(this, <?php echo $f['id']; ?>);" value="1" <?php echo ((wpsg_isSizedInt($f['xml_att']))?'checked="checked"':''); ?> />
63
 
5896 daniel 64
            </td>
5911 daniel 65
            <td style="display:<?php echo (($this->view['profil']['format'] != wpsg_mod_export::FORMAT_XML)?'table-cell; padding:0px':'none'); ?>;" class="wpsg_mod_export_format wpsg_mod_export_format_<?php echo wpsg_mod_export::FORMAT_CSV; ?>">&nbsp;</td>
66
 
5896 daniel 67
            <td>
68
 
69
                <a style="float:right;" onclick="return wpsg_mod_export_removeField(<?php echo $f_id; ?>);" title="<?php echo __('Feld löschen', 'wpsg'); ?>" href="#" class="glyphicon glyphicon-trash"></a>
70
 
71
            </td>
72
 
73
        </tr>
8131 daniel 74
        <tr id="staticformat_<?php echo $f_id; ?>" style="<?php echo (($f['value_key'] != 'general_static')?'display:none;':''); ?>" class="wpsg_mod_export_row2 wpsg_tablerow wpsg_mod_export_fieldrow_<?php echo $f_id; ?> <?php echo (($i % 2 == 0)?'odd':'even'); ?>">
75
            <td class="wpsg_mod_export_col_format_user" colspan="4">
76
 
77
                <?php echo __('Statischer Wert', 'wpsg'); ?>:
78
 
79
                <div class="wpsg_editable" id="field_static_<?php echo $f_id; ?>"><?php echo wpsg_hspc(wpsg_getStr($f['static'])); ?></div>
80
 
81
            </td>
82
            <td></td>
83
        </tr>
5896 daniel 84
        <tr id="userformatrow_<?php echo $f_id; ?>" style="<?php echo (($f['format'] != 700)?'display:none;':''); ?>" class="wpsg_mod_export_row2 wpsg_tablerow wpsg_mod_export_fieldrow_<?php echo $f_id; ?> <?php echo (($i % 2 == 0)?'odd':'even'); ?>">
8131 daniel 85
            <td class="wpsg_mod_export_col_format_user" colspan="4">
5896 daniel 86
 
87
                <?php echo __('Format', 'wpsg'); ?>:
88
 
89
                <div class="wpsg_editable" id="field_userformat_<?php echo $f_id; ?>"><?php echo wpsg_hspc(wpsg_getStr($f['userformat'])); ?></div>
90
 
91
            </td>
92
            <td style="position:relative;">
93
 
6005 hartmut 94
                <a rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_export_userformat" href="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=mod_export_userformat" data-wpsg-tip="mod_export_userformat" class="glyphicon glyphicon-question-sign" style="float:right;"></a>
5896 daniel 95
 
96
                <script type="text/javascript">/* <![CDATA[ */
97
 
98
                    jQuery(document).ready(function() {
99
 
5934 hartmut 100
                        jQuery('#field_name_<?php echo $f_id; ?>').wpsg_editable('<?php echo $inlineEdit_url; ?>', { } );
5896 daniel 101
 
5934 hartmut 102
                        jQuery('#field_typ_<?php echo $f_id; ?>').wpsg_editable('<?php echo $inlineEdit_url; ?>', {
5896 daniel 103
                            'type': 'multiarray',
8131 daniel 104
                            'data': '<?php echo addslashes(json_encode($this->view['fields'], JSON_UNESCAPED_SLASHES)); ?>',
105
                            'callback': function(response, newValue) {
106
 
107
								if (newValue === 'general_static') jQuery('#staticformat_<?php echo $f_id; ?>').show();
108
								else jQuery('#staticformat_<?php echo $f_id; ?>').hide();
109
 
110
                            }
5896 daniel 111
                        } );
112
 
5934 hartmut 113
                        jQuery('#field_format_<?php echo $f_id; ?>').wpsg_editable('<?php echo $inlineEdit_url; ?>', {
5896 daniel 114
                            'type': 'select',
5911 daniel 115
                            'data': <?php echo wpsg_prepare_for_inlineEdit($this->view['arFieldFormats']); ?>,
5896 daniel 116
                            'callback': function(response, newValue) {
117
 
118
                                if (newValue === "700") jQuery('#userformatrow_<?php echo $f_id; ?>').show();
119
                                else jQuery('#userformatrow_<?php echo $f_id; ?>').hide();
120
 
121
                            }
122
                        } );
123
 
5934 hartmut 124
                        jQuery('#field_userformat_<?php echo $f_id; ?>').wpsg_editable('<?php echo $inlineEdit_url; ?>', { } );
5896 daniel 125
 
8131 daniel 126
						jQuery('#field_static_<?php echo $f_id; ?>').wpsg_editable('<?php echo $inlineEdit_url; ?>', { } );
127
 
5896 daniel 128
                    } );
129
 
130
                /* ]]> */</script>
131
 
132
            </td>
133
        </tr>
134
    </tbody>
135
    <?php } ?>
136
 
137
</table>
138
 
139
<script type="text/javascript">/* <![CDATA[ */
5911 daniel 140
 
5896 daniel 141
    wpsg_ajaxBind();
142
 
143
    jQuery("#wpsg_mod_export_fieldtable").sortable( {
144
        helper: wpsg_Tablefix,
145
        items: 'tbody',
146
        handler: '.wpsg_id',
147
        update: function(event, ui) {
148
 
149
            var wpsg_reorder = jQuery(this).sortable('serialize');
150
 
151
            jQuery.ajax( {
152
                url: '<?php echo WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_export&do=wpsg_mod_export_reorder&noheader=1&profil_id='.$this->view['profil']['id']; ?>',
153
                data: {
154
                    wpsg_reorder: wpsg_reorder
155
                },
156
                success: function(data) {
157
 
158
                    if (data !== "1") alert(data);
159
 
160
                }
161
            } );
162
 
163
        }}
164
    ).disableSelection();
165
 
166
/* ]]> */</script>
8131 daniel 167
 
168
<style>
169
 
170
    .wpsg_mod_export_col_format { min-width:100px; }
171
 
172
</style>