'Custom Layout Method'

@staticmethod
def layout(item):

    if (not item.authorized):
        item.enabled = False
        item.visible = False
    elif ((item.enabled is None) or item.enabled):
        item.enabled = True
        item.visible = True
    if (item.enabled and item.visible):
        items = item.render_components()
        if (item.parent is not None):
            _class = ((item.selected and 'selected') or '')
            if item.opts.right:
                _class = ('fright    selected' if _class else 'fright')
            else:
                _class = ('fleft    selected' if _class else 'fleft')
            _href = item.url()
            link = A(DIV(item.label, _class='hoverable'), _href=item.url(), _id=item.attr._id)
            return LI(link, _class=_class)
        else:
            return UL(items, _id='modulenav')
    else:
        return None
