Perfect, you found it.
If I can permit myself, your proposal is not the best because you have copied / paste code.
Why not to use a simple parameter ?
Two better solutions :
- 8< - - If you want to use it for 2 or 4 states in your application :
You can custom JDom for recieving one parameter for this purpose. (and ckstate.php for passing this parameter like a bridge between XML and JDom)
- 8< - - If you want 'sometimes' to use it as your please and specifiying the options manually, then you can simply add sub entries in the XML file.
Look at ckstate.php, it is designed to first search in the subitems of the XML node, so if something is found it is prioritary and sent to JDom. (parameter: 'list')
Important note, I don't know if the bug is fixed now, but if you want to add sub items nodes in a FORK, then you need to fix a Joomla issue :
www.j-cook.pro/index.php/h/hacks
Hope it helps.
PS : One last tought... 'statebinary' is a wierd name. In the past this field was binary and simply named 'publish'