Subversion Repositories wimsdev

Rev

Rev 10475 | Rev 13004 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23 reyssat 1
 
2497 bpr 2
n=!recordcnt lang/cat.$modu_lang
23 reyssat 3
!bound confcat between 1 and $n default 1
4504 bpr 4
l=!record $confcat of lang/cat.$modu_lang
5
!distribute lines $l into catname, cattit
6
!if $catname=housekeep
3030 guerimand 7
 !readproc mu/publishdownload.def
8
!endif
23 reyssat 9
 
10
!if $catname=appearances
10475 obado 11
  csslist=!sh cd html/css/$lang; ls *.css | sed 's/\.css$$//' | sort
12
  csslist=!words2items ---- -theme- $csslist
13
  themelist=!sh find themes -name visitor.phtml | sed 's!^themes/!!;s!/visitor.phtml$!!' | sort
14
  themelist=!words2items $themelist
15
  themelist=!listuniq default,$themelist
16
  iconlist=!sh cd gifs/themes/;ls -d */ | cut -f1 -d'/' | sort
17
  iconlist=!words2items $iconlist
18
  !for icon_theme in $iconlist
19
    !set icon_title=!defof title in wimshome/public_html/gifs/themes/$icon_theme/INDEX
20
    !set iconpromptlist=!append item $icon_title to $iconpromptlist
21
  !next
23 reyssat 22
!endif
23
 
24
!if $catname=graphics
25
 chtest=!sh ls $wims_home/chroot/tmp/sessions/.chroot 2>/dev/null
26
 !if chroot isin $chtest
27
  cvtest=new.png
28
 !else
29
  cvtest=!sh convert gifs/new.gif ../tmp/new.png >/dev/null\
30
   ls ../tmp/new.png 2>/dev/null\
31
   rm -f ../tmp/new.png >/dev/null
32
 !endif
33
!endif
34
 
35
!if $catname=software
36
 !reset othermiss
37
 !distribute items tool/number/baseconv,\
38
	H6/algebra/decrypt,\
39
	adm/doc,\
40
	H5/physics/chim1,\
9322 bpr 41
	H5/physics/travail,\
42
	into mod_bc,mod_fortune,mod_perl,mod_chemeq,mod_units,babel
10314 bpr 43
 otherlist=tex perl bc fortune chemeq units-filter ldapsearch tac
23 reyssat 44
 test=!sh for bin in $otherlist\
45
  do\
46
   which $$bin\
47
  done
48
 otherlist=!words2items $otherlist
49
 !for other in $otherlist
50
  !if /$other notin $test
51
   othermiss=!append item $other to $othermiss
52
  !endif
53
 !next other
10314 bpr 54
 !if perl notin in $othermiss
55
   !set pack_validation=WebService::Validator::HTML::W3C
56
   !sh perl -M$pack_validation -e 1
57
   !if $wims_exec_error!=$empty
58
     othermiss=!append item validation to $othermiss
59
     !reset wims_exec_error
60
   !endif
11951 bpr 61
   !set pack_perldate=Time::Piece
62
   !sh perl -M$pack_perldate -e 1
63
   !if $wims_exec_error!=$empty
64
     othermiss=!append item perldate to $othermiss
65
     !reset wims_exec_error
66
   !endif
10314 bpr 67
  !endif
68
!! test for non posix options for date and stat.
69
  test=!sh date -d '20 minutes' '+%s'
6624 bpr 70
  !if $wims_exec_error!=$empty
10314 bpr 71
     othermiss=!append item date to $othermiss
72
     !reset wims_exec_error
6624 bpr 73
  !endif
10314 bpr 74
  test=!sh stat -c'%s' .
75
  !if $wims_exec_error!=$empty
76
     othermiss=!append item stat to $othermiss
77
     !reset wims_exec_error
78
  !endif
6624 bpr 79
!endif
6762 bpr 80
 
81
!readdef wimshome/public_html/bases/sys/defaults.conf
82
 
6688 guerimand 83
!! test for QRencoder
84
testn=!defof QRencode_command in wimshome/log/wims.conf
6717 guerimand 85
!default testn=$DF_QRencode_command
6688 guerimand 86
testn=!word 1 of $testn
87
test=!sh which $testn
88
!if /$testn notin $test
6717 guerimand 89
 !setdef QRencode_open=no in wimshome/log/wims.conf
