Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
1193 bpr 1
!!##preparation of the "bottom menu"
16 reyssat 2
 
8597 obado 3
!if _check isin $session or $wims_mode=popup
15729 reyssat 4
  !read themes.phtml tail
13743 bpr 5
  !exit
16 reyssat 6
!endif
7
 
8
!if _test isin $session and $wims_hacked_variables!=$empty
11268 obado 9
  <p><span class="wims_warning">WIMS WARNING</span>. The following variables of your module could be hacked
10
    by students using manually modified http addresses! You might want to put more
11
    strict permissions to them in var.def, in order to build a secure exercise module.
12
  </p>
13
  <pre>$wims_hacked_variables</pre>
16 reyssat 14
!endif
15
 
2373 bpr 16
!read name.phtml.$lang
9309 bpr 17
!read themes/$wims_theme/name.phtml.$lang
16 reyssat 18
!default wims_homeref_bgcolor=$wims_ref_bgcolor
4635 bpr 19
!read themes/$wims_theme/local.phtml
10057 bpr 20
 
16 reyssat 21
!if exam isin $wims_session
11268 obado 22
  !read examclock.proc
23
  !goto rmend
16 reyssat 24
!endif
25
 
1193 bpr 26
!if $wims_rm_1=no
13743 bpr 27
  !reset wims_rm_1
28
  !goto local
1193 bpr 29
!endif
16 reyssat 30
!if $wims_rm_1!=$empty
13743 bpr 31
  !goto rm2
16 reyssat 32
!endif
33
!reset 1_
4346 bpr 34
 
35
!!********* Link #1 : "Close Window" or "Home" (Not Shown if Embedded)
16 reyssat 36
!if _ isin $wims_subsession
13743 bpr 37
  !!set 1_=!append line back2,3,window.close() to $1_
16 reyssat 38
!else
13743 bpr 39
  !!set 1_=!append line class_home,1,session=$wims_session.1 to $1_
16 reyssat 40
!endif
2865 guerimand 41
 
4346 bpr 42
!!********* Link #2 : "Sheet"
2865 guerimand 43
!if $wims_sheet>0 or P isin $wims_sheet
13743 bpr 44
  !if $wims_sheet>0
45
    !set tmp_=sheetmanagement,1,module=adm/class/sheet&sheet=$wims_sheet
46
  !else
47
    !set tmp_=sheet,1,module=adm/sheet&sh=$wims_sheet&
48
  !endif
49
  !if yes notin $wims_lightpopup
8597 obado 50
    !set 1_=!append line $tmp_ to $1_
13743 bpr 51
  !endif
52
  !let wims_menu_items=!append line $tmp_ to $wims_menu_items
15767 guerimand 53
  !let p=!positionof item $wims_exo in $wims_listexo
54
  !if $wims_exo!=$(wims_listexo[1])
55
    !let wims_menu_items=!append line previousseries,1,module=home&directworksheet=$wims_sheet.$(wims_listexo[$p-1]) to $wims_menu_items
13743 bpr 56
  !endif
15767 guerimand 57
  !if $wims_exo!=$(wims_listexo[-1])
58
    !let wims_menu_items=!append line nextseries,1,module=home&directworksheet=$wims_sheet.$(wims_listexo[$p+1]) to $wims_menu_items
13743 bpr 59
  !endif
678 guerimand 60
!endif
4635 bpr 61
 
4528 bpr 62
!if $wims_sheet>0 or P isin $wims_sheet
13743 bpr 63
  !if $(wims_exofeedback[$wims_exo;])!=$empty
14646 bpr 64
    !if $module_score!=$empty
65
      !set feedexotot=!declosing $(wims_exofeedback[$wims_exo;])
66
      !set feedexocnt=!itemcnt $(feedexotot[;1])
67
      !for t=1 to $feedexocnt
68
        !set feedexo=$(feedexotot[$t;])
