Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 1524 | Revision 1526 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1509 lars 1
<!-- $Id: bilder.tpl 4097 2023-03-23 13:41:48Z erling $ BEGIN -->
1525 lars 2
<link rel="stylesheet" href="/admin/fonts/font-awesome/css/fontawesome-all.min.css" type="text/css" />
1509 lars 3
<style>
4
    .tb_bv_button
5
    {
6
        height: 22px;
7
        width: 30px;
8
    }
9
</style>
10
<script>
11
    $(function(){
12
        {if $action->id}
13
        // toggle image
14
        $('.toggle_img').on("click",function() {
15
            let aktiv = 1;
16
            let id = $(this).data("imgid");
17
 
18
            // deaktivieren
19
            if( $(this).hasClass("fa-toggle-on") ) {
20
                $('tr[data-tr_id='+id+']').addClass("inactive");
21
                $(this).removeClass('fa-toggle-on');
22
                $(this).addClass("fa-toggle-off");
23
                aktiv = 0;
24
            }else {
25
                // aktivieren
26
                $('tr[data-tr_id='+id+']').removeClass("inactive");
27
                $(this).removeClass('fa-toggle-off');
28
                $(this).addClass("fa-toggle-on");
29
            }
30
 
31
            let url="aktion_v3.php?aktionen_id={$aktion.ID}&mode=edit_aktionen_item&id="+id+"&aktiv="+aktiv;
32
            $.get(url,function(html){
33
                //alert(html);
34
            });
35
 
36
        });
37
        {/if}
38
 
39
        $('.pic_up').css("cursor","pointer").click(move_pic);
40
        $('.pic_down').css("cursor","pointer").click(move_pic);
41
        $('.edit_desc').button({
42
            icons:{
43
                primary:"ui-icon-pencil"
44
            }
45
        }).css("cursor","pointer").click(edit_medium_desc);
46
        $('.edit_param').button({
47
            icons:{
48
                primary:"ui-icon-pencil"
49
            }
50
        }).css("cursor","pointer").click(edit_medium_param);
51
        $('#edit_desc_dlg').dialog({
52
            autoOpen:false,
53
            modal:true,
54
            resizable:false,
55
            buttons:{
56
                "speichern": function()
57
                {
58
                    let url="/toolbox/editMedimDesc.php";
59
                    $.get(url,$('#edit_desc_form').serialize(),function(html){
60
                        $('#desc_'+$('#hidden_id').val()).html(html);
61
                    })
62
                    $(this).dialog("close");
63
                },
64
                "abbrechen": function()
65
                {
66
                    $(this).dialog("close");
67
                }
68
            }
69
        });
70
        $('#edit_param_dlg').dialog({
71
            autoOpen:false,
72
            modal:true,
73
            resizable:false,
74
            buttons:{
75
                "speichern": function()
76
                {
77
                    let url="/toolbox/editMediumParam.php";
78
                    $.get(url,$('#edit_param_form').serialize(),function(html){
79
                        $('#param_'+$('#hidden_param_id').val()).html(html);
80
                    })
81
                    $(this).dialog("close");
82
                },
83
                "abbrechen": function()
84
                {
85
                    $(this).dialog("close");
86
                }
87
            }
88
        });
89
    })
90
</script>
1517 lars 91
{if $lType!="k"}
1509 lars 92
    <script>
93
        $(function(){
94
            $('.del_image').css("cursor","pointer").click(del_image);
95
            $('.aehnlich').change(change_aehnlich);
96
            $('.edit_type').button({
97
                icons:{
98
                    primary:"ui-icon-pencil"
99
                }
100
            }).css("cursor","pointer").click(edit_medium_type);
101
            $('#editTypeDlg').dialog({
102
                autoOpen:false,
103
                modal:true,
104
                resizable:false,
105
                buttons:{
106
                    "speichern": function()
107
                    {
108
                        let url="/toolbox/editMedimType.php";
109
                        $.get(url,$('#edit_type_form').serialize(),function(html){
110
                            $('#type_'+$('#hidden_id_type').val()).html(html);
111
                        })
112
                        $(this).dialog("close");
113
                    },
114
                    "abbrechen": function()
115
                    {
116
                        $(this).dialog("close");
117
                    }
118
                }
119
            });
120
        });
