Merge branch 'master' of https://github.com/EiffelWebFramework/ROC
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
<div class="col-md-2 col-md-offset-9">
|
<div class="col-md-2 col-md-offset-9">
|
||||||
<form action="{$site_url/}gcse" class="search-form" id="gcse_search_form">
|
<form action="{$site_url/}gcse" class="search-form" id="gcse_search_form">
|
||||||
<div class="form-group has-feedback">
|
<div class="form-group has-feedback">
|
||||||
<input type="search" class="form-control" name="q" id="gcse_search" placeholder="search" value="{$google_search/}" >
|
<input type="search" class="form-control" name="q" id="gcse_search" placeholder="search" value="{$cms_search_query/}" >
|
||||||
<span class="glyphicon glyphicon-search form-control-feedback"></span>
|
<span class="glyphicon glyphicon-search form-control-feedback"></span>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -11,14 +11,9 @@ class
|
|||||||
inherit
|
inherit
|
||||||
|
|
||||||
CMS_MODULE
|
CMS_MODULE
|
||||||
redefine
|
|
||||||
setup_hooks
|
|
||||||
end
|
|
||||||
|
|
||||||
CMS_HOOK_BLOCK_HELPER
|
CMS_HOOK_BLOCK_HELPER
|
||||||
|
|
||||||
CMS_HOOK_VALUE_TABLE_ALTER
|
|
||||||
|
|
||||||
SHARED_EXECUTION_ENVIRONMENT
|
SHARED_EXECUTION_ENVIRONMENT
|
||||||
export
|
export
|
||||||
{NONE} all
|
{NONE} all
|
||||||
@@ -57,30 +52,6 @@ feature -- Router
|
|||||||
a_router.map (m, a_router.methods_head_get)
|
a_router.map (m, a_router.methods_head_get)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Hooks configuration
|
|
||||||
|
|
||||||
setup_hooks (a_hooks: CMS_HOOK_CORE_MANAGER)
|
|
||||||
-- Module hooks configuration.
|
|
||||||
do
|
|
||||||
a_hooks.subscribe_to_value_table_alter_hook (Current)
|
|
||||||
end
|
|
||||||
|
|
||||||
value_table_alter (a_value: CMS_VALUE_TABLE; a_response: CMS_RESPONSE)
|
|
||||||
-- <Precursor>
|
|
||||||
local
|
|
||||||
l_url: STRING
|
|
||||||
l_url_name: READABLE_STRING_GENERAL
|
|
||||||
do
|
|
||||||
if
|
|
||||||
attached {WSF_STRING} a_response.request.query_parameter ("q") as l_query and then
|
|
||||||
not l_query.value.is_empty
|
|
||||||
then
|
|
||||||
a_value.force (l_query.value, "google_search")
|
|
||||||
else
|
|
||||||
a_value.force (Void, "google_search")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
feature -- GCSE Keys
|
feature -- GCSE Keys
|
||||||
|
|
||||||
gcse_secret_key (api: CMS_API): detachable READABLE_STRING_8
|
gcse_secret_key (api: CMS_API): detachable READABLE_STRING_8
|
||||||
@@ -132,6 +103,7 @@ feature -- Handler
|
|||||||
attached gcse_cx_key (api) as l_cx and then
|
attached gcse_cx_key (api) as l_cx and then
|
||||||
attached gcse_secret_key (api) as l_key
|
attached gcse_secret_key (api) as l_key
|
||||||
then
|
then
|
||||||
|
r.set_value (l_query.value, "cms_search_query")
|
||||||
create l_parameters.make (l_key, l_cx, l_query.url_encoded_value )
|
create l_parameters.make (l_key, l_cx, l_query.url_encoded_value )
|
||||||
if
|
if
|
||||||
attached {WSF_STRING} req.query_parameter ("start") as l_index and then
|
attached {WSF_STRING} req.query_parameter ("start") as l_index and then
|
||||||
|
|||||||
Reference in New Issue
Block a user