def getMenuItems(self, context, request): """ Return menu items """ url = context.absolute_url() action = url + '/@@faceted_settings/%s' left_hidden = IHidePloneLeftColumn.providedBy(context) right_hidden = IHidePloneRightColumn.providedBy(context) smart_hidden = IDisableSmartFacets.providedBy(context) menu = [ { 'title': (_('Enable left portlets') if left_hidden else _('Disable left portlets')), 'description': '', 'action': action % 'toggle_left_column', 'selected': not left_hidden, 'icon': ('++resource++faceted_images/show.png' if left_hidden else '++resource++faceted_images/hide.png'), 'extra': { 'id': 'toggle_left_column', 'separator': None, 'class': '' }, 'submenu': None, }, { 'title': (_('Enable right portlets') if right_hidden else _('Disable right portlets')), 'description': '', 'action': action % 'toggle_right_column', 'selected': not right_hidden, 'icon': ('++resource++faceted_images/show.png' if right_hidden else '++resource++faceted_images/hide.png'), 'extra': { 'id': 'toggle_right_column', 'separator': None, 'class': '' }, 'submenu': None, }, { 'title': (_('Enable smart facets hiding') if smart_hidden else _('Disable smart facets hiding')), 'description': '', 'action': action % 'toggle_smart_facets', 'selected': not smart_hidden, 'icon': ('++resource++faceted_images/show.png' if smart_hidden else '++resource++faceted_images/hide.png'), 'extra': { 'id': 'disable_smart_facets', 'separator': None, 'class': '' }, 'submenu': None, }, ] return menu
def toggle_left_column(self, **kwargs): """ Show / hide plone portlets left column """ if IHidePloneLeftColumn.providedBy(self.context): noLongerProvides(self.context, IHidePloneLeftColumn) return self._redirect(_('Portlets left column is visible now')) else: alsoProvides(self.context, IHidePloneLeftColumn) return self._redirect(_('Portlets left column is hidden now'))
def getMenuItems(self, context, request): """ Return menu items """ url = context.absolute_url() # use format to avoid messing with url with "%" in them like # 'http://foo/stones-1/foo%20bar%20moo/@@faceted_settings/%s' action = url + '/@@faceted_settings/{0}' left_hidden = IHidePloneLeftColumn.providedBy(context) right_hidden = IHidePloneRightColumn.providedBy(context) smart_hidden = IDisableSmartFacets.providedBy(context) menu = [ { 'title': (_('Enable left portlets') if left_hidden else _('Disable left portlets')), 'description': '', 'action': action.format('toggle_left_column'), 'selected': not left_hidden, 'icon': ('++resource++faceted_images/show.png' if left_hidden else '++resource++faceted_images/hide.png'), 'extra': { 'id': 'toggle_left_column', 'separator': None, 'class': '' }, 'submenu': None, }, { 'title': (_('Enable right portlets') if right_hidden else _('Disable right portlets')), 'description': '', 'action': action.format('toggle_right_column'), 'selected': not right_hidden, 'icon': ('++resource++faceted_images/show.png' if right_hidden else '++resource++faceted_images/hide.png'), 'extra': { 'id': 'toggle_right_column', 'separator': None, 'class': '' }, 'submenu': None, }, { 'title': (_('Enable smart facets hiding') if smart_hidden else _('Disable smart facets hiding')), 'description': '', 'action': action.format('toggle_smart_facets'), 'selected': not smart_hidden, 'icon': ('++resource++faceted_images/show.png' if smart_hidden else '++resource++faceted_images/hide.png'), 'extra': { 'id': 'disable_smart_facets', 'separator': None, 'class': '' }, 'submenu': None, }, ] iscanonical = getattr(context, 'isCanonical', None) if callable(iscanonical) and not iscanonical(): inherit_config = not IDontInheritConfiguration.providedBy(context) menu.append({ 'title': (_('Disable inheriting configuration') if inherit_config else _('Enable inheriting configuration ')), 'description': '', 'action': action.format('toggle_inherit_config'), 'selected': not inherit_config, 'icon': None, 'extra': { 'id': 'toggle_inherit_config', 'separator': None, 'class': '' }, 'submenu': None, }) return menu
def showBigLogo(self): if IHidePloneLeftColumn.providedBy(self.context): #always show home page logos on faceted return True