Rev 10573 | Rev 10768 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
23 | reyssat | 1 | !if robot isin $session or _ isin $session |
2 | !exit |
||
3 | !endif |
||
2368 | bpr | 4 | !read adm/class/classlang names.phtml |
5013 | bpr | 5 | |
5411 | bpr | 6 | listlim=100 |
23 | reyssat | 7 | wims_prefix=class user tmp |
8 | wims_module_log=$type $keyword |
||
9 | wims_helper=chapter=3 |
||
10 | wims_form_method=post |
||
11 | wims_ref_otherlangs=yes |
||
12 | !default class_bgcolor=$wims_bgcolor |
||
13 | !default class_bgimg=$wims_bgimg |
||
14 | !default class_css=$wims_css |
||
1170 | bpr | 15 | |
5013 | bpr | 16 | !if $class!=$empty |
5105 | bpr | 17 | ## output auth_method_list, aut_idp_method_list, auth_method, aut_idp_method |
18 | !read adm/class/initclass $class,auth |
||
23 | reyssat | 19 | !endif |
5020 | bpr | 20 | !!useful ! if $class=$empty |
21 | superclass=!text remove . in $superclass |
||
22 | !if $wims_superclass!=$empty |
||
23 | superclass=$wims_superclass |
||
24 | !endif |
||
5013 | bpr | 25 | |
23 | reyssat | 26 | !default superclass2=$superclass |
27 | !read tabletheme |
||
5408 | guerimand | 28 | !if $auth_method=$empty and $class!=$empty |
29 | !bound type within supervisor,participant,example,\ |
||
9506 | bpr | 30 | authsupervisor,authparticipant,forgetpwd default example |
5408 | guerimand | 31 | !else |
32 | !bound type within supervisor,participant,example,\ |
||
9506 | bpr | 33 | authsupervisor,authparticipant default example |
5408 | guerimand | 34 | !endif |
23 | reyssat | 35 | !if $type=example |
36 | superclass= |
||
37 | !endif |
||
4993 | bpr | 38 | |
5350 | guerimand | 39 | !if $type=forgetpwd |
40 | !changeto forgetpwd.proc |
||
41 | !endif |
||
42 | |||
23 | reyssat | 43 | !if $superclass=$empty |
44 | indf=wimshome/log/classes/.index |
||
45 | limited=yes |
||
46 | !else |
||
47 | indf=wimshome/log/classes/$superclass/.subclasses |
||
48 | keyword= |
||
49 | !endif |
||
50 | keyword=!items2words $keyword |
||
51 | keyword=!trim $keyword |
||
52 | kw=!words2items $keyword |
||
53 | kw=!deaccent $kw |
||
54 | kw=!tolower $kw |
||
55 | ccnt=!recordcnt $indf |
||
56 | !if $wims_class!=$empty |
||
57 | !read var.direct |
||
58 | !if $error!=$empty |
||
59 | !exit |
||
60 | !endif |
||
61 | !endif |
||
62 | |||
63 | clcnt=0 |
||
64 | encnt=0 |
||
65 | lacnt=0 |
||
4348 | bpr | 66 | excnt=0 |
4256 | bpr | 67 | listla= |
23 | reyssat | 68 | !if $type=example |
69 | !for i=1 to $ccnt |
||
70 | l=!record $i of $indf |
||
71 | c=!item 1 of $l |
||
72 | !if NaN notin $[$c] and $c<10000 |
||
73 | ltest=!defof class_lang in wimshome/log/classes/$c/.def |
||
4348 | bpr | 74 | !advance excnt |
9311 | bpr | 75 | !if $module_language iswordof $ltest |
23 | reyssat | 76 | laclasses=!append line $l to $laclasses |
77 | !advance lacnt |
||
78 | !else |
||
4256 | bpr | 79 | listla=!append item $ltest to $listla |
23 | reyssat | 80 | !if $ltest=en |
81 | enclasses=!append line $l to $enclasses |
||
82 | !advance encnt |
||
83 | !endif |
||
84 | !endif |
||
85 | !endif |
||
86 | !next i |
||
87 | !if $lacnt>0 |
||
88 | clcnt=$lacnt |
||
89 | classes=$laclasses |
||
90 | !else |
||
91 | clcnt=$encnt |
||
92 | classes=$enclasses |
||
93 | !endif |
||
4256 | bpr | 94 | listla=!listuniq $listla |
6043 | bpr | 95 | listla=!replace internal , by </span>, <span class="tt"> in <span class="tt">$listla</span> |
4348 | bpr | 96 | othercnt=$[$excnt-$lacnt] |
23 | reyssat | 97 | !endif |
98 | |||
99 | !if $type iswordof supervisor participant |
||
100 | sccnt=0 |
||
101 | !if $wims_class!=$empty |
||
102 | !defread wimshome/log/classes/$wims_class/.def |
||
10593 | bpr | 103 | !set wims_ariane=!append line n_$type,8, to $wims_ariane |
23 | reyssat | 104 | !default class_type=0 |
10593 | bpr | 105 | !if $class_type=4 |
106 | !set wims_ariane_home=no |
||
107 | !endif |
||
108 | !set wims_ariane_self=no |
||
23 | reyssat | 109 | !if $class_type>=2 |
110 | !read adm/class/userdef classes,$wims_class,$wims_user |
||
111 | supervisable=!defof user_supervisable in $userdef |
||
112 | super_type=!defof class_type in wimshome/log/classes/$wims_superclass/.def |
||
113 | !ifval $super_type=4 |
||
114 | stype=$[$super_type] |
||
115 | sp=!translate internal / to , in $superclass2 |
||
116 | splevel=!itemcnt $sp |
||
117 | sparent=!item 1 to -2 of $sp |
||
118 | sparent=!translate internal , to / in $sparent |
||
119 | sparent=!nospace $sparent |
||
120 | !if $splevel=1 |
||
121 | classes1=!record 0 of wimshome/log/classes/$superclass2/levels |
||
122 | !endif |
||
123 | !if $splevel=2 |
||
124 | classes1=!record 0 of wimshome/log/classes/$superclass2/classes |
||
125 | classes2=!record 0 of wimshome/log/classes/$superclass2/programs |
||
411 | bpr | 126 | !!classes1=!append line $classes2 to $classes1 |
23 | reyssat | 127 | !endif |
128 | !if $splevel=3 |
||
129 | classes1=!record 0 of wimshome/log/classes/$superclass2/courses |
||
130 | !endif |
||
131 | clcnt=!linecnt $classes1 |
||
411 | bpr | 132 | clcnt_pr=!linecnt $classes2 |
23 | reyssat | 133 | classes= |
411 | bpr | 134 | classes_pr= |
23 | reyssat | 135 | !for i=1 to $clcnt |
136 | l=!line $i of $classes1 |
||
137 | !distribute items $l into code,Sup,name,sup |
||
138 | classes=!append line $wims_superclass/$code,,,$name to $classes |
||
139 | !next i |
||
411 | bpr | 140 | !for i=1 to $clcnt_pr |
141 | l=!line $i of $classes2 |
||
142 | !distribute items $l into code,Sup,name,sup |
||
143 | classes_pr=!append line $wims_superclass/$code,,,$name to $classes_pr |
||
144 | !next i |
||
23 | reyssat | 145 | !exit |
146 | !endif |
||
147 | !endif |
||
148 | !endif |
||
149 | !for i=1 to $ccnt |
||
150 | l=!record $i of $indf |
||
151 | !distribute items $l into code,expire,inst,cl,la,ty |
||
152 | l1=!deaccent $l |
||
153 | l1=!tolower $l1 |
||
154 | c1=!text extract 0123456789 in $code |
||
155 | k=yes |
||
156 | !for w in $kw |
||
157 | !if $w notin $l1 |
||
158 | k=no |
||
159 | !break |
||
160 | !endif |
||
161 | !next w |
||
4567 | bpr | 162 | !!delete condition on language in a superclass |
163 | !if (/ isin $code or $c1>9999) and ($la=$module_language or $class_type!=) and\ |
||
23 | reyssat | 164 | ($code!=$wims_class or ($wims_user!=supervisor and $type=supervisor)) and \ |
165 | $k = yes |
||
166 | !if $ty isin 24 |
||
167 | sclasses=!append line $l to $sclasses |
||
168 | !advance sccnt |
||
169 | !else |
||
170 | classes=!append line $l to $classes |
||
171 | !advance clcnt |
||
172 | !endif |
||
173 | !endif |
||
174 | !if $limited = yes and $clcnt+$sccnt > $listlim |
||
175 | overflow=yes |
||
176 | !break |
||
177 | !endif |
||
178 | !next i |
||
179 | !if $wims_user!=$empty and $wims_supertype iswordof 2 4 |
||
180 | sccnt=0 |
||
181 | !endif |
||
182 | !endif |
||
183 | |||
4152 | bpr | 184 | !if $type iswordof authparticipant authsupervisor |
185 | !reset class_defined |
||
186 | class=!text remove . in $class |
||
187 | !defread wimshome/log/classes/$class/.def |
||
188 | !!#### la seconde condition pour entrer dans la classe en tant que supervisor : |
||
189 | !!#### le user est supervisor de cette classe, ou wims_realuser est supervisor ou vide (cas de l'administrateur) ou la classe est la classe test |
||
4993 | bpr | 190 | |
4152 | bpr | 191 | !if $type=authsupervisor and ($class isitemof $wims_supervise or $wims_realuser=$empty or $wims_realuser=supervisor or /0/ isin $class/) |
192 | !default auth_user=supervisor |
||
23 | reyssat | 193 | !endif |
5100 | bpr | 194 | |
4424 | bpr | 195 | !if $save_logincgu!=$empty |
5100 | bpr | 196 | auth_user=$save_logincgu |
4424 | bpr | 197 | !endif |
4993 | bpr | 198 | |
5013 | bpr | 199 | superclass=!defof class_superclass in wimshome/log/classes/$class/.def |
200 | !default superclass=$class |
||
4993 | bpr | 201 | |
5026 | bpr | 202 | !if $class_defined=yes and ($auth_user!=$empty or $auth_method isitemof $auth_method_list) |
4993 | bpr | 203 | !changeto var.auth |
23 | reyssat | 204 | !endif |
205 | !endif |