Subversion-Projekte lars-tiefland.ci

Revision

Revision 2193 | Revision 2202 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2182 lars 1
<!-- $Id: getMedien.tpl 2201 2017-12-23 16:00:52Z lars $ BEGIN -->
2
<script>
3
    $(document).ready(function(){
4
        $('.add_image').button({
5
            icons:{
6
                primary:"ui-icon-plus"
7
            }
8
        }).click(add_image);
9
        $('.add_d_image').button({
10
            icons:{
11
                primary:"ui-icon-plus"
12
            }
13
        }).click(add_d_image);
14
        $('.add_u_image').button({
15
            icons:{
16
                primary:"ui-icon-plus"
17
            }
18
        }).click(add_u_image);
19
        $('.add_v_image').button({
20
            icons:{
21
                primary:"ui-icon-plus"
22
            }
23
        }).click(add_v_image);
24
 
25
 
26
 
27
        $('.bilder_verz').click(change_folder).css("cursor","pointer");
28
        $('a.pagination').click(paginate).css("cursor","pointer");
29
    });
30
    function change_folder(e)
31
    {
32
        e.preventDefault();
33
        f_name=this.id;
2201 lars 34
        url = '/backend/medien/get/?folder='+f_name+'&l_id='+{$a_id}+'&l_type={$smarty.get.l_type}';
2182 lars 35
        $('#add_image_dialog').load(url);
36
    }
37
    function paginate(e)
38
    {
39
        e.stopPropagation();
40
        e.preventDefault();
41
        url=$(this).attr("href");
42
        url=url+"&l_type={$smarty.get.l_type}&l_id={$a_id}&folder={$folder}";
43
        //alert(url);
44
        $('#add_image_dialog').load(url);
45
    }
46
    function add_image()
47
    {
48
        id=this.id;
49
        id=id.split("_");
50
        b_id=id[2];
51
        a_id=id[3];
52
        $.get("/Online-Shop/add_image.php?l_id="+a_id+"&l_type=a&b_id="+b_id,function(html){
53
            $('#bildverwaltung').load( "/Online-Shop/bilder.php?l_id="+a_id+"&l_type=a");
54
        });
55
    }
56
    function add_d_image()
57
    {
58
        id=this.id;
59
        id=id.split("_");
60
        b_id=id[2];
61
        a_id=id[3];
62
        $.get("/Online-Shop/add_image.php?l_id="+a_id+"&l_type=d&b_id="+b_id,function(html){
63
            //alert(html);
64
            $('#bildverwaltung').load( "/Online-Shop/bilder.php?l_id="+a_id+"&l_type=d");
65
        });
66
    }
67
    function add_u_image()
68
    {
69
        id=this.id;
70
        id=id.split("_");
71
        b_id=id[2];
72
        a_id=id[3];
73
        $.get("/Online-Shop/add_image.php?l_id="+a_id+"&l_type=u&b_id="+b_id,function(html){
74
            $('#bildverwaltung').load( "/Online-Shop/bilder.php?l_id="+a_id+"&l_type=u");
75
        });
76
    }
77
    function add_v_image()
78
    {
79
        id=this.id;
80
        id=id.split("_");
81
        b_id=id[2];
82
        a_id=id[3];
83
        $.get("/Online-Shop/add_image.php?l_id="+a_id+"&l_type=d&b_id="+b_id,function(html){
84
            $('#bildverwaltung').load( "/Online-Shop/bilder.php?l_id="+a_id+"&l_type=v");
85
        });
86
    }
87
</script>
88
<div class="pos">
89
    <span class="aktuell">Position:</span>
90
    {if $folder}
91
        <a class="bilder_verz" href="#" id="">TOP</a>
92
    {else}
93
        <span class="aktuell">TOP</span>
94
    {/if}
95
    {foreach $pos as $dir}
96
        {if $dir@first} > {/if}
97
        {if !$dir@last}
98
            <a class="bilder_verz" href="#" id="{$dir.fullName}">{$dir.name}</a> >
99
        {else}
100
            <span class="aktuell">
101
                {$dir.name}
102
            </span>
103
        {/if}
104
    {/foreach}
105
</div>
106
{foreach $folders as $f_id => $f_name}
107
    {if $f_name@first}
108
        <div class="break">&nbsp;</div>
109
    {/if}
110
    <img src="/images/Online-Shop/directory/ordner.gif" /><a href="#" id="{$f_name|urlencode}" class="bilder_verz">{$f_name}</a>
111
    {if !$f_name@last}
2192 lars 112
        <br/>
2182 lars 113
    {else}
114
        <div class="break">&nbsp;</div>
115
    {/if}
116
{/foreach}
117
<div id="reiter">
118
    <ul>
119
        <li>
120
            <a href="#browse">Browse</a>
121
        </li>
122
        <li>
123
            <a href="#search">Suche</a>
124
        </li>
125
    </ul>
126
    <div id="browse">
127
        <table width="100%">
128
            <tr class="links">
129
                <td>Dateiname</td>
130
                <td>Vorschau</td>
131
                <td>zuordnen</td>
132
            </tr>
133
            {foreach $images as $bild}
134
            <tr class="{cycle values="rechts,links"}">
2192 lars 135
                <td>{$bild.name}</td>
2182 lars 136
                <td>
137
                    {if $bild.typ==1||$bild.typ==5||$bild.typ==6||$bild.typ==7}
2193 lars 138
                    <a href="{$bild.bild_url}" target="_blank">
139
                        <img src="{$bild.bild_url_mini}" alt="{$bild.name}"/>
2192 lars 140
                    </a>
2182 lars 141
                    {else}
142
                    Dies ist kein Bild!<br/>Daher gibt es keine Vorschau!
143
                    {/if}
144
                </td>
145
                <td>
146
                    <button id="add_image_{$bild.id}_{$a_id}" class="{if $smarty.get.l_type=="d"}add_d_image{elseif $smarty.get.l_type=="v"}add_v_image{elseif $smarty.get.l_type=="u"}add_u_image{else}add_image{/if}"></button>
147
                </td>
148
            </tr>
149
            {/foreach}
150
        </table>
151
    </div>
152
    <div id="search">
153
        <form id="searchForm">
154
            <input type="text" name="search" id="search" placeholder="Suche" value="" />
155
            <input type="hidden" name="folder" value="{$folder}" />
156
            <input type="hidden" name="l_type" value="{$smarty.get.l_type}" />
157
            <input type="hidden" name="l_id" value="{$smarty.get.l_id}" />
158
            <button class="search" id="searchBtn">&nbsp;</button>
159
        </form>
160
        <div id="searchResult"></div>
161
    </div>
162
</div>
163
 
164
<script>
165
    $(function(){
166
        $('#reiter').tabs();
167
        $('#searchBtn').button({
168
            icons:{
169
                primary:"ui-icon-search"
170
            }
171
        }).click(searchMedia);
172
    })
173
 
174
    function searchMedia(e)
175
    {
176
        e.preventDefault();
177
        daten=$('#searchForm').serialize();
2183 lars 178
        url="/medien/get/?"+daten;
2182 lars 179
        $('#searchResult').load(url)
180
    }
181
</script>
182
<!-- $Id: getMedien.tpl 2201 2017-12-23 16:00:52Z lars $ END -->