Subversion Repositories wimsdev

Rev

Rev 10057 | Rev 10321 | 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
  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. !read themes/$wims_theme/name.phtml.$lang
  18. !default wims_homeref_bgcolor=$wims_ref_bgcolor
  19. !read themes/$wims_theme/local.phtml
  20.  
  21. !if exam isin $wims_session
  22.  !!debug end= $wims_exam_end, $wims_now $wims_exam_remain timeleft=[60*$sdure-($now-$registered)]
  23.  !set wims_hr_r=$[max(0,$wims_exam_remain)]
  24.  !set wims_hr_rm=$[floor($wims_hr_r/60)]
  25.  !set wims_hr_rs=!char 2,3 of $[$wims_hr_r%60+100]
  26.  !set wims_homeref_special= XXX=$wims_exam_end $wims_name_examremain $wims_hr_rm:$wims_hr_rs ($wims_name_whenloaded)
  27.  !goto rmend
  28. !endif
  29.  
  30. !if $wims_rm_1=no
  31.  !reset wims_rm_1
  32.  !goto local
  33. !endif
  34. !if $wims_rm_1!=$empty
  35.  !goto rm2
  36. !endif
  37. !reset 1_
  38.  
  39. !!********* Link #1 : "Close Window" or "Home" (Not Shown if Embedded)
  40. !if _ isin $wims_subsession
  41.  !!set 1_=!append line back2,3,window.close() to $1_
  42. !else
  43.  !!set 1_=!append line class_home,1,session=$wims_session.1 to $1_
  44. !endif
  45.  
  46. !!********* Link #2 : "Sheet"
  47. !if $wims_sheet>0 or P isin $wims_sheet
  48.  !if $wims_sheet>0
  49.   !set tmp_=sheetmanagement,1,module=adm/class/sheet&sheet=$wims_sheet
  50.  !else
  51.   !set tmp_=sheet,1,module=adm/sheet&sh=$wims_sheet&
  52.  !endif
  53.  !if yes notin $wims_lightpopup
  54.     !set 1_=!append line $tmp_ to $1_
  55.  !endif
  56.  !let wims_menu_items=!append line $tmp_ to $wims_menu_items
  57.  !if $wims_exo>1
  58.   !let wims_menu_items=!append line previousseries,1,module=home&directworksheet=$wims_sheet.$[$wims_exo-1] to $wims_menu_items
  59.  !endif
  60.  !if $wims_exo<$wims_sheetmax
  61.   !let wims_menu_items=!append line nextseries,1,module=home&directworksheet=$wims_sheet.$[$wims_exo+1] to $wims_menu_items
  62.  !endif
  63. !endif
  64.  
  65. !if $wims_sheet>0 or P isin $wims_sheet
  66.  !if $(wims_exofeedback[$wims_exo;])!=$empty
  67.   !set feedexo=$(wims_exofeedback[$wims_exo;])
  68.   !if $module_score!=$empty and $module_score < $(feedexo[2]) and $module_score >= $(feedexo[3])
  69.     !if $(feedexo[3])=0 or $(feedexo[3])=$empty
  70.       !set 5_=!append line feedbackexo,7,$(feedexo[1]),mfeed to $5_
  71.     !else
  72.       !set 5_=!append line feedbackplus,7,$(feedexo[1]),mfeed to $5_
  73.     !endif
  74.   !endif
  75.  !endif
  76. !endif
  77.  
  78. !!********* Link #3 : "Resume"
  79. !if $cmd=help or $cmd=hint
  80.  !set 1_=!append line resume,1,cmd=resume to $1_
  81. !endif
  82.  
  83. !!********* Link #4 : "Introduction" (Not Shown if Embedded)
  84. !if $module_has_intro=yes and $cmd notwordof intro help and\
  85.         $wims_sheet=$empty and exam notin $wims_session
  86.  !!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_
  87. !endif
  88.  
  89. !!********* Link #5 : "Help"
  90. !if $module_has_help=yes and $cmd notwordof intro help
  91.  !if $module_help=$empty or $module_help=popup
  92.   !!set 1_=!append line help,4,module=$module&cmd=help&special_parm=$wims_help_parm,mhelp to $1_
  93.  !else
  94.   !!set 1_=!append line help,1,module=$module&cmd=help&special_parm=$wims_help_parm to $1_
  95.  !endif
  96. !endif
  97.  
  98. !!********* Link #6 : "About"
  99. !if $module_has_about=yes and $cmd notwordof help intro
  100.   !!set 1_=!append line about,4,module=$module&cmd=help&special_parm=about,mhelp to $1_
  101. !endif
  102.  
  103. !if print isin $job,$job2 or $print!=
  104.   !set 1_=!append line print,3,window.print() to $1_
  105. !endif
  106. !set wims_rm_1=$1_
  107.  
  108. :local
  109. !reset 1_
  110. !if $wims_sheet!=$empty or _exam isin $wims_session
  111.   !set 1_=!append line itemsep,0,\
  112.   tools,4,module=home,tool\
  113.   itemsep,0,\
  114.   to $1_
  115. !endif
  116.  
  117. !if $wims_developer!=$empty and COPYING isin $module_copyright and ../classes/ notin ../$module
  118.  !set V_=!char 1 of $module
  119.  !set M_=!translate internal / to , in $module
  120.  !set M_=!item 1 of $M_
  121.  !if $V_ isin ABCDEFGHIJKLMNOPQRTSUVWXYZ or $M_ iswordof local contrib tool
  122.   !set 1_=!append line modify,1,module=adm/modtool&original=$module to $1_
  123.  !endif
  124. !endif
  125. !if $wims_user=supervisor and _adm/doc notin _$module and adddoc notin $module and (document iswordof $module_category or tool iswordof $module_category)
  126.   !if document iswordof $module_category
  127.     !set wims_homeref_parm=block=$block&doc=$doc
  128.   !endif
  129.   !set 1_=!append line adddoc,1,module=adm/class/adddoc&job=add&dir=$module&iniparm=$wims_homeref_parm to $1_
  130.   !set 1_=!append line addh,1,module=adm/class/addmodule&job=helpexo&dir=$module&iniparm=$wims_homeref_parm to $1_
  131. !endif
  132. !if $special_parm4=$empty
  133.  !if $cmd!=intro and $cmd!=help and $module!=home and \
  134.         ../adm/ notin ../$module and \
  135.         (../devel/ notin ../$module or $wims_devel_modules iswordof open) \
  136.         and exercise isin $module_category
  137.   !set wims_homeref_parm=!replace % by %25 in $module_init_parm
  138.   !set wims_homeref_parm=!replace + by %2B in $wims_homeref_parm
  139.   !set wims_homeref_parm=!replace & by %26 in $wims_homeref_parm
  140.   !set 1_=!append line add,1,module=adm/class/addmodule&dir=$module&scoring=$module_scoring&iniparm=$wims_homeref_parm to $1_
  141.   !set 1_=!append line addh,1,module=adm/class/addmodule&job=helpexo&dir=$module&scoring=$module_scoring&iniparm=$wims_homeref_parm to $1_
  142.  !endif
  143.  !if $wims_user=supervisor and exam notin $session and \
  144.         ..classes/ notin ..$module and ..adm/ notin ..$module and \
  145.         ..devel/ notin ..$module and \
  146.         GNU isin $module_copyright and \
  147.         _check notin $session and \
  148.         $class_importation!=no and\
  149.         $thisexo!=
  150.   !set 1_=!append line import,1,module=adm/createxo&existing=$thisexo&catmodule=$module to $1_
  151.  !endif
  152.  
  153. !else
  154. !! ----- place pour ajouter le lien vers la modification de serie dans une feuille
  155.  !if $cmd!=intro and $cmd!=help and $module!=home and \
  156.         ../adm/ notin ../$module and \
  157.         (../devel/ notin ../$module or $wims_devel_modules iswordof open)
  158.   !set wims_homeref_parm=!replace % by %25 in $module_init_parm
  159.   !set wims_homeref_parm=!replace + by %2B in $wims_homeref_parm
  160.   !set wims_homeref_parm=!replace & by %26 in $wims_homeref_parm
  161.   !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_
  162.  !endif
  163. !endif
  164. !! add module links to general links with a separation
  165. !set 1_=!append line itemsep,0,\
  166. $wims_menu_items to $1_
  167. !if $wims_user=supervisor and $cmd!=intro and $cmd!=help and $module!=home and \
  168.         ../adm/ notin ../$module and ($module_category!=document or $job=exosource)
  169.   !if $job=exosource
  170.     !set tmp=back2
  171.     !if $block!=$empty
  172.       !set docbl=block=$block
  173.     !else
  174.       !reset docbl
  175.     !endif
  176.   !else
  177.     !set tmp=moduback
  178.   !endif
  179.   !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_
  180. !endif
  181. !! next exo and prev exo in the menu for supervisor
  182. !if $wims_user=supervisor and $exoprev$exonext != $empty and $wims_sheet=$empty
  183.    !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  \
  184.  to $1_
  185.    !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  \
  186.  to $1_
  187.   !reset exoprev exonext
  188. !endif
  189.  
  190. !if $special_parm4=$empty
  191.  !if $cmd!=intro and $cmd!=help and $module!=home and \
  192.         ../adm/ notin ../$module and \
  193.         (../devel/ notin ../$module or $wims_devel_modules iswordof open) \
  194.         and oef isin $module_category and $wims_classification_open=yes and ../devel/ notin ../$module
  195.    !set 1_=!append line itemsep,0,\
  196.    Indexation,4,module=adm/tool/classification&refdir=$module&iniparm=$wims_homeref_parm,test to $1_
  197.  !endif
  198. !endif
  199. !if $module_score!=$empty and $wims_class_exolog>0 and E notin $wims_sheet
  200.   !set 1_=!append line exolog,1,module=adm/class/exolog&cmd=new&job=log&logsheet=$wims_sheet&logexo=$wims_exo to $1_
  201. !endif
  202.  
  203.  
  204. !! When in lightpopup mode, only links in whitelist are available
  205.  
  206. !if yes isin $wims_lightpopup
  207.     !set whitelist = nextseries,previousseries
  208.     !set nb_elem=!linecnt $1_
  209.     !for a=1 to $nb_elem
  210.         !set element = !line $a of $1_
  211.         !set id = !item 1 of $element
  212.         !if $id isitemof $whitelist
  213.             !set wims_rm_0 = !append line $element to $wims_rm_0
  214.         !endif
  215.     !next
  216. !else
  217.     !set wims_rm_0=$1_
  218. !endif
  219.  
  220. !set wims_rm_3=!append line $wims_menu_tabs to $wims_rm_3
  221. :rm2
  222. !if $wims_rm_2!=$empty
  223.  !goto rmend
  224. !endif
  225. !reset 2_
  226.  
  227. !!********* Link #8 : "Author(s)"
  228.  
  229. !if $module_author!=$empty and @ isin $module_address
  230.  !read namewriting.phtml $module_author
  231.  !set wims_homeref_author_num=$script_cnt
  232.  !set module_address=!replace internal ; by , in $module_address
  233.  !if $wims_homeref_author_num>1
  234.   !set 3_=$wims_name_authors:
  235.  !else
  236.   !set 3_=$wims_name_author:
  237.  !endif
  238.  !set 4_=
  239.  !for ad=1 to $wims_homeref_author_num
  240.    !if $(module_address[$ad])!= and @ isin $(module_address[$ad])
  241.     !set 4__=!mailurl $(module_address[$ad]) $(script_out[$ad])\
  242. WIMS $module_title [$module_language]
  243.    !else
  244.      !set 4__=$(script_out[$ad])
  245.    !endif
  246.     !set 4_=!append item $4__ to $4_
  247.   !next
  248.   !set 2_=!append line author,0,$3_ $4_ to $2_
  249. !endif
  250.  
  251. !!********* Link #9 : "Translator(s)"
  252. !set mod_transl=$(module_translator_$lang)
  253. !if $module_transl!=$empty
  254.    !set module_translator=$mod_transl
  255.    !set module_translator_address=$(module_translator_address_$lang)
  256. !endif
  257.  
  258. !if $module_translator!=$empty and $module_translator_address!=$empty
  259.  !read namewriting.phtml $module_translator
  260.  !set module_translator=$(script_out[1])
  261.  !set wims_homeref_translator_num=$script_cnt
  262.  !set module_translator_address=!replace internal ; by , in $module_translator_address
  263.  !for ad=1 to $wims_homeref_translator_num
  264.    !set 3_=!mailurl $(module_translator_address[$ad]) $(module_translator[$ad])\
  265. WIMS $module_title [$module_language]
  266.    !set 2_=!append line trans,0,$wims_name_translatedby $3_ to $2_
  267.  !next
  268. !endif
  269. !if $wims_theme_version>=1
  270.  !reset 2_
  271. !endif
  272. !set 2_=!append line syou,0,$wims_name_syou to $2_
  273. !set 2_=!append line class,0,$wims_classname ($wims_institutionname) to $2_
  274. !set 2_=!append line time,0,Server time: $wims_now to $2_
  275. !set wims_rm_2=$2_
  276. !set wims_rm_5=$5_
  277.  
  278. :rmend
  279. !set wims_homeref_n1=!linecnt $wims_rm_1
  280. !set wims_homeref_n2=!linecnt $wims_rm_2
  281. !set wims_homeref_n0=!linecnt $wims_rm_0
  282. !set wims_homeref_n3=!linecnt $wims_rm_3
  283. !!</div><!--div dans homeref_supervisor-->
  284. !set wims_homeref_n5=!linecnt $wims_rm_5
  285. !set wims_homeref_local_n0=!linecnt $wims_local_menu_items
  286. !read themes.phtml tail
  287. !robottrap
  288.