Beispiel #1
0
    def AdministrationLinks(self, context=None):
        if context:
            apps = (context,)
        else:
            apps = self.context.app.portal.GetApps()
        links = []
        for app in apps:
            if not hasattr(app, "registry"):
                continue

            # search all view modules for admin links
            for vm in app.QueryConf(IViewModuleConf):
                if not vm.get("adminLink"):
                    continue
                if not self.Allowed(vm.permission, app):
                    continue
                url = self.ResolveUrl(vm.get("adminLink"), app)
                links.append({"href":url, "title":app.configuration.title + u": " + vm.name})

            # bw.0.9.13
            # search for cms editor and public view by root
            for root in app.GetRoots():
                if ICMSRoot.providedBy(root):
                    links.append({"href":self.Url(root), "title":app.configuration.title + u": " + _(u"editor")})
                elif IWebsiteRoot.providedBy(root):
                    links.append({"href":self.Url(root), "title":app.configuration.title + u": " + _(u"public")})

        return links
Beispiel #2
0
    def AdministrationLinks(self, context=None):
        if context:
            apps = (context, )
        else:
            apps = self.context.app.portal.GetApps()
        links = []
        for app in apps:
            if not hasattr(app, "registry"):
                continue

            # search all view modules for admin links
            for vm in app.QueryConf(IViewModuleConf):
                if not vm.get("adminLink"):
                    continue
                if not self.Allowed(vm.permission, app):
                    continue
                url = self.ResolveUrl(vm.get("adminLink"), app)
                links.append({
                    "href": url,
                    "title": app.configuration.title + u": " + vm.name
                })

            # bw.0.9.13
            # search for cms editor and public view by root
            for root in app.GetRoots():
                if ICMSRoot.providedBy(root):
                    links.append({
                        "href":
                        self.Url(root),
                        "title":
                        app.configuration.title + u": " + _(u"editor")
                    })
                elif IWebsiteRoot.providedBy(root):
                    links.append({
                        "href":
                        self.Url(root),
                        "title":
                        app.configuration.title + u": " + _(u"public")
                    })

        return links
Beispiel #3
0
 def AdministrationLinks(self, context=None):
     if context:
         apps = (context,)
     else:
         apps = self.context.app.portal.GetApps()
     links = []
     for app in apps:
         if not hasattr(app, "registry"):
             continue
         # search for cms editor
         for root in app.GetRoots():
             if ICMSRoot.providedBy(root):
                 links.append({"href":self.Url(root), "title":app.configuration.title + u": " + _(u"editor")})
             elif IWebsiteRoot.providedBy(root):
                 links.append({"href":self.Url(root), "title":app.configuration.title + u": " + _(u"public")})
         # administration
         links.append({"href":self.FolderUrl(app)+u"admin", "title":app.configuration.title + u": " + _(u"administration")})
         # user management
         if IUserDatabase.providedBy(app):
             links.append({"href":self.FolderUrl(app)+u"usermanagement", "title":app.configuration.title + u": " + _(u"user management")})
     return links
Beispiel #4
0
 def AdministrationLinks(self, context=None):
     if context:
         apps = (context,)
     else:
         apps = self.context.app.portal.GetApps()
     links = []
     for app in apps:
         if not hasattr(app, "registry"):
             continue
         # search for cms editor
         for root in app.GetRoots():
             if ICMSRoot.providedBy(root):
                 links.append({"href":self.Url(root), "title":app.configuration.title + u": " + _(u"editor")})
             elif IWebsiteRoot.providedBy(root):
                 links.append({"href":self.Url(root), "title":app.configuration.title + u": " + _(u"public")})
         # administration
         links.append({"href":self.FolderUrl(app)+u"admin", "title":app.configuration.title + u": " + _(u"administration")})
         # user management
         if IUserDatabase.providedBy(app):
             links.append({"href":self.FolderUrl(app)+u"usermanagement", "title":app.configuration.title + u": " + _(u"user management")})
     return links