Changeset 3706 for extensions/AStat/admin
- Timestamp:
- Jul 30, 2009, 7:36:50 PM (15 years ago)
- Location:
- extensions/AStat/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AStat/admin/astat_by_ip.tpl
r3394 r3706 10 10 {foreach from=$datarows key=name item=data} 11 11 <tr class="StatTableRow"> 12 <td style="white-space: nowrap"> {$data.ASTAT_IP_GEOLOCALISATION} {$data.ASTAT_IP_ADRESS}</td>12 <td style="white-space: nowrap"><a href="">{$data.ASTAT_IP_BLACKLIST} {$data.ASTAT_IP_GEOLOCALISATION} {$data.ASTAT_IP_ADRESS}</td> 13 13 <td class="number">{$data.PAGES}</td> 14 14 <td class="number">{$data.PICTURES}</td> -
extensions/AStat/admin/astat_config.tpl
r3394 r3706 20 20 } 21 21 22 function isAValidIP(ip, strict) 23 { 24 returnedip=ip; 25 re = /^(\d{1,3}){1}(\.\d{1,3}){0,3}$/i; 26 if(re.test(ip)) 27 { 28 num = ip.split('.'); 29 for(i=0;i<num.length;i++) 30 { 31 if(num[i]>255) return(false); 32 } 33 if(!strict) 34 { 35 returnedip+="%"; 36 } 37 for(j=4-i;j>0;j--) 38 { 39 returnedip+=".%"; 40 } 41 return(returnedip); 42 } 43 else 44 { 45 return(false); 46 } 47 } 48 49 function makeOptionsFromList(list, options) 50 { 51 if(list=="") 52 { 53 return(false); 54 } 55 56 items=list.split(","); 57 for(i=0;i<items.length;i++) 58 { 59 opt = document.createElement("option"); 60 opt.value=items[i]; 61 opt.text=items[i]; 62 options.appendChild(opt); 63 } 64 } 65 66 function makeListFromOptions(options) 67 { 68 list=""; 69 for(i=0;i<options.length;i++) 70 { 71 (i!=0)?list+=",":""; 72 list+=options[i].value; 73 } 74 return(list); 75 } 76 77 function addIP() 78 { 79 ip=isAValidIP($("#iaddblackip").val(), true); 80 81 if(ip==false) return(false); 82 83 list = $("#iblacklistedip").val()+","; 84 if(list.indexOf(ip+",")==-1) 85 { 86 opt = document.createElement("option"); 87 opt.value=ip; 88 opt.text=ip; 89 $("#iblacklistip")[0].appendChild(opt); 90 $("#iblacklistedip").val(makeListFromOptions($("#iblacklistip")[0].options)); 91 } 92 $("#iaddblackip").val(""); 93 checkButtons(); 94 } 95 96 function delIP() 97 { 98 opt = $("#iblacklistip")[0]; 99 100 i=0; 101 while(i<opt.options.length) 102 { 103 if(opt.options[i].selected) 104 { 105 opt.removeChild(opt.options[i]); 106 } 107 else 108 { 109 i++; 110 } 111 } 112 $("#iblacklistedip").val(makeListFromOptions(opt.options)); 113 checkButtons(); 114 } 115 116 function checkButtons() 117 { 118 $("#idelipbutton").attr('disabled', !($("#iblacklistip")[0].selectedIndex!=-1)); 119 $("#iaddipbutton").attr('disabled', (isAValidIP($('#iaddblackip').val(),true)==false) ); 120 } 121 122 function init() 123 { 124 makeOptionsFromList($("#iblacklistedip").val(), $("#iblacklistip")[0]); 125 126 $("#iaddblackip").bind("keyup focus", getIPList).bind("blur", hideIPList); 127 p = $("#iaddblackip").offset() 128 $("#iplist").css({ 129 left:p.left+1, 130 top:p.top+$("#iaddblackip").outerHeight()-1 131 }); 132 $("#iblacklistip").bind("change", checkButtons); 133 checkButtons(); 134 } 135 136 function getIPList() 137 { 138 /*if($("#iaddblackip").val()=="") 139 { 140 ip="%"; 141 } 142 else 143 { 144 ip=isAValidIP($("#iaddblackip").val(),false); 145 } 146 if(ip==false) return(false);*/ 147 ip=$("#iaddblackip").val()+"%"; 148 149 checkButtons(); 150 $("html,input").css({cursor:"progress"}); 151 $.get("{/literal}{$datas.ajaxurl}{literal}", { 152 ajaxfct:"astat_listip", 153 ipfilter:ip, 154 exclude:$("#iblacklistedip").val() 155 }, 156 function (data) 157 { 158 $("#iplist").html(data).css({visibility:"visible"}); 159 $("#iipsellist") 160 .bind("mouseover", function (event) { 161 $("#iaddblackip").unbind("blur"); 162 } ) 163 .bind("mouseout", function (event) { 164 $("#iaddblackip").bind("blur", hideIPList); 165 } ) 166 .bind("blur", hideIPList) 167 .bind("change", function (event) { 168 $("#iaddblackip").val($("#iipsellist").val()); 169 $("#iipsellist").trigger("blur").attr("selectedIndex", -1); 170 checkButtons(); 171 hideIPList(); 172 } ) ; 173 $("html,input").css({cursor:"default"}); 174 $("input:text").css({cursor:"text"}); 175 } 176 ); 177 } 178 179 function hideIPList() 180 { 181 $("#iplist").css({visibility:"hidden"}); 182 } 183 22 184 </script> 23 185 {/literal} … … 112 274 <tr> 113 275 <td>{'AStat_NbIPPerPages'|@translate}</td> 114 <td ><input type="text" name="f_AStat_NpIPPerPages" value="{$datas.f_AStat_NpIPPerPages}" maxlength=4/></td>276 <td colspan="2"><input type="text" name="f_AStat_NpIPPerPages" value="{$datas.f_AStat_NpIPPerPages}" maxlength=4/></td> 115 277 </tr> 116 278 117 279 <tr> 118 280 <td>{'AStat_DefaultSortIP'|@translate}</td> 119 <td >281 <td colspan="2"> 120 282 <select name="f_AStat_DefaultSortIP"> 121 283 {html_options values=$AStat_defaultsortip_list_values output=$AStat_defaultsortip_list_labels selected=$datas.AStat_defaultsortip_selected} … … 123 285 </td> 124 286 </tr> 287 288 <tr> 289 <td>{'AStat_BlackListedIP'|@translate}</td> 290 <td> 291 <input type="text" size="15" id="iaddblackip" style="width:200px;" autocomplete="off"/> 292 <input type="hidden" id="iblacklistedip" name="f_AStat_BlackListedIP" value="{$datas.f_AStat_BlackListedIP}"/> 293 <div id="iplist"></div> 294 </td> 295 <td> 296 <input type="button" value="{'AStat_AddIP'|@translate}" id="iaddipbutton" onclick="addIP();"/> 297 </td> 298 </tr> 299 <tr> 300 <td> </td> 301 <td> 302 <select multiple size="4" id="iblacklistip" style="width:200px;height:150px;"> 303 </select> 304 </td> 305 <td> 306 <input type="button" value="{'AStat_DelIP'|@translate}" id="idelipbutton" onclick="delIP();"/> 307 </td> 308 </tr> 309 310 311 125 312 </table> 126 313 </fieldset> … … 190 377 </form> 191 378 192 193 379 <script type="text/javascript"> 380 init(); 381 </script> 382 -
extensions/AStat/admin/astat_tools.tpl
r3394 r3706 1 {known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"} 2 {known_script id="jquery.ui.datepicker" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.datepicker.packed.js"} 3 {assign var="datepicker_language" value="template-common/lib/ui/i18n/ui.datepicker-"|@cat:$lang_info.code|@cat:".js"} 4 5 {if "PHPWG_ROOT_PATH"|@constant|@cat:$datepicker_language|@file_exists} 6 {known_script id="jquery.ui.datepicker-$lang_info.code" src=$ROOT_URL|@cat:$datepicker_language} 7 {/if} 8 9 {html_head} 10 <link rel="stylesheet" type="text/css" href="{$ROOT_URL}template-common/lib/ui/ui.datepicker.css"> 11 {/html_head} 12 1 13 {literal} 2 14 <script type="text/javascript"> 3 15 4 16 function enabled_purge() 5 17 { 6 var objconfirm = document.getElementById('purge_history_confirm'); 7 var objdate = document.getElementById('purge_history_date'); 8 var objbutton = document.getElementById('purge_history_button'); 9 var objtype0 = document.getElementById('purge_history_type0'); 10 18 re = /\d{2}/\d{2}/\d{4}/i; 11 19 12 if(((objconfirm.checked==true)&&(objtype0.checked==true)&&(objdate.value.length==10))|| 13 ((objconfirm.checked==true)&&(objtype0.checked==false))) 14 { objbutton.disabled=false; } else { objbutton.disabled=true; } 20 if(($('#purge_history_confirm').attr('checked')&&$('#purge_history_type0').attr('checked')&&re.test($('#purge_history_date').val()))|| 21 ($('#purge_history_confirm').attr('checked')&&!('#purge_history_type0').attr('checked'))) 22 { 23 $('#purge_history_button').attr('disabled', true); 24 } 25 else 26 { 27 $('#purge_history_button').attr('disabled', false); 28 } 15 29 } 16 30 17 31 function enabled_deleted_picture() 18 32 { 19 20 33 var objconfirm = document.getElementById('deleted_picture_confirm_resync'); 34 var objbutton = document.getElementById('deleted_picture_resync_button'); 21 35 22 if(objconfirm.checked==true) 23 { objbutton.disabled=false; } else { objbutton.disabled=true; } 36 if($('#deleted_picture_confirm_resync').attr('checked')) 37 { 38 $('deleted_picture_resync_button').attr('disabled', false); 39 } 40 else 41 { 42 $('deleted_picture_resync_button').attr('disabled', true); 43 } 44 } 45 46 function init() 47 { 48 $("#purge_history_date").datepicker({ 49 dateFormat: 'dd/mm/yy', 50 constrainInput: true, 51 defaultDate:"-12m", 52 maxDate:0, 53 minDate:new Date({/literal}"{$datas.ASTAT_MINDATE}"{literal}) 54 }); 24 55 } 25 56 … … 27 58 {/literal} 28 59 29 {$datas.ASTAT_RESULT_OK} 60 {$datas.ASTAT_RESULT_OK} 30 61 31 62 <fieldset class='formtable'> 32 33 63 <legend>{'AStat_tools_general_nfo'|@translate}</legend> 64 <p>{$datas.ASTAT_GENERAL_NFO}</p> 34 65 </fieldset> 35 66 … … 51 82 52 83 <fieldset class='formtable'> 53 54 55 56 57 84 <legend>{'AStat_tools_deleted_picture'|@translate}</legend> 85 <p>{'AStat_tools_deleted_picture_nfo0'|@translate}</p> 86 <p>{$datas.ASTAT_DELETED_PICTURE_NFO}</p> 87 <form method="post" action="" class="general"> 88 { if isset($datas.AStat_deleted_picture_submit0) and $datas.AStat_deleted_picture_submit0 == 'yes'} 58 89 <p class='formtable'> 59 90 <input type="submit" value="{'AStat_tools_deleted_picture_apply'|@translate}" name="apply_tool_deleted_picture"/> 60 91 </p> 61 62 63 64 65 66 67 92 {/if} 93 </form> 94 <hr/> 95 <p>{'AStat_tools_deleted_picture_nfo3'|@translate}</p> 96 97 <form method="post" action="" class="general"> 98 <p> 68 99 <label> 69 100 <input type="radio" value="prepare" name="fAStat_tools_deleted_picture_action" id="deleted_picture0" {$datas.ASTAT_DELETED_PICTURE_PREPARE} > 70 101 {'AStat_tools_deleted_picture_prepare_action'|@translate} 71 102 </label><br> 72 103 <label> 73 104 <input type="radio" value="apply" name="fAStat_tools_deleted_picture_action" id="deleted_picture1" {$datas.ASTAT_DELETED_PICTURE_DO_ACTION} > 74 105 {'AStat_tools_deleted_picture_do_action'|@translate}{$datas.ASTAT_DELETED_PICTURE_NFO_NB} 75 106 </label> 76 107 </p> 77 78 79 80 81 108 <p class='formtable'> 109 <input type="checkbox" id="deleted_picture_confirm_resync" onclick="enabled_deleted_picture();"/> 110 <input type="submit" value="{'AStat_tools_deleted_picture_do'|@translate}" name="apply_tool_deleted_picture_resync" id="deleted_picture_resync_button" disabled /> 111 </p> 112 </form> 82 113 </fieldset> 83 114 84 115 85 116 <fieldset class='formtable'> 86 87 88 89 90 91 92 93 94 95 117 <legend>{'AStat_tools_deleted_category'|@translate}</legend> 118 <p>{'AStat_tools_deleted_category_nfo0'|@translate}</p> 119 <p>{$datas.ASTAT_DELETED_CATEGORY_NFO}</p> 120 <form method="post" action="" class="general"> 121 {if isset($datas.AStat_deleted_category_submit0) and $datas.AStat_deleted_category_submit0=='yes'} 122 <p class='formtable'> 123 <input type="submit" value="{'AStat_tools_deleted_category_apply'|@translate}" name="apply_tool_deleted_category"/> 124 </p> 125 {/if} 126 </form> 96 127 </fieldset> 97 128 98 129 99 130 <fieldset class='formtable'> 100 101 102 103 131 <legend>{'AStat_tools_purge_history'|@translate}</legend> 132 <p>{'AStat_tools_purge_history_nfo'|@translate}</p> 133 <form method="post" action="" class="general"> 134 <p> 104 135 <label> 105 136 <input type="radio" value="bydate" name="fAStat_purge_history_type" id="purge_history_type0" checked onclick="enabled_purge();"> … … 107 138 </label> 108 139 109 <input type="text" id="purge_history_date" name="fAStat_purge_history_date" value="" maxlength=10onchange="enabled_purge();"/><br>140 <input type="text" id="purge_history_date" name="fAStat_purge_history_date" size="10" onchange="enabled_purge();"/><br> 110 141 111 142 <label> … … 113 144 {$datas.ASTAT_PURGE_HISTORY_IMAGE_NFO} 114 145 </label> 115 <br >146 <br/> 116 147 117 148 <label> 118 149 <input type="radio" value="bycategoryid0" name="fAStat_purge_history_type" id="purge_history_type2" onclick="enabled_purge();" {$datas.ASTAT_PURGE_HISTORY_CATEGORY_DISABLED}> 119 150 {$datas.ASTAT_PURGE_HISTORY_CATEGORY_NFO} 151 </label> 152 <br/> 153 154 <label> 155 <input type="radio" value="byipid0" name="fAStat_purge_history_type" id="purge_history_type3" onclick="enabled_purge();" {$datas.ASTAT_PURGE_HISTORY_IP_DISABLED}> 156 {$datas.ASTAT_PURGE_HISTORY_IP_NFO} 120 157 </label> 121 158 </p> … … 126 163 </p> 127 164 128 165 </form> 129 166 </fieldset> 130 167 168 <script type="text/javascript"> 169 init(); 170 </script>
Note: See TracChangeset
for help on using the changeset viewer.