Subversion Repositories wimsdev

Rev

Rev 13562 | Rev 15909 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. !!************** homeref.phtml  ****************
  2. !! This File creates 2 sets of links, to put in the left menu or tail menu of Wims.
  3. !! 1st set contains up to 6 links
  4. !! 2nd set contains informations about author(s), and mail links to them.
  5. !! **********************************************
  6. <!-- begin of html/homeref.phtml -->
  7.  
  8. !if yes isin $wims_lightpopup
  9.   !if $wims_lightpopup_option=$empty
  10.     !set 1_=!append line itemsep,0, $wims_name_devwims to $1_
  11.     !set 1_=!append line itemsep,0, $wims_name_Author: $module_author to $1_
  12.     !set wims_rm_2=$1_
  13.     !goto rmend
  14.   !else
  15.     !if about isitemof $wims_lightpopup_option
  16.       !set 1_=!append line about,4,module=$module&cmd=help&special_parm=about,mhelp to $1_
  17.     !endif
  18.     !set wims_rm_1=$1_
  19.     !goto rmend
  20.   !endif
  21. !endif
  22.  
  23. !if robot isin $session or _check isin $session
  24.   !if robot isin $session and wims.unice.fr notin $httpd_SERVER_NAME\
  25.       and $cmd iswordof new intro
  26.     !set wims_c1=!char 1 of $module
  27.     !if $wims_c1 isin ABCDEFGHIJKLMNOPQRSTUVWXYZ or ../tool isin ../$module
  28.       !set wims_md=!translate . to , in $module
  29.       !set wims_md=!item -1 of $wims_md
  30.       !set wims_mdcnt=!charcnt $wims_md
  31.       !if $wims_mdcnt=2
  32.         !set wims_ff=!translate / to ~ in $module
  33.         <small><a href="http://wims.unice.fr/wims/$(wims_md)_$wims_ff.html">The most recent version</a></small><br/>
  34.       !endif
  35.     !endif
  36.   !endif
  37.   !changeto robotref.phtml
  38. !endif
  39.  
  40. !if $wims_mode=popup
  41.   <div class="wimstail">
  42.     <hr/>
  43.     <small>
  44.      <a target="wims" href="http://$httpd_HTTP_HOST$httpd_SCRIPT_NAME">WIMS @ $httpd_HTTP_HOST</a>
  45.     </small>
  46.   </div>
  47.   !exit
  48. !endif
  49.  
  50. !if _test isin $session and $wims_hacked_variables!=$empty
  51.   <p><span class="wims_warning">WIMS WARNING</span>. The following variables of your module could be hacked
  52.   by students using manually modified http addresses! You might want to put more
  53.   strict permissions to them in var.def, in order to build a secure exercise module.
  54.   </p>
  55.   <pre>$wims_hacked_variables</pre>
  56. !endif
  57.  
  58. !read name.phtml.$module_language
  59. !read themes/_lang/name.phtml.$lang
  60. !read themes/$wims_theme/lang/name.phtml.$lang
  61. !default wims_homeref_bgcolor=$wims_ref_bgcolor
  62.  
  63. !if $wims_rm_1=no
  64.   !reset wims_rm_1
  65.   !goto local
  66. !endif
  67. !if $wims_rm_1!=$empty
  68.   !goto rm2
  69. !endif
  70. !reset 1_
  71.  
  72. !!********* Link #1 : "Close Window" or "Home" (Not Shown if Embedded)
  73. !if _ isin $wims_subsession
  74.   !set 1_=!append line back,3,window.close() to $1_
  75. !else
  76.   !if $window != embeded
  77.     !!set 1_=!append line home,1,session=$wims_session.1 to $1_
  78.   !endif
  79. !endif
  80.  
  81. !!********* Link #2 : "Sheet"
  82. !if $wims_sheet>0 or P isin $wims_sheet
  83.   !if $wims_sequence>0
  84.     !set tmp_=sheet,1,module=adm/sheet&sh=$wims_sheet&seq=$wims_sequence
  85.   !else
  86.     !set tmp_=sheet,1,module=adm/sheet&sh=$wims_sheet&
  87.   !endif
  88.   !set 1_=!append line $tmp_ to $1_
  89.   !let wims_menu_items=!append line $tmp_ to $wims_menu_items
  90.   !let p=!positionof item $wims_exo in $wims_listexo
  91.   !if $wims_exo!=$(wims_listexo[1])
  92.     !let wims_menu_items=!append line previousseries,1,module=home&directworksheet=$wims_sheet.$(wims_listexo[$p-1]) to $wims_menu_items
  93.   !endif
  94.   !if $wims_exo!=$(wims_listexo[-1])
  95.     !let wims_menu_items=!append line nextseries,1,module=home&directworksheet=$wims_sheet.$(wims_listexo[$p+1]) to $wims_menu_items
  96.   !endif
  97. !endif
  98.  
  99. !if ($wims_user=$empty or $wims_developer!=$empty or $wims_user=supervisor)\
  100.     and $exoprev$exonext != $empty and $wims_sheet=$empty
  101.   !set wims_menu_items=!append line itemsep,0\
  102. prev,1,cmd=new&module=$module&exo=$exoprev&wims_seedcnt=0&special_parm=$special_parm&special_parm2=$special_parm2&special_parm3=$special_parm3&special_parm4=$special_parm4 \
  103.      to $wims_menu_items
  104.   !set wims_menu_items=!append line next,1,cmd=new&module=$module&exo=$exonext&wims_seedcnt=0&special_parm=$special_parm&special_parm2=$special_parm2&special_parm3=$special_parm3&special_parm4=$special_parm4 \
  105. to $wims_menu_items
  106.   !reset exoprev exonext
  107. !endif
  108.  
  109. !!********* Link #3 : "Resume"
  110. !if $cmd=help or $cmd=hint
  111.   !set 1_=!append line resume,1,cmd=resume to $1_
  112. !endif
  113.  
  114. !!********* Link #4 : "Introduction" (Not Shown if Embedded)
  115. !if $window != embeded and $module_has_intro=yes and $cmd notwordof intro help
  116.   !set 1_=!append line intro,1,module=$module&cmd=intro&special_parm=$special_parm&special_parm2=$special_parm2&special_parm3=$special_parm3 to $1_
  117. !endif
  118.  
  119. !if _ notin $wims_session and adm/ notin $module and home notin $module\
  120.   and $cmd notwordof help ref
  121.  !!!set 1_=!append line reference,4,module=$module&cmd=ref&special_parm=$cmd,ref to $1_
  122. !endif
  123.  
  124. !!********* Link #5 : "Help"
  125. !if $module_help!=$empty and $module_has_help=yes and $cmd notwordof intro help
  126.   !if $module_help=popup
  127.     !set 1_=!append line help,4,module=$module&cmd=help&special_parm=$wims_help_parm,mhelp to $1_
  128.   !else
  129.     !set 1_=!append line help,1,module=$module&cmd=help&special_parm=$wims_help_parm to $1_
  130.   !endif
  131. !endif
  132.  
  133. !!********* Link #6 : "About"
  134. !if $module_has_about=yes and $cmd notwordof help
  135.   !!set 1_=!append line about,4,module=$module&cmd=help&special_parm=about,mhelp to $1_
  136. !endif
  137.  
  138. !set wims_rm_1=$1_
  139. :local
  140. !reset 1_
  141. !if $wims_menu_items!=$empty
  142.   !set 1_=!append line itemsep,0,\
  143. $wims_menu_items to $1_
  144. !endif
  145. !set wims_rm_0=$1_
  146. !!wims_menu_tabs not used - to delete
  147. !set wims_rm_3=!append line $wims_menu_tabs to $wims_rm_3
  148. :rm2
  149. !if $wims_rm_2!=$empty
  150.   !goto rmend
  151. !endif
  152. !reset 2_
  153.  
  154. !!********* Link #8 : "Author(s)"
  155.  
  156. !if $module_author!=$empty and (@ isin $module_address or $module_address=$empty)
  157.   !read namewriting.phtml $module_author
  158.   !set module_address=!replace internal ; by , in $module_address
  159.   !set wims_homeref_author_num=$script_cnt
  160.   !if $wims_homeref_author_num>1
  161.     !set 3_=$wims_name_authors:
  162.   !else
  163.     !set 3_=$wims_name_author:
  164.   !endif
  165.   !set 4_=
  166.   !for ad=1 to $wims_homeref_author_num
  167.     !set adreplace=$(module_address[$ad])
  168.     !if $adreplace=$empty
  169.       !set adreplace=$module_maintainer_address
  170.     !endif
  171.     !if $adreplace!= and @ isin $adreplace
  172.       !!!#### xiao treatment - should disappear when modules are republished
  173.      !if xiao isin $adreplace
  174.         !set adreplace=qualite@wimsedu.info
  175.       !endif
  176.       !!!####
  177.      !set 4__=!mailurl $adreplace $(script_out[$ad])\
  178. WIMS $module_title [$module_language]
  179.     !else
  180.       !set 4__=$(script_out[$ad])
  181.     !endif
  182.     !set 4_=!append item $4__ to $4_
  183.   !next
  184.   !set 2_=!append line author,0,$3_ $4_ to $2_
  185. !endif
  186.  
  187. !!********* Link #9 : "Translator(s)"
  188. !set mod_transl=$(module_translator_$lang)
  189. !if $module_transl!=$empty
  190.   !set module_translator=$mod_transl
  191.   !set module_translator_address=$(module_translator_address_$lang)
  192. !endif
  193.  
  194. !if $module_translator!=$empty and $module_translator_address!=$empty
  195.   !read namewriting.phtml $module_translator
  196.   !set module_translator_address=!replace internal ; by , in $module_translator_address
  197.   !set module_translator=$(script_out[1])
  198.   !set wims_homeref_translator_num=$script_cnt
  199.   !for ad=1 to $wims_homeref_translator_num
  200.     !set 3_=!mailurl $(module_translator_address[$ad]) $(module_translator[$ad])\
  201. WIMS $module_title [$module_language]
  202.     !set 2_=!append line trans,0,$wims_name_translatedby $3_ to $2_
  203.   !next
  204. !endif
  205.  
  206. !!********* Link #10 : "Version & Copyright"
  207. !if $module_version$module_copyright!=$empty
  208.   !set 2_=!append line version,0,$wims_name_Version $module_version, $module_copyright to $2_
  209. !endif
  210.  
  211. !!********* Link #11 : "Modify"
  212. !if $wims_developer!=$empty and COPYING isin $module_copyright
  213.   !set V_=!char 1 of $module
  214.   !set M_=!translate internal / to , in $module
  215.   !set M_=!item 1 of $M_
  216.   !if $V_ isin ABCDEFGHIJKLMNOPQRTSUVWXYZ or $M_ iswordof local contrib tool
  217.     !set  wims_rm_0=!append line modify,1,module=adm/modtool&original=$module to $wims_rm_0
  218.   !endif
  219. !endif
  220.  
  221. !!********* Link #12 : "Server Time"
  222. !if $wims_ismanager>=2
  223.   !set 2_=!append line time,0,$wims_name_server_time: $wims_now to $2_
  224. !endif
  225.  
  226. !set wims_rm_2=$2_
  227.  
  228. :rmend
  229. !set wims_homeref_n0=!linecnt $wims_rm_0
  230. !set wims_homeref_n1=!linecnt $wims_rm_1
  231. !set wims_homeref_n2=!linecnt $wims_rm_2
  232. !!!set wims_homeref_n3=!linecnt $wims_rm_3
  233.  
  234. <!-- END of html/homeref.phtml -->
  235. !read themes.phtml tail
  236. !robottrap
  237.