Edit detail for SearchPage-Italiano revision 1 of 1

1
Editor: Ed Leafe
Time: 2010/01/04 07:32:00 GMT-5
Note:

changed:
-
<dtml-call "RESPONSE.setHeader('Content-Type','text/html; charset=utf-8')">

<!-- search form -->
<p>
<dtml-translate domain=zwiki>Inserisci una paola o una frase e poi premi enter per cercare dentro wiki. </dtml-translate><br> 
<dtml-translate domain=zwiki>Accade la stessa cosa se usi il campo a destra. </dtml-translate>
<p>
<dtml-translate domain=zwiki>Sugg.to: Una parola lavora meglio per cercare il nome di una pagina. </dtml-translate><br>  

<dtml-translate domain=zwiki> Non rileva maiuscolo o minuscolo supporta caratteri jolli se attivi nel vostro catalogo di configuratione.</dtml-translate><br>
<dtml-translate domain=zwiki>Lascia in bianco per avere l'elenco di tutte le pagine. </dtml-translate><br>

<table border="0" width="100%">
<tr>
<td>
<form method="GET" action="&dtml-URL;">
  cerca dentro wiki<br/>
  <input name="expr" type="text" size="20" value="<dtml-var expr html_quote missing>" accesskey="s"
  /><input type="submit" name="submit" value="<dtml-translate domain=zwiki>Search </dtml-translate>" />
</form>
</td>
<td>
<form method="GET" action="http://www.google.com/custom">
  google cerca questo wiki<br />
  <input type="hidden" name="sitesearch"  value="<dtml-var "wikiUrl().split('/')[2]">" />
  <input type="hidden" name="cof" VALUE="L:&dtml-SERVER_URL;misc_/ZWiki/ZWikiPage_icon.gif"" />
  <input type="hidden" name="site" value="<dtml-var "wikiUrl().split('/')[2]">" />
  <input type="text" size="20" name="q" value="<dtml-var expr html_quote missing>" 
  /><input type="submit" VALUE="Search" />
</form>
</td>
<dtml-if "_.has_key('thoroughexpr')">
<td>
<!-- for spam hunting -->
<form method="GET" action="&dtml-URL;">
  thorough search (for spam, etc.):<br />
  <input name="thoroughexpr" type="text" size="20" value="<dtml-var thoroughexpr html_quote missing>"
  /><input type="submit" name="submit" value="<dtml-translate domain=zwiki>Search</dtml-translate>" />
</form>
</td>
</dtml-if>
</tr>
</table>

<!-- results -->
<dtml-if "_.has_key('expr')">
<dtml-let 
 wikiurl=wikiUrl
 comment="0
 # Catalog notes
 #
 # Ideally we want the user to enter one or more words and find all 
 # partial matches in page names and text, without fuss.
 # TextIndex, ZCTextIndex, TextIndexNG2 and no catalog can all produce
 # different results, depending on configuration. Also the indexes
 # are temperamental and will break with certain search expressions.
 #
 # We'll add wildcards around all words (showing the user what we're doing)
 # and try to work around known index bugs.
 #
 # Warning: the yellow highlights added by excerptAt do not always
 # correspond to the index's search strategy and can be misleading
 # (looks like partial matching when it isn't, etc.)
 #
 # Good configurations:
 # - no catalog
 #   less scalable, accurate
 # - ZCTextIndex 2.7.3
 #   allows parentheses, quotes for phrase search, boolean operators
 #   allows right truncation only
 #   doesn't like the words and, or, not
 #   doesn't like a blank expression
 # - TextIndexNG2 2.2b1
 #   enable case folding and left truncation in the index
 #   doesn't like quotes or too many wildcards
 "
 cleanexpr="_.string.replace(expr,'*','')"
 cleanexpr="_.string.replace(cleanexpr,_.chr(34),'')"
 cleanexpr="_.string.strip(cleanexpr)"
 wildcardexpr="'*'+_.string.join(_.string.split(cleanexpr),'* *')+'*'"
 titlesearchexpr=wildcardexpr
 textsearchexpr=expr
 titlehits="((cleanexpr and pages(Title=titlesearchexpr)+['dummy']) or pages()+['dummy'])[:-1]" 
 texthits="((cleanexpr and pages(text=textsearchexpr)+['dummy']) or ['dummy'])[:-1]" 
 >

<p>
<b><dtml-translate domain=zwiki>Page names matching</dtml-translate> &dtml-titlesearchexpr; (<dtml-var "_.len(titlehits)">):</b>
<br /><br />
<dtml-in titlehits sort=Title>
  <dtml-try>
    <a href="&dtml-wikiurl;/&dtml.url_quote-id;"><dtml-var "excerptAt(cleanexpr,text=formatWikiname(Title))"></a><br />
  <dtml-except>
    error<br />
  </dtml-try>
</dtml-in>

<p>
<b><dtml-translate domain=zwiki>Text matching</dtml-translate> &dtml-textsearchexpr; (<dtml-var "_.len(texthits)">):</b>
<br /><br />
<dtml-in texthits sort=Title>
  <dl>
  <dtml-try>
    <dt><a href="&dtml-wikiurl;/&dtml.url_quote-id;"><dtml-var "formatWikiname(Title)"></a></dt>
    <dd><small><em><dtml-var "pageWithName(id).excerptAt(cleanexpr,size=500)"></em></small></dd>
  </dl>
  <dtml-except>
    <dt>error</dt>
  </dtml-try>
</dtml-in>

</dtml-let>
</dtml-if>

<dtml-if "_.has_key('thoroughexpr')">
<dtml-let wikiurl=wikiUrl>
<p>
<b><dtml-translate domain=zwiki>Thorough (non-catalog) search for text matching</dtml-translate> &dtml.html_quote-thoroughexpr;:</b>
<br /><br />
<dtml-call "REQUEST.set('count',0)">
<dtml-in "aq_parent.objectValues(spec='ZWiki Page')" sort=Title>
  <dtml-unless "_.string.find(_.string.lower(_.getitem('sequence-item').raw),_.string.lower(thoroughexpr)) == -1 and _.string.find(_.string.lower(id()),_.string.lower(thoroughexpr)) == -1">
    <dtml-call "REQUEST.set('count',REQUEST.count + 1)">
    <a href="&dtml-wikiurl;/&dtml.url_quote-id;">&dtml-Title;</a>
    (<a href="&dtml-wikiurl;/&dtml.url_quote-id;/diff">diff</a>,
    <a href="&dtml-wikiurl;/&dtml.url_quote-id;/manage_change_history_page">history</a>,
    <a href="&dtml-wikiurl;/&dtml.url_quote-id;/src">src</a>)<br>
  </dtml-unless>
</dtml-in>
<p><b>(<dtml-var count>)</b>

</dtml-let>
</dtml-if>


Inserisci una paola o una frase e poi premi enter per cercare dentro wiki.
Accade la stessa cosa se usi il campo a destra.

Sugg.to: Una parola lavora meglio per cercare il nome di una pagina.

Non rileva maiuscolo o minuscolo supporta caratteri jolli se attivi nel vostro catalogo di configuratione.
Lascia in bianco per avere l'elenco di tutte le pagine.

cerca dentro wiki
google cerca questo wiki