removed the display option from index.html, yacysearch.html and yacyinteractive.html

instead, a setting at ConfigPortal.html can be made to define if the topmenu shall be shown at these pages or if there is no naviagtion at all. 

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7366 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 14 years ago
parent fc2e41e691
commit 4565b2f2c0

@ -831,6 +831,11 @@ currentSkin=pdblue
publicSurftips = true publicSurftips = true
publicSearchpage = true publicSearchpage = true
# flag to show if the top navigation bar shall be shown to all users
# if this is disabled, then the user must navigate manually from the search page
# to /Status.html to get the main memu bar back
publicTopmenu = true
# Wiki access rights # Wiki access rights
# the built-in wiki system allows by default only that the administrator is allowed to make changes # the built-in wiki system allows by default only that the administrator is allowed to make changes
# this can be changed. There are three options: # this can be changed. There are three options:

@ -30,6 +30,12 @@
<dt>URL of a Large Corporate Image</dt> <dt>URL of a Large Corporate Image</dt>
<dd><input type="text" name="promoteSearchPageGreeting.largeImage" value="#[promoteSearchPageGreeting.largeImage]#" size="60" /></dd> <dd><input type="text" name="promoteSearchPageGreeting.largeImage" value="#[promoteSearchPageGreeting.largeImage]#" size="60" /></dd>
<dt>Show Navigation Bar on Search Page?</dt>
<dd>
<input type="radio" name="publicTopmenu" value="true" #(publicTopmenu)#::checked="checked"#(/publicTopmenu)# />Show Navigation Top-Menu&nbsp;
<input type="radio" name="publicTopmenu" value="false" #(publicTopmenu)#checked="checked"::#(/publicTopmenu)# />no link to YaCy Menu (admin must navigate to /Status.html manually)
</dd>
<dt>Default Pop-Up Page</dt> <dt>Default Pop-Up Page</dt>
<dd> <dd>
<input type="radio" name="popup" value="status" #(popupStatus)#::checked="checked"#(/popupStatus)# />Status Page&nbsp; <input type="radio" name="popup" value="status" #(popupStatus)#::checked="checked"#(/popupStatus)# />Status Page&nbsp;

@ -27,6 +27,7 @@
import net.yacy.cora.protocol.RequestHeader; import net.yacy.cora.protocol.RequestHeader;
import de.anomic.data.WorkTables; import de.anomic.data.WorkTables;
import de.anomic.http.server.HTTPDFileHandler;
import de.anomic.search.Switchboard; import de.anomic.search.Switchboard;
import de.anomic.search.SwitchboardConstants; import de.anomic.search.SwitchboardConstants;
import de.anomic.server.serverObjects; import de.anomic.server.serverObjects;
@ -68,6 +69,8 @@ public class ConfigPortal {
sb.setConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, post.get(SwitchboardConstants.GREETING_SMALL_IMAGE, "")); sb.setConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, post.get(SwitchboardConstants.GREETING_SMALL_IMAGE, ""));
sb.setConfig(SwitchboardConstants.SEARCH_TARGET, post.get("target", "_self")); sb.setConfig(SwitchboardConstants.SEARCH_TARGET, post.get("target", "_self"));
sb.setConfig(SwitchboardConstants.INDEX_FORWARD, post.get(SwitchboardConstants.INDEX_FORWARD, "")); sb.setConfig(SwitchboardConstants.INDEX_FORWARD, post.get(SwitchboardConstants.INDEX_FORWARD, ""));
HTTPDFileHandler.indexForward = post.get(SwitchboardConstants.INDEX_FORWARD, "");
sb.setConfig("publicTopmenu", post.get("publicTopmenu", "true"));
} }
if (post.containsKey("searchpage_default")) { if (post.containsKey("searchpage_default")) {
sb.setConfig(SwitchboardConstants.GREETING, "P2P Web Search"); sb.setConfig(SwitchboardConstants.GREETING, "P2P Web Search");
@ -86,6 +89,7 @@ public class ConfigPortal {
prop.putHTML(SwitchboardConstants.GREETING_LARGE_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, "")); prop.putHTML(SwitchboardConstants.GREETING_LARGE_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_LARGE_IMAGE, ""));
prop.putHTML(SwitchboardConstants.GREETING_SMALL_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, "")); prop.putHTML(SwitchboardConstants.GREETING_SMALL_IMAGE, sb.getConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, ""));
prop.putHTML(SwitchboardConstants.INDEX_FORWARD, sb.getConfig(SwitchboardConstants.INDEX_FORWARD, "")); prop.putHTML(SwitchboardConstants.INDEX_FORWARD, sb.getConfig(SwitchboardConstants.INDEX_FORWARD, ""));
prop.put("publicTopmenu", sb.getConfig("publicTopmenu", "").equals("true") ? 1 : 0);
final String browserPopUpPage = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "ConfigBasic.html"); final String browserPopUpPage = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "ConfigBasic.html");
prop.put("popupFront", 0); prop.put("popupFront", 0);

@ -44,8 +44,8 @@
<li class="menugroup" id="menugroupGlobalIndex"> <li class="menugroup" id="menugroupGlobalIndex">
<h3>Search&nbsp;&amp;&nbsp;Browse</h3> <h3>Search&nbsp;&amp;&nbsp;Browse</h3>
<ul class="menu"> <ul class="menu">
<li><a href="/index.html?display=0" accesskey="s" class="MenuItemLink">Search Page</a></li> <li><a href="/index.html" accesskey="s" class="MenuItemLink">Search Page</a></li>
<li><a href="/yacyinteractive.html?display=0" class="MenuItemLink">Interactive local Search</a></li> <li><a href="/yacyinteractive.html" class="MenuItemLink">Interactive local Search</a></li>
<li><a href="/yacy/ui/" accesskey="s" class="MenuItemLink">Rich Client Search</a></li> <li><a href="/yacy/ui/" accesskey="s" class="MenuItemLink">Rich Client Search</a></li>
<li><a href="/compare_yacy.html?display=1" class="MenuItemLink">Compare Search</a></li> <li><a href="/compare_yacy.html?display=1" class="MenuItemLink">Compare Search</a></li>
<li><a href="/Ranking_p.html" class="MenuItemLink lock">Ranking Config</a></li> <li><a href="/Ranking_p.html" class="MenuItemLink lock">Ranking Config</a></li>

