#!/usr/sbin/install-menu
compat="menu-1"

!include menu.h

genmenu="menu2.xml"
rootprefix="/etc/xfce4/"
userprefix=".xfce4/"
treewalk="(M)"

function ltitle()=encode_translate(lang(),title(),"UTF-8")
function charreplace($str,$toreplace,$with,$lastchar)=replacewith(escwith($str,$toreplace,$with),$toreplace,$lastchar)
function xmlesc($str)= charreplace(charreplace(charreplace(replacewith(charreplace($str, \
  "&","amp",";"),"","&"), \
  "\"","&quot",";"), \
  "<","&lt",";"), \
  ">","&gt",";")

supported
    x11=   nstring(level(), "   ") "<app name=\"" xmlesc(ltitle()) "\" cmd=\"" xmlesc($command) "\"/>\n" 
    text=  nstring(level(), "   ") "<app name=\"" xmlesc(ltitle()) "\" cmd=\""xmlesc($command) "\" term=\"yes\" />\n"
    xfce4= nstring(level(), "   ") "<builtin name=\"" xmlesc(ltitle()) "\" cmd=\"" xmlesc($command) "\"/>\n"
endsupported

startmenu= nstring(level(), "   ") "<menu name=\"" xmlesc(ltitle()) "\" visible=\"yes\">\n"
endmenu= ifneq( level(), "-1",  nstring(level(), "   ") "</menu>\n" )

postrun="touch /etc/xfce4/menu.xml*"

mainmenutitle="ALT Linux"
