Exemple #1
0
 def __init__(self, pagename, request):
     ActionBase.__init__(self, pagename, request)
     self.use_ticket = True
     _ = self._
     self.form_trigger = 'revert'
     self.form_trigger_label = _('Revert')
     self.method = 'POST'
Exemple #2
0
 def __init__(self, pagename, request):
     ActionBase.__init__(self, pagename, request)
     self.use_ticket = True
     _ = self._
     self.form_trigger = "revert"
     self.form_trigger_label = _("Revert")
     self.method = "POST"
 def __init__(self, pagename, request):
     ActionBase.__init__(self, pagename, request)
     self.getText = request.getText
     self.request = request
     self.use_ticket = True
     self.form_trigger = 'get'
     self.form_trigger_label = self.getText('Get cookie')
Exemple #4
0
 def __init__(self, pagename, request):
     ActionBase.__init__(self, pagename, request)
     self.use_ticket = True
     _ = self._
     self.form_trigger = 'revert'
     self.form_trigger_label = _('Revert')
     self.method = 'POST'
Exemple #5
0
 def __init__(self, pagename, request, **kw):
     ActionBase.__init__(self, pagename, request)
     self.getText = request.getText
     self.request = request
     self.use_ticket = True
     self.form_trigger = 'invite'
     self.form_trigger_label = wikiutil.escape(kw.get('button_text', [self.getText('Invite')])[0], True)
     self.template = kw.get('template', [])
     self.querytext = kw.get('text', [self.getText('Invite user to visit this page')])[0]
Exemple #6
0
 def __init__(self, pagename, request):
     ActionBase.__init__(self, pagename, request)
     self.use_ticket = True
     _ = self._
     self.form_trigger = 'Load'
     self.form_trigger_label = _('Load')
     self.pagename = pagename
     self.method = 'POST'
     self.enctype = 'multipart/form-data'
Exemple #7
0
 def __init__(self, pagename, request):
     ActionBase.__init__(self, pagename, request)
     self.use_ticket = True
     _ = self._
     self.form_trigger = 'rename'
     self.form_trigger_label = _('Rename Page')
     filterfn = re.compile(ur"^%s/.*$" % re.escape(pagename), re.U).match
     subpagenames = request.rootpage.getPageList(user='', exists=1, filter=filterfn)
     self.subpages = [pagename for pagename in subpagenames if self.request.user.may.delete(pagename)]
Exemple #8
0
 def __init__(self, pagename, request):
     ActionBase.__init__(self, pagename, request)
     self.use_ticket = True
     _ = self._
     self.form_trigger = 'Load'
     self.form_trigger_label = _('Load')
     self.pagename = pagename
     self.method = 'POST'
     self.enctype = 'multipart/form-data'
Exemple #9
0
 def __init__(self, pagename, request):
     ActionBase.__init__(self, pagename, request)
     self.use_ticket = True
     _ = self._
     self.form_trigger = "copy"
     self.form_trigger_label = _("Copy Page")
     filterfn = re.compile(ur"^%s/.*$" % re.escape(pagename), re.U).match
     pages = request.rootpage.getPageList(user="", exists=1, filter=filterfn)
     subpagenames = request.rootpage.getPageList(user="", exists=1, filter=filterfn)
     self.subpages = subpagenames
     self.users_subpages = [pagename for pagename in subpagenames if self.request.user.may.read(pagename)]
Exemple #10
0
 def __init__(self, pagename, request, **kw):
     ActionBase.__init__(self, pagename, request)
     self.getText = request.getText
     self.request = request
     self.use_ticket = True
     self.form_trigger = 'invite'
     self.form_trigger_label = wikiutil.escape(
         kw.get('button_text', [self.getText('Invite')])[0], True)
     self.template = kw.get('template', [])
     self.querytext = kw.get(
         'text', [self.getText('Invite user to visit this page')])[0]
Exemple #11
0
    def __init__(self, pagename, request, **kw):
        ActionBase.__init__(self, pagename, request)
        self.getText = request.getText
        self.request = request
        self.use_ticket = True
        self.form_trigger = 'requestinvite'
        self.form_trigger_label = wikiutil.escape(kw.get('button_text', [self.getText('Send Request')])[0], True)
        self.querytext = kw.get('text', [self.getText('Send invite request for collab')])[0]

        form = values_to_form(self.request.values)
        collab = form.get('collab', [u''])[0]
        self.collab = wikiutil.clean_input(collab).strip()
Exemple #12
0
 def __init__(self, pagename, request):
     ActionBase.__init__(self, pagename, request)
     self.use_ticket = True
     _ = self._
     self.form_trigger = 'delete'
     self.form_trigger_label = _('Delete')
     filterfn = re.compile(ur"^%s/.*$" % re.escape(pagename), re.U).match
     subpagenames = request.rootpage.getPageList(user='',
                                                 exists=1,
                                                 filter=filterfn)
     self.subpages = [
         pagename for pagename in subpagenames
         if self.request.user.may.delete(pagename)
     ]
Exemple #13
0
 def __init__(self, pagename, request):
     ActionBase.__init__(self, pagename, request)
     self.use_ticket = True
     _ = self._
     self.form_trigger = 'rename'
     self.form_trigger_label = _('Rename Page')
     filterfn = re.compile(ur"^%s/.*$" % re.escape(pagename), re.U).match
     subpagenames = request.rootpage.getPageList(user='', exists=1, filter=filterfn)
     self.subpages = [pagename for pagename in subpagenames if self.request.user.may.delete(pagename)]
     try:
         self.show_redirect = request.cfg.show_rename_redirect
     except AttributeError:
         self.show_redirect = False
     try:
         self.rename_redirect = int(self.request.form.get('rename_redirect', '0'))
     except ValueError:
         self.rename_redirect = 0
Exemple #14
0
 def __init__(self, pagename, request):
     ActionBase.__init__(self, pagename, request)
     self.use_ticket = True
     _ = self._
     self.form_trigger = 'rename'
     self.form_trigger_label = _('Rename Page')
     filterfn = re.compile(ur"^%s/.*$" % re.escape(pagename), re.U).match
     subpagenames = request.rootpage.getPageList(user='', exists=1, filter=filterfn)
     self.subpages = [pagename for pagename in subpagenames if self.request.user.may.delete(pagename)]
     try:
         self.show_redirect = request.cfg.show_rename_redirect
     except AttributeError:
         self.show_redirect = False
     try:
         self.rename_redirect = int(self.request.form.get('rename_redirect', '0'))
     except ValueError:
         self.rename_redirect = 0
     try:
         self.rename_inlinks = int(self.request.form.get('rename_inlinks', '0'))
     except ValueError:
         self.rename_inlinks = 0
    def render_msg(self, msg, msgtype):

        """
        Render 'msg' and 'msgtype'. If 'msgtype' is "dialog" then the form is
        rendered, and if only part of the form is being requested, the output
        will be only the form HTML fragment and not the entire page.
        """

        # Either render the form as a fragment of a page.

        form = self.get_form()
        update_form_only = form.get("update-form-only", ["false"])[0] == "true"
        action_attempted = form.has_key(self.form_trigger)

        if msgtype == "dialog" and update_form_only and not action_attempted:
            send_headers = get_send_headers(self.request)
            send_headers(["Content-Type: text/html; charset=%s" % config.charset])
            self.request.write(msg.render())

        # Or render the message/form within an entire page.

        else:
            ActionBase.render_msg(self, msg, msgtype)
Exemple #16
0
 def __init__(self, pagename, request):
     ActionBase.__init__(self, pagename, request)
     self.use_ticket = True
     _ = self._
     self.form_trigger = 'delete'
     self.form_trigger_label = _('Delete')
Exemple #17
0
    def __init__(self, pagename, request):
        ActionBase.__init__(self, pagename, request)

        self.page = PageEditor(request, pagename)
        self.use_ticket = True