예제 #1
0
    def items(self):
        menu = []
        m_context = PLONESOCIAL.context(self.context)
        if m_context:
            m_base = m_context.absolute_url() + '/'
            menu.extend([
                dict(url=m_base + '@@stream',
                     title=m_context.Title() + ' updates',
                     state='localstream')
            ])

        base = self.portal_url() + '/'
        menu.extend(
            [dict(url=base + '@@stream', title='Explore', state='explore')])
        if PLONESOCIAL.network:
            menu.extend([
                dict(url=base + '@@stream/network',
                     title='My network',
                     state='stream'),
                dict(url=base + '@@author',
                     title='My profile',
                     state='profile')
            ])
        for item in menu:
            if self.request.URL == item['url']:
                item['state'] = 'active'
        return menu
예제 #2
0
 def title(self):
     m_context = PLONESOCIAL.context(self.context)
     if m_context:
         return m_context.Title() + ' updates'
     elif self.explore:
         return _(u'Explore')
     else:
         return _(u'My network')
 def __init__(self, context, request, view):
     self.context = context
     self.request = request
     self.view = self.__parent__ = view
     # @@activitystream_portal renders this as a portlet
     self.portlet_data = None
     # @@stream renders this optionally with a tag filter
     self.tag = None
     # @@stream and plonesocial.network:@@author
     # render this optionally with a users filter
     self.users = None
     self.microblog_context = PLONESOCIAL.context(context)
 def __init__(self, context, request, view):
     self.context = context
     self.request = request
     self.view = self.__parent__ = view
     # @@activitystream_portal renders this as a portlet
     self.portlet_data = None
     # @@stream renders this optionally with a tag filter
     self.tag = None
     # @@stream and plonesocial.network:@@author
     # render this optionally with a users filter
     self.users = None
     self.microblog_context = PLONESOCIAL.context(context)
    def items(self):
        menu = []
        m_context = PLONESOCIAL.context(self.context)
        if m_context:
            m_base = m_context.absolute_url() + "/"
            menu.extend([dict(url=m_base + "@@stream", title=m_context.Title() + " updates", state="localstream")])

        base = self.portal_url() + "/"
        menu.extend([dict(url=base + "@@stream", title="Explore", state="explore")])
        if PLONESOCIAL.network:
            menu.extend(
                [
                    dict(url=base + "@@stream/network", title="My network", state="stream"),
                    dict(url=base + "@@author", title="My profile", state="profile"),
                ]
            )
        for item in menu:
            if self.request.URL == item["url"]:
                item["state"] = "active"
        return menu