source: extensions/CryptograPHP/template/admin.tpl @ 12617

Last change on this file since 12617 was 12617, checked in by mistic100, 12 years ago

rewrite some prefilters, replace CryptograPHP by Securimage (not abandoned project!)

File size: 7.6 KB
Line 
1{combine_css path=$CRYPTO_PATH|@cat:"template/colorpicker/colorpicker.css"}
2{combine_script id="jquery.colorpicker" require="jquery" path=$CRYPTO_PATH|@cat:"template/colorpicker/colorpicker.js"}
3
4{footer_script require='jquery.colorpicker'}{literal}
5jQuery(document).ready(function() {
6  $('.colorpicker-input')
7  .ColorPicker({
8    onSubmit: function(hsb, hex, rgb, el) {
9      $(el).val(hex);
10      $(el).ColorPickerHide();
11    },
12    onChange: function(hsb, hex, rgb, el) {
13      $(el).val(hex);
14      changeColor(el, hex);
15      $('.preset').removeClass('selected');
16      $('input[name=theme]').val('custom');
17    },
18    onBeforeShow: function () {
19      $(this).ColorPickerSetColor(this.value);
20    }
21  })
22  .bind('keyup', function(){
23    $(this).ColorPickerSetColor(this.value);
24    changeColor(this, $(this).val());
25  })
26  .each(function() {
27    changeColor(this, $(this).val());
28  });
29 
30  $('.preset').click(function() {
31    $('.preset').removeClass('selected');
32    $(this).addClass('selected');
33    eval('apply_'+ $(this).attr('title') +'();');
34    $('.colorpicker-input').each(function() { changeColor(this, $(this).val()); });
35    $('input[name=theme]').val($(this).attr('title'));
36  });
37 
38  $('.customize').click(function() {
39    $('#theming').fadeToggle();
40  });
41 
42  $('input.istheme').change(function() {
43    $('.preset').removeClass('selected');
44    $('input[name=theme]').val('custom');
45  });
46});
47
48function changeColor(target, color) {
49  if (color == 'random') color = '808080';
50  if (parseInt(color, 16) > 16777215/2) {
51    $(target).css('color', '#222');
52  } else {
53    $(target).css('color', '#ddd');
54  }
55  $(target).css('background', '#'+color)
56}
57{/literal}
58
59{$PRESETS_FUNC}
60{/footer_script}
61
62{html_head}
63<style type="text/css">
64{foreach from=$fonts item=font}
65@font-face {ldelim} 
66  font-family: {$font} ; 
67  src: url({$CRYPTO_PATH}securimage/fonts/{$font}.ttf) format("truetype"); 
68}
69{/foreach}
70.preset img {ldelim}
71  margin:1px;
72  padding:3px;
73  border:1px solid #999;
74}
75.preset.selected img {ldelim}
76  border-color:#f70;
77}
78</style>
79{/html_head}
80
81<div class="titrePage">
82  <h2>Crypto Captcha</h2>
83</div>
84
85<form method="post" class="properties">
86<fieldset>
87  <legend>{'Configuration'|@translate}</legend>
88 
89  <ul>                 
90    <li>
91      <span class="property">{'Comments action'|@translate}</span>
92      <label><input type="radio" name="comments_action" value="inactive" {if $crypto.comments_action == 'inactive'}checked="checked"{/if}> {'No captcha'|@translate}</label>
93      <label><input type="radio" name="comments_action" value="reject" {if $crypto.comments_action == 'reject'}checked="checked"{/if}> {'Reject'|@translate}</label>
94      <label><input type="radio" name="comments_action" value="moderate" {if $crypto.comments_action == 'moderate'}checked="checked"{/if}> {'Moderate'|@translate}</label>
95    </li>
96    <li>
97      <span class="property">{'Captcha type'|@translate}</span>
98      <label><input type="radio" name="captcha_type" value="string" {if $crypto.captcha_type == 'string'}checked="checked"{/if}> {'Random string'|@translate}</label>
99      <label><input type="radio" name="captcha_type" value="math" {if $crypto.captcha_type == 'math'}checked="checked"{/if}> {'Simple equation'|@translate}</label>
100    </li>
101    <!--<li>
102      <span class="property">{'Case sensitive'|@translate}</span>
103      <label><input type="radio" name="case_sensitive" value="false" {if $crypto.case_sensitive == 'false'}checked="checked"{/if}> {'No'|@translate}</label>
104      <label><input type="radio" name="case_sensitive" value="true" {if $crypto.case_sensitive == 'true'}checked="checked"{/if}> {'Yes'|@translate}</label>
105    </li>-->
106    <li>
107      <span class="property">{'Code lenght'|@translate}</span>
108      <label><input type="text" name="code_length" value="{$crypto.code_length}" size="6" maxlength="2"></label>
109    </li>
110    <li>
111      <span class="property">{'Width'|@translate}</span>
112      <label><input type="text" name="width" value="{$crypto.width}" size="6" maxlength="3"> {'good value:'|@translate} lenght*20</label>
113    </li>
114    <li>
115      <span class="property">{'Height'|@translate}</span>
116      <label><input type="text" name="height" value="{$crypto.height}" size="6" maxlength="3"> {'good value:'|@translate} width/4</label>
117    </li>
118    <li>
119      <span class="property">{'Captcha theme'|@translate}</span>
120      <div style="display:relative;margin-left:51%;">
121        {foreach from=$presets item=preset}
122        <a class="preset {if $crypto.theme == $preset}selected{/if}" title="{$preset}"><img src="{$CRYPTO_PATH}template/presets/{$preset}.png" alt="{$preset}"></a>
123        {/foreach}
124        <br><a class="customize">{'Customize'|@translate}</a><input type="hidden" name="theme" value="{$crypto.theme}">
125      </div>
126    </li>
127  </ul>
128 
129  <fieldset {if $crypto.theme != 'custom'}style="display:none;"{/if} id="theming">
130    <legend>{'Customize'|@translate}</legend>
131   
132    <ul>
133      <li>
134        <span class="property">{'Perturbation'|@translate}</span>
135        <label><input type="text" name="perturbation" value="{$crypto.perturbation}" class="istheme" size="6" maxlength="4"> {'range:'|@translate} 0 to 1</label>
136      </li>
137      <li>
138        <span class="property">{'Background color'|@translate}</span>
139        <label><input type="text" name="image_bg_color" value="{$crypto.image_bg_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label>
140      </li>
141      <li>
142        <span class="property">{'Text color'|@translate}</span>
143        <label><input type="text" name="text_color" value="{$crypto.text_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label>
144      </li>
145      <li>
146        <span class="property">{'Lines density'|@translate}</span>
147        <label><input type="text" name="num_lines" value="{$crypto.num_lines}" class="istheme" size="6" maxlength="4"> {'range:'|@translate} 0 to 10</label>
148      </li>
149      <li>
150        <span class="property">{'Lines color'|@translate}</span>
151        <label><input type="text" name="line_color" value="{$crypto.line_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label>
152      </li>
153      <li>
154        <span class="property">{'Noise level'|@translate}</span>
155        <label><input type="text" name="noise_level" value="{$crypto.noise_level}" class="istheme" size="6" maxlength="4"> {'range:'|@translate} 0 to 10</label>
156      </li>
157      <li>
158        <span class="property">{'Noise color'|@translate}</span>
159        <label><input type="text" name="noise_color" value="{$crypto.noise_color}" class="colorpicker-input istheme" size="6" maxlength="6"></label>
160      </li>
161      <li>
162        <span class="property">{'Font'|@translate}</span>
163        <div style="display:relative;margin-left:51%;">
164          {foreach from=$fonts item=font}
165          <label style="font-family:{$font};" title="{$font}"><input type="radio" name="ttf_file" value="{$font}" {if $crypto.ttf_file == $font}checked="checked"{/if} class="istheme"> {$font}</label>
166          {/foreach}
167        </div>
168      </li>
169     
170      <li>
171        <span class="property">{'Preview'|@translate}</span>
172        <label><img id="captcha" src="{$CRYPTO_PATH}securimage/securimage_show.php" alt="CAPTCHA Image"></label>
173      </li>
174    </ul>
175   
176    {'Tip: type "random" on a color field to have a random color'|@translate}
177  </fieldset>
178 
179  <p class="bottomButtons">
180    <input class="submit" type="submit" value="{'Submit'|@translate}" name="submit">
181  </p>
182</fieldset>
183</form>
184
185<div style="text-align:right;">
186  All free fonts from <a href="http://www.dafont.com" target="_blank">dafont.com</a> |
187  Powered by : <a href="http://www.phpcaptcha.org/" target="_blank"><img src="{$CRYPTO_PATH}template/logo.png" alt="Secureimage"></a>
188</div>
Note: See TracBrowser for help on using the repository browser.