!! 0 is used for title in the menu, 01 is juste some text.
!! the next line doesn't work from everywhere (for example,
!! when executing an exercise in a sheet so ... copy paste for the moment
!! must be the same as scripts/adm/oneitem.phtml
!!##!changeto adm/oneitem.phtml $wims_read_parm

!! be careful : if 3_ (url) contains a comma, there should be a confusion
!! for types 2, 3, 4, 5, 7
!! to have no bug, the url part (3_) should be coded, for example , -> %2C
!! it should have been better to put the url always in last position.
!! it would be the only way to be sure and to have no surprise.

!if $wims_theme_icon=yes
  !set wims_theme_icon=$wims_theme
!endif
!distribute items $wims_read_parm into 1_,2_,3_,4_,5_
!reset w_image
!if " isin $1_
  !set w_name=!replace internal " by in $1_
  !reset w_name1
!else
  !set w_name1=!word 1 of $1_
  !set w_name2=!word 2 to -1 of $1_
  !set w_name=$(wims_name_$(w_name1)) $w_name2
  !if $w_name issametext
    !set w_name=$1_
  !endif
!endif
!goto $2_
:0
 $(wims_read_parm[3..-1])
 !exit
:01
 $(wims_read_parm[3..-1])
 !exit
:1
 !set 3_=!item 3 to -1 of $wims_read_parm
 !set 3_=!nospace $3_
 !set wims_ref_class=$w_name1
 !default wims_ref_title=$(wims_name_title_$1_)
 !!default wims_ref_title=!detag $w_name
 !href $3_ <span>$w_name</span>
 !reset wims_ref_class wims_ref_title
 !exit
:2
 !if $4_ notsametext
  <a href="$3_" target="wims_$4_" class="$w_name1"><span class="text_item">$w_name</span></a>
 !else
  <a href="$3_" class="$w_name1"><span class="text_item">$w_name</span></a>
 !endif
 !exit
:3
 <a href="#" onclick="$3_" class="$w_name1"><span class="text_item">$w_name</span></a>
 !exit
:4
 !set wims_ref_class=$w_name1
 !default wims_ref_title=$(wims_name_title_$1_)
 !!default wims_ref_title=$w_name
 !href target=wims_$4_ $3_ <span class="text_item">$w_name</span>
 !reset wims_ref_class wims_ref_title
 !exit
:5
 <a href="$3_" class="$w_name1">$4_</a>
 !exit
:6
!! no text (only the icon - should exist)
 !set 3_=!item 3 to -1 of $wims_read_parm
 !set 3_=!nospace $3_
 !set wims_ref_class=$w_name1
 !!default wims_ref_title=$w_name
 !href $3_ <span class="show-for-sr">$w_name</span>
 !reset wims_ref_class wims_ref_title
 !exit
:7
 !set wims_ref_class=wims_button_help
 !default wims_ref_title=$(wims_name_title_$1_)
 !!default wims_ref_title=$w_name
 !href target=wims_$4_ $3_ <span>$w_name</span>
 !reset wims_ref_class wims_ref_title
 !exit
:8
 <span class="text_item $wims_ref_class">$w_name</span>
 !reset wims_ref_class
 !exit
:9
!! title is the last item
 !set 3_=!item 3 to -2 of $wims_read_parm
 !set 3_=!nospace $3_
 !set wims_ref_class=$w_name1
 !set wims_ref_title=!item -1 of $wims_read_parm
 !href $3_ $w_name
 !reset wims_ref_class wims_ref_title
 !exit
:*