121
            function change_aehnlich()
122
            {
123
                let aId=$(this).attr("id").split("_");
124
                let l_id=aId[1];
125
                let m_id=aId[2];
126
                let l_type=aId[3];
127
                let val=$(this).val();
128
                let url="change_aehnlich.php?l_id="+l_id+"&m_id="+m_id+"&val="+val+"&l_type="+l_type
129
                let meld;
130
                $.get(url,function(html)
131
                {
132
                    if(html==1)
133
                    {
134
                        meld="Änderung erfolgreich gespeichert!";
135
                    }
136
                    else
137
                    {
138
                        meld="Es ist leider ein Fehler aufgetreten!<br>"+html;
139
                    }
140
                    $('#change_aehnlich_meld').html(meld);
141
                    $('#change_aehnlich_msg').dialog({
142
                        modal:true,
143
                        resizable:false,
144
                        buttons:{
145
                            "ok":function()
146
                            {
147
                                $(this).dialog("close");
148
                            }
149
                        }
150
                    })
151
                })
152
            }
153
            function edit_medium_type(e)
154
            {
155
                e.preventDefault();
156
                let mId=this.id;
157
                mId=mId.split("__");
158
                mId=mId[1];
159
                $('#hidden_id_type').val(mId);
160
                let type=$('#type_'+mId).html()
161
                $('#input_type').val(type);
162
                $('#editTypeDlg').dialog("open");
163
            }
164
    </script>
165
    <table width="100%">
166
        <tr class="links">
167
            <td>Dateiname</td>
168
            <td>Vorschau</td>
169
            <td>ähnlich?</td>
170
            <td>Beschreibung</td>
171
            <td>Parameter</td>
172
            <td>Größe</td>
173
            <td>Type</td>
174
            {if !$bilder[0].mutter || !in_array( "medien" , $gesperrte_felder )}
175
                <td>Aktionen</td>
176
            {/if}
177
        </tr>
178
        {foreach $bilder as $bild}
179
            <tr>
180
                <td id="bild_name_{$bild.id}">{$bild.name|utf8_decode}</td>
181
                <td>
182
                    {if $bild.typ==1||$bild.typ==5||$bild.typ==6||$bild.typ==7}
183
                        <a href="{$bild.url}" target="_blank"><img src="{$bild.url_mini}" alt="" /></a>
184
                    {elseif $bild.typ==3}
185
                        <a href="{$bild.name}" target="_blank">
186
                            <img src="{$bild.url_mini}" width="153" alt="" />
187
                        </a>
188
                    {else}
189
                        {if $bild.typ==2}
190
                            <a href="{$bild.url}" target="_blank">
191
                        {/if}
192
                        Dies ist kein Bild!<br/>Daher gibt es keine Vorschau!
193
                        {if $bild.typ==2}
194
                            </a>
195
                        {/if}
196
                    {/if}
197
                </td>
198
                <td>
199
                    {if !$bild.mutter || !in_array( "medien" , $gesperrte_felder )}
1517 lars 200
                        <select id="aehnlich_{$smarty.get.l_id}_{$bild.id}_{$lType}" class="aehnlich">
1509 lars 201
                            {html_options selected=$bild.aehnlich options=$aehnlich}
202
                        </select>
203
                    {else}
204
                        {$aehnlich[$bild.aehnlich]}
205
                    {/if}
206
                </td>
207
                <td style="width:200px;">
208
                    <div>
209
                        {if !$bild.mutter || !in_array( "medien" , $gesperrte_felder )}
210
                            <div style="float:left;">
211
                                <a class="edit_desc tb_bv_button" id="edit_desc__{$bild.id}" title="Beschreibung editieren"></a>
212
                            </div>
213
                        {/if}
214
                        <div style="float:left;" id="desc_{$bild.id}">{$bild.beschreibung|default:"&nbsp;"}</div>
