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