Subversion Repositories wimsdev

Rev

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
13111 bpr 7
  !readproc mu/publishdownload.def
3030 guerimand 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
13111 bpr 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
23 reyssat 33
!endif
34
 
35
!if $catname=software
13111 bpr 36
  !reset othermiss
37
  !distribute items tool/number/baseconv,\
38
	 H6/algebra/decrypt,\
39
	 adm/doc,\
40
	 H5/physics/chim1,\
41
	 H5/physics/travail,\
42
	 into mod_bc,mod_fortune,mod_perl,mod_chemeq,mod_units,babel
43
  otherlist=tex perl bc fortune chemeq units-filter ldapsearch tac
44
  test=!sh for bin in $otherlist\
45
   do\
23 reyssat 46
   which $$bin\
47
  done
13111 bpr 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
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
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
23 reyssat 67
  !endif
13111 bpr 68
  !! test for non posix options for date and stat.
10314 bpr 69
  test=!sh date -d '20 minutes' '+%s'
6624 bpr 70
  !if $wims_exec_error!=$empty
13111 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
13111 bpr 76
    othermiss=!append item stat to $othermiss
77
    !reset wims_exec_error
10314 bpr 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
13111 bpr 89
  !setdef QRencode_open=no in wimshome/log/wims.conf
90
  othermiss=!append item QRencode to $othermiss
6717 guerimand 91
!else
13111 bpr 92
  !setdef QRencode_open=yes in wimshome/log/wims.conf
6688 guerimand 93
!endif
94
!! ---------------- end test
13111 bpr 95
backup_delete=!defof backup_delete in wimshome/public_html/bases/sys/define.conf
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
13111 bpr 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
113
    l=!record $i of lang/confdata.$modu_lang
114
    ltype=!line 3 of $l
115
    lbound=!line 4 of $l
116
    l=!line 1 of $l
117
    !distribute words $l into c_,n_,w_
118
    v_=$($n_)
119
    !if $catname isitemof $c_
120
      !!! check the download center
121
      !if housekeep iswordof $catname and mu_download_site iswordof $n_
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
          !! the following tests if there is an html answer or if the file is empty
129
          !! but the first test is no more valid (the answer has changed)
130
          !! and the second one gives an error for some zipped file
131
          !! does not seem very useful
132
          !!!if HTTP 404 isin $download_site_exists or $download_site_exists=$empty
133
          !!   error_list=!append item $depot to $error_list
134
          !!!endif HTTP
135
        !next depot
136
        !if $error_list!=$empty
137
          error=no_download_sites
138
          !exit
139
        !endif
140
      !endif housekeep
141
      v_=$(conf_$i)
142
      v_=!trim $v_
143
      v_=!singlespace $v_
144
      v_=!replace internal \ by $ in $v_
145
      !! test if v_ is an integer if it should be and if it is non empty
146
      !if $ltype=int and $v_!=$empty
147
        v_=!text select 0123456789 in $v_
148
      !default v_=$(lbound[2])
3031 guerimand 149
    !endif
13111 bpr 150
    !!FIXME take in account the parameters in confdata.$lang in case the type is int
151
    !! I comment because I am not sure it is a good idea for all fields
152
    !! but why is it in the file confdata.xx if it is not used ??
153
    !!!if $ltype=int and $v_!=$empty and $(lbound)!=$empty
154
    !!  !bound v_ between integer $(lbound[1]) and $(lbound[2])
155
    !! !reset ltype lbound
156
    !!!endif
157
    !if $v_!=$($n_)
158
      changed=1
159
      $n_=$v_
160
    !endif
161
    !if $n_=css and $v_=none
162
      v_=
163
    !endif
164
    !if $n_=theme_icon and $wims_theme iswordof column columnb default classic
165
      v_=default
166
    !endif
23 reyssat 167
  !endif
168
  !if $v_!=$(DF_$n_)
13111 bpr 169
    !appendfile wimshome/log/wims.conf2 $n_=$v_
23 reyssat 170
  !endif
3064 bpr 171
  !if $w_ !=$empty and $w_ iswordof wims_bgcolor wims_bgimg wims_ref_bgcolor wims_css wims_theme wims_theme_icon wims_ref_menucolor \
13111 bpr 172
      ref_button_help_bgcolor ref_button_help_color ref_button_bgcolor ref_button_color
173
    $w_=$v_
23 reyssat 174
  !endif
13111 bpr 175
!next i
176
!if $changed>0
23 reyssat 177
  backdir=!mexec scripts/confcopy.sh
13111 bpr 178
!endif
23 reyssat 179
 !sh rm -f $wims_home/log/wims.conf2
180
 !restart cmd=reply
181
!endif