@ -34,17 +34,11 @@
}); });
</script> </script>
#(display)# #(topmenu)#
#%env/templates/simpleheader.template%#
<div id="kiosk">
<a href="index.html?display=2"><img src="env/grafics/close.gif" width="16" height="16" alt="close" /></a>
<span>kiosk mode</span>
</div>
::
#%env/templates/header.template%#
::
#%env/templates/embeddedheader.template%# #%env/templates/embeddedheader.template%#
#(/display)# ::
#%env/templates/simpleheader.template%#
#(/topmenu)#
<h2 class="yacy"> <h2 class="yacy">
<a href="#[promoteSearchPageGreeting.homepage]#" class="yacylogo"><img src="#[promoteSearchPageGreeting.largeImage]#" alt="yacy" style="margin: auto;"/></a><br /><br /> <a href="#[promoteSearchPageGreeting.homepage]#" class="yacylogo"><img src="#[promoteSearchPageGreeting.largeImage]#" alt="yacy" style="margin: auto;"/></a><br /><br />
@ -53,7 +47,6 @@
<form class="search" action="yacysearch.html" method="get" id="searchform" accept-charset="UTF-8"> <form class="search" action="yacysearch.html" method="get" id="searchform" accept-charset="UTF-8">
<fieldset class="maininput"> <fieldset class="maininput">
<input type="hidden" name="display" value="#[display]#" />
<input name="query" id="search" type="text" size="52" maxlength="80" value="#[former]#" /> <input name="query" id="search" type="text" size="52" maxlength="80" value="#[former]#" />
<input type="submit" name="Enter" value="Search" /> <input type="submit" name="Enter" value="Search" />
<input type="hidden" name="verify" value="true" /> <input type="hidden" name="verify" value="true" />
@ -76,7 +69,7 @@
<input type="hidden" name="indexof" value="off" /> <input type="hidden" name="indexof" value="off" />
<input type="hidden" name="meanCount" value="5" /> <input type="hidden" name="meanCount" value="5" />
</fieldset> </fieldset>
<p><a href="/index.html?searchoptions=1&amp;display=#[display]#" onclick="this.href='/index.html?searchoptions=1&amp;display=#[display]#&amp;former='+document.getElementById('searchform').search.value+'&amp;contentdom='+radioValue(document.getElementById('searchform').contentdom)">more options...</a></p> <p><a href="/index.html?searchoptions=1" onclick="this.href='/index.html?searchoptions=1&amp;former='+document.getElementById('searchform').search.value+'&amp;contentdom='+radioValue(document.getElementById('searchform').contentdom)">more options...</a></p>
<p><a href="http://www.yacy-websuche.de/wiki/index.php/En:SearchParameters">advanced parameters</a></p> <p><a href="http://www.yacy-websuche.de/wiki/index.php/En:SearchParameters">advanced parameters</a></p>
:: ::
</fieldset> </fieldset>
@ -159,13 +152,11 @@
</p> </p>
</form> </form>
#(/searchoptions)# #(/searchoptions)#
#(display)# #(topmenu)#
#%env/templates/simplefooter.template%#
::
#%env/templates/footer.template%#
::
#%env/templates/embeddedfooter.template%# #%env/templates/embeddedfooter.template%#
#(/display)# ::
#%env/templates/simplefooter.template%#
#(/topmenu)#
<p> <p>
<img src="cytag.png?icon=invisible&amp;nick=yacyh_#[clientid]#&amp;tag=search" alt=""/> <img src="cytag.png?icon=invisible&amp;nick=yacyh_#[clientid]#&amp;tag=search" alt=""/>
</p> </p>