69
        !if $module_score < $(feedexo[2]) and $module_score >= $(feedexo[3])
70
          !if $module_score < 10
71
            !set 5_=!append line feedbackexo,7,$(feedexo[1]),mfeed to $5_
72
          !else
73
            !set 5_=!append line feedbackplus,7,$(feedexo[1]),mfeed to $5_
74
          !endif
75
        !endif
76
      !next
6298 bpr 77
    !endif
4528 bpr 78
  !endif
79
!endif
2865 guerimand 80
 
4346 bpr 81
!!********* Link #3 : "Resume"
16 reyssat 82
!if $cmd=help or $cmd=hint
13743 bpr 83
  !set 1_=!append line resume,1,cmd=resume to $1_
16 reyssat 84
!endif
4346 bpr 85
 
86
!!********* Link #4 : "Introduction" (Not Shown if Embedded)
16 reyssat 87
!if $module_has_intro=yes and $cmd notwordof intro help and\
88
        $wims_sheet=$empty and exam notin $wims_session
13743 bpr 89
  !!set 1_=!append line intro,1,module=$module&cmd=intro&special_parm=$special_parm&special_parm2=$special_parm2&special_parm3=$special_parm3&special_parm4=$special_parm4 to $1_
16 reyssat 90
!endif
4346 bpr 91
 
92
!!********* Link #5 : "Help"
16 reyssat 93
!if $module_has_help=yes and $cmd notwordof intro help
13743 bpr 94
  !if $module_help=$empty or $module_help=popup
95
   !!set 1_=!append line help,4,module=$module&cmd=help&special_parm=$wims_help_parm,mhelp to $1_
96
  !else
97
   !!set 1_=!append line help,1,module=$module&cmd=help&special_parm=$wims_help_parm to $1_
98
  !endif
16 reyssat 99
!endif
4346 bpr 100
 
101
!!********* Link #6 : "About"
16 reyssat 102
!if $module_has_about=yes and $cmd notwordof help intro
9800 bpr 103
  !!set 1_=!append line about,4,module=$module&cmd=help&special_parm=about,mhelp to $1_
16 reyssat 104
!endif
9800 bpr 105
 
1193 bpr 106
!if print isin $job,$job2 or $print!=
107
  !set 1_=!append line print,3,window.print() to $1_
108
!endif
1202 bpr 109
!set wims_rm_1=$1_
8597 obado 110
 
1202 bpr 111
:local
112
!reset 1_
10057 bpr 113
!if $wims_sheet!=$empty or _exam isin $wims_session
114
  !set 1_=!append line itemsep,0,\
115
  tools,4,module=home,tool\
116
  to $1_
117
!endif
118
 
1193 bpr 119
!if $wims_developer!=$empty and COPYING isin $module_copyright and ../classes/ notin ../$module
12836 bpr 120
  !set V_=!char 1 of $module
121
  !set M_=!translate internal / to , in $module
122
  !set M_=!item 1 of $M_
123
  !if $V_ isin ABCDEFGHIJKLMNOPQRTSUVWXYZ or $M_ iswordof local contrib tool
124
    !set 1_=!append line modify,1,module=adm/modtool&original=$module to $1_
125
  !endif
1193 bpr 126
!endif
12836 bpr 127
!if $wims_user=supervisor and $module=adm/class/glossary
128
  !set 1_=!append line newglose,1,module=adm/tool/glossary&gl=0 to $1_
129
!endif
130
!if $wims_user=supervisor and ((_adm/doc notin _$module and adddoc notin $module \
13743 bpr 131
    and (document iswordof $module_category or tool iswordof $module_category))\
132
    or _c isin _$doc)
12370 bpr 133
  !if document iswordof $module_category or _c isin _$doc
14192 bpr 134
    !set wims_homeref_parm=doc=$doc&block=$block&job=read
135
    !set wims_homeref_parm=!replace internal & by %26 in $wims_homeref_parm
2080 bpr 136
  !endif