215
                    </div>
216
                </td>
217
                <td style="width:200px;">
218
                    <div>
219
                        {if (!$bild.mutter || !in_array( "medien" , $gesperrte_felder ))&&$bild.typ==10}
220
                            <div style="float:left;">
221
                                <a class="edit_param tb_bv_button" id="edit_param__{$bild.id}" title="Parameter editieren"></a>
222
                            </div>
223
                        {/if}
224
                        <div style="float:left;" id="param_{$bild.id}">{$bild.parameter|default:"&nbsp;"}</div>
225
                    </div>
226
                </td>
227
                <td>
228
                    {$bild.size|fsize_format:"":2:",":"."}
229
                    {if $bild.typ==1||$bild.typ==5||$bild.typ==6||$bild.typ==3}
230
                        ({$bild.img_size[0]} x {$bild.img_size[1]} Pixel)
231
                    {/if}
232
                </td>
233
                <td>
234
                    <div>
235
                        {if !$bild.mutter || !in_array( "medien" , $gesperrte_felder )}
236
                            <div style="float:left">
237
                                <a class="edit_type tb_bv_button" id="edit_type__{$bild.id}" title="Typ editieren"></a>
238
                            </div>
239
                        {/if}
240
                        <div style="float:left" id="type_{$bild.id}">{$bild.typ_name}</div>
241
                    </div>
242
                </td>
243
                {if !($bild.mutter) || !in_array( "medien" , $gesperrte_felder )}
244
                    <td>
245
                        <table>
246
                            <tr>
247
                                <td width="16">
248
                                    {if !$bild@first}
1517 lars 249
                                        <a class="pic_up" title="nach oben" id="up_{$smarty.get.l_id}_{$bild.id}_{$lType}"><img src="/images/Icons/up.png" alt=""/></a>
1509 lars 250
                                    {/if}
251
                                </td>
252
                                <td width="16">
253
                                    {if !$bild@last}
1517 lars 254
                                        <a class="pic_down" title="nach unten" id="down_{$smarty.get.l_id}_{$bild.id}_{$lType}"><img src="/images/Icons/down.png" alt=""/></a>
1509 lars 255
                                    {/if}
256
                                </td>
257
 
258
                                <td width="16">
259
                                    <a title="löschen" class="del_image" id="del_image_{$bild.id}_{$smarty.get.l_id}"><img src="/images/Icons/trashcan.png" alt=""/></a>
260
                                </td>
261
 
262
                            </tr>
263
                        </table>
264
                    </td>
265
                {/if}
266
            </tr>
267
        {/foreach}
1517 lars 268
        <input type="hidden" id="l_type" value="{$lType}" />
1509 lars 269
        <input type="hidden" id="l_id" value="{$smarty.get.l_id}" />
270
    </table>
271
 
272
    <div id="change_aehnlich_msg" title="Ergebnis">
273
        <div id="change_aehnlich_meld"></div>
274
    </div>
275
 
276
    <div title="Type des Mediums anpassen" id="editTypeDlg">
277
        <form id="edit_type_form">
278
            <input type="hidden" name="id" value="" id="hidden_id_type" />
279
            Typ:
280
            {html_options options=$typen name="typ"}
281
        </form>
282
    </div>
283
{else}
284
    <script>
