Subversion Repositories wimsdev

Rev

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