@ -63,14 +63,6 @@ public class index {
} }
final boolean global = (post == null) ? true : post.get("resource", "global").equals("global"); final boolean global = (post == null) ? true : post.get("resource", "global").equals("global");
final boolean authenticated = sb.adminAuthenticated(header) >= 2;
int display = (post == null) ? 0 : post.getInt("display", 0);
if ((display == 1) && (!authenticated)) display = 0;
final boolean browserPopUpTrigger = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_TRIGGER, "true").equals("true");
if (browserPopUpTrigger) {
final String browserPopUpPage = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "ConfigBasic.html");
if (browserPopUpPage.startsWith("index") || browserPopUpPage.startsWith("yacysearch")) display = 2;
}
final int searchoptions = (post == null) ? 0 : post.getInt("searchoptions", 0); final int searchoptions = (post == null) ? 0 : post.getInt("searchoptions", 0);
final String former = (post == null) ? "" : post.get("former", ""); final String former = (post == null) ? "" : post.get("former", "");
@ -126,7 +118,7 @@ public class index {
prop.putHTML("cat", cat); prop.putHTML("cat", cat);
prop.put("type", type); prop.put("type", type);
prop.put("depth", "0"); prop.put("depth", "0");
prop.put("display", display); prop.put("topmenu", sb.getConfigBool("publicTopmenu", true) ? 1 : 0);
prop.putHTML("constraint", constraint); prop.putHTML("constraint", constraint);
prop.put("searchdomswitches", sb.getConfigBool("search.text", true) || sb.getConfigBool("search.audio", true) || sb.getConfigBool("search.video", true) || sb.getConfigBool("search.image", true) || sb.getConfigBool("search.app", true) ? 1 : 0); prop.put("searchdomswitches", sb.getConfigBool("search.text", true) || sb.getConfigBool("search.audio", true) || sb.getConfigBool("search.video", true) || sb.getConfigBool("search.image", true) || sb.getConfigBool("search.app", true) ? 1 : 0);
prop.put("searchdomswitches_searchtext", sb.getConfigBool("search.text", true) ? 1 : 0); prop.put("searchdomswitches_searchtext", sb.getConfigBool("search.text", true) ? 1 : 0);
@ -139,7 +131,6 @@ public class index {
prop.put("searchdomswitches_searchvideo_check", (contentdom == ContentDomain.VIDEO) ? "1" : "0"); prop.put("searchdomswitches_searchvideo_check", (contentdom == ContentDomain.VIDEO) ? "1" : "0");
prop.put("searchdomswitches_searchimage_check", (contentdom == ContentDomain.IMAGE) ? "1" : "0"); prop.put("searchdomswitches_searchimage_check", (contentdom == ContentDomain.IMAGE) ? "1" : "0");
prop.put("searchdomswitches_searchapp_check", (contentdom == ContentDomain.APP) ? "1" : "0"); prop.put("searchdomswitches_searchapp_check", (contentdom == ContentDomain.APP) ? "1" : "0");
prop.put("searchoptions_display", display);
// online caution timing // online caution timing
sb.localSearchLastAccess = System.currentTimeMillis(); sb.localSearchLastAccess = System.currentTimeMillis();

@ -1,5 +1,7 @@
function xmlhttpPost() { function xmlhttpPost() {
var searchform = document.forms['searchform']; var searchform = document.forms['searchform'];
var rsslink = document.getElementById("rsslink");
if (rsslink != null) rsslink.href="yacysearch.rss?query=" + searchform.query.value;
search(searchform.query.value); search(searchform.query.value);
} }

@ -13,22 +13,23 @@ var q = "#[query]#";
if (q != "") search(q); if (q != "") search(q);
//]]> //]]>
</script> </script>
#(display)# #(topmenu)#
#%env/templates/simpleheader.template%# #%env/templates/embeddedheader.template%#
<div id="kiosk"> ::
<a href="yacyinteractive.html?display=2"><img src="env/grafics/close.gif" width="16" height="16" alt="close" /></a> <div id="api">
<span>kiosk mode</span> <script type="text/javascript">
</div> //<![CDATA[
:: document.write("\<a id=\"rsslink\" href=\"yacysearch.rss?" + window.location.search.substring(1) + "\"\>")
<div id="api"><a href="yacysearch.json?query=yacy"><img src="env/grafics/api.png" width="60" height="40" alt="API" /></a> //]]>
<span>This page uses the JSON search API to display search results as you type. </script>
Click the API icon to see an example call to the native API. <img src="env/grafics/api.png" width="60" height="40" alt="API" /></a>
<span>This search result can also be retrieved as RSS/<a href="http://www.opensearch.org">opensearch</a> output.
The query format is similar to <a href="http://www.loc.gov/standards/sru/">SRU</a>.
Click the API icon to see an example call to the search rss API.
To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de/wiki/index.php/Dev:API">API wiki page</a>.</span> To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de/wiki/index.php/Dev:API">API wiki page</a>.</span>
</div> </div>
#%env/templates/header.template%# #%env/templates/simpleheader.template%#
:: #(/topmenu)#
#%env/templates/embeddedheader.template%#
#(/display)#
<div style="float:left"> <div style="float:left">
<form class="search small" id="searchform" action="yacyinteractive.html" method="get" onkeyup="xmlhttpPost(); return false;"> <form class="search small" id="searchform" action="yacyinteractive.html" method="get" onkeyup="xmlhttpPost(); return false;">
<h2>#[promoteSearchPageGreeting]#</h2> <h2>#[promoteSearchPageGreeting]#</h2>

@ -37,20 +37,12 @@ public class yacyinteractive {
public static serverObjects respond(final RequestHeader header, serverObjects post, final serverSwitch env) { public static serverObjects respond(final RequestHeader header, serverObjects post, final serverSwitch env) {
final Switchboard sb = (Switchboard) env; final Switchboard sb = (Switchboard) env;
final serverObjects prop = new serverObjects(); final serverObjects prop = new serverObjects();
final boolean authenticated = sb.adminAuthenticated(header) >= 2; prop.put("topmenu", sb.getConfigBool("publicTopmenu", true) ? 1 : 0);
int display = (post == null) ? 0 : post.getInt("display", 0);
if ((display == 1) && (!authenticated)) display = 0;
final boolean browserPopUpTrigger = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_TRIGGER, "true").equals("true");
if (browserPopUpTrigger) {
final String browserPopUpPage = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "ConfigBasic.html");
if (browserPopUpPage.startsWith("yacyinteractive")) display = 2;
}
String promoteSearchPageGreeting = env.getConfig(SwitchboardConstants.GREETING, ""); String promoteSearchPageGreeting = env.getConfig(SwitchboardConstants.GREETING, "");
if (env.getConfigBool(SwitchboardConstants.GREETING_NETWORK_NAME, false)) promoteSearchPageGreeting = env.getConfig("network.unit.description", ""); if (env.getConfigBool(SwitchboardConstants.GREETING_NETWORK_NAME, false)) promoteSearchPageGreeting = env.getConfig("network.unit.description", "");
prop.put("promoteSearchPageGreeting", promoteSearchPageGreeting); prop.put("promoteSearchPageGreeting", promoteSearchPageGreeting);
prop.put("promoteSearchPageGreeting.homepage", sb.getConfig(SwitchboardConstants.GREETING_HOMEPAGE, "")); prop.put("promoteSearchPageGreeting.homepage", sb.getConfig(SwitchboardConstants.GREETING_HOMEPAGE, ""));
prop.put("promoteSearchPageGreeting.smallImage", sb.getConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, "")); prop.put("promoteSearchPageGreeting.smallImage", sb.getConfig(SwitchboardConstants.GREETING_SMALL_IMAGE, ""));
prop.put("display", display);
String query = (post == null) ? "" : post.get("query", ""); String query = (post == null) ? "" : post.get("query", "");
prop.putHTML("query", query); prop.putHTML("query", query);

@ -62,10 +62,10 @@
}; };
}); });
</script> </script>
#(display)# #(topmenu)#
#%env/templates/simpleheader.template%# #%env/templates/embeddedheader.template%#
:: ::
<div id="api"> <div id="api">
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
@ -78,11 +78,9 @@ The query format is similar to <a href="http://www.loc.gov/standards/sru/">SRU</
Click the API icon to see an example call to the search rss API. Click the API icon to see an example call to the search rss API.
To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de/wiki/index.php/Dev:API">API wiki page</a>.</span> To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de/wiki/index.php/Dev:API">API wiki page</a>.</span>
</div> </div>
#%env/templates/header.template%# #%env/templates/simpleheader.template%#
:: #(/topmenu)#
#%env/templates/embeddedheader.template%#
#(/display)#
<script type="text/javascript"> <script type="text/javascript">
//<![CDATA[ //<![CDATA[
$(function() { $(function() {
@ -117,7 +115,7 @@ $(function() {
#(searchvideo)#::<input type="radio" id="video" name="contentdom" value="video" #(check)#::checked="checked"#(/check)# /><label for="video">Video</label>&nbsp;&nbsp;#(/searchvideo)# #(searchvideo)#::<input type="radio" id="video" name="contentdom" value="video" #(check)#::checked="checked"#(/check)# /><label for="video">Video</label>&nbsp;&nbsp;#(/searchvideo)#
#(searchapp)#::<input type="radio" id="app" name="contentdom" value="app" #(check)#::checked="checked"#(/check)# /><label for="app">Applications</label>#(/searchapp)# #(searchapp)#::<input type="radio" id="app" name="contentdom" value="app" #(check)#::checked="checked"#(/check)# /><label for="app">Applications</label>#(/searchapp)#
&nbsp; &nbsp;
<a href="index.html?display=#[display]#&amp;searchoptions=1&amp;count=#[count]#&amp;resource=#[resource]#&amp;urlmaskfilter=#[urlmaskfilter]#&amp;prefermaskfilter=#[prefermaskfilter]#&amp;cat=#[cat]#&amp;constraint=#[constraint]#&amp;contentdom=#[contentdom]#&amp;former=#[former]#&amp;meanCount=#[meanCount]#">more options</a> <a href="index.html?searchoptions=1&amp;count=#[count]#&amp;resource=#[resource]#&amp;urlmaskfilter=#[urlmaskfilter]#&amp;prefermaskfilter=#[prefermaskfilter]#&amp;cat=#[cat]#&amp;constraint=#[constraint]#&amp;contentdom=#[contentdom]#&amp;former=#[former]#&amp;meanCount=#[meanCount]#">more options</a>
</div> </div>
#(/searchdomswitches)# #(/searchdomswitches)#
<input type="hidden" name="former" value="#[former]#" /> <input type="hidden" name="former" value="#[former]#" />
@ -130,7 +128,6 @@ $(function() {
<input type="hidden" name="prefermaskfilter" value="#[prefermaskfilter]#" /> <input type="hidden" name="prefermaskfilter" value="#[prefermaskfilter]#" />
<input type="hidden" name="depth" value="#[depth]#" /> <input type="hidden" name="depth" value="#[depth]#" />
<input type="hidden" name="cat" value="#[cat]#" /> <input type="hidden" name="cat" value="#[cat]#" />
<input type="hidden" name="display" value="#[display]#" />
<input type="hidden" name="constraint" value="#[constraint]#" /> <input type="hidden" name="constraint" value="#[constraint]#" />
<input type="hidden" name="meanCount" value="#[meanCount]#" /> <input type="hidden" name="meanCount" value="#[meanCount]#" />
</fieldset> </fieldset>
@ -197,7 +194,7 @@ var progressbar = new Progressbar(#[results]#, document.getElementById("results"
<!-- linklist begin --> <!-- linklist begin -->
#(resultTable)#::<table width="100%"><tr class="TableHeader"><td width="30%">Media</td><td width="70%">URL</td></tr>#(/resultTable)# #(resultTable)#::<table width="100%"><tr class="TableHeader"><td width="30%">Media</td><td width="70%">URL</td></tr>#(/resultTable)#
#{results}# #{results}#
<!--#include virtual="yacysearchitem.html?item=#[item]#&eventID=#[eventID]#&display=#[display]#" --> <!--#include virtual="yacysearchitem.html?item=#[item]#&eventID=#[eventID]#" -->
#{/results}# #{/results}#
#(resultTable)#::</table>#(/resultTable)# #(resultTable)#::</table>#(/resultTable)#
<!-- linklist end --> <!-- linklist end -->
@ -205,7 +202,7 @@ var progressbar = new Progressbar(#[results]#, document.getElementById("results"
#(pageNavBottom)#::<div id="pageNavBottom" style="text-align:center">#[resnav]#</div>#(/pageNavBottom)# #(pageNavBottom)#::<div id="pageNavBottom" style="text-align:center">#[resnav]#</div>#(/pageNavBottom)#
</div> </div>
<!-- div style="width=220px;" --> <!-- div style="width=220px;" -->
<!--#include virtual="yacysearchtrailer.html?eventID=#[eventID]#&amp;display=#[display]#" --> <!--#include virtual="yacysearchtrailer.html?eventID=#[eventID]#" -->
<!-- /div --> <!-- /div -->
</div> </div>
</body> </body>

@ -84,17 +84,6 @@ public class yacysearch {
final boolean authenticated = sb.adminAuthenticated(header) >= 2; final boolean authenticated = sb.adminAuthenticated(header) >= 2;
final boolean localhostAccess = sb.accessFromLocalhost(header); final boolean localhostAccess = sb.accessFromLocalhost(header);
int display = (post == null) ? 0 : post.getInt("display", 0);
if (!authenticated) display = 2;
// display == 0: shop top menu
// display == 1: show top and left menu
// display == 2: do not show any menu
final boolean browserPopUpTrigger = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_TRIGGER, "true").equals("true");
if (browserPopUpTrigger) {
final String browserPopUpPage = sb.getConfig(SwitchboardConstants.BROWSER_POP_UP_PAGE, "ConfigBasic.html");
if (browserPopUpPage.startsWith("index") || browserPopUpPage.startsWith("yacysearch")) display = 2;
}
String promoteSearchPageGreeting = env.getConfig(SwitchboardConstants.GREETING, ""); String promoteSearchPageGreeting = env.getConfig(SwitchboardConstants.GREETING, "");
if (env.getConfigBool(SwitchboardConstants.GREETING_NETWORK_NAME, false)) promoteSearchPageGreeting = env.getConfig("network.unit.description", ""); if (env.getConfigBool(SwitchboardConstants.GREETING_NETWORK_NAME, false)) promoteSearchPageGreeting = env.getConfig("network.unit.description", "");
final String client = header.get(HeaderFramework.CONNECTION_PROP_CLIENTIP); // the search client who initiated the search final String client = header.get(HeaderFramework.CONNECTION_PROP_CLIENTIP); // the search client who initiated the search
@ -104,7 +93,8 @@ public class yacysearch {
String querystring = originalquerystring.replace('+', ' '); String querystring = originalquerystring.replace('+', ' ');
CrawlProfile.CacheStrategy snippetFetchStrategy = (post == null) ? null : CrawlProfile.CacheStrategy.parse(post.get("verify", "cacheonly")); CrawlProfile.CacheStrategy snippetFetchStrategy = (post == null) ? null : CrawlProfile.CacheStrategy.parse(post.get("verify", "cacheonly"));
final servletProperties prop = new servletProperties(); final servletProperties prop = new servletProperties();
prop.put("topmenu", sb.getConfigBool("publicTopmenu", true) ? 1 : 0);
// get segment // get segment
Segment indexSegment = null; Segment indexSegment = null;
if (post != null && post.containsKey("segment")) { if (post != null && post.containsKey("segment")) {
@ -124,7 +114,6 @@ public class yacysearch {
if (post == null || indexSegment == null || env == null || !searchAllowed) { if (post == null || indexSegment == null || env == null || !searchAllowed) {
// we create empty entries for template strings // we create empty entries for template strings
prop.put("searchagain", "0"); prop.put("searchagain", "0");
prop.put("display", display);
prop.put("former", ""); prop.put("former", "");
prop.put("count", "10"); prop.put("count", "10");
prop.put("offset", "0"); prop.put("offset", "0");
@ -574,7 +563,7 @@ public class yacysearch {
suggestion = meanIt.next(); suggestion = meanIt.next();
prop.put("didYouMean_suggestions_"+meanCount+"_word", suggestion); prop.put("didYouMean_suggestions_"+meanCount+"_word", suggestion);
prop.put("didYouMean_suggestions_"+meanCount+"_url", prop.put("didYouMean_suggestions_"+meanCount+"_url",
QueryParams.navurl("html", 0, display, theQuery, suggestion, originalUrlMask.toString(), theQuery.navigators) QueryParams.navurl("html", 0, theQuery, suggestion, originalUrlMask.toString(), theQuery.navigators)
); );
prop.put("didYouMean_suggestions_"+meanCount+"_sep","|"); prop.put("didYouMean_suggestions_"+meanCount+"_sep","|");
meanCount++; meanCount++;
@ -634,7 +623,7 @@ public class yacysearch {
resnav.append("<img src=\"env/grafics/navdl.gif\" alt=\"arrowleft\" width=\"16\" height=\"16\" />&nbsp;"); resnav.append("<img src=\"env/grafics/navdl.gif\" alt=\"arrowleft\" width=\"16\" height=\"16\" />&nbsp;");
} else { } else {
resnav.append("<a id=\"prevpage\" href=\""); resnav.append("<a id=\"prevpage\" href=\"");
resnav.append(QueryParams.navurl("html", thispage - 1, display, theQuery, null, originalUrlMask, navigation)); resnav.append(QueryParams.navurl("html", thispage - 1, theQuery, null, originalUrlMask, navigation));
resnav.append("\"><img src=\"env/grafics/navdl.gif\" alt=\"arrowleft\" width=\"16\" height=\"16\" /></a>&nbsp;"); resnav.append("\"><img src=\"env/grafics/navdl.gif\" alt=\"arrowleft\" width=\"16\" height=\"16\" /></a>&nbsp;");
} }
final int numberofpages = Math.min(10, 1 + ((indexcount - 1) / theQuery.displayResults())); final int numberofpages = Math.min(10, 1 + ((indexcount - 1) / theQuery.displayResults()));
@ -648,7 +637,7 @@ public class yacysearch {
resnav.append("\" width=\"16\" height=\"16\" />&nbsp;"); resnav.append("\" width=\"16\" height=\"16\" />&nbsp;");
} else { } else {
resnav.append("<a href=\""); resnav.append("<a href=\"");
resnav.append(QueryParams.navurl("html", i, display, theQuery, null, originalUrlMask, navigation)); resnav.append(QueryParams.navurl("html", i, theQuery, null, originalUrlMask, navigation));
resnav.append("\"><img src=\"env/grafics/navd"); resnav.append("\"><img src=\"env/grafics/navd");
resnav.append(i + 1); resnav.append(i + 1);
resnav.append(".gif\" alt=\"page"); resnav.append(".gif\" alt=\"page");
@ -660,7 +649,7 @@ public class yacysearch {
resnav.append("<img src=\"env/grafics/navdr.gif\" alt=\"arrowright\" width=\"16\" height=\"16\" />"); resnav.append("<img src=\"env/grafics/navdr.gif\" alt=\"arrowright\" width=\"16\" height=\"16\" />");
} else { } else {
resnav.append("<a id=\"nextpage\" href=\""); resnav.append("<a id=\"nextpage\" href=\"");
resnav.append(QueryParams.navurl("html", thispage + 1, display, theQuery, null, originalUrlMask, navigation)); resnav.append(QueryParams.navurl("html", thispage + 1, theQuery, null, originalUrlMask, navigation));
resnav.append("\"><img src=\"env/grafics/navdr.gif\" alt=\"arrowright\" width=\"16\" height=\"16\" /></a>"); resnav.append("\"><img src=\"env/grafics/navdr.gif\" alt=\"arrowright\" width=\"16\" height=\"16\" /></a>");
} }
String resnavs = resnav.toString(); String resnavs = resnav.toString();
@ -672,7 +661,6 @@ public class yacysearch {
for (int i = 0; i < theQuery.displayResults(); i++) { for (int i = 0; i < theQuery.displayResults(); i++) {
prop.put("results_" + i + "_item", offset + i); prop.put("results_" + i + "_item", offset + i);
prop.put("results_" + i + "_eventID", theQuery.id(false)); prop.put("results_" + i + "_eventID", theQuery.id(false));
prop.put("results_" + i + "_display", display);
} }
prop.put("results", theQuery.displayResults()); prop.put("results", theQuery.displayResults());
prop.put("resultTable", (contentdom == ContentDomain.APP || contentdom == ContentDomain.AUDIO || contentdom == ContentDomain.VIDEO) ? 1 : 0); prop.put("resultTable", (contentdom == ContentDomain.APP || contentdom == ContentDomain.AUDIO || contentdom == ContentDomain.VIDEO) ? 1 : 0);
@ -707,7 +695,6 @@ public class yacysearch {
} }
prop.put("searchagain", global ? "1" : "0"); prop.put("searchagain", global ? "1" : "0");
prop.put("display", display);
prop.putHTML("former", originalquerystring); prop.putHTML("former", originalquerystring);
prop.put("count", itemsPerPage); prop.put("count", itemsPerPage);
prop.put("offset", offset); prop.put("offset", offset);
@ -731,7 +718,6 @@ public class yacysearch {
prop.put("searchdomswitches_searchapp_check", (contentdom == ContentDomain.APP) ? "1" : "0"); prop.put("searchdomswitches_searchapp_check", (contentdom == ContentDomain.APP) ? "1" : "0");
// copy properties for "more options" link // copy properties for "more options" link
prop.put("searchdomswitches_display", prop.get("display"));
prop.put("searchdomswitches_count", prop.get("count")); prop.put("searchdomswitches_count", prop.get("count"));
prop.put("searchdomswitches_urlmaskfilter", prop.get("urlmaskfilter")); prop.put("searchdomswitches_urlmaskfilter", prop.get("urlmaskfilter"));
prop.put("searchdomswitches_prefermaskfilter", prop.get("prefermaskfilter")); prop.put("searchdomswitches_prefermaskfilter", prop.get("prefermaskfilter"));

@ -21,7 +21,7 @@
</div> </div>
<p class="snippet"><span class="snippetLoaded" id="h#[urlhash]#">#[description]#</span></p> <p class="snippet"><span class="snippetLoaded" id="h#[urlhash]#">#[description]#</span></p>
<p class="url"><a href="#[link]#" id="url#[urlhash]#" target="#[target]#">#[urlname]#</a></p> <p class="url"><a href="#[link]#" id="url#[urlhash]#" target="#[target]#">#[urlname]#</a></p>
<p class="urlinfo">#[date]# | #[sizename]# | <a href="api/yacydoc.html?urlhash=#[urlhash]#" onclick="return hs.htmlExpand(this, { objectType: 'ajax'} )">Metadata</a> | <a href="ViewFile.html?urlHash=#[urlhash]#&amp;words=#[words]#&amp;display=#[display]#">Parser</a> | <a href="yacysearch.html?cat=image&amp;url=#[link]#&amp;query=#[former]#&amp;display=#[display]#">Pictures</a></p> <p class="urlinfo">#[date]# | #[sizename]# | <a href="api/yacydoc.html?urlhash=#[urlhash]#" onclick="return hs.htmlExpand(this, { objectType: 'ajax'} )">Metadata</a> | <a href="ViewFile.html?urlHash=#[urlhash]#&amp;words=#[words]#&amp">Parser</a> | <a href="yacysearch.html?cat=image&amp;url=#[link]#&amp;query=#[former]#">Pictures</a></p>
</div> </div>
:: ::
#(item)#::<div class="thumbcontainer"> #(item)#::<div class="thumbcontainer">

@ -68,7 +68,6 @@ public class yacysearchitem {
final boolean authenticated = sb.adminAuthenticated(header) >= 2; final boolean authenticated = sb.adminAuthenticated(header) >= 2;
final int item = post.getInt("item", -1); final int item = post.getInt("item", -1);
final boolean auth = (header.get(HeaderFramework.CONNECTION_PROP_CLIENTIP, "")).equals("localhost") || sb.verifyAuthentication(header, true); final boolean auth = (header.get(HeaderFramework.CONNECTION_PROP_CLIENTIP, "")).equals("localhost") || sb.verifyAuthentication(header, true);
final int display = (post == null) ? 0 : post.getInt("display", 0);
// default settings for blank item // default settings for blank item
prop.put("content", "0"); prop.put("content", "0");
@ -127,7 +126,6 @@ public class yacysearchitem {
prop.putJSON("content_title-json", result.title()); prop.putJSON("content_title-json", result.title());
prop.putHTML("content_link", result.urlstring()); prop.putHTML("content_link", result.urlstring());
prop.putHTML("content_target", sb.getConfig(SwitchboardConstants.SEARCH_TARGET, "_self")); prop.putHTML("content_target", sb.getConfig(SwitchboardConstants.SEARCH_TARGET, "_self"));
prop.put("content_display", display);
if (faviconURL != null && isHtml) sb.loader.loadIfNotExistBackground(faviconURL.toNormalform(true, false), 1024 * 1024 * 10); if (faviconURL != null && isHtml) sb.loader.loadIfNotExistBackground(faviconURL.toNormalform(true, false), 1024 * 1024 * 10);
prop.putHTML("content_faviconCode", sb.licensedURLs.aquireLicense(faviconURL)); // acquire license for favicon url loading prop.putHTML("content_faviconCode", sb.licensedURLs.aquireLicense(faviconURL)); // acquire license for favicon url loading
prop.put("content_urlhash", resulthashString); prop.put("content_urlhash", resulthashString);

@ -47,7 +47,6 @@ public class yacysearchtrailer {
final serverObjects prop = new serverObjects(); final serverObjects prop = new serverObjects();
final String eventID = post.get("eventID", ""); final String eventID = post.get("eventID", "");
final int display = post.getInt("display", 0);
// find search event // find search event
final SearchEvent theSearch = SearchEventCache.getEvent(eventID); final SearchEvent theSearch = SearchEventCache.getEvent(eventID);
@ -74,8 +73,8 @@ public class yacysearchtrailer {
name = navigatorIterator.next(); name = navigatorIterator.next();
count = namespaceNavigator.get(name); count = namespaceNavigator.get(name);
prop.putJSON("nav-namespace_element_" + i + "_name", name); prop.putJSON("nav-namespace_element_" + i + "_name", name);
prop.put("nav-namespace_element_" + i + "_url", "<a href=\"" + QueryParams.navurl("html", 0, display, theQuery, theQuery.queryStringForUrl() + "+" + "inurl:" + name, theQuery.urlMask.toString(), theQuery.navigators) + "\">" + name + " (" + count + ")</a>"); prop.put("nav-namespace_element_" + i + "_url", "<a href=\"" + QueryParams.navurl("html", 0, theQuery, theQuery.queryStringForUrl() + "+" + "inurl:" + name, theQuery.urlMask.toString(), theQuery.navigators) + "\">" + name + " (" + count + ")</a>");
prop.putJSON("nav-namespace_element_" + i + "_url-json", QueryParams.navurl("json", 0, display, theQuery, theQuery.queryStringForUrl() + "+" + "inurl:" + name, theQuery.urlMask.toString(), theQuery.navigators)); prop.putJSON("nav-namespace_element_" + i + "_url-json", QueryParams.navurl("json", 0, theQuery, theQuery.queryStringForUrl() + "+" + "inurl:" + name, theQuery.urlMask.toString(), theQuery.navigators));
prop.put("nav-namespace_element_" + i + "_count", count); prop.put("nav-namespace_element_" + i + "_count", count);
prop.put("nav-namespace_element_" + i + "_modifier", "inurl:" + name); prop.put("nav-namespace_element_" + i + "_modifier", "inurl:" + name);
prop.put("nav-namespace_element_" + i + "_nl", 1); prop.put("nav-namespace_element_" + i + "_nl", 1);
@ -98,8 +97,8 @@ public class yacysearchtrailer {
name = navigatorIterator.next(); name = navigatorIterator.next();
count = hostNavigator.get(name); count = hostNavigator.get(name);
prop.putJSON("nav-domains_element_" + i + "_name", name); prop.putJSON("nav-domains_element_" + i + "_name", name);
prop.put("nav-domains_element_" + i + "_url", "<a href=\"" + QueryParams.navurl("html", 0, display, theQuery, theQuery.queryStringForUrl() + "+" + "site:" + name, theQuery.urlMask.toString(), theQuery.navigators) + "\">" + name + " (" + count + ")</a>"); prop.put("nav-domains_element_" + i + "_url", "<a href=\"" + QueryParams.navurl("html", 0, theQuery, theQuery.queryStringForUrl() + "+" + "site:" + name, theQuery.urlMask.toString(), theQuery.navigators) + "\">" + name + " (" + count + ")</a>");
prop.putJSON("nav-domains_element_" + i + "_url-json", QueryParams.navurl("json", 0, display, theQuery, theQuery.queryStringForUrl() + "+" + "site:" + name, theQuery.urlMask.toString(), theQuery.navigators)); prop.putJSON("nav-domains_element_" + i + "_url-json", QueryParams.navurl("json", 0, theQuery, theQuery.queryStringForUrl() + "+" + "site:" + name, theQuery.urlMask.toString(), theQuery.navigators));
prop.put("nav-domains_element_" + i + "_count", count); prop.put("nav-domains_element_" + i + "_count", count);
prop.put("nav-domains_element_" + i + "_modifier", "site:" + name); prop.put("nav-domains_element_" + i + "_modifier", "site:" + name);
prop.put("nav-domains_element_" + i + "_nl", 1); prop.put("nav-domains_element_" + i + "_nl", 1);
@ -124,8 +123,8 @@ public class yacysearchtrailer {
count = authorNavigator.get(name); count = authorNavigator.get(name);
anav = (name.indexOf(' ') < 0) ? "author:" + name : "author:'" + name.replace(" ", "+") + "'"; anav = (name.indexOf(' ') < 0) ? "author:" + name : "author:'" + name.replace(" ", "+") + "'";
prop.putJSON("nav-authors_element_" + i + "_name", name); prop.putJSON("nav-authors_element_" + i + "_name", name);
prop.put("nav-authors_element_" + i + "_url", "<a href=\"" + QueryParams.navurl("html", 0, display, theQuery, theQuery.queryStringForUrl() + "+" + anav, theQuery.urlMask.toString(), theQuery.navigators) + "\">" + name + " (" + count + ")</a>"); prop.put("nav-authors_element_" + i + "_url", "<a href=\"" + QueryParams.navurl("html", 0, theQuery, theQuery.queryStringForUrl() + "+" + anav, theQuery.urlMask.toString(), theQuery.navigators) + "\">" + name + " (" + count + ")</a>");
prop.putJSON("nav-authors_element_" + i + "_url-json", QueryParams.navurl("json", 0, display, theQuery, theQuery.queryStringForUrl() + "+" + anav, theQuery.urlMask.toString(), theQuery.navigators)); prop.putJSON("nav-authors_element_" + i + "_url-json", QueryParams.navurl("json", 0, theQuery, theQuery.queryStringForUrl() + "+" + anav, theQuery.urlMask.toString(), theQuery.navigators));
prop.put("nav-authors_element_" + i + "_count", count); prop.put("nav-authors_element_" + i + "_count", count);
prop.put("nav-authors_element_" + i + "_modifier", "author:'" + name + "'"); prop.put("nav-authors_element_" + i + "_modifier", "author:'" + name + "'");
prop.put("nav-authors_element_" + i + "_nl", 1); prop.put("nav-authors_element_" + i + "_nl", 1);
@ -151,9 +150,9 @@ public class yacysearchtrailer {
if (name != null) { if (name != null) {
prop.putJSON("nav-topics_element_" + i + "_name", name); prop.putJSON("nav-topics_element_" + i + "_name", name);
prop.put("nav-topics_element_" + i + "_url", prop.put("nav-topics_element_" + i + "_url",
"<a href=\"" + QueryParams.navurl("html", 0, display, theQuery, theQuery.queryStringForUrl() + "+" + name, theQuery.urlMask.toString(), theQuery.navigators) + "\">" + name + "</a>"); "<a href=\"" + QueryParams.navurl("html", 0, theQuery, theQuery.queryStringForUrl() + "+" + name, theQuery.urlMask.toString(), theQuery.navigators) + "\">" + name + "</a>");
//+"<a href=\"" + QueryParams.navurl("html", 0, display, theQuery, theQuery.queryStringForUrl() + "+-" + name, theQuery.urlMask.toString(), theQuery.navigators) + "\">-</a>")*/; //+"<a href=\"" + QueryParams.navurl("html", 0, display, theQuery, theQuery.queryStringForUrl() + "+-" + name, theQuery.urlMask.toString(), theQuery.navigators) + "\">-</a>")*/;
prop.putJSON("nav-topics_element_" + i + "_url-json", QueryParams.navurl("json", 0, display, theQuery, theQuery.queryStringForUrl() + "+" + name, theQuery.urlMask.toString(), theQuery.navigators)); prop.putJSON("nav-topics_element_" + i + "_url-json", QueryParams.navurl("json", 0, theQuery, theQuery.queryStringForUrl() + "+" + name, theQuery.urlMask.toString(), theQuery.navigators));
prop.put("nav-topics_element_" + i + "_count", count); prop.put("nav-topics_element_" + i + "_count", count);
prop.put("nav-topics_element_" + i + "_modifier", name); prop.put("nav-topics_element_" + i + "_modifier", name);
prop.put("nav-topics_element_" + i + "_nl", 1); prop.put("nav-topics_element_" + i + "_nl", 1);
@ -185,8 +184,7 @@ public class yacysearchtrailer {
} else { } else {
prop.put("cat-location", 1); prop.put("cat-location", 1);
prop.put("cat-location_query", theQuery.queryString(true)); prop.put("cat-location_query", theQuery.queryString(true));
prop.put("cat-location_queryenc", theQuery.queryString(true).replace(' ', '+')); prop.put("cat-location_queryenc", theQuery.queryString(true).replace(' ', '+'));
prop.put("cat-location_display", display);
} }
EventTracker.update(EventTracker.EClass.SEARCH, new ProfilingGraph.searchEvent(theQuery.id(true), SearchEvent.Type.FINALIZATION, "bottomline", 0, 0), false); EventTracker.update(EventTracker.EClass.SEARCH, new ProfilingGraph.searchEvent(theQuery.id(true), SearchEvent.Type.FINALIZATION, "bottomline", 0, 0), false);

@ -119,6 +119,7 @@ public final class HTTPDFileHandler {
private static String[] defaultFiles = null; private static String[] defaultFiles = null;
private static File htDefaultPath = null; private static File htDefaultPath = null;
private static File htLocalePath = null; private static File htLocalePath = null;
public static String indexForward = "";
protected static final class TemplateCacheEntry { protected static final class TemplateCacheEntry {
Date lastModified; Date lastModified;
@ -179,6 +180,8 @@ public final class HTTPDFileHandler {
// create default files array // create default files array
defaultFiles = switchboard.getConfig("defaultFiles","index.html").split(","); defaultFiles = switchboard.getConfig("defaultFiles","index.html").split(",");
if (defaultFiles.length == 0) defaultFiles = new String[] {"index.html"}; if (defaultFiles.length == 0) defaultFiles = new String[] {"index.html"};
indexForward = switchboard.getConfig("indexForward", "");
if (indexForward.startsWith("/")) indexForward = indexForward.substring(1);
} }
/** Returns a path to the localized or default file according to the locale.language (from he switchboard) /** Returns a path to the localized or default file according to the locale.language (from he switchboard)
@ -403,6 +406,7 @@ public final class HTTPDFileHandler {
// locate the file // locate the file
if (path.length() > 0 && path.charAt(0) != '/' && path.charAt(0) != '\\') path = "/" + path; // attach leading slash if (path.length() > 0 && path.charAt(0) != '/' && path.charAt(0) != '\\') path = "/" + path; // attach leading slash
if (path.endsWith("index.html")) path = path.substring(0, path.length() - 10);
// a different language can be desired (by i.e. ConfigBasic.html) than the one stored in the locale.language // a different language can be desired (by i.e. ConfigBasic.html) than the one stored in the locale.language
String localeSelection = switchboard.getConfig("locale.language","default"); String localeSelection = switchboard.getConfig("locale.language","default");
@ -420,14 +424,21 @@ public final class HTTPDFileHandler {
targetClass = rewriteClassFile(new File(htDefaultPath, path)); targetClass = rewriteClassFile(new File(htDefaultPath, path));
if (path.endsWith("/") || path.endsWith("\\")) { if (path.endsWith("/") || path.endsWith("\\")) {
String testpath; String testpath;
// attach default file name // look for indexForward setting
for (int i = 0; i < defaultFiles.length; i++) { if (indexForward.length() > 0 && (targetFile = getOverlayedFile(path + indexForward)).exists()) {
testpath = path + defaultFiles[i]; testpath = path + indexForward;
targetFile = getOverlayedFile(testpath);
targetClass = getOverlayedClass(testpath); targetClass = getOverlayedClass(testpath);
if (targetFile.exists()) { path = testpath;
path = testpath; } else {
break; // attach default file name(s)
for (int i = 0; i < defaultFiles.length; i++) {
testpath = path + defaultFiles[i];
targetFile = getOverlayedFile(testpath);
targetClass = getOverlayedClass(testpath);
if (targetFile.exists()) {
path = testpath;
break;
}
} }
} }
targetFile = getLocalizedFile(path, localeSelection); targetFile = getLocalizedFile(path, localeSelection);

@ -455,24 +455,19 @@ public final class QueryParams {
/** /**
* make a query anchor tag * make a query anchor tag
* @param page * @param page
* @param display
* @param theQuery * @param theQuery
* @param originalUrlMask * @param originalUrlMask
* @param addToQuery * @param addToQuery
* @return * @return
*/ */
public static String navurl( public static String navurl(
final String ext, final int page, final int display, final QueryParams theQuery, final String ext, final int page, final QueryParams theQuery,
String newQueryString, final String originalUrlMask, final String nav) { String newQueryString, final String originalUrlMask, final String nav) {
final StringBuilder sb = new StringBuilder(); final StringBuilder sb = new StringBuilder();
sb.append("/yacysearch."); sb.append("/yacysearch.");
sb.append(ext); sb.append(ext);
sb.append("?display="); sb.append("?query=");
sb.append(display);
sb.append(ampersand);
sb.append("query=");
sb.append(newQueryString == null ? theQuery.queryStringForUrl() : newQueryString); sb.append(newQueryString == null ? theQuery.queryStringForUrl() : newQueryString);
sb.append(ampersand); sb.append(ampersand);

Loading…
Cancel
Save