Subversion Repositories wimsdev

Rev

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