source: extensions/user_custom_fields/admin.tpl @ 31810

Last change on this file since 31810 was 31783, checked in by ddtddt, 7 years ago

[extensions] - user_custom_fields -

File size: 11.5 KB
Line 
1{combine_script id='jquery.ui.sortable' require='jquery.ui' load='footer' path='themes/default/js/ui/minified/jquery.ui.sortable.min.js'}
2{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
3{footer_script}
4jQuery(document).ready(function(){
5  jQuery(".drag_button").show();
6  jQuery(".categoryLi").css("cursor","move");
7  jQuery(".categoryUl").sortable({
8    axis: "y",
9    opacity: 0.8,
10    update : function() {
11      jQuery("#manualOrderInfo").show();
12    }
13  });
14
15  jQuery("#infoOrdering").submit(function(){
16    ar = jQuery('.categoryUl').sortable('toArray');
17    for(i=0;i < ar.length ;i++) {
18      iord = ar[i].split('iord_');
19      document.getElementsByName('infoOrd[' + iord[1] + ']')[0].value = i;
20    }
21  });
22
23  jQuery("#cancelManualOrderInfo").click(function(){
24    jQuery(".categoryUl").sortable("cancel");
25    jQuery("#manualOrderInfo").hide();
26  });
27 
28  jQuery('.categoryLi').mouseover(function(){
29    jQuery(this).children('span').show();
30  });
31  jQuery('.categoryLi').mouseout(function(){
32    jQuery(this).children('span').hide();
33  });
34 
35  jQuery('#aip_sumit').click(function(){
36    jQuery("#add_info_edit").show();
37    jQuery("#leg_add").show();
38    jQuery("#leg_edit").hide();
39    jQuery('#aip_add').empty();
40    jQuery('#aip_hide').attr('checked', false);
41        jQuery('#aip_adminonly').attr('checked', false);
42    jQuery('#hideid').val(0);
43    jQuery("textarea[name=inserwording]").focus();
44  });
45 
46  jQuery("#addinfoClose").click(function(){
47    jQuery("#add_info_edit").hide();
48  });
49
50  jQuery('.pphide').click(function(){
51    var id= $(this).data('id');
52    var link= $(this).data('link2');
53    $.ajax({
54        method: 'POST',
55        url: link,
56        success: function(Datalc,textStatus,jqXHR) {
57          jQuery('#pphide'+id).hide();
58          jQuery('#ppshow'+id).show();
59                  jQuery('#ppobligatorys'+id).hide();
60          jQuery('#ppobligatoryh'+id).show();
61          jQuery('#iord_'+id).css("opacity","0.4");
62                  $('#edit_libinfo'+id).attr('data-hide', 0);
63        }
64      });
65  });
66  jQuery('.ppshow').click(function(){
67    var id= $(this).data('id');
68    var link= $(this).data('link2');
69    $.ajax({
70        method: 'POST',
71        url: link,
72        success: function(Datalc,textStatus,jqXHR) {
73          jQuery('#pphide'+id).show();
74          jQuery('#ppshow'+id).hide();
75          jQuery('#iord_'+id).css("opacity","1");
76                  $('#edit_libinfo'+id).attr('data-hide', 1);
77         }
78      });
79  });
80  jQuery('.ppadminonlyh').click(function(){
81    var id= $(this).data('id');
82    var link= $(this).data('link3');
83    $.ajax({
84        method: 'POST',
85        url: link,
86        success: function(Datalc,textStatus,jqXHR) {
87          jQuery('#ppadminonlyh'+id).hide();
88          jQuery('#ppadminonlys'+id).show();
89                  $('#edit_libinfo'+id).attr('data-adminonly', 1);
90        }
91      });
92  });
93  jQuery('.ppadminonlys').click(function(){
94    var id= $(this).data('id');
95    var link= $(this).data('link3');
96    $.ajax({
97        method: 'POST',
98        url: link,
99        success: function(Datalc,textStatus,jqXHR) {
100          jQuery('#ppadminonlyh'+id).show();
101          jQuery('#ppadminonlys'+id).hide();
102                  $('#edit_libinfo'+id).attr('data-adminonly', 0);
103         }
104      });
105  });
106
107  jQuery('.ppobligatoryh').click(function(){
108    var id= $(this).data('id');
109    var link= $(this).data('link4');
110    $.ajax({
111        method: 'POST',
112        url: link,
113        success: function(Datalc,textStatus,jqXHR) {
114          jQuery('#ppobligatoryh'+id).hide();
115          jQuery('#ppobligatorys'+id).show();
116                  $('#edit_libinfo'+id).attr('data-obligatory', 1);
117        }
118      });
119  });
120  jQuery('.ppobligatorys').click(function(){
121    var id= $(this).data('id');
122    var link= $(this).data('link4');
123    $.ajax({
124        method: 'POST',
125        url: link,
126        success: function(Datalc,textStatus,jqXHR) {
127          jQuery('#ppobligatoryh'+id).show();
128          jQuery('#ppobligatorys'+id).hide();
129                  $('#edit_libinfo'+id).attr('data-obligatory', 0);
130         }
131      });
132  });
133
134  jQuery('.edit_libinfo').click(function(){
135    var id_prop_photo=$(this).data('id');
136    var lib=$(this).data('lib');
137    var hide=$(this).data('hide');
138        var adminonly=$(this).data('adminonly');
139        var obligatory=$(this).data('obligatory');
140    jQuery("#add_info_edit").show();
141    jQuery("#leg_add").hide();
142    jQuery("#leg_edit").show();
143    jQuery('#hideid').val(id_prop_photo);
144    jQuery('#aip_add').text(lib);
145        if(hide==1){
146                jQuery('#aip_hide').prop('checked', false);
147        }else{
148                jQuery('#aip_hide').prop('checked', true);
149        }
150        if(adminonly==0){
151                jQuery('#aip_adminonly').prop('checked', false);
152        }else{
153                jQuery('#aip_adminonly').prop('checked', true);
154    }
155        if(obligatory==0){
156                jQuery('#aip_obligatory').prop('checked', false);
157        }else{
158                jQuery('#aip_obligatory').prop('checked', true);
159    }
160    jQuery("textarea[name=inserwording]").focus();
161       
162  });
163 
164});
165{/footer_script}
166{html_style}
167.mouse:hover{
168    cursor:pointer;
169}
170{/html_style}
171
172
173<div class="titrePage">
174  <h2>{'Manage user custom fields'|@translate}</h2>
175</div>
176{if isset ($addinfotemplate)}
177        <p class="showCreateAlbum">
178            <a href="#" id="aip_sumit" >{'Create new custom fields'|@translate} </a>
179        </p>
180    <div id="add_info_edit" style="display: none;">
181        <form method="post" >
182            <fieldset>
183                <legend><span id="leg_add">{'Create new custom fields'|@translate}</span><span id="leg_edit">{'Edit custom fields'|@translate}</span></legend>
184                <input id="hideid" type="hidden" name="invisibleID" value="{$addinfo_edit2.AIPID}">
185                <p class="input">
186                    <label for="inserwording">{'Wording'|@translate}</label><br />
187                    <textarea {if $useED==1}placeholder="{'Use Extended Description tags...'|@translate}"{/if} style="margin-left:50px" rows="5" cols="50" class="description" name="inserwording" id="aip_add">{$addinfo_edit2.AIPDESC}</textarea>
188                    {if $useED==1}
189                    <a href="{$ROOT_URL}admin/popuphelp.php?page=extended_desc" onclick="popuphelp(this.href); return false;" title="{'Use Extended Description tags...'|translate}" style="vertical-align: middle; border: 0; margin: 0.5em;"><img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/help.png" class="button" alt="{'Use Extended Description tags...'|translate}'"></a>
190                    {/if}
191                </p>
192                <p class="input" style="width: 700px;">
193                    <label for="inseractive">{'Hide'|@translate}</label>
194                    <input id="aip_hide" type="checkbox" name="inseractive" {if {$addinfo_edit2.AIPACTIF}==1}checked{/if} value="1">
195                </p>
196                                <p class="input" style="width: 700px;">
197                    <label for="adminonly">{'Admin only'|@translate}</label>
198                    <input id="aip_adminonly" type="checkbox" name="adminonly" {if {$addinfo_edit2.UCFADMINONLY}==1}checked{/if} value="1">
199                </p>
200                                <p class="input" style="width: 700px;">
201                    <label for="obligatory">{'Obligatory'|@translate}</label>
202                    <input id="aip_obligatory" type="checkbox" name="obligatory" {if {$addinfo_edit2.UCFOBLIGATORY}==1}checked{/if} value="1">
203                </p>
204                                <p class="actionButtons">
205                    <input class="submit" name="submitUCF" type="submit" value="{'Submit'|@translate}" />
206                    <a href="#" id="addinfoClose">{'Cancel'|@translate}</a>
207                </p>
208            </fieldset>
209        </form>
210    </div>
211    <form id="infoOrdering" method="post" >
212        <p id="manualOrderInfo" style="display:none; text-align: left">
213          <input class="submit" name="submitManualOrderInfo" type="submit" value="{'Save order'|@translate}">
214          {'... or '|@translate} <a href="#" id="cancelManualOrderInfo">{'cancel manual order'|@translate}</a>
215        </p>
216        <fieldset>
217        <legend>{'Fields List'|@translate}</legend>
218          <ul class="categoryUl">
219            {foreach from=$user_custom_fields item=ucf}
220              <li {if ($ucf.UCFACTIVE==1)}style="opacity: 1;"{else}style="opacity: 0.4;"{/if}class="categoryLi{if ($ucf.UCFEDIT==1)} virtual_cat{/if}" id="iord_{$ucf.IDUCF}">
221                <img src="{$themeconf.admin_icon_dir}/cat_move.png" class="drag_button" style="display:none;" alt="{'Drag to re-order'|@translate}" title="{'Drag to re-order'|@translate}">
222                {$ucf.UCFWORDING}
223                <input type="hidden" name="infoOrd[{$ucf.IDUCF}]" value="{$ucf.UCFORDER}">
224                <br />
225                <span class="actiononphoto" style="display: none">
226                                        {if ($ucf.UCFOBLO==1)}
227                    <span id="pphide{$ucf.IDUCF}" {if ($ucf.UCFACTIVE==0)}style="display: none"{/if}class="graphicalCheckbox icon-check-empty mouse pphide" data-id="{$ucf.IDUCF}" data-link2="{$ucf.U_HIDE}">{'Hide'|@translate}</span>
228                    <span id="ppshow{$ucf.IDUCF}" {if ($ucf.UCFACTIVE==1)}style="display: none"{/if}class="graphicalCheckbox icon-check mouse ppshow" data-id="{$ucf.IDUCF}" data-link2="{$ucf.U_SHOW}">{'Hide'|@translate}</span>
229                    {/if}
230                                        {if ($ucf.UCFEDIT==1)}
231                                        | <span id="edit_libinfo{$ucf.IDUCF}" class="edit_libinfo mouse icon-pencil" data-id="{$ucf.IDUCF}" data-lib="{$ucf.UCFWORDING2}" data-hide="{$ucf.UCFACTIVE}" data-adminonly="{$ucf.UCFADMINONLY}" data-obligatory="{$ucf.UCFOBLIGATORY}"/>{'Edit'|@translate}</span>
232                                        | <a href="{$ucf.U_DELETE}" onclick="return confirm('{'Are you sure?'|@translate|@escape:javascript}');"><span class="icon-trash"></span>{'delete'|@translate}</a>
233                                        |<span id="ppadminonlyh{$ucf.IDUCF}" {if ($ucf.UCFADMINONLY==1)}style="display: none"{/if}class="graphicalCheckbox icon-check-empty mouse ppadminonlyh" data-id="{$ucf.IDUCF}" data-link3="{$ucf.U_ADMINONLYHIDE}">{'Admin only'|@translate}</span>
234                    <span id="ppadminonlys{$ucf.IDUCF}" {if ($ucf.UCFADMINONLY==0)}style="display: none"{/if}class="graphicalCheckbox icon-check mouse ppadminonlys" data-id="{$ucf.IDUCF}" data-link3="{$ucf.U_ADMINONLYSHOW}">{'Admin only'|@translate}</span>
235                    {/if}
236                                        {if ($ucf.UCFOBLO==1)}
237                                        |<span id="ppobligatoryh{$ucf.IDUCF}" {if ($ucf.UCFOBLIGATORY==1)}style="display: none"{/if}class="graphicalCheckbox icon-check-empty mouse ppobligatoryh" data-id="{$ucf.IDUCF}" data-link4="{$ucf.U_OBLIGATORYHIDE}">{'Obligatory'|@translate}</span>
238                                        <span id="ppobligatorys{$ucf.IDUCF}" {if ($ucf.UCFOBLIGATORY==0)}style="display: none"{/if}class="graphicalCheckbox icon-check mouse ppobligatorys" data-id="{$ucf.IDUCF}" data-link4="{$ucf.U_OBLIGATORYSHOW}">{'Obligatory'|@translate}</span>
239                                        {/if}
240                                </span>
241                <br />
242              </li>
243            {/foreach}
244          </ul>
245        </fieldset>
246    </form>
247{/if}
248{if isset ($editusertemplate)}
249<form method="post" name="ucfprofile" id="ucfprofile" class="properties">
250 <input id="hideuserid" type="hidden" name="invisibleUSERID" value="{$UCF_USERID}">
251 <fieldset>
252  <legend>{$UCF_USERNAME}</legend>
253    <ul>
254      {foreach from=$tab_user_custom_fields_adminlist item=userinfo}
255                {if $userinfo.UCFID == 1}
256                {else if $userinfo.UCFID == 2}
257                {else if $userinfo.UCFID == 3}
258                {else if $userinfo.UCFID == 4}
259                {else if}
260                  <li>
261                        <span class="property">
262              <label for="login">{$userinfo.UCFWORDING}</label>
263                        </span>
264                        <input type="text" name="data[{$userinfo.UCFID}]" id="data[{$userinfo.UCFID}]" value="{$userinfo.UCFDATA}"> {if $userinfo.UCFADMINONLY==1}{'Admin only'|@translate}{/if}
265                  </li>
266        {/if}
267          {/foreach}
268  </ul>
269  <p class="actionButtons">
270        <input class="submit" name="submitUCFa" type="submit" value="{'Submit'|@translate}" />
271        <a href="#" id="addinfoClose">{'Cancel'|@translate}</a>
272  </p>
273 </fieldset>
274</form>
275{/if}
Note: See TracBrowser for help on using the repository browser.