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