Posted to tcl by mookie at Sun Aug 01 13:52:55 GMT 2021view raw

  1. namespace eval menu {
  2. }
  3.  
  4. ####
  5. proc menu::showMenuBar { args } {
  6. try {
  7. set debug [lindex $args 0]
  8. set menuBar [getFormValue about] ;#7c61626f75745f6d656e75 ~ |about_menu
  9. ;#7c61626f75745f72657475726e ~ |about_return
  10. ####
  11. set split [lindex [split [2Base $menuBar] "|"] 1] ;# Split the value of the menuBar by |
  12. ####
  13. ;# Switch based on split to determine what we show next
  14. ;# Assign the menus to display
  15.  
  16. switch $split {
  17. about_menu { dict create mookie system menu 1 } ;#Problematic Switch Case
  18. about_return { dict create mookie system menu 0 }
  19. default { set myMenuBar "[menu::about 0]"}
  20. } ;#end switch
  21.  
  22. ####
  23. set myList [hexList "%menu" "[menu::about 1]"]
  24. set craft [neonCrystal::getCraft neonMenu] ;# Load the craftsheet
  25. set hex [tagSwap $craft $myList ] ;# Preform morphing of tags with values
  26. ###
  27. ixc::returnHtml [2Base "$hex"] ;# Output final HTML layout with morphed values
  28. #
  29. } on error {err msg} {
  30. set craft [neonCrystal::getCraft neonMenu]
  31. set myList "[hexList "%menu" "$err"]"
  32. set hex [tagSwap $craft $myList ]
  33. #
  34. ixc::returnHtml [2Base "$hex"]
  35. } ;#end try
  36. } ;#end proc
  37. ####
  38.  
  39. ####
  40. proc menu::about {menu_state} {
  41. # depends on which menu is selected and permissions
  42. # Switch operations to display the following:
  43. ## 0 - About Button
  44. ## 1 - Return Button
  45.  
  46. set about_menu [2Hex "|about_menu"] ;# Encode the value to |about_menu to Hex
  47. set about_return [2Hex "|about_return"] ;# Encode the value to |about_return to Hex
  48.  
  49. switch $menu_state {
  50. 0 { return [uiButton "about" "/menu" "$about_menu" "about" "button"]} ;#Display the HTML button with parameters
  51. 1 { return [uiButton "about" "/menu" "$about_return" "return" "button"]}
  52. } ;#end switch
  53. } ;#end proc
  54.  
  55. ####
  56.  
  57.