'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):
        if (item.parent is None):
            items = item.render_components()
            return UL(items, _id='nav')
        elif item.components:
            items = item.render_components()
            _class = ((item.selected and 'highlight') or '')
            return LI(A(item.label, _href=item.url(), _id=item.attr._id, _class=_class), UL(items, _class='sub-menu'))
        else:
            return LI(A(item.label, _href=item.url(), _id=item.attr._id))
    else:
        return None
