In some cases it is necessary to limit the display of interface elements depending on the state of data. For example, to hide inactive buttons. You can create an XML plugin that solves the problem:
- Create an XML file: /etc/xml/billmgr_mod_hide.xml
<mgrdata> <handler name="gotoserver_hide" type="xml"> <event name="vds" after="yes"/> </handler> </mgrdata>
- Create a Bash script for the handler: /addon/gotoserver_hide
The code in example specifies an event handler to be triggered after executing a certain action. Here, after a#!/bin/bash if [[ "${PARAM_func}" == "vds" ]] ; then sed "s:<toolbtn func=\"gotoserver\" name=\"gotoserver\" img=\"t-go\" type=\"window\"><hide name=\"transition\" value=\"off\"/><show name=\"status\" value=\"2\"/></toolbtn>::g" else cat fi
vds
event. If thevds
event is triggered, the handler uses thesed
command to replace a certain button element in the XML. Changing the XML parameters allows to hide the button. - Make the script executable with the command:
chmod +x addon/gotoserver_hide
May be useful
Useful tips: