Subversion Repositories wimsdev

Rev

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

!if $wims_class!=
  !read adm/class/classlang names.phtml
  !set modu_lang=$moduclass_lang
!else
  !read adm/language lang/names.phtml
!endif
!read defs

wims_trustfile=primitives/embed.phtml primitives/fold.phtml \
   primitives/link.phtml primitives/href.phtml primitives/target.phtml \
   printlink.proc primitives.phtml \
   oef/togetfile.proc

wims_nw=job jobsave editable readable doctype doc block docdir Docdir \
   foldlist filelink sheetdata empty
wims_nr=wims_sesrandom

!read docu/docdef

!if $cmd=help and $special_parm!=about
 job=read
 doc=$helpd
 block=main
!endif
!if $seq!=
 !set wims_sequence=$seq
!endif

!bound job within home,auth,auth2,read,print,edit,prop,source,creat,recode,list,\
   erase,openclose,help,file,exosource,transfer default home
readjobs=read source list print exosource
editjobs=edit prop erase openclose file
!if robot isin $session
 job=home
!endif
!read tabletheme
!if $job=help
 !exit
!endif

!for i=1 to 20
 m_parm$i=$(parm$i)
 parm$i=
!next i

msg2wims_primitives=if ifval for while\
   reload fold ref link docform form resource calcform embed\
   exercise tool doc example help adm tooltip href slib\
   def define comment draw canvasdraw audio
doc=!text select $namechars in $doc
block=!text select $namechars in $block
Docdir=public_html/bases/doc
doctype=doc
!if c isin $doc and $wims_class!=$empty
 Docdir=log/classes/$wims_class/doc
 doctype=class
 !if $wims_user=supervisor
  editable=yes
  readable=yes
 !else
  editable=no
  readable=yes
 !endif
 !if $wims_developer!=$empty
  transferable=yes
 !endif
 !if $job=source and $wims_user!=supervisor
  job=read
 !endif
 m_user_login=$wims_user
 m_user_lastname=$wims_lastname
 m_user_firstname=$wims_firstname
 m_class_code=$wims_class
!else
 editable=no
 readable=yes
!endif
!if $wims_developer!=$empty and $devdoc!=$empty and c notin $doc
 devdoc=!text select $namechars.-~ in $devdoc
 test=!defof tit in wimshome/public_html/modules/devel/$wims_developer/$devdoc/doc/$doc/.def
 !if $test!=$empty
  Docdir=public_html/modules/devel/$wims_developer/$devdoc/doc
  doctype=devel
  editable=yes
  readable=yes
  docopen=yes
 !endif
!endif
docdir=wimshome/$Docdir
wims_priv_docdir=$docdir
openlist=!record 0 of $docdir/open.dist
opensite=!record 0 of $docdir/open.site
openlist=!items2words $openlist $opensite
!if robot notin $session
 edlist  =!record 0 of wimshome/$wims_sesdir/doc.$module_language.editable
!endif
!default readcnt=0
!if $job=creat
 !reset doc,tit,desc,author,email,header
!endif
doc=!trim $doc
wims_priv_thisdoc=$docdir/$doc
!if $doc!=$empty
  !readdef $docdir/.def
  docdir1= !replace internal /doc by in $(docdir)
  docadm=1
  !read $docdir1/var.proc
  !reset docadm
### common_files can be yes now or the address of a datamodule
  !if datamodule isin $common_files
    m_filedir=!replace datamodule by modules/data in $common_files
  !else
    m_filedir=$wims_ref_name?session=$wims_session&+cmd=getfile&+special_parm=doc
  !endif
 #####what is filelink : create a link to doc in the session
 !if ($filelink!=$Docdir/$doc and $common_files!=yes) or ($filelink!=$Docdir and $common_files=yes)
  !if $common_files!=yes
    filelink=$Docdir/$doc
  !else
    filelink=$Docdir
  !endif
  !sh if [ -d $wims_home/$filelink/files ]; then\
   cd $wims_home/$wims_sesdir\
   mkdir -p getfile\
   cd getfile\
   rm -f doc\
   ln -s $wims_home/$filelink/files doc\
  fi
 !endif
 !readdef $docdir/$doc/.def
 !default docopen=no
 !if $tit!=$empty
  !default block=main
  block=!text select $namechars in $block
  block=!char 1 to $namelim of $block
  !read $docdir/$doc/$block.def
  !if $noedit!=yes and $doctype!=class and \
    ($doc iswordof $edlist or $wims_ismanager=2)
   editable=yes
  !endif
  !if $doctype=class and $wims_user!=supervisor
   !ifval $docopen=0
    readable=no
   !endif
   !ifval $docopen=2
    editable=yes
   !endif
  !endif
  !if $doctype notwordof class devel and \
    ($docopen!=yes or $doc notwordof $openlist) and \
    $doc notwordof $edlist and $wims_ismanager<2
   readable=no
  !endif
 !else
  error=doc_not_exist
  !reset doc
 !endif
!endif
!if $job!=home
 !if $doctype=class
  !set wims_module_log=$job $wims_class/$doc $block
 !else
  !if $doctype=devel
   !set wims_module_log=$job $devdoc@$wims_developer $block
  !else
   !set wims_module_log=$job $doc $block
  !endif
 !endif
!endif

!if $doc=$empty and $job notwordof home creat
 job=home
!endif

!if $job=erase and $wims_ismanager!=2 and $editable!=yes
 job=home
!endif

!if $job=openclose and \
  ($wims_ismanager!=2 or $doctype iswordof class devel)
 job=home
!endif

!if $doctype=class and auth isin $job
 job=home
!endif

!if $doctype=class and \
   (($job iswordof $readjobs and $readable!=yes) or \
   ($job iswordof $editjobs and $editable!=yes))
 job=home
 error=unauthorized
!endif

!if $job=home and $doctype=devel
 job=read
 block=main
!endif

!if $doctype notwordof class devel
 !if $job iswordof $readjobs and $readable!=yes
  job=auth1
  readauth=yes
 !endif

 !if $job=auth
  !if $editable=yes
   job=read
  !else
   job=auth1
  !endif
 !endif

 !if $editable!=yes and $job iswordof $editjobs
  job=auth1
 !endif
!endif

!if $doc!=$empty and $job=edit
 !if $doctype!=devel
  !read quota.proc
  !if $quota_free<0
   error=quota
   job=read
   !changeto read.proc
  !endif
 !endif
 !if $rEg!=$empty
  job=reg
 !endif
 !if $preview!=$empty
  job=preview
 !endif
 !if $abandon!=$empty
  job=read
 !endif
!endif

!if $doc!=$empty and $job=prop
 !if $abandon!=$empty
  job=read
  block=main
  !read $docdir/$doc/main.def
 !endif
!endif

!read $job.proc