Subversion Repositories wimsdev

Rev

Rev 15792 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
15792 guerimand 1
 
2
!! read autocompletion script of the server
3
geoloclist=!filelist $wims_home/public_html/scripts/adm/geoloc/
4
geoloclist=!lines2items $geoloclist
5
 
6
nblang=!wordcnt $wims_site_languages
7
 
8
!! --- save newconfiguration
9
!if $save!=$empty and $job=geolocoption
10
  !! --- check geoloc
11
  geoloc=!text select 0123456789., in $geoloc
12
  X=!item 1 of $geoloc
13
  X=$[$X * 1]
14
  Y=!item 2 of $geoloc
15
  Y=$[$Y * 1]
16
  N=!itemcnt $geoloc
17
  !if $N!=2 or NAN isin $X$Y
18
    geoloc=$empty,$empty
19
  !endif
20
  !! --- check location
21
  location=!translate ,!$$"< to $     $ in $location
22
  location=!singlespace $location
23
  location=!trim $location
24
  !writefile wimshome/log/stat/server.geoloc $location,$X,$Y
25
 
26
  !! --- check for autocompletion
27
  data=$empty
28
  !for k=1 to $nblang
29
    l=!word $k of $wims_site_languages
30
    up_autocompletion$k=!listintersection $(up_autocompletion$k) and 0,$geoloclist
31
    !if $(up_autocompletion$k)=$empty
32
      up_autocompletion$k=!lookup $l in wimshome/log/stat/geoloc.dictionary
33
    !endif
34
    !if $(up_autocompletion$k)!=$empty and $(up_autocompletion$k)!=0
35
      data=!append line $l:$(up_autocompletion$k) to $data
36
    !endif
37
  !next k
38
  !writefile wimshome/log/stat/geoloc.dictionary $data
15929 guerimand 39
  !restart module=adm/manage&job=list
15792 guerimand 40
!endif
41
 
42
!! read server parameter
43
t=!record 0 of wimshome/log/stat/server.geoloc
44
location=!item 1 of $t
45
geoloc=!item 2 to 3 of $t
46
!for k=1 to $nblang
47
  l=!word $k of $wims_site_languages
48
  up_autocompletion$k=!lookup $l in wimshome/log/stat/geoloc.dictionary
49
!next k