예제 #1
0
    def get(self, scope, hashkey, plugin_hashkey):
        from core.plugins.loader import plugins
        context, mod = get_context_for_scope(scope, hashkey)
        views = plugins[plugin_hashkey].views

        context.plugin = plugins[plugin_hashkey]
        manager = ViewManager(context)
        user_views = []
        for v in views:
            data = manager.get_meta(v.hashkey)
            data['url'] = self.get_url(scope, hashkey, plugin_hashkey, v.hashkey)
            user_views.append(data)
        return user_views
예제 #2
0
    def get(self, scope, hashkey):
        from core.plugins.loader import plugins
        context, mod = get_context_for_scope(scope, hashkey)
        user_views = []
        scope_installed = [p.hashkey for p in mod.plugins]
        for key in plugins:
            p = plugins[key]
            views = p.views
            for v in views:
                context.plugin = p
                manager = ViewManager(context)
                data = manager.get_meta(v.hashkey)
                data['url'] = self.get_url(scope, hashkey, p.hashkey, v.hashkey)
                data['installed'] = False
                data['plugin'] = p.hashkey
                if p.hashkey in scope_installed:
                    data['installed'] = True
                user_views.append(data)

        return user_views