Subversion Repositories wimsdev

Rev

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