Subversion Repositories wimsdev

Rev

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