forked from saurabh/orbit4-5
update site search setting
This commit is contained in:
parent
856b590e1b
commit
ef55afceae
|
@ -74,7 +74,8 @@
|
|||
<ul class="orbit-bar-search-sign-language">
|
||||
<%
|
||||
google_search_cx = current_site.search['sitesearch'] rescue nil
|
||||
unless google_search_cx.blank?
|
||||
is_google_seach_cx = google_search_cx =~ /^[0-9]+\:[0-9A-Za-z]+$/
|
||||
if !google_search_cx.blank? and is_google_seach_cx
|
||||
%>
|
||||
<li>
|
||||
<form id="search" method="get" action="http://www.google.com/cse" target="_blank">
|
||||
|
@ -82,6 +83,25 @@
|
|||
<%= text_field_tag 'q', '', {:type => "search", :placeholder => t("search.sitesearch"), 'x-webkit-speech' => ''} %>
|
||||
</form>
|
||||
</li>
|
||||
<%
|
||||
else
|
||||
if !google_search_cx.blank? and !is_google_seach_cx
|
||||
search_domain = google_search_cx
|
||||
else
|
||||
search_domain = request.host_with_port
|
||||
end
|
||||
%>
|
||||
<li>
|
||||
<form id="search" method="get" action="http://www.google.com/custom" target="_blank">
|
||||
<input type="hidden" name="client" value="pub-&" />
|
||||
<input type="hidden" name="ie" id="ie" value="utf-8" />
|
||||
<input type="hidden" name="oe" id="oe" value="utf-8" />
|
||||
<input type="hidden" name="cof" id="cof" value="AH:center;AWFID:03de271f1940eea3;" />
|
||||
<input type='hidden' name='domains' value='<%= search_domain %>'>
|
||||
<input type='hidden' name='sitesearch' value='<%= search_domain %>'>
|
||||
<%= text_field_tag 'q', '', {:type => "search", :placeholder => t("search.sitesearch"), 'x-webkit-speech' => ''} %>
|
||||
</form>
|
||||
</li>
|
||||
<% end %>
|
||||
<li>
|
||||
<% locale = session[:zh_cn] ? :zh_cn : I18n.locale %>
|
||||
|
|
Loading…
Reference in New Issue