# Path: nive_cms/i18n.py

# 
# Path: nive_cms/baseobjects.py
# class PageElementBase(ObjCopy, PageElement, ObjectBase):
#     """
#     *Page element* 
#     
#     - stored in database
#     - does not store subobjects
#     - stored in element containers 
#     - cut, copy and paste support
#     
#     Interfaces: ``INonContainer, IObject, IPageElement``
#     """
#     implements(IPageElement)


from nive_cms.i18n import _
from nive.definitions import StagPageElement, ObjectConf, FieldConf
from nive_cms.baseobjects import PageElementBase
    
    def GetMenuPages(self, **kw):
        """
        """
        menu = self.data.get("menutype")
        if menu == u"sub":
            return self.GetPage().GetPages(hidden=0, **kw)
        elif menu == u"level":
            p = self.GetPage().parent
            if not p:
                #root
                p = self.GetPage()
            return p.GetPages(hidden=0, **kw)
        return []


# text type definition ------------------------------------------------------------------
#@nive_module
configuration = ObjectConf(
    id = "menublock",
    name = _(u"Navigation"),
    dbparam = "menublocks",
    context = "nive_cms.menublock.menublock",
    template = "menublock.pt",
    selectTag = StagPageElement,
    icon = "nive_cms.cmsview:static/images/types/menublock.png",
    description = _(u"Element to render navigation trees and linked table of contents. The menublock can be used as main navigation for the web page.")
)

menu=[  {'id': u'sub', 'name': _(u'Sub pages')},

# Path: nive_cms/i18n.py

# 
# Path: nive_cms/baseobjects.py
# class PageElementBase(ObjCopy, PageElement, ObjectBase):
#     """
#     *Page element* 
#     
#     - stored in database
#     - does not store subobjects
#     - stored in element containers 
#     - cut, copy and paste support
#     
#     Interfaces: ``INonContainer, IObject, IPageElement``
#     """
#     implements(IPageElement)


# Path: nive_cms/menublock.py
from nive_cms.i18n import _
from nive.definitions import StagPageElement, ObjectConf, FieldConf
from nive_cms.baseobjects import PageElementBase

    
    def GetMenuPages(self, **kw):
        """
        """
        menu = self.data.get("menutype")
        if menu == u"sub":
            return self.GetPage().GetPages(hidden=0, **kw)
        elif menu == u"level":
            p = self.GetPage().parent
            if not p:
                #root
                p = self.GetPage()
            return p.GetPages(hidden=0, **kw)
        return []


# text type definition ------------------------------------------------------------------
#@nive_module
configuration = ObjectConf(
    id = "menublock",
    name = _(u"Navigation"),
    dbparam = "menublocks",
    context = "nive_cms.menublock.menublock",
    template = "menublock.pt",
    selectTag = StagPageElement,
    icon = "nive_cms.cmsview:static/images/types/menublock.png",
    description = _(u"Element to render navigation trees and linked table of contents. The menublock can be used as main navigation for the web page.")
)

menu=[  {'id': u'sub', 'name': _(u'Sub pages')},

        {'id': u'level', 'name': _(u'Same level pages')},