source: extensions/AdminTools/template/public_controller.tpl @ 25617

Last change on this file since 25617 was 25617, checked in by mistic100, 10 years ago

create plugin AdminTools

File size: 5.7 KB
Line 
1{combine_css path=$ADMINTOOLS_PATH|cat:'template/style.css'}
2{combine_css path='admin/themes/default/fontello/css/fontello.css'}
3{combine_css path=$ADMINTOOLS_PATH|cat:'template/fontello/css/fontello-ato.css'}
4
5{capture assign=users_options} {html_options options=$ato.USERS  selected=$ato.MULTIVIEW.view_as}{/capture}
6{capture assign=themes_options}{html_options options=$ato.THEMES selected=$ato.MULTIVIEW.theme}{/capture}
7{capture assign=langs_options} {html_options options=$ato.LANGS  selected=$ato.MULTIVIEW.lang}{/capture}
8
9<div id="ato_header">
10  <ul id="ato_header_root">
11    <li class="parent"><a href="#" class="icon-menu">{$GALLERY_TITLE}</a>
12      <ul>
13        <li><a class="icon-picture" href="{$ato.U_SITE_ADMIN}photos_add">{'Photos'|translate}</a></li>
14        <li><a class="icon-sitemap" href="{$ato.U_SITE_ADMIN}cat_list">{'Albums'|translate}</a></li>
15        <li><a class="icon-users" href="{$ato.U_SITE_ADMIN}user_list">{'Users'|translate}</a></li>
16        <li><a class="icon-puzzle" href="{$ato.U_SITE_ADMIN}plugins">{'Plugins'|translate}</a></li>
17        <li><a class="icon-wrench" href="{$ato.U_SITE_ADMIN}maintenance">{'Tools'|translate}</a></li>
18        <li><a class="icon-cog" href="{$ato.U_SITE_ADMIN}configuration">{'Options'|translate}</a></li>
19      </ul>
20    </li>
21  {if isset($ato.U_EDIT)}
22    <li class="parent"><a href="#" class="icon-pencil">{'Edit'|translate}</a>
23      <ul>
24        <li><a href="#" class="icon-ato-flash edit-quick">{'Quick edit'|translate}</a></li>
25        <li><a class="icon-ato-doc-text-inv" href="{$ato.U_EDIT}">{'Properties page'|translate}</a></li>
26      </ul>
27    </li>
28  {/if}
29  {if isset($ato.U_SET_REPRESENTATIVE)}
30    <li><a class="icon-ato-trophy set-representative" href="{$ato.U_SET_REPRESENTATIVE}">{'representative'|translate|ucfirst}</a></li>
31  {/if}
32  {if isset($ato.U_CADDIE)}
33    <li><a class="icon-ato-flag add-caddie" href="{$ato.U_CADDIE}">{'Add to caddie'|translate}</a></li>
34  {/if}
35    <li class="parent right"><a class="icon-cog-alt" href="#">{'Tools'|translate}</a>
36      <ul>
37        <li><label>User</label>
38          <select class="switcher" data-type="view_as">
39            {$users_options}
40          </select>
41        </li>
42        <li><label>Theme</label>
43          <select class="switcher" data-type="theme">
44            {$themes_options}
45          </select>
46        </li>
47        <li><label>Language</label>
48          <select class="switcher" data-type="lang">
49            {$langs_options}
50          </select>
51        </li>
52        <li><a class="icon-ato-check{if !$ato.MULTIVIEW.show_queries}-empty{/if}" href="{$ato.U_SELF}show_queries={(int)!$ato.MULTIVIEW.show_queries}">{'Show SQL queries'|translate}</a></li>
53        <li><a class="icon-ato-check{if !$ato.MULTIVIEW.debug_l10n}-empty{/if}" href="{$ato.U_SELF}debug_l10n={(int)!$ato.MULTIVIEW.debug_l10n}">{'Debug languages'|translate}</a></li>
54        <li><a class="icon-ato-check{if !$ato.MULTIVIEW.debug_template}-empty{/if}" href="{$ato.U_SELF}debug_template={(int)!$ato.MULTIVIEW.debug_template}">{'Debug template'|translate}</a></li>
55        <li><a class="icon-ato-check{if !$ato.MULTIVIEW.template_combine_files}-empty{/if}" href="{$ato.U_SELF}template_combine_files={(int)!$ato.MULTIVIEW.template_combine_files}">{'Combine JS&amp;CSS'|translate}</a></li>
56        <li><a class="icon-ato-check{if $ato.MULTIVIEW.no_history}-empty{/if}" href="{$ato.U_SELF}no_history={(int)!$ato.MULTIVIEW.no_history}">{'Save visit in history'|translate}</a></li>
57        <li><a class="icon-ato-null" href="{$ato.U_SELF}purge_template=1">{'Purge compiled templates'|translate}</a></li>
58      </ul>
59    </li>
60  </ul>
61</div>
62
63{footer_script require='jquery'}
64(function($){
65  var $ato = $('#ato_header').show(),
66      urlWS = '{$ROOT_URL}ws.php?format=json&method=';
67
68  $('body').css('margin-top', '+=28').prepend($ato);
69
70{*<!-- sub menus -->*}
71  $ato.find('.parent').on({
72    'click': function(){
73      $(this).find('ul').toggle();
74    },
75    'mouseleave': function(e) {
76      if (e.target.tagName.toLowerCase() != "select") {
77        $(this).find('ul').hide();
78      }
79    }
80  });
81  $ato.find('.parent>a').on('click', function(e) {
82    e.preventDefault();
83  });
84  $ato.find('.parent ul').on('mouseleave', function(e) {
85    if (e.target.tagName.toLowerCase() != "select") {
86      $(this).hide();
87    }
88  });
89
90  $ato.find('.switcher').on({
91    'change': function() {
92      window.location.href = '{$ato.U_SELF}'+ $(this).data('type') +'='+ $(this).val();
93    },
94    'click': function(e) {
95      e.stopPropagation();
96    }
97  });
98
99{*<!-- set representative -->*}
100{if isset($ato.U_SET_REPRESENTATIVE)}
101  $ato.find('.set-representative').on('click', function(e) {
102
103    if (!$(this).parent().hasClass('disabled')) {
104      $(this).parent().addClass('disabled')
105
106      $.ajax({
107        method: 'POST',
108        url: urlWS + 'pwg.categories.setRepresentative',
109        dataType: 'json',
110        data: {
111          image_id: {$current.id},
112          category_id: {$ato.CATEGORY_ID}
113        },
114        success: function() {
115          alert('ok');
116        },
117        fail: function(num, text) {
118          alert(num + ' ' + text);
119        }
120      });
121    }
122
123    e.preventDefault();
124  });
125{/if}
126
127{*<!-- add to caddie -->*}
128{if isset($ato.U_CADDIE) and isset($ato.IS_PICTURE)}
129  $ato.find('.add-caddie').on('click', function(e) {
130
131    if (!$(this).parent().hasClass('disabled')) {
132      $(this).parent().addClass('disabled')
133
134      $.ajax({
135        method: 'POST',
136        url: urlWS + 'pwg.caddie.add',
137        dataType: 'json',
138        data: {
139          image_id: {$current.id}
140        },
141        success: function() {
142          alert('ok');
143        },
144        fail: function(num, text) {
145          alert(num + ' ' + text);
146        }
147      });
148    }
149
150    e.preventDefault();
151  });
152{/if}
153
154}(jQuery));
155{/footer_script}
Note: See TracBrowser for help on using the repository browser.