Subversion Repositories wimsdev

Rev

Rev 14338 | Rev 15729 | 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. !endif
  14.  
  15. !read name.phtml.$lang
  16. !read themes/$wims_theme/name.phtml.$lang
  17. !default wims_homeref_bgcolor=$wims_ref_bgcolor
  18. !read themes/$wims_theme/local.phtml
  19.  
  20. !if exam isin $wims_session
  21.   !read examclock.proc
  22.   !goto rmend
  23. !endif
  24.  
  25. !if $wims_rm_1=no
  26.   !reset wims_rm_1
  27.   !goto local
  28. !endif
  29. !if $wims_rm_1!=$empty
  30.   !goto rm2
  31. !endif
  32. !reset 1_
  33.  
  34. !!********* Link #1 : "Close Window" or "Home" (Not Shown if Embedded)
  35. !if _ isin $wims_subsession
  36.   !!set 1_=!append line back2,3,window.close() to $1_
  37. !else
  38.   !!set 1_=!append line class_home,1,session=$wims_session.1 to $1_
  39. !endif
  40.  
  41. !!********* Link #2 : "Sheet"
  42. !if $wims_sheet>0 or P isin $wims_sheet
  43.   !if $wims_sheet>0
  44.     !set tmp_=sheetmanagement,1,module=adm/class/sheet&sheet=$wims_sheet
  45.   !else
  46.     !set tmp_=sheet,1,module=adm/sheet&sh=$wims_sheet&
  47.   !endif
  48.   !if yes notin $wims_lightpopup
  49.     !set 1_=!append line $tmp_ to $1_
  50.   !endif
  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.     !if $module_score!=$empty
  63.       !set feedexotot=!declosing $(wims_exofeedback[$wims_exo;])
  64.       !set feedexocnt=!itemcnt $(feedexotot[;1])
  65.       !for t=1 to $feedexocnt
  66.         !set feedexo=$(feedexotot[$t;])
  67.         !if $module_score < $(feedexo[2]) and $module_score >= $(feedexo[3])
  68.           !if $module_score < 10
  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.       !next
  75.     !endif
  76.   !endif
  77. !endif
  78.  
  79. !!********* Link #3 : "Resume"
  80. !if $cmd=help or $cmd=hint
  81.   !set 1_=!append line resume,1,cmd=resume to $1_
  82. !endif
  83.  
  84. !!********* Link #4 : "Introduction" (Not Shown if Embedded)
  85. !if $module_has_intro=yes and $cmd notwordof intro help and\
  86.         $wims_sheet=$empty and exam notin $wims_session
  87.   !!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_
  88. !endif
  89.  
  90. !!********* Link #5 : "Help"
  91. !if $module_has_help=yes and $cmd notwordof intro help
  92.   !if $module_help=$empty or $module_help=popup
  93.    !!set 1_=!append line help,4,module=$module&cmd=help&special_parm=$wims_help_parm,mhelp to $1_
  94.   !else
  95.    !!set 1_=!append line help,1,module=$module&cmd=help&special_parm=$wims_help_parm to $1_
  96.   !endif
  97. !endif
  98.  
  99. !!********* Link #6 : "About"
  100. !if $module_has_about=yes and $cmd notwordof help intro
  101.   !!set 1_=!append line about,4,module=$module&cmd=help&special_parm=about,mhelp to $1_
  102. !endif
  103.  
  104. !if print isin $job,$job2 or $print!=
  105.   !set 1_=!append line print,3,window.print() to $1_
  106. !endif
  107. !set wims_rm_1=$1_
  108.  
  109. :local
  110. !reset 1_
  111. !if $wims_sheet!=$empty or _exam isin $wims_session
  112.   !set 1_=!append line itemsep,0,\
  113.   tools,4,module=home,tool\
  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 $module=adm/class/glossary
  126.   !set 1_=!append line newglose,1,module=adm/tool/glossary&gl=0 to $1_
  127. !endif
  128. !if $wims_user=supervisor and ((_adm/doc notin _$module and adddoc notin $module \
  129.     and (document iswordof $module_category or tool iswordof $module_category))\
  130.     or _c isin _$doc)
  131.   !if document iswordof $module_category or _c isin _$doc
  132.     !set wims_homeref_parm=doc=$doc&block=$block&job=read
  133.     !set wims_homeref_parm=!replace internal & by %26 in $wims_homeref_parm
  134.   !endif
  135.   !if adm/tool/glossary isin $module
  136.     !if $gl=0
  137.       !if $special_parm!=$empty
  138.         !set wims_homeref_parm=!getopt gloss_item in $module_init_parm
  139.         !set 1_=!append line addglossary,1,module=adm/class/glossary&job=add&iniparm=$wims_homeref_parm to $1_
  140.       !endif
  141.     !else
  142.       !set wims_homeref_parm=gl=$gl
  143.       !set 1_=!append line newglose,1,module=adm/tool/glossary&gl=0 to $1_
  144.     !endif
  145.   !else
  146.     !if _c notin _$doc
  147.       !set 1_=!append line adddoc,1,module=adm/class/adddoc&job=add&dir=$module&iniparm=$wims_homeref_parm to $1_
  148.     !endif
  149.   !endif
  150.   !if ($gl>0 and $cmd!=reply) or adm/tool/glossary notin $module
  151.     !set 1_=!append line addh,1,module=adm/class/addmodule&job=helpexo&dir=$module&iniparm=$wims_homeref_parm to $1_
  152.   !endif
  153. !endif
  154. !if $wims_user=supervisor and $module=adm/doc
  155.   !set 1_=!append line doch_docs,1,module=adm/doc&job=home to $1_
  156. !endif
  157. !if $special_parm4=$empty
  158.   !if $cmd!=intro and $cmd!=help and $module!=home and \
  159.     ../adm/ notin ../$module and \
  160.       (../devel/ notin ../$module or $wims_devel_modules iswordof open) \
  161.       and exercise isin $module_category
  162.     !set wims_homeref_parm=!replace internal % by %25 in $module_init_parm
  163.     !set wims_homeref_parm=!replace internal + by %2B in $wims_homeref_parm
  164.     !set wims_homeref_parm=!replace internal & by %26 in $wims_homeref_parm
  165.     !set wims_homeref_parm=!replace internal ; by %3B in $wims_homeref_parm
  166.     !set wims_homeref_parm=!lines2rows $wims_homeref_parm
  167.     !set 1_=!append line add,1,module=adm/class/addmodule&dir=$module&scoring=$module_scoring&iniparm=$wims_homeref_parm to $1_
  168.     !set 1_=!append line addh,1,module=adm/class/addmodule&job=helpexo&dir=$module&scoring=$module_scoring&iniparm=$wims_homeref_parm to $1_
  169.   !endif
  170.   !if $wims_user=supervisor and exam notin $session and \
  171.     ..classes/ notin ..$module and ..adm/ notin ..$module and \
  172.     ..devel/ notin ..$module and \
  173.       GNU isin $module_copyright and \
  174.       _check notin $session and \
  175.       $class_importation!=no and $thisexo!=
  176.     !set 1_=!append line import,1,module=adm/createxo&existing=$thisexo&catmodule=$module to $1_
  177.   !endif
  178.  
  179. !else
  180.   !! ----- place pour ajouter le lien vers la modification de serie dans une feuille
  181.   !if $cmd!=intro and $cmd!=help and $module!=home and \
  182.       ../adm/ notin ../$module and \
  183.       (../devel/ notin ../$module or $wims_devel_modules iswordof open)
  184.     !set wims_homeref_parm=!replace % by %25 in $module_init_parm
  185.     !set wims_homeref_parm=!replace + by %2B in $wims_homeref_parm
  186.     !set wims_homeref_parm=!replace & by %26 in $wims_homeref_parm
  187.     !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_
  188.   !endif
  189. !endif
  190. !! add module links to general links with a separation
  191. !if $wims_menu_items!=$empty
  192.   !set 1_=!append line itemsep,0,\
  193. $wims_menu_items to $1_
  194. !endif
  195. !if $wims_user=supervisor and $cmd!=intro and $cmd!=help and $module!=home and \
  196.     ../adm/ notin ../$module and ($module_category!=document or $job=exosource)\
  197.     and $module_category!=help
  198.   !!last condition is for the uniq module help/main.$lang
  199.   !if $job=exosource
  200.     !set tmp=back2
  201.     !if $block!=$empty
  202.       !set docbl=block=$block
  203.     !else
  204.       !reset docbl
  205.     !endif
  206.   !else
  207.     !set tmp=moduback
  208.   !endif
  209.   !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_
  210. !endif
  211. !! next exo and prev exo in the menu for supervisor
  212. !if $wims_user=supervisor and $exoprev$exonext != $empty and $wims_sheet=$empty
  213.   !set 1_=!append line itemsep,0\
  214. prev,1,cmd=new&module=$module&exo=$exoprev&special_parm=$special_parm&special_parm2=$special_parm2&special_parm3=$special_parm3&special_parm4=$special_parm4  \
  215. to $1_
  216.   !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  \
  217. to $1_
  218.   !reset exoprev exonext
  219. !endif
  220.  
  221. !if $special_parm4=$empty
  222.   !if $cmd!=intro and $cmd!=help and $module!=home and \
  223.       ../adm/ notin ../$module and \
  224.       (../devel/ notin ../$module or $wims_devel_modules iswordof open) \
  225.       and oef isin $module_category and $wims_classification_open=yes and ../devel/ notin ../$module
  226.     !set 1_=!append line itemsep,0,\
  227.     Indexation,4,module=adm/tool/classification&refdir=$module&iniparm=$wims_homeref_parm,test to $1_
  228.   !endif
  229. !endif
  230. !if $module_score!=$empty and $wims_class_exolog>0 and E notin $wims_sheet
  231.   !set 1_=!append line exolog,1,module=adm/class/exolog&cmd=new&job=log&logsheet=$wims_sheet&logexo=$wims_exo to $1_
  232. !endif
  233.  
  234.  
  235. !! When in lightpopup mode, only links in whitelist are available
  236.  
  237. !if yes isin $wims_lightpopup
  238.   !set whitelist = nextseries,previousseries
  239.   !set nb_elem=!linecnt $1_
  240.   !for a=1 to $nb_elem
  241.     !set element = !line $a of $1_
  242.     !set id = !item 1 of $element
  243.     !if $id isitemof $whitelist
  244.       !set wims_rm_0 = !append line $element to $wims_rm_0
  245.     !endif
  246.   !next
  247. !else
  248.   !set wims_rm_0=$1_
  249. !endif
  250.  
  251. !set wims_rm_3=!append line $wims_menu_tabs to $wims_rm_3
  252. :rm2
  253. !if $wims_rm_2!=$empty
  254.   !goto rmend
  255. !endif
  256. !reset 2_
  257.  
  258. !!********* Link #8 : "Author(s)"
  259.  
  260. !if $module_author!=$empty and @ isin $module_address
  261.   !read namewriting.phtml $module_author
  262.   !set wims_homeref_author_num=$script_cnt
  263.   !set module_address=!replace internal ; by , in $module_address
  264.   !if $wims_homeref_author_num>1
  265.     !set 3_=$wims_name_authors:
  266.   !else
  267.     !set 3_=$wims_name_author:
  268.   !endif
  269.   !set 4_=
  270.   !for ad=1 to $wims_homeref_author_num
  271.     !if $(module_address[$ad])!= and @ isin $(module_address[$ad])
  272.       !set 4__=!mailurl $(module_address[$ad]) $(script_out[$ad])\
  273. WIMS $module_title [$module_language]
  274.     !else
  275.       !set 4__=$(script_out[$ad])
  276.    !endif
  277.   !set 4_=!append item $4__ to $4_
  278.   !next
  279.   !set 2_=!append line author,0,$3_ $4_ to $2_
  280. !endif
  281.  
  282. !!********* Link #9 : "Translator(s)"
  283. !set mod_transl=$(module_translator_$lang)
  284. !if $module_transl!=$empty
  285.   !set module_translator=$mod_transl
  286.   !set module_translator_address=$(module_translator_address_$lang)
  287. !endif
  288.  
  289. !if $module_translator!=$empty and $module_translator_address!=$empty
  290.   !read namewriting.phtml $module_translator
  291.   !set module_translator=$(script_out[1])
  292.   !set wims_homeref_translator_num=$script_cnt
  293.   !set module_translator_address=!replace internal ; by , in $module_translator_address
  294.   !for ad=1 to $wims_homeref_translator_num
  295.     !set 3_=!mailurl $(module_translator_address[$ad]) $(module_translator[$ad])\
  296. WIMS $module_title [$module_language]
  297.     !set 2_=!append line trans,0,$wims_name_translatedby $3_ to $2_
  298.   !next
  299. !endif
  300. !if $wims_theme_version>=1
  301.   !reset 2_
  302. !endif
  303. !set 2_=!append line syou,0,$wims_name_syou to $2_
  304. !set 2_=!append line class,0,$wims_classname ($wims_institutionname) to $2_
  305.  
  306. !read date.phtml $wims_now,noprint
  307. !set 2_=!append line time,0,$wims_name_server_time: $slib_out to $2_
  308. !set wims_rm_2=$2_
  309. !set wims_rm_5=$5_
  310.  
  311. :rmend
  312. !set wims_homeref_n1=!linecnt $wims_rm_1
  313. !set wims_homeref_n2=!linecnt $wims_rm_2
  314. !set wims_homeref_n0=!linecnt $wims_rm_0
  315. !set wims_homeref_n3=!linecnt $wims_rm_3
  316. !!</div><!--div dans homeref_supervisor-->
  317. !set wims_homeref_n5=!linecnt $wims_rm_5
  318. !set wims_homeref_local_n0=!linecnt $wims_local_menu_items
  319. !read themes.phtml tail
  320. !robottrap
  321.