12569 bpr 137
  !if adm/tool/glossary isin $module
12595 bpr 138
    !if $gl=0
139
      !if $special_parm!=$empty
140
        !set wims_homeref_parm=!getopt gloss_item in $module_init_parm
141
        !set 1_=!append line addglossary,1,module=adm/class/glossary&job=add&iniparm=$wims_homeref_parm to $1_
142
      !endif
143
    !else
144
      !set wims_homeref_parm=gl=$gl
12836 bpr 145
      !set 1_=!append line newglose,1,module=adm/tool/glossary&gl=0 to $1_
12569 bpr 146
    !endif
147
  !else
148
    !if _c notin _$doc
14733 bpr 149
      !default wims_homeref_parm=$module_init_parm
12569 bpr 150
      !set 1_=!append line adddoc,1,module=adm/class/adddoc&job=add&dir=$module&iniparm=$wims_homeref_parm to $1_
151
    !endif
12370 bpr 152
  !endif
12595 bpr 153
  !if ($gl>0 and $cmd!=reply) or adm/tool/glossary notin $module
154
    !set 1_=!append line addh,1,module=adm/class/addmodule&job=helpexo&dir=$module&iniparm=$wims_homeref_parm to $1_
155
  !endif
2080 bpr 156
!endif
10321 bpr 157
!if $wims_user=supervisor and $module=adm/doc
158
  !set 1_=!append line doch_docs,1,module=adm/doc&job=home to $1_
159
!endif
1980 guerimand 160
!if $special_parm4=$empty
16468 guerimand 161
  !let tmptest=print=yes
12515 bpr 162
  !if $cmd!=intro and $cmd!=help and $module!=home and \
13762 bpr 163
    ../adm/ notin ../$module and \
164
      (../devel/ notin ../$module or $wims_devel_modules iswordof open) \
16468 guerimand 165
      and exercise isin $module_category
166
!!and $tmptest notin $module_init_parm
13762 bpr 167
    !set wims_homeref_parm=!replace internal % by %25 in $module_init_parm
168
    !set wims_homeref_parm=!replace internal + by %2B in $wims_homeref_parm
169
    !set wims_homeref_parm=!replace internal & by %26 in $wims_homeref_parm
170
    !set wims_homeref_parm=!replace internal ; by %3B in $wims_homeref_parm
171
    !set wims_homeref_parm=!lines2rows $wims_homeref_parm
12515 bpr 172
    !set 1_=!append line add,1,module=adm/class/addmodule&dir=$module&scoring=$module_scoring&iniparm=$wims_homeref_parm to $1_
173
    !set 1_=!append line addh,1,module=adm/class/addmodule&job=helpexo&dir=$module&scoring=$module_scoring&iniparm=$wims_homeref_parm to $1_
16087 guerimand 174
    !set 1_=!append line addfw,1,module=adm/class/freework&job=addexo&dir=$module&scoring=$module_scoring&iniparm=$wims_homeref_parm to $1_
12515 bpr 175
  !endif
176
  !if $wims_user=supervisor and exam notin $session and \
13762 bpr 177
    ..classes/ notin ..$module and ..adm/ notin ..$module and \
178
    ..devel/ notin ..$module and \
179
      GNU isin $module_copyright and \
180
      _check notin $session and \
181
      $class_importation!=no and $thisexo!=
12515 bpr 182
    !set 1_=!append line import,1,module=adm/createxo&existing=$thisexo&catmodule=$module to $1_
183
  !endif
7182 bpr 184
 
1980 guerimand 185
!else
12515 bpr 186
  !! ----- place pour ajouter le lien vers la modification de serie dans une feuille
187
  !if $cmd!=intro and $cmd!=help and $module!=home and \
188
      ../adm/ notin ../$module and \
189
      (../devel/ notin ../$module or $wims_devel_modules iswordof open)
190
    !set wims_homeref_parm=!replace % by %25 in $module_init_parm