285
        $(function(){
286
            $('.add_mobile_image').button({
287
                icons:{
288
                    primary:"ui-icon-link"
289
                }
290
            }).click(add_k_mobile_images);
291
            $('.upload_mobile_image').button({
292
                icons:{
293
                    primary:"ui-icon-image"
294
                }
295
            }).click(upload_k_mobile_images);
296
            $('.del_image').css("cursor","pointer").click(del_image3);
297
            $('.del_mobile_image').css("cursor","pointer").click(del_mobile_image);
298
            $('#aktionUploadMsg').dialog({
299
                autoOpen:false,
300
                modal:true,
301
                resizable:false,
302
                buttons:{
303
                    "OK":function(){
304
                        $(this).dialog("close");
305
                    }
306
                }
307
            })
308
            $('#upload_mobile_dlg').dialog({
309
                autoOpen:false,
310
                modal:true,
311
                resizable:false,
312
                width:800,
313
                buttons:[
314
                    {
315
                        text:"Hochladen",
316
                        icon:"ui-icon-check",
317
                        click:function(){
318
                            let formData = new FormData($("#upload_mobile")[0]);
319
                            $.ajax({
320
                                url: "/Online-Shop/aktionUploadMobile.php",
321
                                type: 'POST',
322
                                data: formData,
323
                                processData: false,
324
                                contentType: false,
325
                                success: function (response) {
326
                                    let ret=$.parseJSON(response);
327
                                    let err=ret.err;
328
                                    let msg=ret.msg;
329
                                    if(err!=1)
330
                                    {
331
                                        let b2_id=$('#b_id').val();
332
                                        $.post("/Online-Shop/add_image.php?m=1&b2_id="+b2_id+"&l_type=k&l_id={$smarty.get.l_id}&b_id="+ret.b_id,function(){
333
                                            getBilder();
334
                                            $('#upload_mobile_dlg').dialog("close");
335
                                        })
336
                                    }
337
                                    else
338
                                    {
339
                                        msg='<div style="color:red;font-weight:bold">'+msg+'</div>';
340
                                    }
341
                                    $('#upload_mobile_dlg').dialog("close");
342
                                    $('#aktionUploadMsg').html(msg).dialog("open");
343
                                },
344
                                error: function (xhr, status, error) {
345
                                    //....
346
                                }
347
                            });
348
                        }
349
                    }]
350
            })
351
        })
352
    </script>
353
    <table width="100%">
354
        <tr class="links">
355
            <td>Dateiname</td>
356
            <td>Vorschau</td>
357
            <td>Link</td>
358
            <td>Größe</td>
359
            <td>Aktionen</td>
360
            {if $action->category !="Display"}
361
            <td>mobiles BIld</td>
362
            {/if}
363
        </tr>
364
        {foreach $bilder as $bild}
1524 lars 365
            <tr data-tr_id="{$bild->meidum->id}"  {if $bild->meidum->aktiv!=1} class="inactive" {/if}>
366
                <td id="bild_name_{$bild->meidum->id}">{$bild->meidum->name}</td>
1509 lars 367
                <td>
1524 lars 368
                    <a href="{$bild->meidum->url}" target="_blank"><img src="{$bild->meidum->url}" width="153" alt="" /></a>
1509 lars 369
                </td>
370
                <td style="width:200px;">
371
                    <div>
372
                        <div style="float:left;">
1524 lars 373
                            <a class="edit_desc tb_bv_button" id="edit_desc__{$bild->meidum->id}" title="Beschreibung editieren"></a>
1509 lars 374
                        </div>
1524 lars 375
                        <div style="float:left;" id="desc_{$bild->meidum->id}">{$bild->meidum->beschreibung|default:"&nbsp;"}</div>
1509 lars 376
                    </div>
377
                </td>
378
                <td>
379
                    {$bild.size|fsize_format:"":2:",":"."}
1524 lars 380
                    {if $bild->meidum->typ==1||$bild->meidum->typ==5||$bild->meidum->typ==6||$bild->meidum->typ==3}
1509 lars 381
                        ({$bild.img_size[0]} x {$bild.img_size[1]} Pixel)
382
                    {/if}
383
                </td>
384
                <td>
385
                    <table>
386
                        <tr>
387
                            <td width="16">
388
                                {if !$bild@first}
1524 lars 389
                                    <a class="pic_up" title="nach oben" id="up_{$smarty.get.l_id}_{$bild->meidum->id}_{$lType}"><img src="/images/Icons/up.png" alt=""/></a>
1509 lars 390
                                {/if}
391
                            </td>
392
                            <td width="16">
393
                                {if !$bild@last}
1524 lars 394
                                    <a class="pic_down" title="nach unten" id="down_{$smarty.get.l_id}_{$bild->meidum->id}_{$lType}"><img src="/images/Icons/down.png" alt=""/></a>
