Refactored to work in (up to) Zikula 1.3.5 in compatability mode