191
    !set wims_homeref_parm=!replace + by %2B in $wims_homeref_parm
192
    !set wims_homeref_parm=!replace & by %26 in $wims_homeref_parm
193
    !set 1_=!append line chseries,1,module=adm/class/sheet&dir=$module&scoring=$module_scoring&iniparm=$wims_homeref_parm&job=chseries&num=$special_parm4 to $1_
194
  !endif
1980 guerimand 195
!endif
9703 bpr 196
!! add module links to general links with a separation
10285 bpr 197
!if $wims_menu_items!=$empty
198
  !set 1_=!append line itemsep,0,\
9703 bpr 199
$wims_menu_items to $1_
10285 bpr 200
!endif
9281 bpr 201
!if $wims_user=supervisor and $cmd!=intro and $cmd!=help and $module!=home and \
14338 bpr 202
    ../adm/ notin ../$module and ($module_category!=document or $job=exosource)\
203
    and $module_category!=help
12515 bpr 204
  !!last condition is for the uniq module help/main.$lang
10039 bpr 205
  !if $job=exosource
206
    !set tmp=back2
207
    !if $block!=$empty
208
      !set docbl=block=$block
209
    !else
210
      !reset docbl
211
    !endif
212
  !else
213
    !set tmp=moduback
214
  !endif
215
  !set 1_=!append line $tmp,1,module=$module&cmd=intro&special_parm=$special_parm&special_parm2=$special_parm2&special_parm3=$special_parm3&special_parm4=$special_parm4&$docbl to $1_
9281 bpr 216
!endif
7182 bpr 217
!! next exo and prev exo in the menu for supervisor
7188 bpr 218
!if $wims_user=supervisor and $exoprev$exonext != $empty and $wims_sheet=$empty
12515 bpr 219
  !set 1_=!append line itemsep,0\
10792 bpr 220
prev,1,cmd=new&module=$module&exo=$exoprev&special_parm=$special_parm&special_parm2=$special_parm2&special_parm3=$special_parm3&special_parm4=$special_parm4  \
221
to $1_
222
  !set 1_=!append line next,1,cmd=new&module=$module&exo=$exonext&special_parm=$special_parm&special_parm2=$special_parm2&special_parm3=$special_parm3&special_parm4=$special_parm4  \
223
to $1_
7182 bpr 224
  !reset exoprev exonext
225
!endif
226
 
7699 bpr 227
!if $special_parm4=$empty
12515 bpr 228
  !if $cmd!=intro and $cmd!=help and $module!=home and \
13915 bpr 229
      ../adm/ notin ../$module and \
230
      (../devel/ notin ../$module or $wims_devel_modules iswordof open) \
231
      and oef isin $module_category and $wims_classification_open=yes and ../devel/ notin ../$module
12515 bpr 232
    !set 1_=!append line itemsep,0,\
233
    Indexation,4,module=adm/tool/classification&refdir=$module&iniparm=$wims_homeref_parm,test to $1_
234
  !endif
7699 bpr 235
!endif
8484 bpr 236
!if $module_score!=$empty and $wims_class_exolog>0 and E notin $wims_sheet
237
  !set 1_=!append line exolog,1,module=adm/class/exolog&cmd=new&job=log&logsheet=$wims_sheet&logexo=$wims_exo to $1_
238
!endif
7699 bpr 239
 
7182 bpr 240
 
8597 obado 241
!! When in lightpopup mode, only links in whitelist are available
242
 
243
!if yes isin $wims_lightpopup
12515 bpr 244
  !set whitelist = nextseries,previousseries
245
  !set nb_elem=!linecnt $1_
246
  !for a=1 to $nb_elem
247
    !set element = !line $a of $1_
248
    !set id = !item 1 of $element
249
    !if $id isitemof $whitelist
250
      !set wims_rm_0 = !append line $element to $wims_rm_0
251
    !endif
252
  !next
8597 obado 253
!else
12515 bpr 254
  !set wims_rm_0=$1_
