Index: /extensions/AStat/admin/astat_tools.tpl
===================================================================
--- /extensions/AStat/admin/astat_tools.tpl	(revision 27064)
+++ /extensions/AStat/admin/astat_tools.tpl	(revision 27065)
@@ -1,18 +1,5 @@
+{include file='include/datepicker.inc.tpl'}
 
-{combine_script id="jquery.ui" path="themes/default/js/ui/jquery.ui.core.js"}
-{combine_script id="jquery.ui.datepicker" path="themes/default/js/ui/jquery.ui.datepicker.js"}
-{assign var="datepicker_language" value="themes/default/js/ui/i18n/jquery.ui.datepicker-"|@cat:$lang_info.code|@cat:".js"}
-
-
-{if "PHPWG_ROOT_PATH"|@constant|@cat:$datepicker_language|@file_exists}
-{combine_script id="jquery.ui.datepicker-$lang_info.code" path=$datepicker_language}
-{/if}
-
-{html_head}
-<link rel="stylesheet" type="text/css" href="themes/default/js/ui/theme/jquery.ui.datepicker.css">
-{/html_head}
-
-{literal}
-<script type="text/javascript">
+{footer_script}{literal}
 
  function enabled_purge()
@@ -20,6 +7,6 @@
   re = /\d{2}\/\d{2}\/\d{4}/i;
 
-  if(($('#purge_history_confirm').attr('checked')&&$('#purge_history_type0').attr('checked')&&re.test($('#purge_history_date').val()))||
-     ($('#purge_history_confirm').attr('checked')&&!$('#purge_history_type0').attr('checked')))
+  if(($('#purge_history_confirm').is(':checked')&&$('#purge_history_type0').is(':checked')&&re.test($('#purge_history_date').val()))||
+     ($('#purge_history_confirm').is(':checked')&&!$('#purge_history_type0').is(':checked')))
   {
     $('#purge_history_button').attr('disabled', false);
@@ -36,5 +23,5 @@
   var objbutton = document.getElementById('deleted_picture_resync_button');
 
-  if($('#deleted_picture_confirm_resync').attr('checked'))
+  if($('#deleted_picture_confirm_resync').is(':checked'))
   {
     $('deleted_picture_resync_button').attr('disabled', false);
@@ -57,6 +44,7 @@
  }
 
-</script>
-{/literal}
+ init();
+
+{/literal}{/footer_script}
 
 {if isset($datas.ASTAT_RESULT_OK)}{$datas.ASTAT_RESULT_OK}{/if}
@@ -88,5 +76,5 @@
   <p>{$datas.ASTAT_DELETED_PICTURE_NFO}</p>
   <form method="post" action="" class="general">
-    { if isset($datas.AStat_deleted_picture_submit0) and $datas.AStat_deleted_picture_submit0 == 'yes'}
+    {if isset($datas.AStat_deleted_picture_submit0) and $datas.AStat_deleted_picture_submit0 == 'yes'}
       <p class='formtable'>
         <input type="submit" value="{'AStat_tools_deleted_picture_apply'|@translate}" name="apply_tool_deleted_picture"/>
@@ -167,6 +155,2 @@
   </form>
 </fieldset>
-
-<script type="text/javascript">
-  init();
-</script>
Index: /extensions/AStat/astat_aip.class.inc.php
===================================================================
--- /extensions/AStat/astat_aip.class.inc.php	(revision 27064)
+++ /extensions/AStat/astat_aip.class.inc.php	(revision 27065)
@@ -1443,5 +1443,5 @@
     if(isset($_POST['submit']))
     {
-      if(!is_adviser())
+      if (true) // if(!is_adviser())
       {
         reset($this->config);
@@ -1574,5 +1574,5 @@
     if(isset($_POST['apply_tool_purge_history']))
     {
-      if(!is_adviser())
+      if (true) // if(!is_adviser())
       {
         $action_result['action']='AStat_tools_purge_history';
@@ -1632,5 +1632,5 @@
     elseif(isset($_POST['apply_tool_deleted_picture_resync']))
     {
-      if(!is_adviser())
+      if (true) // if(!is_adviser())
       {
         $action_result['action']='AStat_tools_deleted_picture';
@@ -1673,5 +1673,5 @@
     elseif(isset($_POST['apply_tool_deleted_picture']))
     {
-      if(!is_adviser())
+      if (true) // if(!is_adviser())
       {
         $action_result['action']='AStat_tools_deleted_picture';
@@ -1696,5 +1696,5 @@
     elseif(isset($_POST['apply_tool_deleted_category']))
     {
-      if(!is_adviser())
+      if (true) // if(!is_adviser())
       {
         $action_result['action']='AStat_tools_deleted_category';
@@ -1719,5 +1719,5 @@
     elseif(isset($_POST['apply_tool_deleted_user']))
     {
-      if(!is_adviser())
+      if (true) // if(!is_adviser())
       {
         $action_result['action']='AStat_tools_deleted_user';
