Beispiel #1
0
    def searchform(self, d):
        """
        assemble HTML code for the search forms
        
        @param d: parameter dictionary
        @rtype: string
        @return: search form html
        """
        _ = self.request.getText
        sitenav_pagename = wikiutil.getSysPage(self.request,
                                               'SiteNavigation').page_name
        dict = {
            'find_page_html': wikiutil.link_tag(
                self.request, d['page_find_page']+'?value='+
                              urllib.quote_plus(d['page_name'], ''),
                _('FindPage')),
            'navi_page_html': wikiutil.link_tag(self.request, sitenav_pagename,
                                                sitenav_pagename),
            'search_html': _("or search titles %(titlesearch)s, "
                             "full text %(textsearch)s or") % d,
        }
        dict.update(d)
        
        html = (
            '<form method="POST" action="%(script_name)s/%(q_page_name)s">\n'
            '<p>\n'
            '<input type="hidden" name="action" value="inlinesearch">\n'
            '%(find_page_html)s %(search_html)s %(navi_page_html)s\n'
            '</p>\n'
            '</form>' % dict)

        return html
Beispiel #2
0
          return self.finish()

        try:
            # handle request
            from Sycamore import wikiaction

            # The following "if" is to deal with various backward
            # compatability situations
            pagename = backward_compatibility(self, pagename, oldlink,
                                              oldlink_propercased)

            if action:
                handler = wikiaction.getHandler(action)
                if handler:
                    handler(pagename or
                            wikiutil.getSysPage(self,
                                self.config.page_front_page).page_name, self)
                else:
                    self.http_headers()
                    self.write("<p>" + _("Unknown action"))
            else:
                if self.form.has_key('goto'):
                    query = self.form['goto'][0].strip()
                elif pagename:
                    query = pagename
                else:
                    query = wikiutil.unquoteWikiname(self.query_string) or \
                        wikiutil.getSysPage(self,
                            self.config.page_front_page).proper_name()

                try:
                    Page(query, self).send_page(count_hit=1)