8597 obado 255
!endif
256
 
1407 bpr 257
!set wims_rm_3=!append line $wims_menu_tabs to $wims_rm_3
16 reyssat 258
:rm2
259
!if $wims_rm_2!=$empty
12515 bpr 260
  !goto rmend
16 reyssat 261
!endif
262
!reset 2_
4346 bpr 263
 
264
!!********* Link #8 : "Author(s)"
265
 
16 reyssat 266
!if $module_author!=$empty and @ isin $module_address
12515 bpr 267
  !read namewriting.phtml $module_author
268
  !set wims_homeref_author_num=$script_cnt
269
  !set module_address=!replace internal ; by , in $module_address
270
  !if $wims_homeref_author_num>1
271
    !set 3_=$wims_name_authors:
272
  !else
273
    !set 3_=$wims_name_author:
274
  !endif
275
  !set 4_=
276
  !for ad=1 to $wims_homeref_author_num
277
    !if $(module_address[$ad])!= and @ isin $(module_address[$ad])
278
      !set 4__=!mailurl $(module_address[$ad]) $(script_out[$ad])\
4346 bpr 279
WIMS $module_title [$module_language]
12515 bpr 280
    !else
281
      !set 4__=$(script_out[$ad])
7182 bpr 282
   !endif
12515 bpr 283
  !set 4_=!append item $4__ to $4_
7182 bpr 284
  !next
4346 bpr 285
  !set 2_=!append line author,0,$3_ $4_ to $2_
16 reyssat 286
!endif
4346 bpr 287
 
288
!!********* Link #9 : "Translator(s)"
2233 bpr 289
!set mod_transl=$(module_translator_$lang)
290
!if $module_transl!=$empty
12515 bpr 291
  !set module_translator=$mod_transl
292
  !set module_translator_address=$(module_translator_address_$lang)
2233 bpr 293
!endif
294
 
16 reyssat 295
!if $module_translator!=$empty and $module_translator_address!=$empty
12515 bpr 296
  !read namewriting.phtml $module_translator
297
  !set module_translator=$(script_out[1])
298
  !set wims_homeref_translator_num=$script_cnt
299
  !set module_translator_address=!replace internal ; by , in $module_translator_address
300
  !for ad=1 to $wims_homeref_translator_num
301
    !set 3_=!mailurl $(module_translator_address[$ad]) $(module_translator[$ad])\
16 reyssat 302
WIMS $module_title [$module_language]
12515 bpr 303
    !set 2_=!append line trans,0,$wims_name_translatedby $3_ to $2_
304
  !next
16 reyssat 305
!endif
2963 bpr 306
!if $wims_theme_version>=1
12515 bpr 307
  !reset 2_
2963 bpr 308
!endif
16 reyssat 309
!set 2_=!append line syou,0,$wims_name_syou to $2_
310
!set 2_=!append line class,0,$wims_classname ($wims_institutionname) to $2_
11268 obado 311
 
312
!read date.phtml $wims_now,noprint
313
!set 2_=!append line time,0,$wims_name_server_time: $slib_out to $2_
16 reyssat 314
!set wims_rm_2=$2_
4528 bpr 315
!set wims_rm_5=$5_
16 reyssat 316
 
317
:rmend
318
!set wims_homeref_n1=!linecnt $wims_rm_1
319
!set wims_homeref_n2=!linecnt $wims_rm_2
1202 bpr 320
!set wims_homeref_n0=!linecnt $wims_rm_0
1407 bpr 321
!set wims_homeref_n3=!linecnt $wims_rm_3
3044 bpr 322
!!</div><!--div dans homeref_supervisor-->
4528 bpr 323
!set wims_homeref_n5=!linecnt $wims_rm_5
4635 bpr 324
!set wims_homeref_local_n0=!linecnt $wims_local_menu_items
16 reyssat 325
!read themes.phtml tail
326
!robottrap