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