Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
14777 guerimand 1
# Variable calculations should be done in this file.
2
# It is read and interpreted by wims for all valid calls to the module.
3
 
4
!if $notallowed=1
5
  error=notallowedmodule
6
  !exit
7
!endif
8
 
9
!! check access
10
!if $statuttchat!=open
11
  !restart module=home
12
!endif
13
 
14903 guerimand 14
wims_prefix=class user tchat
14777 guerimand 15
!read adm/language lang/names.phtml
16
!read tabletheme
17
 
14905 guerimand 18
!if $tchat_open!=yes
19
  !if $wims_user!=supervisor
20
    warning=notopen
21
    job=close
22
  !else
23
    job=config
24
  !endif
25
!endif
26
 
14861 guerimand 27
!! create list of living for the user (all for supervisor)
28
 
29
!reset livinglist livingfile
30
dt=!record 0 of wimshome/log/classes/$wims_class/tchat/.livings
31
livingst_0=!line 1 of $dt
32
!if $(livingst_0)=1
33
  livinglist=0
14783 guerimand 34
!endif
15132 guerimand 35
livingname_0=!line 2 of $dt
36
!default livingname_0=!nosubst $wims_name_class
14861 guerimand 37
livingusers_0=all
38
livingnb_0=$[$nbuser+1]
39
nbliving=!recordcnt wimshome/log/classes/$wims_class/tchat/.livings
40
!for k=1 to $nbliving
41
  dt=!record $k of wimshome/log/classes/$wims_class/tchat/.livings
42
  !distribute line $dt into livingst_$k,livingname_$k,livingusers_$k
43
  !default livingname_$k=$name_living $k
44
  livingusers_$k=!append item supervisor to $(livingusers_$k)
45
  livingnb_$k=!itemcnt $(livingusers_$k)
46
  !if $(livingst_$k)=1 and $wims_user isitemof $(livingusers_$k)
47
    livinglist=!append item $k to $livinglist
48
  !endif
49
!next k
50
livingfile=!makelist .living k for k in $livinglist
51
livingfile=!nospace $livingfile
14783 guerimand 52
 
14777 guerimand 53
!! ------ use math in message
54
!let insmath_rawmath=yes
55
!let wims_backslash_insmath=yes
56
 
57
!if $cmd=help
58
  !exit
59
!endif
60
 
61
!if $class_expiration=$empty
62
  !defread wimshome/log/classes/$wims_class/.def
63
  !if $wims_superclass!=$empty
64
    class_expiration=!defof class_expiration in wimshome/log/classes/$wims_superclass/.def
65
  !endif
66
!endif
67
 
68
!if $class_expiration=$empty
69
  error=bad_class
70
  !exit
71
!endif
72
 
16069 guerimand 73
!readproc linkmodule/tchat.proc
15284 guerimand 74
!if $wims_allowlink_tchat!=yes
14777 guerimand 75
  error=badright
76
  notallowed=1
77
  !exit
78
!endif
79
 
80
!if $wims_user=supervisor
81
  !readproc adm/whoconnect
15072 bpr 82
  listjob=userlistliving,edit,viewpage,listliving,addliving,config,showhide
14777 guerimand 83
  defjob=userlist
84
!else
15636 guerimand 85
  listjob=edit,close,sharescreen,uploadfile
14777 guerimand 86
  defjob=edit
87
!endif
88
!bound job within $listjob default $defjob
89
 
15117 guerimand 90
!if $job=sharescreen
91
  !if $wims_sharescreen=yes
92
    wims_sharescreen=$empty
93
  !else
94
    wims_sharescreen=yes
95
  !endif
96
  ses=!replace internal _ by , in $wims_session
97
  ses=!item 1 of $ses
98
  !setdef wims_sharescreen=$wims_sharescreen in wimshome/sessions/$ses/var.stat
99
  job=edit
100
!endif
101
 
15068 guerimand 102
!if $wims_user!=supervisor
103
  !set page_name=*
104
!else
15072 bpr 105
  !if $job isitemof listliving,addliving,userlistliving
15068 guerimand 106
    !set page_name=$(wims_name_$(job))
107
  !else
108
    !default page_name=$(name_$(job))
109
    !if $job isitemof config
110
      !set page_name=$name_configuration
111
    !endif
112
  !endif
15072 bpr 113
  !default page_name=$wims_name_userlistliving
15068 guerimand 114
!endif
115
 
15078 guerimand 116
!if $wims_user=supervisor
117
!! ariane only for supervisor.
118
  !set wims_ariane=!append line tchat,1,module=adm/class/tchat to $wims_ariane
119
  !set wims_ariane=!append line "$page_name",8, to $wims_ariane
120
  !set wims_ariane_self=no
121
!endif
15068 guerimand 122
 
14777 guerimand 123
!read lang.phtml.$lang
124
!changeto $job.proc