1509 lars 395
                                {/if}
396
                            </td>
397
                            <td width="16">
1524 lars 398
                                <a title="löschen" class="del_image" id="del_image_{$bild->meidum->id}_{$smarty.get.l_id}"><img src="/images/Icons/trashcan.png" alt=""/></a>
1509 lars 399
                            </td>
400
                            {if $action->id}
401
                            <td>
402
                                {if $bild.aktiv==1}
1524 lars 403
                                    <i data-imgid="{$bild->meidum->id}" title="deaktivieren" class="fa fa-toggle-on toggle_img" aria-hidden="true"></i>
1509 lars 404
                                {else}
1524 lars 405
                                    <i data-imgid="{$bild->meidum->id}" title="aktivieren" class="fa fa-toggle-off toggle_img" aria-hidden="true"></i>
1509 lars 406
                                {/if}
407
                            </td>
408
                            {/if}
409
                        </tr>
410
                    </table>
411
                </td>
412
                {if $action->category !="Display"}
413
                <td>
1524 lars 414
                    <a title="mobiles Bild zuordnen" class="add_mobile_image tb_bv_button" id="add_mobile_image_{$smarty.get.l_id}_{$bild->meidum->id}_{$lType}"></a>
415
                    <a title="mobiles Bild hochladen" class="upload_mobile_image tb_bv_button" id="upload_mobile_image_{$smarty.get.l_id}_{$bild->meidum->id}_{$lType}"></a>
1509 lars 416
                    {if $bild.mobil_id}
417
                        <br />
1524 lars 418
                        mobiles BIld: <br /> <img src="{$bild->meidum->mobil_img}" width="153" alt="" />
419
                        <a title="Zuordnung entfernen" class="del_mobile_image" id="del_mobile_image_{$bild.id}_{$bild->meidum->mobil_id}"><img src="/images/Icons/trashcan.png" alt=""/></a>
1509 lars 420
                    {/if}
421
                </td>
422
                {/if}
423
            </tr>
424
        {/foreach}
425
    </table>
426
    <div id="upload_mobile_dlg" title="mobiles Bild hochladen">
427
        <form id="upload_mobile" method="post">
428
            Bild: <input type="file" name="bild" />
429
            <input type="hidden" name="l_id" value="{$smarty.get.l_id}" />
430
            <input type="hidden" name="l_type" value="k" />
431
            <input type="hidden" name="b_id" id="b_id" />
432
        </form>
433
    </div>
434
    <div id="aktionUploadMsg" title="Ergebnis"></div>
435
{/if}
1517 lars 436
<div title="{if $lType!="k"}Beschreibung{else}Verlinkung{/if} des Mediums anpassen" id="edit_desc_dlg">
1509 lars 437
    <form id="edit_desc_form">
438
        <input type="hidden" name="id" value="" id="hidden_id" />
1517 lars 439
        <label for="input_desc">{if $lType!="k"}Beschreibung{else}Link{/if}:</label>
1509 lars 440
        <input type="text" name="beschreibung" value="" id="input_desc" />
441
    </form>
442
</div>
443
<div title="Aufrufparameter des Mediums anpassen" id="edit_param_dlg">
444
    <form id="edit_param_form">
445
        <input type="hidden" name="medien_id" value="" id="hidden_param_id" />
446
        <input type="hidden" name="artikel_id" value="{$smarty.get.l_id}">
1517 lars 447
        <input type="hidden" name="l_type" value="{$lType}">
1509 lars 448
        <label for="input_param">Aufrufparameter:</label>
449
        <input type="text" name="parameter" value="" id="input_paramter" />
450
    </form>
451
</div>
452
 
453
<style>
454
    .fa-toggle-on,
455
    .fa-toggle-off {
456
        cursor:pointer;
457
    }
458
    .inactive td {
459
        opacity:.3;
460
    }
461
</style>
462
<!-- $Id: bilder.tpl 4097 2023-03-23 13:41:48Z erling $ END -->