Subversion-Projekte lars-tiefland.ci

Revision

Revision 2186 | Revision 2192 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
2182 lars 1
<!-- $Id: getMedien.tpl 2191 2017-12-23 14:57:04Z 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;
2183 lars 34
        url = '/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}
112
        <br>
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"}">
135
                <td>{$bild.name|utf8_decode}</td>
136
                <td>
2191 lars 137
                    {$bild|var_dump}
2182 lars 138
                    {if $bild.typ==1||$bild.typ==5||$bild.typ==6||$bild.typ==7}
139
                    <a href="{$bild.url}" target="_blank"><img src="{$bild.url_mini}" alt="{$bild.name}"/></a>
140
                    {else}
141
                    Dies ist kein Bild!<br/>Daher gibt es keine Vorschau!
142
                    {/if}
143
                </td>
144
                <td>
145
                    <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>
146
                </td>
147
            </tr>
148
            {/foreach}
149
        </table>
150
    </div>
151
    <div id="search">
152
        <form id="searchForm">
153
            <input type="text" name="search" id="search" placeholder="Suche" value="" />
154
            <input type="hidden" name="folder" value="{$folder}" />
155
            <input type="hidden" name="l_type" value="{$smarty.get.l_type}" />
156
            <input type="hidden" name="l_id" value="{$smarty.get.l_id}" />
157
            <button class="search" id="searchBtn">&nbsp;</button>
158
        </form>
159
        <div id="searchResult"></div>
160
    </div>
161
</div>
162
 
163
<script>
164
    $(function(){
165
        $('#reiter').tabs();
166
        $('#searchBtn').button({
167
            icons:{
168
                primary:"ui-icon-search"
169
            }
170
        }).click(searchMedia);
171
    })
172
 
173
    function searchMedia(e)
174
    {
175
        e.preventDefault();
176
        daten=$('#searchForm').serialize();
2183 lars 177
        url="/medien/get/?"+daten;
2182 lars 178
        $('#searchResult').load(url)
179
    }
180
</script>
181
<!-- $Id: getMedien.tpl 2191 2017-12-23 14:57:04Z lars $ END -->