def get_show(self):
     if not ISliderPage.providedBy(self.context):
         return False
     else:
         if len(self.settings.slides) == 0:
             return False
         else:
             return self.override_hidden or self.settings.show
예제 #2
0
 def get_show(self):
     if not ISliderPage.providedBy(self.context):
         return False
     else:
         if len(self.settings.slides) == 0:
             return False
         else:
             return self.override_hidden or self.settings.show
예제 #3
0
    def disable(self):
        utils = getToolByName(self.context, 'plone_utils')

        if ISliderPage.providedBy(self.context):
            noLongerProvides(self.context, ISliderPage)
            self.context.reindexObject(idxs=['object_provides'])

            #now delete the annotation
            annotations = IAnnotations(self.context)
            metadata = annotations.get('collective.easyslider', None)
            if metadata is not None:
                del annotations['collective.easyslider']

            utils.addPortalMessage("Slider removed.")

        self.request.response.redirect(self.context.absolute_url())
예제 #4
0
    def disable(self):
        utils = getToolByName(self.context, 'plone_utils')

        if ISliderPage.providedBy(self.context):
            noLongerProvides(self.context, ISliderPage)
            self.context.reindexObject(idxs=['object_provides'])

            #now delete the annotation
            annotations = IAnnotations(self.context)
            metadata = annotations.get('collective.easyslider', None)
            if metadata is not None:
                del annotations['collective.easyslider']

            utils.addPortalMessage("Slider removed.")

        self.request.response.redirect(self.context.absolute_url())
예제 #5
0
    def enable(self):
        utils = getToolByName(self.context, 'plone_utils')

        if utils.browserDefault(self.context)[1][0] == "sliderview":
            utils.addPortalMessage("You can not add a slider to a page with a"
                                   "Slider view already!")
            self.request.response.redirect(self.context.absolute_url())

        elif not ISliderPage.providedBy(self.context):
            alsoProvides(self.context, ISliderPage)
            self.context.reindexObject(idxs=['object_provides'])
            utils.addPortalMessage("You have added a slider to this page. "
                                   " To customize, click the 'Slider "
                                   "Settings' button.")
            self.request.response.redirect('%s/@@slider-settings' % (
                self.context.absolute_url()))
        else:
            self.request.response.redirect(self.context.absolute_url())
예제 #6
0
    def enable(self):
        utils = getToolByName(self.context, 'plone_utils')

        if utils.browserDefault(self.context)[1][0] == "sliderview":
            utils.addPortalMessage("You can not add a slider to a page with a"
                                   "Slider view already!")
            self.request.response.redirect(self.context.absolute_url())

        elif not ISliderPage.providedBy(self.context):
            alsoProvides(self.context, ISliderPage)
            self.context.reindexObject(idxs=['object_provides'])
            utils.addPortalMessage("You have added a slider to this page. "
                                   " To customize, click the 'Slider "
                                   "Settings' button.")
            self.request.response.redirect('%s/@@slider-settings' %
                                           (self.context.absolute_url()))
        else:
            self.request.response.redirect(self.context.absolute_url())
예제 #7
0
 def enabled(self):
     return ISliderPage.providedBy(self.context)
예제 #8
0
 def enabled(self):
     return ISliderPage.providedBy(self.context)