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

Last change on this file since 25619 was 25619, checked in by mistic100, 10 years ago
  • display info about current logged user
  • add button to hide the bar
  • fix select boxes
File size: 6.9 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_closed"><a href="#" class="icon-tools"></a></div>
10
11<div id="ato_header">
12  <ul id="ato_header_root">
13    <li><a href="#" class="icon-ato-cancel close-panel"></a></li>
14    <li class="parent"><a href="#" class="icon-menu">{'Admin panel'|translate}</a>
15      <ul>
16        <li><a class="icon-picture" href="{$ato.U_SITE_ADMIN}photos_add">{'Photos'|translate}</a></li>
17        <li><a class="icon-sitemap" href="{$ato.U_SITE_ADMIN}cat_list">{'Albums'|translate}</a></li>
18        <li><a class="icon-users" href="{$ato.U_SITE_ADMIN}user_list">{'Users'|translate}</a></li>
19        <li><a class="icon-puzzle" href="{$ato.U_SITE_ADMIN}plugins">{'Plugins'|translate}</a></li>
20        <li><a class="icon-wrench" href="{$ato.U_SITE_ADMIN}maintenance">{'Tools'|translate}</a></li>
21        <li><a class="icon-cog" href="{$ato.U_SITE_ADMIN}configuration">{'Options'|translate}</a></li>
22      </ul>
23    </li>
24  {if isset($ato.U_EDIT)}
25    <li class="parent"><a href="#" class="icon-pencil">{'Edit'|translate}</a>
26      <ul>
27        <li><a href="#" class="icon-ato-flash edit-quick">{'Quick edit'|translate}</a></li>
28        <li><a class="icon-ato-doc-text-inv" href="{$ato.U_EDIT}">{'Properties page'|translate}</a></li>
29      </ul>
30    </li>
31  {/if}
32  {if isset($ato.U_SET_REPRESENTATIVE)}
33    <li><a class="icon-ato-trophy set-representative" href="{$ato.U_SET_REPRESENTATIVE}">{'representative'|translate|ucfirst}</a></li>
34  {/if}
35  {if isset($ato.U_CADDIE)}
36    <li><a class="icon-ato-flag add-caddie" href="{$ato.U_CADDIE}">{'Add to caddie'|translate}</a></li>
37  {/if}
38    <li class="parent right"><a class="icon-cog-alt" href="#">{'Tools'|translate}</a>
39      <ul>
40        <li><label>View as</label>
41          <select class="switcher" data-type="view_as">
42            {$users_options}
43          </select>
44        </li>
45        <li><label>Theme</label>
46          <select class="switcher" data-type="theme">
47            {$themes_options}
48          </select>
49        </li>
50        <li><label>Language</label>
51          <select class="switcher" data-type="lang">
52            {$langs_options}
53          </select>
54        </li>
55        <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>
56        <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>
57        <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>
58        <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>
59        <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>
60        <li><a class="icon-ato-null" href="{$ato.U_SELF}purge_template=1">{'Purge compiled templates'|translate}</a></li>
61      </ul>
62    </li>
63  {if $ato.USER.username != $USERNAME}
64    <li class="right">
65      &nbsp;&nbsp;{'Logged as <b>%s</b>, viewing as <b>%s</b>.'|translate:$ato.USER.username:$USERNAME}
66      <a href="{$ato.U_SELF}view_as={$ato.USER.id}">{'Go back'|translate}</a>
67    </li>
68  {/if}
69  </ul>
70</div>
71
72{footer_script require='jquery'}
73(function($){
74  var $ato = $('#ato_header'),
75      $ato_closed = $('#ato_header_closed'),
76      ato_height = 28,
77      urlWS = '{$ROOT_URL}ws.php?format=json&method=';
78
79  $('body').prepend($ato);
80
81  if (window.localStorage.ato_panel_open == null) {
82    window.localStorage.ato_panel_open = "true";
83  }
84
85  if (window.localStorage.ato_panel_open == "true") {
86    $ato.show();
87    $('body').css({ldelim}'margin-top': '+='+ato_height});
88  }
89  else {
90    $ato_closed.show();
91  }
92
93{*<!-- sub menus -->*}
94  $ato.find('.parent').on({
95    'click': function(){
96      $(this).find('ul').toggle();
97    },
98    'mouseleave': function(e) {
99      if (e.target.tagName.toLowerCase() != "select") {
100        $(this).find('ul').hide();
101      }
102    }
103  });
104  $ato.find('.parent>a').on('click', function(e) {
105    e.preventDefault();
106  });
107  $ato.find('.parent ul').on('mouseleave', function(e) {
108    if (e.target.tagName.toLowerCase() != "select") {
109      $(this).hide();
110    }
111  });
112
113  $ato.find('.switcher').on({
114    'change': function() {
115      window.location.href = '{$ato.U_SELF}'+ $(this).data('type') +'='+ $(this).val();
116    },
117    'click': function(e) {
118      e.stopPropagation();
119    }
120  });
121
122  $ato.find('.close-panel').on('click', function(e) {
123    $ato.slideUp();
124    $ato_closed.slideDown();
125    $('body').animate({ldelim}'margin-top': '-='+ato_height});
126
127    window.localStorage.ato_panel_open = "false";
128    e.preventDefault();
129  });
130 
131  $ato_closed.on('click', function(e) {
132    $ato.slideDown();
133    $ato_closed.slideUp();
134    $('body').animate({ldelim}'margin-top': '+='+ato_height});
135
136    window.localStorage.ato_panel_open = "true";
137    e.preventDefault();
138  });
139
140{*<!-- set representative -->*}
141{if isset($ato.U_SET_REPRESENTATIVE)}
142  $ato.find('.set-representative').on('click', function(e) {
143
144    if (!$(this).parent().hasClass('disabled')) {
145      $(this).parent().addClass('disabled')
146
147      $.ajax({
148        method: 'POST',
149        url: urlWS + 'pwg.categories.setRepresentative',
150        dataType: 'json',
151        data: {
152          image_id: {$current.id},
153          category_id: {$ato.CATEGORY_ID}
154        },
155        success: function() {
156          alert('ok');
157        },
158        fail: function(num, text) {
159          alert(num + ' ' + text);
160        }
161      });
162    }
163
164    e.preventDefault();
165  });
166{/if}
167
168{*<!-- add to caddie -->*}
169{if isset($ato.U_CADDIE) and isset($ato.IS_PICTURE)}
170  $ato.find('.add-caddie').on('click', function(e) {
171
172    if (!$(this).parent().hasClass('disabled')) {
173      $(this).parent().addClass('disabled')
174
175      $.ajax({
176        method: 'POST',
177        url: urlWS + 'pwg.caddie.add',
178        dataType: 'json',
179        data: {
180          image_id: {$current.id}
181        },
182        success: function() {
183          alert('ok');
184        },
185        fail: function(num, text) {
186          alert(num + ' ' + text);
187        }
188      });
189    }
190
191    e.preventDefault();
192  });
193{/if}
194
195}(jQuery));
196{/footer_script}
Note: See TracBrowser for help on using the repository browser.