]> git.mxchange.org Git - friendica.git/blob - view/templates/contacts-template.tpl
Add form security token to contact actions
[friendica.git] / view / templates / contacts-template.tpl
1
2 <h2>{{$header}}{{if $total}} ({{$total}}){{/if}}</h2>
3
4 {{if $finding}}<h4>{{$finding}}</h4>{{/if}}
5
6 <div id="contacts-search-wrapper">
7 <form id="contacts-search-form" action="{{$cmd}}" method="get">
8 <span class="contacts-search-desc">{{$desc nofilter}}</span>
9 <input type="text" name="search" id="contacts-search" class="search-input" onfocus="this.select();" value="{{$search}}" />
10 <input type="submit" name="submit" id="contacts-search-submit" value="{{$submit}}" />
11 </form>
12 </div>
13 <div id="contacts-search-end"></div>
14
15 {{$tabs nofilter}}
16
17 <form action="{{$baseurl}}/contact/batch/" method="POST">
18         <input type="hidden" name="redirect_url" value="{{$cmd}}" />
19         <input type="hidden" name="form_security_token" value="{{$form_security_token}}" />
20 {{foreach $contacts as $contact}}
21         {{include file="contact_template.tpl"}}
22 {{/foreach}}
23 <div id="contact-edit-end"></div>
24 <div id="contacts-actions">
25 {{foreach $batch_actions as $n=>$l}}
26  <input class="batch-action" name="{{$n}}" value="{{$l}}" type="submit">
27  {{/foreach}}
28  </div>
29 </form>
30 <script>
31  $(document).ready(function() {
32   // javascript dialog to batch actions
33   $(".batch-action").click(function(e){
34     if (confirm($(this).attr('value')+" ?")) {
35      return true;
36     } else {
37      e.preventDefault();
38      return false;
39     }
40   });
41  
42   // add javascript confirm dialog to "drop" links. Plain html url have "?confirm=1" to show confirmation form, we need to remove it
43   $(".drop").each(function() {
44    $(this).attr('href', $(this).attr('href').replace("confirm=1","") );
45    $(this).click(function(e){
46     if (confirm("{{$contact_drop_confirm}}")) {
47      return true;
48     } else {
49      e.preventDefault();
50      return false;
51     }
52    });
53    
54   });
55  });
56  </script>
57
58 {{$paginate nofilter}}
59
60
61
62