There a mod called menu system that you may be able to borrow code from. Also I can see some hand coded words like UCP, not sure that will pass it in into the style database.
Please note that I will not be porting any of my mods to phpBB 3.1. Sorry for the inconvenience this may cause.