source: extensions/ASearchEngine/admin/ase_config.tpl @ 11516

Last change on this file since 11516 was 7407, checked in by grum, 13 years ago

Fix bugs bug:1958, bug:1959

  • Property svn:executable set to *
File size: 3.5 KB
Line 
1
2<h2>{'ase_config'|@translate}</h2>
3
4{literal}
5<script type='text/javascript'>
6
7  function configManager()
8  {
9
10    this.init = function ()
11    {
12      this.displayTab('gallery');
13    }
14
15    /**
16     * manage the tabsheet
17     *
18     * @param String tabsheet : id of the tabsheet to display
19     */
20    this.displayTab = function (tabsheet)
21    {
22      switch(tabsheet)
23      {
24        case 'gallery':
25          $('#iTabGallery').css('display', 'block');
26          $('#iTabConfig').css('display', 'none');
27          break;
28        case 'keyword':
29          $('#iTabGallery').css('display', 'none');
30          $('#iTabConfig').css('display', 'block');
31          break;
32      }
33    }
34
35    this.checkValidity = function(tabsheet)
36    {
37      $('.error').removeClass('error');
38
39      re=/\d+/i;
40
41      ok=true;
42
43      if(tabsheet==null || tabsheet=='gallery')
44      {
45
46        if($('#iPAActive').attr('checked') && $('input.checkModules:checked').length==0)
47        {
48          $('input.checkModules').parent().addClass('error');
49          $('#itabcfggallery a').click();
50          ok=false;
51          alert("{/literal}{"ase_error_no_module_checked"|@translate}{literal}");
52        }
53
54        if(re.exec($('#iPALimits').val())==null || $('#iPALimits').val()=='0')
55        {
56          $('#iPALimits').addClass('error');
57          $('#itabcfggallery a').click();
58          ok=false;
59          alert("{/literal}{'ase_error_limit_must_be_integer_gt_0'|@translate}{literal}");
60        }
61      }
62
63      if(tabsheet==null || tabsheet=='keyword')
64      {
65        if(re.exec($('#iKMinLength').val())==null || $('#iKMinLength').val()=='0')
66        {
67          $('#iKMinLength').addClass('error');
68          $('#itabcfgkeyword a').click();
69          ok=false;
70          alert("{/literal}{'ase_error_key_word_min_length_must_be_integer_gt_0'|@translate}{literal}");
71        }
72      }
73
74      return(ok);
75    }
76
77    this.submit = function ()
78    {
79      var ok=this.checkValidity();
80
81
82      if(ok) $('#iForm').get(0).submit();
83    }
84
85    this.init();
86  }
87
88</script>
89{/literal}
90
91{$configTabsheet}
92
93
94<form method="POST" action="" id='iForm'>
95
96  <div id='iTabGallery' style='display:none;'>
97    <div>
98      <label><input type="checkbox" id='iPAActive' name='fPAActive' {if $aseConfig.ase_publicAccess_active}checked{/if}>&nbsp;{'ase_publicAccess_active'|@translate}</label>
99    </div>
100
101    <div style='margin-left:30px;'>
102      {'ase_publicAccess_allowedPlugins'|@translate}
103      <ul class='modulesList'>
104        {foreach from=$datas.modules item=module}
105          <li><label><input class='checkModules' type="checkbox" name="fModule{$module.id}" {if $module.accessible}checked{/if}>&nbsp;{$module.name}</label></li>
106        {/foreach}
107      </ul>
108    </div>
109
110    <div class='cfgBloc' style='display:none;'>
111      <label><input type="checkbox" id='iPAApplyLimits' name='fPAApplyLimits' {if $aseConfig.ase_publicAccess_applyLimits}checked{/if}>&nbsp;{'ase_publicAccess_applyLimits'|@translate}</label>
112      <input id="iPALimits" name="fPALimits" type="text" maxlength='6' size='6' value="{$aseConfig.ase_publicAccess_limits}">
113    </div>
114
115  </div>
116
117  <div id='iTabConfig' style='display:none;'>
118    {'ase_keyword_minLength'|@translate}&nbsp;
119    <input id="iKMinLength" name="fKMinLength" type="text" maxlength='2' size='2' value="{$aseConfig.ase_keyword_minLength}">
120  </div>
121
122
123  <div class='cfgBloc'>
124    <input type="button" onclick="cm.submit();" value="{'ase_apply'|@translate}">
125  </div>
126
127</form>
128
129
130{literal}
131<script type="text/javascript">
132  var cm=new configManager();
133</script>
134{/literal}
Note: See TracBrowser for help on using the repository browser.