Subversion Repositories wimsdev

Rev

Rev 7182 | Rev 7808 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. !!##preparation of the "bottom menu"
  2.  
  3. !if _check isin $session or $wims_mode=popup or yes isin $wims_lightpopup
  4.  !exit
  5. !endif
  6.  
  7. !if _test isin $session and $wims_hacked_variables!=$empty
  8.  <p><span class="wims_warning">WIMS WARNING</span>. The following variables of your module could be hacked
  9.  by students using manually modified http addresses! You might want to put more
  10.  strict permissions to them in var.def, in order to build a secure exercise module.
  11.  </p>
  12.  <pre>$wims_hacked_variables</pre>
  13.  
  14. !endif
  15.  
  16. !read name.phtml.$lang
  17. !default wims_homeref_bgcolor=$wims_ref_bgcolor
  18. !read themes/$wims_theme/local.phtml
  19. !if exam isin $wims_session
  20.  !set wims_hr_r=$[max(0,$wims_exam_remain)]
  21.  !set wims_hr_rm=$[floor($wims_hr_r/60)]
  22.  !set wims_hr_rs=!char 2,3 of $[$wims_hr_r%60+100]
  23.  !set wims_homeref_special=$wims_name_examremain $wims_hr_rm:$wims_hr_rs ($wims_name_whenloaded)
  24.  !goto rmend
  25. !endif
  26.  
  27. !if $wims_rm_1=no
  28.  !reset wims_rm_1
  29.  !goto local
  30. !endif
  31. !if $wims_rm_1!=$empty
  32.  !goto rm2
  33. !endif
  34. !reset 1_
  35.  
  36. !!********* Link #1 : "Close Window" or "Home" (Not Shown if Embedded)
  37. !if _ isin $wims_subsession
  38.  !set 1_=!append line back2,3,window.close() to $1_
  39. !else
  40.  !set 1_=!append line class_home,1,session=$wims_session.1 to $1_
  41. !endif
  42.  
  43. !!********* Link #2 : "Sheet"
  44. !if $wims_sheet>0 or P isin $wims_sheet
  45.  !if $wims_sheet>0
  46.   !set tmp_=sheetmanagement,1,module=adm/class/sheet&sheet=$wims_sheet
  47.  !else
  48.   !set tmp_=sheet,1,module=adm/sheet&sh=$wims_sheet&
  49.  !endif
  50.  !set 1_=!append line $tmp_ to $1_
  51.  !let wims_menu_items=!append line $tmp_ to $wims_menu_items
  52.  !if $wims_exo>1
  53.   !let wims_menu_items=!append line previousseries,1,module=home&directworksheet=$wims_sheet.$[$wims_exo-1] to $wims_menu_items
  54.  !endif
  55.  !if $wims_exo<$wims_sheetmax
  56.   !let wims_menu_items=!append line nextseries,1,module=home&directworksheet=$wims_sheet.$[$wims_exo+1] to $wims_menu_items
  57.  !endif
  58. !endif
  59.  
  60. !if $wims_sheet>0 or P isin $wims_sheet
  61.  !if $(wims_exofeedback[$wims_exo;])!=$empty
  62.   !set feedexo=$(wims_exofeedback[$wims_exo;])
  63.     !if $module_score!=$empty and $module_score < $(feedexo[2]) and $module_score >= $(feedexo[3])
  64.      !if $(feedexo[3])=0 or $(feedexo[3])=$empty
  65.       !set 5_=!append line feedbackexo,7,$(feedexo[1]),mfeed to $5_
  66.     !else
  67.       !set 5_=!append line feedbackplus,7,$(feedexo[1]),mfeed to $5_
  68.     !endif
  69.   !endif
  70.  !endif
  71. !endif
  72.  
  73. !!********* Link #3 : "Resume"
  74. !if $cmd=help or $cmd=hint
  75.  !set 1_=!append line resume,1,cmd=resume to $1_
  76. !endif
  77.  
  78. !!********* Link #4 : "Introduction" (Not Shown if Embedded)
  79. !if $module_has_intro=yes and $cmd notwordof intro help and\
  80.         $wims_sheet=$empty and exam notin $wims_session
  81.  !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_
  82. !endif
  83.  
  84. !!********* Link #5 : "Help"
  85. !if $module_has_help=yes and $cmd notwordof intro help
  86.  !if $module_help=$empty or $module_help=popup
  87.   !set 1_=!append line help,4,module=$module&cmd=help&special_parm=$wims_help_parm,mhelp to $1_
  88.  !else
  89.   !set 1_=!append line help,1,module=$module&cmd=help&special_parm=$wims_help_parm to $1_
  90.  !endif
  91. !endif
  92.  
  93. !!********* Link #6 : "About"
  94. !if $module_has_about=yes and $cmd notwordof help intro
  95.  !set 1_=!append line about,4,module=$module&cmd=help&special_parm=about,mhelp to $1_
  96. !endif
  97. !if print isin $job,$job2 or $print!=
  98.   !set 1_=!append line print,3,window.print() to $1_
  99. !endif
  100. !set wims_rm_1=$1_
  101. :local
  102. !reset 1_
  103. !if $wims_developer!=$empty and COPYING isin $module_copyright and ../classes/ notin ../$module
  104.  !set V_=!char 1 of $module
  105.  !set M_=!translate internal / to , in $module
  106.  !set M_=!item 1 of $M_
  107.  !if $V_ isin ABCDEFGHIJKLMNOPQRTSUVWXYZ or $M_ iswordof local contrib tool
  108.   !set 1_=!append line modify,1,module=adm/modtool&original=$module to $1_
  109.  !endif
  110. !endif
  111. !if $wims_user=supervisor and _adm/doc notin _$module and adddoc notin $module and (document iswordof $module_category or tool iswordof $module_category)
  112.   !if document iswordof $module_category
  113.     !set wims_homeref_parm=block=$block&doc=$doc
  114.   !endif
  115.   !set 1_=!append line adddoc,1,module=adm/class/adddoc&dir=$module&iniparm=$wims_homeref_parm to $1_
  116.   !set 1_=!append line addh,1,module=adm/class/addmodule&job=helpexo&dir=$module&iniparm=$wims_homeref_parm to $1_
  117. !endif
  118. !if $special_parm4=$empty
  119.  !if $cmd!=intro and $cmd!=help and $module!=home and \
  120.         ../adm/ notin ../$module and \
  121.         (../devel/ notin ../$module or $wims_devel_modules iswordof open) \
  122.         and exercise isin $module_category
  123.  !set wims_homeref_parm=!replace % by %25 in $module_init_parm
  124.  !set wims_homeref_parm=!replace + by %2B in $wims_homeref_parm
  125.  !set wims_homeref_parm=!replace & by %26 in $wims_homeref_parm
  126.  !set 1_=!append line add,1,module=adm/class/addmodule&dir=$module&scoring=$module_scoring&iniparm=$wims_homeref_parm to $1_
  127.  !set 1_=!append line addh,1,module=adm/class/addmodule&job=helpexo&dir=$module&scoring=$module_scoring&iniparm=$wims_homeref_parm to $1_
  128. !endif
  129. !if $wims_user=supervisor and exam notin $session and \
  130.         ..classes/ notin ..$module and ..adm/ notin ..$module and \
  131.         ..devel/ notin ..$module and \
  132.         GNU isin $module_copyright and \
  133.         _check notin $session and \
  134.         $class_importation!=no and\
  135.         $thisexo!=
  136.   !set 1_=!append line import,1,module=adm/createxo&existing=$thisexo&catmodule=$module to $1_
  137. !endif
  138.  
  139. !else
  140. !! ---------------------------------------------- place pour ajouter le lien vers la modification de serie dans une feuille
  141.  !if $cmd!=intro and $cmd!=help and $module!=home and \
  142.         ../adm/ notin ../$module and \
  143.         (../devel/ notin ../$module or $wims_devel_modules iswordof open)
  144.   !set wims_homeref_parm=!replace % by %25 in $module_init_parm
  145.   !set wims_homeref_parm=!replace + by %2B in $wims_homeref_parm
  146.   !set wims_homeref_parm=!replace & by %26 in $wims_homeref_parm
  147.   !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_
  148.  !endif
  149. !endif
  150. !set 1_=!append line $wims_menu_items to $1_
  151. !! next exo and prev exo in the menu for supervisor
  152. !if $wims_user=supervisor and $exoprev$exonext != $empty and $wims_sheet=$empty
  153.    !set 1_=!append line &#8594;,1,cmd=new&module=$module&exo=$exoprev&special_parm=$special_parm&special_parm2=$special_parm2&special_parm3=$special_parm3&special_parm4=$special_parm4  \
  154.  to $1_
  155.    !set 1_=!append line &#8592;,1,cmd=new&module=$module&exo=$exonext&special_parm=$special_parm&special_parm2=$special_parm2&special_parm3=$special_parm3&special_parm4=$special_parm4  \
  156.  to $1_
  157.   !reset exoprev exonext
  158. !endif
  159.  
  160. !set wims_rm_0=$1_
  161.  
  162. !set wims_rm_3=!append line $wims_menu_tabs to $wims_rm_3
  163. :rm2
  164. !if $wims_rm_2!=$empty
  165.  !goto rmend
  166. !endif
  167. !reset 2_
  168.  
  169. !!********* Link #8 : "Author(s)"
  170.  
  171. !if $module_author!=$empty and @ isin $module_address
  172.  !read namewriting.phtml $module_author
  173.  !set wims_homeref_author_num=$script_cnt
  174.  !set module_address=!replace internal ; by , in $module_address
  175.  !if $wims_homeref_author_num>1
  176.   !set 3_=$wims_name_authors:
  177.  !else
  178.   !set 3_=$wims_name_author:
  179.  !endif
  180.  !set 4_=
  181.  !for ad=1 to $wims_homeref_author_num
  182.    !if $(module_address[$ad])!= and @ isin $(module_address[$ad])
  183.     !set 4__=!mailurl $(module_address[$ad]) $(script_out[$ad])\
  184. WIMS $module_title [$module_language]
  185.    !else
  186.      !set 4__=$(script_out[$ad])
  187.    !endif
  188.     !set 4_=!append item $4__ to $4_
  189.   !next
  190.   !set 2_=!append line author,0,$3_ $4_ to $2_
  191. !endif
  192.  
  193. !!********* Link #9 : "Translator(s)"
  194. !set mod_transl=$(module_translator_$lang)
  195. !if $module_transl!=$empty
  196.    !set module_translator=$mod_transl
  197.    !set module_translator_address=$(module_translator_address_$lang)
  198. !endif
  199.  
  200. !if $module_translator!=$empty and $module_translator_address!=$empty
  201.  !read namewriting.phtml $module_translator
  202.  !set module_translator=$(script_out[1])
  203.  !set wims_homeref_translator_num=$script_cnt
  204.  !set module_translator_address=!replace internal ; by , in $module_translator_address
  205.  !for ad=1 to $wims_homeref_translator_num
  206.    !set 3_=!mailurl $(module_translator_address[$ad]) $(module_translator[$ad])\
  207. WIMS $module_title [$module_language]
  208.    !set 2_=!append line trans,0,$wims_name_translatedby $3_ to $2_
  209.  !next
  210. !endif
  211. !if $wims_theme_version>=1
  212.  !reset 2_
  213. !endif
  214. !set 2_=!append line syou,0,$wims_name_syou to $2_
  215. !set 2_=!append line class,0,$wims_classname ($wims_institutionname) to $2_
  216. !set 2_=!append line time,0,Server time: $wims_now to $2_
  217. !set wims_rm_2=$2_
  218. !set wims_rm_5=$5_
  219.  
  220. :rmend
  221. !set wims_homeref_n1=!linecnt $wims_rm_1
  222. !set wims_homeref_n2=!linecnt $wims_rm_2
  223. !set wims_homeref_n0=!linecnt $wims_rm_0
  224. !set wims_homeref_n3=!linecnt $wims_rm_3
  225. !!</div><!--div dans homeref_supervisor-->
  226. !set wims_homeref_n5=!linecnt $wims_rm_5
  227. !set wims_homeref_local_n0=!linecnt $wims_local_menu_items
  228. !read themes.phtml tail
  229. !robottrap
  230.