6688 guerimand 90
 othermiss=!append item QRencode to $othermiss
6717 guerimand 91
!else
92
 !setdef QRencode_open=yes in wimshome/log/wims.conf
6688 guerimand 93
!endif
94
!! ---------------- end test
23 reyssat 95
 
2497 bpr 96
confcnt=!recordcnt lang/confdata.$modu_lang
23 reyssat 97
!for i=1 to $confcnt
2497 bpr 98
  l=!record $i of lang/confdata.$modu_lang
23 reyssat 99
  n_=!word 2 of $l
100
  $n_=$(DF_$n_)
101
!next i
102
wims_prefix=
103
!readdef wimshome/log/wims.conf
104
wims_prefix=$wims_prefix2
105
 
106
!if $save!=$empty
107
 changed=0
108
 !writefile wimshome/log/wims.conf2 # This file is automatically generated by the online site maintenance tool.\
109
# You can still edit it by hand, but documentation is only available in the\
110
# online tool.\
111
#
112
 !for i=1 to $confcnt
2497 bpr 113
  l=!record $i of lang/confdata.$modu_lang
10325 bpr 114
  ltype=!line 3 of $l
115
  lbound=!line 4 of $l
23 reyssat 116
  l=!line 1 of $l
117
  !distribute words $l into c_,n_,w_
118
  v_=$($n_)
119
  !if $catname isitemof $c_
2827 bpr 120
   !!! check the download center
4504 bpr 121
   !if housekeep iswordof $catname and mu_download_site iswordof $n_
3031 guerimand 122
    !reset error_list
123
    !for depot in $(conf_$i)
124
     addr=!defof mu_site in wimshome/public_html/bases/sys/publishcenter/$depot
125
     webget_output=test_exists_site
126
     !exec webget $addr/index.gz
127
     download_site_exists=!record 0 of wimshome/sessions/$wims_session/$webget_output
128
     !if HTTP 404 isin $download_site_exists or $download_site_exists=$empty
129
       error_list=!append item $depot to $error_list
130
     !endif HTTP
131
    !next depot
132
    !if $error_list!=$empty
133
     error=no_download_sites
134
     !exit
135
    !endif
2827 bpr 136
   !endif housekeep
23 reyssat 137
   v_=$(conf_$i)
138
   v_=!trim $v_
139
   v_=!singlespace $v_
140
   v_=!replace internal \ by $ in $v_
10325 bpr 141
!! test if v_ is an integer if it should be and if it is non empty
142
   !if $ltype=int and $v_!=$empty
143
       v_=!text select 0123456789 in $v_
144
       !default v_=$(lbound[2])
145
   !endif
146
!!FIXME take in account the parameters in confdata.$lang in case the type is int
147
!! I comment because I am not sure it is a good idea for all fields
148
!! but why is it in the file confdata.xx if it is not used ??
149
   !!!if $ltype=int and $v_!=$empty and $(lbound)!=$empty
150
   !!  !bound v_ between integer $(lbound[1]) and $(lbound[2])
151
   !! !reset ltype lbound
152
   !!!endif
23 reyssat 153
   !if $v_!=$($n_)
154
    changed=1
155
    $n_=$v_
156
   !endif
157
   !if $n_=css and $v_=none
158
    v_=
2069 bpr 159
   !endif
1390 bpr 160
   !if $n_=theme_icon and $wims_theme iswordof column columnb default classic
161
    v_=default
2069 bpr 162
   !endif
23 reyssat 163
  !endif
164
  !if $v_!=$(DF_$n_)
165
   !appendfile wimshome/log/wims.conf2 $n_=$v_
166
  !endif
3064 bpr 167
  !if $w_ !=$empty and $w_ iswordof wims_bgcolor wims_bgimg wims_ref_bgcolor wims_css wims_theme wims_theme_icon wims_ref_menucolor \
168
    ref_button_help_bgcolor ref_button_help_color ref_button_bgcolor ref_button_color
23 reyssat 169
   $w_=$v_
170
  !endif
171
 !next i
172
 !if $changed>0
173
  backdir=!mexec scripts/confcopy.sh
174
 !endif
175
 !sh rm -f $wims_home/log/wims.conf2
176
 !restart cmd=reply
177
!endif
178