# Path: feincms/module/page/extensions/navigation.py
# class NavigationExtension(metaclass=TypeRegistryMetaClass):
#     """
#     Base class for all navigation extensions.
# 
#     The name attribute is shown to the website administrator.
#     """
# 
#     name = _("navigation extension")
# 
#     def children(self, page, **kwargs):
#         """
#         This is the method which must be overridden in every navigation
#         extension.
# 
#         It receives the page the extension is attached to, the depth up to
#         which the navigation should be resolved, and the current request object
#         if it is available.
#         """
# 
#         raise NotImplementedError
# 
# class PagePretender:
#     """
#     A PagePretender pretends to be a page, but in reality is just a shim layer
#     that implements enough functionality to inject fake pages eg. into the
#     navigation tree.
# 
#     For use as fake navigation page, you should at least define the following
#     parameters on creation: title, url, level. If using the translation
#     extension, also add language.
#     """
# 
#     pk = None
# 
#     # emulate mptt properties to get the template tags working
#     class _mptt_meta:
#         level_attr = "level"
# 
#     def __init__(self, **kwargs):
#         for k, v in kwargs.items():
#             setattr(self, k, v)
# 
#     def get_absolute_url(self):
#         return self.url
# 
#     def get_navigation_url(self):
#         return self.get_absolute_url()
# 
#     def get_level(self):
#         return self.level
# 
#     def get_children(self):
#         """overwrite this if you want nested extensions using recursetree"""
#         return []
# 
#     def available_translations(self):
#         return ()
# 
#     def get_original_translation(self, page):
#         return page
# 
#     def short_title(self):
#         return shorten_string(self.title)


from feincms.module.page.extensions.navigation import NavigationExtension, PagePretender


class PassthroughExtension(NavigationExtension):
    # See PagesTestCase.test_23_navigation_extension
    name = "passthrough extension"

    def children(self, page, **kwargs):
        yield from page.children.in_navigation()



# Path: feincms/module/page/extensions/navigation.py
# class NavigationExtension(metaclass=TypeRegistryMetaClass):
#     """
#     Base class for all navigation extensions.
# 
#     The name attribute is shown to the website administrator.
#     """
# 
#     name = _("navigation extension")
# 
#     def children(self, page, **kwargs):
#         """
#         This is the method which must be overridden in every navigation
#         extension.
# 
#         It receives the page the extension is attached to, the depth up to
#         which the navigation should be resolved, and the current request object
#         if it is available.
#         """
# 
#         raise NotImplementedError
# 
# class PagePretender:
#     """
#     A PagePretender pretends to be a page, but in reality is just a shim layer
#     that implements enough functionality to inject fake pages eg. into the
#     navigation tree.
# 
#     For use as fake navigation page, you should at least define the following
#     parameters on creation: title, url, level. If using the translation
#     extension, also add language.
#     """
# 
#     pk = None
# 
#     # emulate mptt properties to get the template tags working
#     class _mptt_meta:
#         level_attr = "level"
# 
#     def __init__(self, **kwargs):
#         for k, v in kwargs.items():
#             setattr(self, k, v)
# 
#     def get_absolute_url(self):
#         return self.url
# 
#     def get_navigation_url(self):
#         return self.get_absolute_url()
# 
#     def get_level(self):
#         return self.level
# 
#     def get_children(self):
#         """overwrite this if you want nested extensions using recursetree"""
#         return []
# 
#     def available_translations(self):
#         return ()
# 
#     def get_original_translation(self, page):
#         return page
# 
#     def short_title(self):
#         return shorten_string(self.title)


# Path: tests/testapp/navigation_extensions.py
from feincms.module.page.extensions.navigation import NavigationExtension, PagePretender



class PassthroughExtension(NavigationExtension):
    # See PagesTestCase.test_23_navigation_extension
    name = "passthrough extension"

    def children(self, page, **kwargs):
        yield from page.children.in_navigation()



class PretenderExtension(NavigationExtension):