Subversion Repositories wimsdev

Rev

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


n=!recordcnt lang/cat.$modu_lang
!bound confcat between 1 and $n default 1
l=!record $confcat of lang/cat.$modu_lang
!distribute lines $l into catname, cattit
!if $catname=housekeep
 !readproc mu/publishdownload.def
!endif

!if $catname=appearances
  csslist=!sh cd html/css/$lang; ls *.css | sed 's/\.css$$//' | sort
  csslist=!words2items ---- -theme- $csslist
  themelist=!sh find themes -name visitor.phtml | sed 's!^themes/!!;s!/visitor.phtml$!!' | sort
  themelist=!words2items $themelist
  themelist=!listuniq default,$themelist
  iconlist=!sh cd gifs/themes/;ls -d */ | cut -f1 -d'/' | sort
  iconlist=!words2items $iconlist
  !for icon_theme in $iconlist
    !set icon_title=!defof title in wimshome/public_html/gifs/themes/$icon_theme/INDEX
    !set iconpromptlist=!append item $icon_title to $iconpromptlist
  !next
!endif

!if $catname=graphics
 chtest=!sh ls $wims_home/chroot/tmp/sessions/.chroot 2>/dev/null
 !if chroot isin $chtest
  cvtest=new.png
 !else
  cvtest=!sh convert gifs/new.gif ../tmp/new.png >/dev/null\
   ls ../tmp/new.png 2>/dev/null\
   rm -f ../tmp/new.png >/dev/null
 !endif
!endif

!if $catname=software
 !reset othermiss
 !distribute items tool/number/baseconv,\
        H6/algebra/decrypt,\
        adm/doc,\
        H5/physics/chim1,\
        H5/physics/travail,\
        into mod_bc,mod_fortune,mod_perl,mod_chemeq,mod_units,babel
 otherlist=tex perl bc fortune chemeq units-filter ldapsearch tac
 test=!sh for bin in $otherlist\
  do\
   which $$bin\
  done
 otherlist=!words2items $otherlist
 !for other in $otherlist
  !if /$other notin $test
   othermiss=!append item $other to $othermiss
  !endif
 !next other
 !if perl notin in $othermiss
   !set pack_validation=WebService::Validator::HTML::W3C
   !sh perl -M$pack_validation -e 1
   !if $wims_exec_error!=$empty
     othermiss=!append item validation to $othermiss
     !reset wims_exec_error
   !endif
   !set pack_perldate=Time::Piece
   !sh perl -M$pack_perldate -e 1
   !if $wims_exec_error!=$empty
     othermiss=!append item perldate to $othermiss
     !reset wims_exec_error
   !endif
  !endif
!! test for non posix options for date and stat.
  test=!sh date -d '20 minutes' '+%s'
  !if $wims_exec_error!=$empty
     othermiss=!append item date to $othermiss
     !reset wims_exec_error
  !endif
  test=!sh stat -c'%s' .
  !if $wims_exec_error!=$empty
     othermiss=!append item stat to $othermiss
     !reset wims_exec_error
  !endif
!endif

!readdef wimshome/public_html/bases/sys/defaults.conf

!! test for QRencoder
testn=!defof QRencode_command in wimshome/log/wims.conf
!default testn=$DF_QRencode_command
testn=!word 1 of $testn
test=!sh which $testn
!if /$testn notin $test
 !setdef QRencode_open=no in wimshome/log/wims.conf
 othermiss=!append item QRencode to $othermiss
!else
 !setdef QRencode_open=yes in wimshome/log/wims.conf
!endif
!! ---------------- end test

confcnt=!recordcnt lang/confdata.$modu_lang
!for i=1 to $confcnt
  l=!record $i of lang/confdata.$modu_lang
  n_=!word 2 of $l
  $n_=$(DF_$n_)
!next i
wims_prefix=
!readdef wimshome/log/wims.conf
wims_prefix=$wims_prefix2

!if $save!=$empty
 changed=0
 !writefile wimshome/log/wims.conf2 # This file is automatically generated by the online site maintenance tool.\
# You can still edit it by hand, but documentation is only available in the\
# online tool.\
#
 !for i=1 to $confcnt
  l=!record $i of lang/confdata.$modu_lang
  ltype=!line 3 of $l
  lbound=!line 4 of $l
  l=!line 1 of $l
  !distribute words $l into c_,n_,w_
  v_=$($n_)
  !if $catname isitemof $c_
   !!! check the download center
   !if housekeep iswordof $catname and mu_download_site iswordof $n_
    !reset error_list
    !for depot in $(conf_$i)
     addr=!defof mu_site in wimshome/public_html/bases/sys/publishcenter/$depot
     webget_output=test_exists_site
     !exec webget $addr/index.gz
     download_site_exists=!record 0 of wimshome/sessions/$wims_session/$webget_output
     !if HTTP 404 isin $download_site_exists or $download_site_exists=$empty
       error_list=!append item $depot to $error_list
     !endif HTTP
    !next depot
    !if $error_list!=$empty
     error=no_download_sites
     !exit
    !endif
   !endif housekeep
   v_=$(conf_$i)
   v_=!trim $v_
   v_=!singlespace $v_
   v_=!replace internal \ by $ in $v_
!! test if v_ is an integer if it should be and if it is non empty
   !if $ltype=int and $v_!=$empty
       v_=!text select 0123456789 in $v_
       !default v_=$(lbound[2])
   !endif
!!FIXME take in account the parameters in confdata.$lang in case the type is int
!! I comment because I am not sure it is a good idea for all fields
!! but why is it in the file confdata.xx if it is not used ??
   !!!if $ltype=int and $v_!=$empty and $(lbound)!=$empty
   !!  !bound v_ between integer $(lbound[1]) and $(lbound[2])
   !! !reset ltype lbound
   !!!endif
   !if $v_!=$($n_)
    changed=1
    $n_=$v_
   !endif
   !if $n_=css and $v_=none
    v_=
   !endif
   !if $n_=theme_icon and $wims_theme iswordof column columnb default classic
    v_=default
   !endif
  !endif
  !if $v_!=$(DF_$n_)
   !appendfile wimshome/log/wims.conf2 $n_=$v_
  !endif
  !if $w_ !=$empty and $w_ iswordof wims_bgcolor wims_bgimg wims_ref_bgcolor wims_css wims_theme wims_theme_icon wims_ref_menucolor \
    ref_button_help_bgcolor ref_button_help_color ref_button_bgcolor ref_button_color
   $w_=$v_
  !endif
 !next i
 !if $changed>0
  backdir=!mexec scripts/confcopy.sh
 !endif
 !sh rm -f $wims_home/log/wims.conf2
 !restart cmd=reply
!endif